You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to capture the points in my scatterplot, I'm currently using plotly_relayout. After playing around with this for a bit, I found that the eventdata is somewhat unpredictable, making it hard/confusing to work with:
The plotly_relayout event is in dire need of a redesign. Maybe the solution lies in #145 where each axis interaction would emit an event with a similar data object.
It appears the rangeslider pan and zoom is consistently {xaxis.range: [number, number], yaxis.range: [number, number]}. So to handle relayout event I now do this:
const newSliderRange: [number, number] = e['xaxis.range']; //Plotly format for zooming with the slider
const newZoomRange0: number = e['xaxis.range[0]'];
const newZoomRange1: number = e['xaxis.range[1]']; //Plotly format for zooming within the graph
if (!!newSliderRange || !!newZoomRange0 || !!newZoomRange1) {
const newRange = !!newZoomRange0 || !!newZoomRange1 ? [newZoomRange0, newZoomRange1] : newSliderRange;
console.log("EVENT", e, newRange);
}
It seems like it would take little effort to emit a consistent type of {xaxis.range: [number, number], yaxis.range: [number, number]} where number is still nullable like the current implementation.
Hi, not sure if this is the right place to bring this up, please feel free to remove this if this is not the propper channel.
Today the update information of plotly_relayout only contain the y and x axis.autorange: bool in the case of autorange, but should not the axis.range[] also be included? Such as in the case of other resizing updates.
Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson
Activity
etpinard commentedon Jan 7, 2016
@aderidder great suggestion. Thanks!
The
plotly_relayoutevent is in dire need of a redesign. Maybe the solution lies in #145 where each axis interaction would emit an event with a similar data object.chrisgervang commentedon Dec 12, 2016
It appears the rangeslider pan and zoom is consistently
{xaxis.range: [number, number], yaxis.range: [number, number]}. So to handle relayout event I now do this:It seems like it would take little effort to emit a consistent type of
{xaxis.range: [number, number], yaxis.range: [number, number]}wherenumberis still nullable like the current implementation.jackparmer commentedon Jan 5, 2017
Hiya! Plotly now has improved and consolidated Plotly.js event documentation here:
https://plot.ly/javascript/plotlyjs-events/
Please feel free to suggest documentation improvements in a pull request:
https://github.com/plotly/documentation/tree/source-design-merge/_posts/plotly_js/events
etpinard commentedon Jul 17, 2017
Pie and Sankey event data should be refactor during the v2 push to look more like the other traces.
See #1875
JacobJNilsson commentedon Jul 31, 2018
Hi, not sure if this is the right place to bring this up, please feel free to remove this if this is not the propper channel.
Today the update information of plotly_relayout only contain the y and x axis.autorange: bool in the case of autorange, but should not the axis.range[] also be included? Such as in the case of other resizing updates.
gvwilson commentedon Jun 5, 2024
Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson