Public
Edited
Dec 14, 2022
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
const area = {
type: "area",
paddingLeft: 0,
paddingRight: 0,
paddingBottom: 0,
paddingTop: 0,
axis: false,
data,
scale: {
color: { type: "identity" }
},
encode: {
x: "x",
y: "y",
color: "color",
series: "series",
key: (d) => `(${d.x}, ${d.y})`,
shape: "smooth"
}
};

const chart = G2.render({
type: "timingKeyframe",
width: width,
height: 500,
direction: "alternate",
iterationCount: 10,
duration: 1500,
children: [
area,
{ ...area, transform: [{ type: "stackY" }] },
{ ...area, transform: [{ type: "stackY" }, { type: "normalizeY" }] },
{ ...area, transform: [{ type: "stackY" }, { type: "symmetryY" }] }
]
});
return chart;
}
Insert cell
Insert cell
Insert cell
import { bumps } from "@d3/streamgraph-transitions"
Insert cell
G2 = require("@antv/g2@5.0.0-beta.4/dist/g2.min.js")
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