diff --git a/build/vega-lite-schema.json b/build/vega-lite-schema.json index 75e4602c1e..3f12151256 100644 --- a/build/vega-lite-schema.json +++ b/build/vega-lite-schema.json @@ -12467,7 +12467,7 @@ "$ref": "#/definitions/LayerSpec" }, { - "$ref": "#/definitions/UnitSpec" + "$ref": "#/definitions/UnitSpecWithFrame" } ], "description": "A specification of the view that gets repeated." @@ -29223,7 +29223,7 @@ "$ref": "#/definitions/LayerSpec" }, { - "$ref": "#/definitions/UnitSpec" + "$ref": "#/definitions/UnitSpecWithFrame" } ], "description": "A specification of the view that gets repeated." diff --git a/examples/specs/repeat_layer_size.json b/examples/specs/repeat_layer_size.json new file mode 100644 index 0000000000..d2b8c6eb3e --- /dev/null +++ b/examples/specs/repeat_layer_size.json @@ -0,0 +1,30 @@ +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "data": { + "url": "data/movies.json" + }, + "repeat": { + "layer": ["US Gross", "Worldwide Gross"] + }, + "spec": { + "width": 200, + "mark": "line", + "encoding": { + "x": { + "bin": true, + "field": "IMDB Rating", + "type": "quantitative" + }, + "y": { + "aggregate": "mean", + "field": {"repeat": "layer"}, + "type": "quantitative", + "title": "Mean of US and Worldwide Gross" + }, + "color": { + "datum": {"repeat": "layer"}, + "type": "nominal" + } + } + } +} diff --git a/src/spec/repeat.ts b/src/spec/repeat.ts index 9f208b8a00..be4808e41e 100644 --- a/src/spec/repeat.ts +++ b/src/spec/repeat.ts @@ -2,7 +2,7 @@ import {isArray} from 'vega-util'; import {LayerSpec, NonNormalizedSpec} from '.'; import {Field} from '../channeldef'; import {BaseSpec, GenericCompositionLayoutWithColumns, ResolveMixins} from './base'; -import {UnitSpec} from './unit'; +import {UnitSpecWithFrame} from './unit'; export interface RepeatMapping { /** @@ -53,7 +53,7 @@ export interface LayerRepeatSpec extends BaseSpec, GenericCompositionLayoutWithC /** * A specification of the view that gets repeated. */ - spec: LayerSpec | UnitSpec; + spec: LayerSpec | UnitSpecWithFrame; } export function isRepeatSpec(spec: BaseSpec): spec is RepeatSpec {