Skip to content

Instantly share code, notes, and snippets.

@seanlandsman
Created March 15, 2018 14:36
let myData = ['R', 'G', 'B']
let ordinalScale = d3.scaleOrdinal()
.domain(myData)
.range(['red', 'green', 'blue']);
ordinalScale('R'); // red
ordinalScale('G'); // green
ordinalScale('B'); // blue
ordinalScale('Apr'); // red
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment