httpgd icon indicating copy to clipboard operation
httpgd copied to clipboard

Question: does httpgd works for javascript libraries like plotly

Open statquant opened this issue 3 years ago • 4 comments

I have a very noob question, would httpgd works for javascript libs like plotly ? I cannot seem to have the plotly graphs rendered in the httpgd "window"

library(httpgd)
hgd()
plot(1:10) # fine

library(plotly)
x <- c(1:100)
random_y <- rnorm(100, mean = 0)
data <- data.frame(x, random_y)
fig <- plot_ly(data, x = ~x, y = ~random_y, type = 'scatter', mode = 'lines')
fig # not fine

Many thanks for your package

statquant avatar Jul 15 '22 10:07 statquant

Thank you for opening the issue.

httpgd (currently) only works with the internal graphics engine of R.

I have however been wondering for a while if the viewer could be expanded to include other (web) content in iFrames in the plot list.

This feature won't land soon but I will keep this issue open for discussion and to gauge interest.

nx10 avatar Jul 16 '22 10:07 nx10

+1 for this. While the output of htmlwidgets doesn't necessarily fit in with the "graphics device" theme of httpgd, the idea of any visualizations, including htmlwidgets, showing up in the viewer history and not opening in a separate location would be very nice.

hafen avatar Nov 08 '22 17:11 hafen

Many of the modern table-making packages fall under this category as well, I believe. gt being the most prominent.

kendonB avatar Jan 10 '23 23:01 kendonB

I came here to see whether httpgd could also support HTML tables like reactable or gt. Would be fantastic if you would add this feature!

januz avatar Mar 10 '24 23:03 januz