Skip to content

Contour auto persist #1338

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

Merged
merged 3 commits into from
Jan 30, 2017
Merged

Contour auto persist #1338

merged 3 commits into from
Jan 30, 2017

Conversation

alexcjohnson
Copy link
Collaborator

Fixes a bug I found when playing around with contours: If you make a contour plot without specifying anything about contours (so you get the full autocontour behavior even though it's not explicitly stated) then you change the z range, it would not update the contour range. You can do this in straight plotly.js with Plotly.restyle, or in the workspace by making a contour plot and then modifying the data grid. Also ensures the correct level of replotting when you modify any part of an array, ie if z triggers a recalc, so does z[1], z[2][3], etc.

Related to #1282 but for now I don't want to go all the way into that, I just want to fix the bug.

cc @etpinard

expect(gd.data[0].autocontour).toBe(true);
expect(gd.data[0].contours).toEqual({start: 0.5, end: 3.5, size: 0.5});

Plotly.restyle(gd, {'z[0][0]': 10});
Copy link
Contributor

Choose a reason for hiding this comment

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

Really. This works? That's awesome!

Copy link
Contributor

Choose a reason for hiding this comment

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

This makes #144 obsolete.

@etpinard
Copy link
Contributor

💃 lgtm

@alexcjohnson alexcjohnson merged commit 5b86f99 into master Jan 30, 2017
@alexcjohnson alexcjohnson deleted the contour-auto-persist branch January 30, 2017 21:02
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