Skip to content

Proxy with e_color: Error in !: invalid argument type #347

@etiennebacher

Description

@etiennebacher

Hello, I used the example from the Proxies page, but modified it to change the color of the points instead of adding a line.

library(shiny)
library(echarts4r)

# phoney data
df <- data.frame(
  x = 1:100,
  y = runif(100),
  z = runif(100)
)

ui <- fluidPage(
  actionButton("add", "Add z serie"), # button
  echarts4rOutput("chart")
)

server <- function(input, output){
  
  output$chart <- renderEcharts4r({
    e_charts(df, x) |> 
      e_scatter(y, z)
  })
  
  observeEvent(input$add, {
    echarts4rProxy("chart", data = df, x = x) |>  # create a proxy
      e_color("red") |> 
      e_execute()
  })
  
}

shinyApp(ui, server)

This returns an error:

Warning: Error in !: invalid argument type

whereas adding e_color outside the shiny environment works well:

e_charts(df, x) |> 
  e_scatter(y, z) |>
  e_color("red")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions