nx10 / httpgd

Asynchronous http server graphics device for R.
https://nx10.github.io/httpgd
GNU General Public License v2.0
368 stars 19 forks source link

Question: does httpgd works for javascript libraries like plotly #114

Open statquant opened 2 years ago

statquant commented 2 years ago

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

nx10 commented 2 years ago

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.

hafen commented 1 year ago

+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.

kendonB commented 1 year ago

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

januz commented 4 months ago

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!