Skip to content

animate doesn't animate xaxis.range change for dates in timestamp units #2062

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
druvisc opened this issue Oct 4, 2017 · 8 comments · Fixed by #4249
Closed

animate doesn't animate xaxis.range change for dates in timestamp units #2062

druvisc opened this issue Oct 4, 2017 · 8 comments · Fixed by #4249
Assignees
Labels
bug something broken

Comments

@druvisc
Copy link

druvisc commented Oct 4, 2017

I've recorded the issue, might need to replay it a few times - http://recordit.co/fzDIRlNv6m. What's happening that on the button press the Plotly.animate() method is called with a layout change (no data change), the yaxis.range change is being animated, but the xaxis.range just gets reset to some weird dates (can see the labels at the bottom) and then set to the correct range instantly after the y-axis has been animated.

I tried passing in various date time representations (Date.getTime(), Date.toISOString() and the Plotly's yyyy-mm-dd HH:MM:SS.ssssss format).

@etpinard
Copy link
Contributor

etpinard commented Oct 4, 2017

Can you please share a reproducible example?

@druvisc
Copy link
Author

druvisc commented Oct 5, 2017

https://codepen.io/anon/pen/oGpYaz

And it works if you remove type: 'date' from layout.xaxis.

@druvisc
Copy link
Author

druvisc commented Nov 10, 2017

Sorry, but is this a issue with Plotly or I'm doing something wrong? To reproduce the issue you can toggle between states with the 'Zoom' button.

@etpinard etpinard changed the title animate doesn't animate xaxis.range change for dates animate doesn't animate xaxis.range change for dates in timestamp units Nov 13, 2017
@etpinard etpinard added the bug something broken label Nov 13, 2017
@etpinard
Copy link
Contributor

Looks like something is wrong in plotly.js. Even using datetime strings doesn't solve the problem:

https://codepen.io/etpinard/pen/zPzEXX?editors=0010

thanks for the report.

@brussee
Copy link
Contributor

brussee commented Sep 10, 2019

2 years later I'm encountering this issue too:

Minimal example, not working: https://codepen.io/pbrussee/pen/WNezzqd

Based on documentation example: https://codepen.io/plotly/pen/GjkZNk

Is there any roadmap on fixing this issue? I hope it won't be that difficult seeing animating a regular xaxis type does work.

edit: I've made a minimal workaround using axis type array and manually formatting: https://codepen.io/pbrussee/pen/YzKaLjQ

@etpinard
Copy link
Contributor

etpinard commented Oct 2, 2019

Ok I should have a fix out soon. Here are some before/after using:

https://54267-45646037-gh.circle-artifacts.com/0/dist/plotly.min.js

off

https://github.com/plotly/plotly.js/compare/fix-transition-axes-nonlinear


before: https://codepen.io/n-riesco/pen/GmoZEx
after: https://codepen.io/etpinard/pen/oNvKmMx?editors=1010

before: https://codepen.io/anon/pen/oGpYaz?editors=0010
after: https://codepen.io/etpinard/pen/jONgdev?editors=1010

before: https://codepen.io/pbrussee/pen/WNezzqd
after: https://codepen.io/etpinard/pen/eYOqobM


I apologise for taking this long this fix this issue. This was a fairly bad problem with a fairly easy solution; I feel a little embarrassed to not have fixed it sooner.

@etpinard etpinard self-assigned this Oct 2, 2019
@brussee
Copy link
Contributor

brussee commented Oct 3, 2019

Looks good to me!
Thanks!

@etpinard
Copy link
Contributor

etpinard commented Oct 3, 2019

Thanks for checking @brussee !

etpinard added a commit that referenced this issue Oct 3, 2019
... by using ax.r2l and ax.l2r (similar to how cartesian/dragbox.js
    does it).
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.

3 participants