diff --git a/build/vega-lite-schema.json b/build/vega-lite-schema.json index 02c23e5b0f..6bc330e266 100644 --- a/build/vega-lite-schema.json +++ b/build/vega-lite-schema.json @@ -21928,6 +21928,12 @@ { "$ref": "#/definitions/ColorScheme" }, + { + "items": { + "type": "string" + }, + "type": "array" + }, { "$ref": "#/definitions/SchemeParams" }, diff --git a/examples/specs/line_dynamic_axis.vl.json b/examples/specs/line_dynamic_axis.vl.json deleted file mode 100644 index cc5e2c7181..0000000000 --- a/examples/specs/line_dynamic_axis.vl.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v5.json", - "description": "Vega-Lite computes the minimum and maximum axes values automatically but this can be made more dynamic by using params to produce axes which are +/- 20% of the minimum and maximum values in the dataset.", - "data": { - "values": [ - {"x": 1, "y": 11}, - {"x": 2, "y": 10}, - {"x": 3, "y": 11.23}, - {"x": 4, "y": 10}, - {"x": 5, "y": 9.5}, - {"x": 6, "y": 10}, - {"x": 7, "y": 10} - ] - }, - "params": [ - {"name": "extents", "expr": "extent(pluck(data('source_0'), 'y'))"}, - {"name": "min", "expr": "extents[0] * 0.8"}, - {"name": "max", "expr": "extents[1] * 1.2"} - ], - "mark": {"type": "line", "point": true}, - "encoding": { - "x": {"field": "x", "type": "quantitative"}, - "y": { - "field": "y", - "type": "quantitative", - "scale": {"domain": {"expr": "[min,max]"}} - } - } -} diff --git a/site/_data/examples.json b/site/_data/examples.json index 36a2e1d521..a04bc1af32 100644 --- a/site/_data/examples.json +++ b/site/_data/examples.json @@ -520,10 +520,6 @@ { "name": "layer_point_line_loess", "title": "Loess Regression" - }, - { - "name": "line_dynamic_axis", - "title": "Dynamic Minimum and Maximum Y Axis" } ] }, diff --git a/src/compile/scale/range.ts b/src/compile/scale/range.ts index 87058fea01..104bfe7b5e 100644 --- a/src/compile/scale/range.ts +++ b/src/compile/scale/range.ts @@ -212,7 +212,7 @@ export function parseRangeForChannel(channel: ScaleChannel, model: UnitModel): E return makeImplicit(d); } -function parseScheme(scheme: Scheme | SignalRef): RangeScheme { +function parseScheme(scheme: Scheme | SignalRef | string[]): RangeScheme { if (isExtendedScheme(scheme)) { return { scheme: scheme.name, diff --git a/src/scale.ts b/src/scale.ts index 1a889d701f..fa903c497a 100644 --- a/src/scale.ts +++ b/src/scale.ts @@ -481,7 +481,7 @@ export type Domain = export type Scheme = string | SchemeParams; -export function isExtendedScheme(scheme: Scheme | SignalRef): scheme is SchemeParams { +export function isExtendedScheme(scheme: Scheme | SignalRef | string[]): scheme is SchemeParams { return !isString(scheme) && !!scheme['name']; } @@ -611,7 +611,7 @@ export interface Scale { * * For the full list of supported schemes, please refer to the [Vega Scheme](https://vega.github.io/vega/docs/schemes/#reference) reference. */ - scheme?: ColorScheme | SchemeParams | ES; + scheme?: ColorScheme | string[] | SchemeParams | ES; /** * The alignment of the steps within the scale range.