-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Still animate layout objects if there's no transitioned axis #1315
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
Conversation
1744d2e
to
f587772
Compare
@etpinard @alexcjohnson Layout animation doesn't currently update container objects unless there's also an axis update. This branch checks for and triggers container object updates in case there is no axis update. I've rebased and added a test for this fix. |
Nothing urgent, but @etpinard @alexcjohnson does this seem alright? Trying to close out old things. |
|
||
redrawObjs(fullLayout.annotations || [], Registry.getComponentMethod('annotations', 'drawOne')); | ||
redrawObjs(fullLayout.shapes || [], Registry.getComponentMethod('shapes', 'drawOne')); | ||
redrawObjs(fullLayout.images || [], Registry.getComponentMethod('images', 'draw')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at dragbox.js
, images can short circuit that loop over objArray
above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied the short-circuit code. Maybe there's a more general concept of updating these things.
|
||
Plotly.plot(gd, | ||
[{y: [1, 2, 3]}], | ||
{annotations: [{text: 'hello'}]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to 🔒 down the behavior for shapes
and images
too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
Beautifully done. 💃 |
This PR solves an oversight on my part. At the moment if there's no transitioned axis, then layout objects aren't updated. This PR solves that by calling the layout update if the axes are not otherwise affected.
cc @jackparmer