0

In our project we are using vega-scale to generate heatmaps for numeric data. We managed to use a sequential scheme like viridis with scale = vega.scale('sequential').interploate(vega.scheme('viridis'));. I can't seem to figure out from the documentation how to differentiate between for example a linear and log scale. Also the previously mentioned vega-scale repository is archived now. The README.md file explains that everything has been moved to vega/vega for further development but i can't seem to find any documentation on how to use the scale api. Could someone point me to the documentation for it?

fxwiegand
  • 1
  • 2

1 Answers1

0

Here you go - I think it has been moved here.

https://vega.github.io/vega/docs/api/extensibility/#scales

I'm really not familiar with the API but is this what you want?

enter image description here

var seq = vega.scale('sequential');

// sequential scale, using the plasma color palette
var scale1 = seq().interpolator(vega.scheme('viridis')).domain([0,10]);

document.getElementsByTagName("h1")[0].style.color = scale1(0);
document.getElementsByTagName("h1")[1].style.color = scale1(2);
document.getElementsByTagName("h1")[2].style.color = scale1(4);
document.getElementsByTagName("h1")[3].style.color = scale1(6);
document.getElementsByTagName("h1")[3].style.color = scale1(8);
document.getElementsByTagName("h1")[4].style.color = scale1(10);
Davide Bacci
  • 16,647
  • 3
  • 10
  • 36