You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for the great package. It's really a breeze to integrate D3 with R. In this context, I've developed a small package that outputs some D3 basic plots. Unfortunately, when I tried to use the package in shiny using D3output and renderD3, I encountered the following issue:
When modifying a Shiny Input, which the D3 plot relies on, the D3 plot is again rendered (which is perfect), but instead of getting a new plot, I get an overlay of the old plot and new plot(s). What's also interesting is that when I resize the window, the old plots disappear and I get only the last one. (See example below).
The plots generated by ddplot are normal D3.js graphics, so in my understanding it should work normally in Shiny. Do you have an idea please, maybe I'm using the r2d3 API wrongly.
Thanks in advance :)
library(shiny)
library(r2d3)
library(ddplot)
ui <- fluidPage(
inputPanel(
sliderInput("bar_max", label = "Max:",
min = 0, max = 100, value = 1, step = 1)
),
d3Output("plot")
)
server <- function(input, output) {
output$plot <- renderD3({
barChart(
data = mtcars,
x = "am",
y = "mpg",
fill = "red",
yticks = input$bar_max
)
})
}
shinyApp(ui = ui, server = server)
The text was updated successfully, but these errors were encountered:
Hi,
Thank you for the great package. It's really a breeze to integrate D3 with R. In this context, I've developed a small package that outputs some D3 basic plots. Unfortunately, when I tried to use the package in shiny using D3output and renderD3, I encountered the following issue:
The plots generated by ddplot are normal D3.js graphics, so in my understanding it should work normally in Shiny. Do you have an idea please, maybe I'm using the r2d3 API wrongly.
Thanks in advance :)
The text was updated successfully, but these errors were encountered: