-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Shapes not deleted when clearing all shapes #464
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
I can reproduce it in v1.9.0, but it isn't present in v1.8.0. I'm now bisecting the commits. |
And the guilty commit is ... f67ff4d That's my bad. I will revert the commit, add a comment in the code, and test to prevent this from happening again. |
Excellent! Do you have any vague estimate of when this would be in a release? Basically, is it worth applying your patch myself to a local copy, or will it be pushed in the next few days anyway? |
should be early next week. |
Fixes #464 (shapes not deleted when clearing all shapes)
Hi,
I've come across an issue in the recent version whereby calling Plotly.relayout to remove all shapes (i.e shapes: []) does not remove the shape svg elements. Is there a check somewhere that is bailing out when shapes.length == 0, without first checking if there are elements to remove?
In this example, the red shape should be removed by the call to relayout with an empty shapes array: http://codepen.io/anon/pen/pyZPxX
In this example, using a non-empty shapes array in relayout results in the expected behavior (red removed, blue added): http://codepen.io/anon/pen/XdBRym
This worked in prior versions, so has there been a change in the advised method of removing all shapes? The current workaround I'm having to use is to add a tiny invisible shape when I want to remove all other shapes, which is a bit of a bodge.
Edit: As as addition: shapes that are present when calling Plotly.relayout with shapes: [] appear to be orphaned and never cleaned up in subsequent calls to relayout, even when the shapes array is non-empty. Meaning the chart ends up covered in old shapes.
The text was updated successfully, but these errors were encountered: