owid-grapher icon indicating copy to clipboard operation
owid-grapher copied to clipboard

Admin: Add support for manually ordering legend items in maps

Open sophiamersmann opened this issue 1 year ago • 2 comments

  • Authors often want the items in the map legend to appear in a certain order
  • Adding support for ordinal indicators (see https://github.com/owid/owid-grapher/pull/2039) would help with that in some cases (if the data is actually ordinal and could be encoded as such)
  • But sometimes, the data is not ordinal, but authors want the items in a map legend to be ordered in a certain way for clarity
    • for example, here, the countries should be listed first, followed by "Multiple colonizers", "Colonizer" and "Not colonized"
    • since specifying a manual order in the admin is not possible, authors edit the data (e.g. prepend numbers) to control the order (see here for an example)
      • usually, these values (with for example, numbers prepended) shouldn't surface in the UI; they don't in maps if the "Show custom label in the tooltip, instead of the numeric value" checkbox is ticked, but they do show up in tables (example), which is not optimal
    • editing the data is only necessary because ordering legend items in the admin is not supported
    • if we supported ordering legend items, authors wouldn't need to edit the data to achieve a certain order, and we also wouldn't have to deal with the fact that the values shown in the map are sometimes different from the values shown in the table

Examples:

  • https://owid.cloud/admin/charts/7232/edit
  • https://owid.cloud/admin/charts/7209/edit
  • https://owid.cloud/admin/charts/6684/edit

Slack discussion

sophiamersmann avatar Oct 06 '23 15:10 sophiamersmann