-
-
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
Improve 'relink private keys' steps #749
Comments
- remove error when array container are not of the same length - this is a temporary fix until #749 is addressed.
- remove error when array container are not of the same length - this is a temporary fix until #749 is addressed.
Closing this thing for the time being. |
Reopening - I've lost track of the pattern (if there is one) for which keys need relinking, but as #2375 and #2465 show there are real downsides to the "relink everything" approach. I really like the approach of having |
Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson |
Synopsis
At the moment, during
Plots.supplyDefaults
we loop over all keys found in the old trace and layout containers in order to relink all private keys not set during the defaults step in the new trace and layout containers (remember,fullData
andfullLayout
start as empty[]
and{}
respectively in everyPlots.supplyDefaults
call).These private keys are linked to subplot instances (e.g
fullLayout.scene._scene
), computed values (e.g.fullLayout.xaxis._m
), graph svg selections (e.g.fullLayout._infolayer
) etc ...In brief
Looping over all keys is dumb, slow and hard to maintain ; we can do better!
Observations
Not relinking private keys in trace objects results in:
_module
isn't defined anymore forvisible: false
traces)trace._emptypoints
isn't relinkedNot relinking array container results in:
Possible solution
Make the trace and base plot module (and possibly the component module)
clean
method relink the sticky keys that need to be relinked duringPlots.supplyDefaults
. This would make theclean
methods handle all old container --> new container logic in one go.For example, most base plot modules have a
clean
method that looks like:It might be convenient to put private keys generated in
makePlotFramework
under one object in fullLayout (e.gfullLayout_base._toppaper
) to keep track of private keys more easily.The text was updated successfully, but these errors were encountered: