-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Make restyling arrayOk attribute redo calcdata #1488
Conversation
|
||
if(valObject.arrayOk && (Array.isArray(newVal) || Array.isArray(oldVal))) { | ||
flags.docalc = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
|
||
mockDefaultsAndCalc(gd); | ||
Plotly.restyle(gd, 'marker.color', [['red', 'green', 'blue']]); | ||
expect(gd.calcdata).toBeUndefined(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this means restyle clears gd.calcdata
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that Plotly.plot
is mocked in this suite.
Nice job tracking this down - fix & tests look spot on! 💃 |
fixes #1480
I made a blunder in #1257 where conversion of
arrayOk
attributes fromfullData
->calcdata
was moved from theplot
step 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.