-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ECharts2Shiny even treactive problem (data error) #60
Comments
Hi @luomei308 . Thanks for reporting the issue. May you refer to https://github.com/XD-DENG/ECharts2Shiny/blob/master/examples/example-5%20Use%20Reactive%20Values/server.R first to see if it helps? Thanks. |
library(shiny)
analysis <- function(data_up) { server <- function(input, output) { output$mytable <- DT::renderDataTable({ output$basic <- renderPlot({ }) observeEvent(results()$exp, { } Hello, |
ECharts2Shiny seems not to process the reactive
library(shiny)
library(ECharts2Shiny)
library(DT)
ui <- fluidPage(# App title ----
titlePanel("Uploading Files"),
analysis <- function(data_up) {
expr <-
read.table(
data_up,
header = TRUE,
sep = "\t",
fill = TRUE,
row.names = 1
)
expr <- as.matrix(expr)
resu_list <- list(resu = expr[1:10, 1:3], exp = expr[1:100, 1:3])
}
server <- function(input, output) {
results <- eventReactive(input$do, {
inFile <- input$file1
if (is.null(inFile))
return(NULL)
analysis(inFile$datapath)
})
output$mytable <- DT::renderDataTable({
withProgress(
message = 'Calculation in progress',
detail = 'This may take a while...',
value = 0,
expr = {
df <- results()
result <- df$resu
}
)
DT::datatable(
result,
extensions = 'Buttons',
options = list(
language = list(url = '//cdn.datatables.net/plug-ins/1.10.11/i18n/English.json'),
searchHighlight = TRUE,
dom = 'lBfrtip',
scrollX = TRUE,
fixedColumns = list(leftColumns = 2, rightColumns = 1),
buttons = c('csv', 'excel', 'pdf'),
lengthMenu = c(10, 20, 50, -1)
)
)
})
output$basic <- renderPlot({
plot(results()$exp, type = 'l')
})
renderLineChart(
div_id = "echart",
data = results()$exp,
step = "null",
show.legend = FALSE,
show.tools = TRUE,
show.slider.axis.x = TRUE,
font.size.axis.x = 0.2
)
}
shinyApp(ui, server)
The text was updated successfully, but these errors were encountered: