KrasnokutskiyEA
KrasnokutskiyEA
KrasnokutskiyEA
1 Snippet
Published
1 Channel
Created
1 Channel
Following
29 points
Reputation
Junior Code Generator
Junior Autobiographer
Serious Autobiographer

Recent Snippets See all snippets by KrasnokutskiyEA

public by KrasnokutskiyEA  50  0  1  0

scale

// создаем шкалу: функцию scale(x).

// ['a', 'b', 'c', 'd'] - domain - входной диапазон
// ['red', 'blue', 'green', 'orange'] - range - выходной диапазон

let scale = d3.scaleOrdinal(['red', 'blue', 'green', 'orange']).domain(['a', 'b', 'c', 'd'])

scale('c') // 'green'
;