Maintain dimension mapping when possible #1698
Merged
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.
This addresses the first part of issue #1572 (cf. first bullet point in #1572 (comment)).
"when possible" means when:
If the visualization changes when switching dataset, then the last two conditions must both be met for the dimension mapping state to be maintained.
In other words, the state is maintained when, for instance:
NXdata
groups with signals with exact same dimensions and interpretations;NXData
group with a 1D signal (NX Line), and the signal itself (Line);NXData
group with a 2D+ signal with implicit or explicitimage
interpretation (NX Heatmap), and the signal itself (Heatmap);NXData
group with a 2D+ signal withspectrum
interpretation (NX Line), and the signal itself if thepreferredVis
is Line.However, the state is reset when, for instance:
NXData
groups with signals with exact same dimensions but different interpretations (e.g.image
vsspectrum
);NXData
group with a 2D+ signal withspectum
interpretation (NX Line), and the signal itself (Heatmap) when nopreferredVis
is set.