-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Inconsistent EventData for axis range #1877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for pointing this out. Callbacks emitting Plotly.relayout(gd, 'xaxis.range', [0, 1])
// is equivalent to
Plotly.relayout(gd, {'xaxis.range[0]': 0, 'xaxis.range[1]': 1}) But, I agree we should standardise our event data. For more on this topic, see #168. To me,
Where do you see this exactly? We won't be able to fix this in |
I got this from: https://plot.ly/javascript/zoom-events/ From the example:
|
My workaround (within the plotly_relayout callback): var range = eventdata['xaxis.range[0]']; |
Why is this closed? It's a bug. |
I just came across this bug while using the plotly_relayout callback too. When zooming in on a plot the event data I get is: if I double click to zoom out the event data I get is: If I just resize the plot, the event data comes back as a proper object:
Ideally, the event data would always return an object with nested properties ie:
or |
The And for reference, the reason we tended to use You can access the full |
This changes the shape of the PlotlyRelayoutEvent to use string based property access as per-discussion here: plotly/plotly.js#1877 See: https://plotly.com/javascript/plotlyjs-events/ https://plotly.com/javascript/zoom-events/#binding-to-zoom-events /cc @mmakrzem Thanks! Fixes: DefinitelyTyped#43735
This changes the shape of the PlotlyRelayoutEvent to use string based property access as per-discussion here: plotly/plotly.js#1877 See: https://plotly.com/javascript/plotlyjs-events/ https://plotly.com/javascript/zoom-events/#binding-to-zoom-events /cc @mmakrzem Thanks! Fixes: DefinitelyTyped#43735
This changes the shape of the PlotlyRelayoutEvent to use string based property access as per-discussion here: plotly/plotly.js#1877 See: https://plotly.com/javascript/plotlyjs-events/ https://plotly.com/javascript/zoom-events/#binding-to-zoom-events /cc @mmakrzem Thanks! Fixes: DefinitelyTyped#43735
This changes the shape of the PlotlyRelayoutEvent to use string based property access as per-discussion here: plotly/plotly.js#1877 See: https://plotly.com/javascript/plotlyjs-events/ https://plotly.com/javascript/zoom-events/#binding-to-zoom-events /cc @mmakrzem Thanks! Fixes: #43735
Sorry, but why is this closed? For the sake of keeping things uniform, my workaround is currently:
|
Version used: plotly.js (basic) v1.28.3
I am registered to the event "plotly_relayout".
I am using a chart with one trace and a rangeslider.
When zooming / panning on the trace, the following eventData is emitted to my callback:
Object {xaxis.range[0]: "2017-04-25 02:03:12.3635", xaxis.range[1]: "2017-05-24 12:21:05.5226"}
When panning on the rangeslider the follwoing eventData is emitted to my callback:
Object {xaxis.range: Array[2]}
And the array contains:
["2017-05-16 11:13:38.5694", "2017-06-14 21:31:31.7285"]
The plotly documentation shows that you are supposed to access the eventData axis information like this:
eventdata['xaxis.range[0]']
this only works for the first object, not the one emitted when using the rangeslider.
The text was updated successfully, but these errors were encountered: