[Lens] Client side sorting for categorical data #121558
Closed
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.
Summary
Ref: #86184
This PR explores the potentiality of the client side sorting of categorical data for the visualizations.
Some assumptions made on the current implementation:
empty
andOther
values are always sorted at the end (Other
before,(empty)
last) for alphabetical and "Terms list" mode.Terms list
option which let the user specify specific prioritiesXY charts
+Heatmap
do support sorting at the momentX axis
is considered the "main" sorting dimension, while thebreak down
(XY)/Y axis
(Heatmap) is considered nested. When a nested dimension has a sorting override but not the main one, then a warning will be shown, as there's no way to guarantee a stable sorting for the main dimension.Mosaic
is the only partition chart that supports the sortable optionGroup by
dimension will have the sorting option as it is not possible to set an internal orderDatatable
support the sortable option, but not on theColumn
group.Few extras in this PR:
PalettePanel
and provides the same functionality of the stacked Palette UIThere are probably some bugs which I haven't spotted yet, but will try to address it next time.
Basic UI:
The sorting direction is shown when a sorting override is chosen, other than
None
:List of available sorting overrides with multiple metrics:
Choosing "List of terms" enables the "Edit list" button
Use cases:
Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers