Include dynamic elements in Rmarkdown.

g2_action(plot_id, btn_id, ..., data = NULL, reorder = TRUE)

Arguments

plot_id

Id of chart to interact with.

btn_id

Id of the input_button() that triggers the action.

...

Aspects, see asp().

data

Data.frame containing data to plot.

reorder

Whether to internally reorder the data, namely the x and color. The x axis must be reordered in a descending order for most data type since G2.js plots data as-is. Moreover, color order of all data.frames passed either to this function or subsequent fig_* layers must be identical or the colors will might match the legends on the plot. However, one may sometimes not want the data to be reordered.