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

Model architecture: Add support for continuous color ramps #3441

Closed
kring opened this issue May 28, 2019 · 5 comments
Closed

Model architecture: Add support for continuous color ramps #3441

kring opened this issue May 28, 2019 · 5 comments
Assignees
Labels

Comments

@kring
Copy link
Member

kring commented May 28, 2019

E.g. http://ci.terria.io/master/#build/TerriaJS/test/init/csv.json and add CSV Testing -> Colors -> CSV with colorBins=0.
image

@nf-s
Copy link
Contributor

nf-s commented May 4, 2021

#5426

@nf-s
Copy link
Contributor

nf-s commented May 30, 2021

Related to #3524 SDMX 2021-02-23_Testing feedback:

Some heat maps don't have high contrast

• Not a major issue but some heat maps aren't displaying the contrast between low and high values on the map:
• E.g. Retail Trade in previous National Map: https://nationalmap.gov.au/#share=s-e1xho9kGoFg0hVO3LvFs0lF4TgW
• Same data in new National Map: http://ci.terria.io/sdmx-fixes-loading/#share=s-4lk6ZdzU1VcnSJIdTQIyCLP2CyU

This can be solved by using a continuous color ramp - i.e. not binning the data (#1585)

@nf-s
Copy link
Contributor

nf-s commented May 30, 2021

From duplicate ticket: #1585

Rather than binning the area values, they could be mapped to a continuous interval. For example, we could:

  • 'equalise' the value distribution through a non-linear mapping - eg compute (area rank)/(number of areas) to obtain a value between 0 and 1
  • linearly map the values to the (0,1) interval by computing (y-y_min)/(y_max-y_min). This can be made more robust to data outliers by mapping between the nth and nth last percentiles, rather than the min and max.
  • apply any other transforms such as truncated logarithm

We then apply the colour map function to each value to compute a RGB colour. There are many choices of such functions in the literature, but a perceptually linear colour map would be a principled choice - Matplotlib implements a bunch of (often piecewise-linear) functions that could be easily ported to javascript:
http://matplotlib.org/examples/color/colormaps_reference.html
https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/_cm.py

This was referenced May 30, 2021
@nf-s nf-s assigned nf-s and unassigned na9da Jun 1, 2021
@wibily
Copy link
Contributor

wibily commented Jun 9, 2021

considering clamping. E.g most data between 0-5 and a random 2000 value

@nf-s
Copy link
Contributor

nf-s commented Jul 12, 2021

Closed by #5426

@nf-s nf-s closed this as completed Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants