Closed
Labels
featuresomething newsomething new
Milestone
Description
Hi,
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:
- autoscale button clicked: Object {xaxis.autorange: true, yaxis.autorange: true}
- zoom button clicked: Object {xaxis.range: Array[2], yaxis.range: Array[2]}
- drag zoom: Object {xaxis.range[0]: , xaxis.range[1]: , yaxis.range[0]: , yaxis.range[1]: }
- drag zoom, but leave your plot at the left side: Object {xaxis.range[1]: , yaxis.range[0]: , yaxis.range[1]: }
- pan: similar to drag zoom, but if you drag along an axis (e.g. don't change the y, only the x), the eventdata only contains information about the x
It would be very useful if the eventdata's content would be consistent, e.g. always provide Object {xaxis.range: Array[2], yaxis.range: Array[2]}
Thanks,
Sander
Reacted by Abhilash Chandran and Marek Krzeminski
Metadata
Metadata
Assignees
Labels
featuresomething newsomething new
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