Skip to content
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

fix removal of last shape or annotation #1451

Merged
merged 2 commits into from
Mar 9, 2017
Merged

Conversation

alexcjohnson
Copy link
Collaborator

Removing the last shape or annotation led to an error in drawOne. Images don't have drawOne so are immune to this problem. Ironically, images are also the only one that previously had a test for it. Someday we go d3-idiomatic and get rid of drawOne entirely...

cc @etpinard - there's one more bug I've uncovered while testing in the workspace, will make another PR for it then may need yet another patch release.

@@ -69,7 +69,7 @@ function drawOne(gd, index) {
fullLayout._infolayer.selectAll('.annotation[data-index="' + index + '"]').remove();

// remember a few things about what was already there,
var optionsIn = layout.annotations[index],
var optionsIn = (layout.annotations || [])[index],
Copy link
Contributor

@etpinard etpinard Mar 8, 2017

Choose a reason for hiding this comment

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

Ha. I'm looking forward to making annotations and shapes updates d3-idiomatic. These user / full container double standard headaches will be gone!

.then(function() {
return Plotly.relayout(gd, {'shapes[0]': getRandomShape()});
})
.then(function() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice tests! Annotations and shapes are getting nicely 🔒 ed down.

@etpinard
Copy link
Contributor

etpinard commented Mar 9, 2017

💃

@alexcjohnson alexcjohnson merged commit f3824fb into master Mar 9, 2017
@alexcjohnson alexcjohnson deleted the remove-last-component branch March 9, 2017 23:32
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.

None yet

2 participants