diff --git a/build/vega-lite-schema.json b/build/vega-lite-schema.json index 6bc330e266..56788045dd 100644 --- a/build/vega-lite-schema.json +++ b/build/vega-lite-schema.json @@ -21928,12 +21928,6 @@ { "$ref": "#/definitions/ColorScheme" }, - { - "items": { - "type": "string" - }, - "type": "array" - }, { "$ref": "#/definitions/SchemeParams" }, @@ -21941,7 +21935,7 @@ "$ref": "#/definitions/ExprRef" } ], - "description": "A string indicating a color [scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme) name (e.g., `\"category10\"` or `\"blues\"`) or a [scheme parameter object](https://vega.github.io/vega-lite/docs/scale.html#scheme-params).\n\nDiscrete color schemes may be used with [discrete](https://vega.github.io/vega-lite/docs/scale.html#discrete) or [discretizing](https://vega.github.io/vega-lite/docs/scale.html#discretizing) scales. Continuous color schemes are intended for use with color scales.\n\nFor the full list of supported schemes, please refer to the [Vega Scheme](https://vega.github.io/vega/docs/schemes/#reference) reference." + "description": "A string indicating a color [scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme) name (e.g., `\"category10\"` or `\"blues\"`) or a [scheme parameter object](https://vega.github.io/vega-lite/docs/scale.html#scheme-params).\n\nDiscrete color schemes may be used with [discrete](https://vega.github.io/vega-lite/docs/scale.html#discrete) or [discretizing](https://vega.github.io/vega-lite/docs/scale.html#discretizing) scales. Continuous color schemes are intended for use with color scales.\n\nTo set a custom scheme, instead set the list of values [as the scale range](https://vega.github.io/vega-lite/docs/scale.html#2-setting-the-range-property-to-an-array-of-valid-css-color-strings).\n\nFor the full list of supported schemes, please refer to the [Vega Scheme](https://vega.github.io/vega/docs/schemes/#reference) reference." }, "type": { "$ref": "#/definitions/ScaleType", diff --git a/src/compile/scale/range.ts b/src/compile/scale/range.ts index 104bfe7b5e..87058fea01 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 | string[]): RangeScheme { +function parseScheme(scheme: Scheme | SignalRef): RangeScheme { if (isExtendedScheme(scheme)) { return { scheme: scheme.name, diff --git a/src/scale.ts b/src/scale.ts index fa903c497a..e0a0c06e35 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 | string[]): scheme is SchemeParams { +export function isExtendedScheme(scheme: Scheme | SignalRef): scheme is SchemeParams { return !isString(scheme) && !!scheme['name']; } @@ -609,9 +609,11 @@ export interface Scale { * * Discrete color schemes may be used with [discrete](https://vega.github.io/vega-lite/docs/scale.html#discrete) or [discretizing](https://vega.github.io/vega-lite/docs/scale.html#discretizing) scales. Continuous color schemes are intended for use with color scales. * + * To set a custom scheme, instead set the list of values [as the scale range](https://vega.github.io/vega-lite/docs/scale.html#2-setting-the-range-property-to-an-array-of-valid-css-color-strings). + * * For the full list of supported schemes, please refer to the [Vega Scheme](https://vega.github.io/vega/docs/schemes/#reference) reference. */ - scheme?: ColorScheme | string[] | SchemeParams | ES; + scheme?: ColorScheme | SchemeParams | ES; /** * The alignment of the steps within the scale range.