MCPcopy Create free account
hub / github.com/plotly/plotly.js / ordinalScale

Function ordinalScale

src/traces/parcoords/parcoords.js:107–116  ·  view source on GitHub ↗
(dimension)

Source from the content-addressed store, hash-verified

105}
106
107function ordinalScale(dimension) {
108 if(!dimension.tickvals) return;
109
110 var extent = dimensionExtent(dimension);
111 return d3.scale.ordinal()
112 .domain(dimension.tickvals)
113 .range(dimension.tickvals.map(function(d) {
114 return (d - extent[0]) / (extent[1] - extent[0]);
115 }));
116}
117
118function unitToColorScale(cscale) {
119 var colorStops = cscale.map(function(d) { return d[0]; });

Callers 1

viewModelFunction · 0.85

Calls 1

dimensionExtentFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…