Skip to content

Consider adding an example for onclick listener #215

@chungwong

Description

@chungwong

Given the following Scatter example, it is unclear how to add an onclick listener to the chart.

let mut plot = Plot::new();
let trace = Scatter::new(vec![0, 1, 2], vec![2, 1, 0]);
plot.add_trace(trace);

let layout = plotly::Layout::new().title("Displaying a Chart in Yew");
plot.set_layout(layout);

plotly::bindings::new_plot(id, &plot).await;

In Plotly.js, this can be acheived by capturing the plotly_click event, i.e.

plot.on('plotly_click', function(data) {
  ..
});

Is it supported in plotly.rs?

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions