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

Support custom ordering in scatterplot legend

Open larsyencken opened this issue 2 years ago • 2 comments

Requested by @pabloarosado

Problem

The scatterplot legend is ordered alphabetically, which makes sense when it represents a nominal categorical variable (e.g. gender, region) but not when it represents an ordinal one.

In the example below, rather than alphabetical order, the legend would be better ordered from "Low income" to "High income", or the reverse, with "Not categorised" at the end.

Screen Shot 2022-10-04 at 11 03 01

Technical context

  • Scatterplots allow you to colour by a variable
  • But variables are currently untyped, meaning that Grapher does not know even if they are categorical or numeric until it looks at the data, let alone whether the data is sequential or ordinal

larsyencken avatar Oct 04 '22 09:10 larsyencken

From discussion with @danyx23 , it would be possible to solve this in the grapher admin, but even nicer would be to try to solve the general problem in the upstream data.

Marking as "nice to have" and estimating a 3d fix, which makes it unlikely we'll come to it soon.

larsyencken avatar Oct 04 '22 11:10 larsyencken

This issue came up again today as a request by Joe.

marcelgerber avatar Oct 11 '22 21:10 marcelgerber

This issue has had no activity within 10 months. It is considered stale and will be closed in 7 days unless it is worked on or tagged as pinned.

github-actions[bot] avatar Jan 05 '24 07:01 github-actions[bot]

This is one of the motivating example for getting data types into Grapher (which we really want to do), so I want to keep this issue open for now

sophiamersmann avatar Jan 12 '24 08:01 sophiamersmann