Published
Edited
Feb 10, 2022
Insert cell
# Repeat Layer Example with Vega-Lite-API

A small notebook to answer a question about Vega-Lite on Stackoverflow: https://stackoverflow.com/questions/71026104/how-to-define-repeat-and-layer-in-vega-lite-api/71059566#71059566
Insert cell
import {vl} from '@vega/vega-lite-api'
Insert cell
vl
.markLine()
.encode(
vl.x().fieldN('student_name').sort('y'),
vl.y().field(vl.repeat('layer')),
).repeat(
vl.layer(["d", "e"])
).toSpec();
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more