Skip to content

Marker styles are not updated with Plotly.restyle in zoomed state until double-click to zoom out #1480

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

Closed
kimsk opened this issue Mar 15, 2017 · 6 comments · Fixed by #1488
Closed
Assignees
Labels
bug something broken

Comments

@kimsk
Copy link

kimsk commented Mar 15, 2017

When calling Plotly.restyle in zoomed state, the markers style are not updated in UI until I double-click to zoom out.

Codepen: https://codepen.io/karlkim/pen/OpxMxG?editors=1010#0

Click one of the buttons to trigger Plotly.restyle which update style of markers

Steps to reproduce:

  1. Initially, the red marker has opacity = 1 and others have opacity = 0.3
  2. Click 1, and the blue marker should have opacity = 1, and the red marker should have opacity = 0.3
  3. Zoom into the area around red marker and click 0.

Expected Result:

The red marker should have opacity = 1 and the blue marker should have opacity = 0.3

Actual Result:

The blue marker still has opacity = 1. The marker styles are not updated until I double-click to zoom out.

@etpinard
Copy link
Contributor

etpinard commented Mar 16, 2017

Thanks for writing in! As a lot of people do, you're not providing the right input to restyle. Restyle expects a set of key-value updates - not a object meant to extend a trace. To update nested keys, use e.g. marker.opacity: 0.4.

See https://codepen.io/etpinard/pen/WpZJgb for a working example. And please refer to our https://community.plot.ly/ for more restyle examples.

@kimsk
Copy link
Author

kimsk commented Mar 16, 2017

Thanks for the comment about the input.

However, the working example does not have marker style updated when zooming in either?

@etpinard
Copy link
Contributor

etpinard commented Mar 16, 2017

the working example does not have marker style updated when zooming in either?

I don't understand. Why should the marker style update on zoom? Restyle is only called on button click if I'm not mistaken.

@kimsk
Copy link
Author

kimsk commented Mar 16, 2017

Sorry for the confusion. I mean if I click the buttons to trigger restyle without zooming in, the marker styles are updated immediately. However, if I zoom in and click the buttons, the marker style are not updated until I double-click the graph to zoom out.

@etpinard
Copy link
Contributor

No worries @kimsk !

Thanks very for the report. Something is up during restyle in versions 1.21.3 and up. I think #1257 is the culprit. I'll investigate.

@etpinard
Copy link
Contributor

Thanks again for the report @kimsk

This will be fixed in the next release 1.25.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants