fix for transforms operating on auto-invisible traces #3139
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.
Transforms mean
supplyDefaults
gets run twice. This is mostly fine, but there are some unwanted effects from running it on a trace object that has already had its defaults filled in. The one I'm concerned with here is that if a trace is explicitlyvisible: false
we don't even run the module defaults, but occasionally there are things that automatically triggervisible: false
in the module defaults, after we've already set some properties infullTrace
. Because thevisible: false
only makes sense based on those properties, we still want them to be part of the final trace (for example, to make RCE and toolpanel happy). So in this PR I detect this situation and clearexpandedTrace.visible
so that the original logic will run again the second time throughsupplyDefaults
.@etpinard can you think of any unwanted consequences of this? cc @antoinerg @archmoj - one of the darker, dingier corners of plotly.js...