plotly / react-chart-editor

Customizable React-based editor panel for Plotly charts
https://plotly.github.io/react-chart-editor/
MIT License
505 stars 104 forks source link

[question] Is there a way to use plotly events with the chart editor #971

Open Darruma opened 5 years ago

Darruma commented 5 years ago

Is there a way to use plotly events with the component like in https://plot.ly/javascript/plotlyjs-events/

<PlotlyEditor
            plotly={plotly}
            onClick={(data) => console.log(data)}
            data={this.props.data}
            layout={this.props.layout}
            onUpdate={this.props.updateEditor}
            frames={this.props.frames}
            hideControls={this.state.controls}
            dataSources={{}}
            dataSourcesOptions={{}}
/>

I would like to be able to handle the event when a line is clicked on the chart editor. This seems possible using the react plotly library with event handler props.

nicolaskruchten commented 5 years ago

There's no way to do this with PlotlyEditor but if you go one level inwards, you can control how EditorControls and Plot interact and attach whatever handlers you like therein :)