Make restyling arrayOk attribute redo calcdata#1488
Merged
Conversation
etpinard
commented
Mar 16, 2017
| var valObject = Lib.nestedProperty(moduleAttrs, ai).get() || {}; | ||
|
|
||
| if(valObject.arrayOk && (Array.isArray(newVal) || Array.isArray(oldVal))) { | ||
| flags.docalc = true; |
Contributor
Author
There was a problem hiding this comment.
Previously, calls like restyle(gd, 'marker.size', [[10, 30, 20]]) worked only when one or several axis autorange were turned on as this too clears gd.calcdata.
This here now ensures that restyling any arrayOk key clears gd.calcdata.
Contributor
Author
There was a problem hiding this comment.
@alexcjohnson using _module.attributes here to find the arrayOk keys worked surprisingly well. We could declare a few more keys in the attributes to resolve #648 at some point.
etpinard
commented
Mar 16, 2017
|
|
||
| mockDefaultsAndCalc(gd); | ||
| Plotly.restyle(gd, 'marker.color', [['red', 'green', 'blue']]); | ||
| expect(gd.calcdata).toBeUndefined(); |
Contributor
Author
There was a problem hiding this comment.
this means restyle clears gd.calcdata.
Contributor
Author
There was a problem hiding this comment.
Note that Plotly.plot is mocked in this suite.
Collaborator
|
Nice job tracking this down - fix & tests look spot on! 💃 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #1480
I made a blunder in #1257 where conversion of
arrayOkattributes fromfullData->calcdatawas moved from theplotstep to thecalc. I testedrestyle, it worked (in some situations) but for the wrong reason. Luckily the fixed wasn't too hard.I wouldn't mind a @alexcjohnson review.