MCPcopy Index your code
hub / github.com/microsoft/SandDance / fill

Function fill

packages/sanddance-specs/src/fill.ts:8–25  ·  view source on GitHub ↗
(context: SpecContext, colorFieldName: string, scale: string)

Source from the content-addressed store, hash-verified

6import { ColorValueRef, NumericValueRef, ProductionRule } from 'vega-typings';
7
8export function fill(context: SpecContext, colorFieldName: string, scale: string): ProductionRule<ColorValueRef> {
9 const { specColumns, insight, specViewOptions } = context;
10 const colorColumn = specColumns.color;
11 return colorColumn ?
12 colorColumn.isColorData || insight.directColor ?
13 {
14 field: safeFieldName(colorColumn.name),
15 }
16 :
17 {
18 scale,
19 field: colorColumn.quantitative ? safeFieldName(colorColumn.name) : colorFieldName,
20 }
21 :
22 {
23 value: specViewOptions.colors.defaultCube,
24 };
25}
26
27export function opacity(context: SpecContext): ProductionRule<NumericValueRef> {
28 const result: ProductionRule<NumericValueRef> = {

Callers 1

buildMethod · 0.90

Calls 1

safeFieldNameFunction · 0.90

Tested by

no test coverage detected