See items 1, 2, 3 in https://github.com/plotly/plotly.js/pull/617#discussion_r67130816.
Preceding comment from @etpinard: https://github.com/plotly/plotly.js/pull/617#discussion_r67041656
I think (at least I like to think) that there's a way to achieve this using our attribute declaration.
Some questions that we need to answer:
docalc, doplot, ... distinctions ? Can you merge some of them?docalc updates relate to our data_array and our arrayOk attributes. Meaning that we could simply use the attribute declaration to figure our what update path to take. Are there any exceptions to that rule?And most importantly, much of restyle (and relayout) is un-tested. We should be very careful when making this change.
From @rreusser 's https://github.com/plotly/plotly.js/issues/1578
Carpet is going to add a huge number of attrs to recalcAttrs. (up to 287 total or so!?) The array of attributes is recalculated on every plot and it looks them up with indexOf. It should place them in a hash (e.g. {mode: true, visible: true, ...}) and should be defined in a plot-api-global context since it never changes.
@alexcjohnson notes that a larger refactoring is desired, but this might be a start since, at least once carpet is merged, it shouldn't take more than five minutes and may very well be at the point of having a non-negligible impact on performance.
A pretty valuable first step was made in https://github.com/plotly/plotly.js/pull/1653/files/413e5459960c4b4c2c4c6212919e3a5c3183f981#diff-2941ab69a12080c0633ff4ac8ea3aa83
https://github.com/plotly/plotly.js/pull/1999 will probably close this.
Superseded by https://github.com/plotly/plotly.js/issues/2025
Most helpful comment
https://github.com/plotly/plotly.js/pull/1999 will probably close this.