Published
Edited
Dec 29, 2021
1 fork
Insert cell
doc = html`<div id="container2"></div>`
Insert cell
<div id="container2"></div>
Insert cell
data = fetch(
"https://gw.alipayobjects.com/os/antfincdn/VnrXpYSuqW/circle-pie.json"
).then((res) => res.json())
Insert cell
plot2 = {
const p = new Facet("container2", {
type: "circle",
fields: ["clarity"],
data: data,
tooltip: { showMarkers: false },
meta: {
cut: {
sync: true
}
},
eachView: (view, f) => {
return {
type: "pie",
options: {
data: f.data,
angleField: "mean",
colorField: "cut",
pieStyle: { stroke: null },
theme: "custom"
}
};
}
});
p.render();
return p;
}
Insert cell
Facet = g2plot.Facet
Insert cell
DataSet = require("@antv/data-set")
Insert cell
g2plot = require('@antv/g2plot')
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