Assume recalc is needed when restyling attribute containers#1536
Conversation
| var valObject = Lib.nestedProperty(moduleAttrs, ai).get() || {}; | ||
|
|
||
| // if restyling entire attribute container, assume worse case | ||
| if(!valObject.valType) { |
There was a problem hiding this comment.
A little bit hacky as this relies on the fact that attribute containers (e.g. marker) don't have a valType field set in the attribute declarations.
Morevoer, we could optimize this further by digging into the attribute container for arrayOk keys, but I thought this wasn't necessary. For best-performing restyle calls, users should target specific attributes e.g. restyle(gd, 'marker.color', [['red', 'blue', 'green']]).
There was a problem hiding this comment.
if an attribute container did have a valType field, would (or could) the schema validation tests fail?
I agree 💯 it's not worth optimizing this.
There was a problem hiding this comment.
It would because if it had a valType field it would only need a valid role (i.e. set to 'info' | 'style' | 'data') field to pass this test.
There was a problem hiding this comment.
Great, then I'm happy with this hack.
|
💃 |
fixes #1526
So that:
works in all situations.