Skip to content
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

Sort legend items in case of hierarchy #810

Merged
merged 6 commits into from
Oct 27, 2022
Merged

Conversation

ptbrowne
Copy link
Collaborator

In case of hierarchy, we would not sort legend items and instead rely
on hierarchy order, which is not what we want.

Fixes : #806

How to test

  • Use the NFI dataset /en/create/new?cube=https://environment.ld.admin.ch/foen/nfi/49-19-44/cube/1
  • Color by production region
  • Verify that legend items are sorted automatically and can sorted in reverse, and by name

@vercel
Copy link

vercel bot commented Oct 27, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
visualization-tool ✅ Ready (Inspect) Visit Preview Oct 27, 2022 at 10:13AM (UTC)

@bprusinowski
Copy link
Collaborator

LGTM 💯

@ptbrowne
Copy link
Collaborator Author

I changed the logic and I base myself on the labels received. This is because for some sorters we need the measures (byMeasure), and here we do not have it. Since the labels come already sorted, I figured we could remove the need for sorters here, and resort the hierarchy group entries according to the original order.

Copy link
Collaborator

@bprusinowski bprusinowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, looking good! 😎

@ptbrowne ptbrowne merged commit 1c68672 into main Oct 27, 2022
@ptbrowne ptbrowne deleted the fix/legend-items-sort branch October 27, 2022 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sort order (identifier) reversed in edit mode
2 participants