MCPcopy Create free account
hub / github.com/microsoft/SandDance / binnableColorScale

Function binnableColorScale

docs/app/js/sanddance-app.js:3175–3225  ·  view source on GitHub ↗
(scaleName, colorBin, data, field, scheme)

Source from the content-addressed store, hash-verified

3173 return scale;
3174}
3175function binnableColorScale(scaleName, colorBin, data, field, scheme) {
3176 scheme = scheme || (0, _constants.ColorScaleNone);
3177 const domain = {
3178 data,
3179 field: (0, _expr.safeFieldName)(field)
3180 };
3181 const range = {
3182 scheme
3183 };
3184 const reverse = {
3185 signal: (0, _constants.SignalNames).ColorReverse
3186 };
3187 if (colorBin !== "continuous") range.count = {
3188 signal: (0, _constants.SignalNames).ColorBinCount
3189 };
3190 switch(colorBin){
3191 case "continuous":
3192 {
3193 const sequentialScale = {
3194 name: scaleName,
3195 type: "linear",
3196 domain,
3197 range,
3198 reverse
3199 };
3200 return sequentialScale;
3201 }
3202 case "quantile":
3203 {
3204 const quantileScale = {
3205 name: scaleName,
3206 type: "quantile",
3207 domain,
3208 range,
3209 reverse
3210 };
3211 return quantileScale;
3212 }
3213 default:
3214 {
3215 const quantizeScale = {
3216 name: scaleName,
3217 type: "quantize",
3218 domain,
3219 range,
3220 reverse
3221 };
3222 return quantizeScale;
3223 }
3224 }
3225}
3226
3227},{"./constants":"9PPhV","./expr":"f5d82","@parcel/transformer-js/src/esmodule-helpers.js":"jA2du"}],"f5d82":[function(require,module,exports) {
3228var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected