Public
Edited
Jan 3, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
donut = {
let el = this;
let scene;
if(!el) {
el = document.createElement("div");
let chartHolder = d3.select(el)
.attr("style", "height: 420px")
.append("X3D")
.attr("useGeoCache", false)
.attr("id", "axis")
.attr("width", width + "px")
.attr("height", height + "px");
scene = chartHolder.append("Scene");
} else {
scene = d3.select(el).select("Scene");
}

// Construct components
let donut = d3X3d.component.donut();

// Construct components
let viewpoint = d3X3d.component.viewpoint();
// Append components to scene
scene
.datum(data)
.call(donut);
scene
.call(viewpoint);

return el;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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