Skip to content

Conversation

rreusser
Copy link
Contributor

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

@rreusser rreusser added the bug something broken label Jan 18, 2017
@rreusser
Copy link
Contributor Author

@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.

@rreusser
Copy link
Contributor Author

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'));
Copy link
Contributor

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.

Copy link
Contributor Author

@rreusser rreusser Jul 17, 2017

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'}]}
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@etpinard
Copy link
Contributor

Beautifully done. 💃

@etpinard etpinard added this to the 1.29.0 milestone Jul 18, 2017
@rreusser rreusser merged commit f56e071 into master Jul 18, 2017
@rreusser rreusser deleted the fix-annotation-animation branch July 18, 2017 14:46
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 this pull request may close these issues.

2 participants