e_dispatch_action_p: Dispatch Action

Description Usage Arguments Examples

View source: R/proxies.R

Description

Create your own proxies, essentially a wrapper around the action API.

Usage

1

Arguments

proxy

An echarts4r proxy as returned by echarts4rProxy.

type

Type of action to dispatch, i.e.: highlight.

...

Named options.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
## Not run: 

library(shiny)

ui <- fluidPage(
  fluidRow(
    column(8, echarts4rOutput("chart")),
    column(4, actionButton("zoom", "Zoom"))
  )
)

server <- function(input, output, session) {
  output$chart <- renderEcharts4r({
    cars |>
      e_charts(speed) |>
      e_scatter(dist) |>
      e_datazoom()
  })

  observe({
    req(input$zoom)

    echarts4rProxy("chart") |>
      e_dispatch_action_p("dataZoom", startValue = 1, endValue = 10)
  })
}

if (interactive()) {
  shinyApp(ui, server)
}

## End(Not run)

JohnCoene/echarts4 documentation built on July 27, 2021, 5:20 p.m.