Public
Edited
Jan 3, 2023
1 fork
3 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
bars2 = {
let chartHolder = d3.select(document.createElement("div"));
chartHolder.attr("style", "height: 420px");

// Construct components
let bars = d3X3d.component.bars()
.colors(colors);
let viewpoint = d3X3d.component.viewpoint();

// Create x3d and scene
let scene = chartHolder
.append("X3D")
.attr("width", width + "px")
.attr("height", height + "px")
.append("Scene");

// Append components to scene
scene
.datum(data[0])
.call(bars);
scene
.call(viewpoint);

return chartHolder.node();
}
Insert cell
Insert cell
bars3 = {
let chartHolder = d3.select(document.createElement("div"));
chartHolder.attr("style", "height: 420px");

// Construct components
let bars = d3X3d.component.barsMultiSeries()
.colors(colors);
let viewpoint = d3X3d.component.viewpoint();

// Create x3d and scene
let scene = chartHolder
.append("X3D")
.attr("id", "axis")
.attr("width", width + "px")
.attr("height", height + "px")
.append("Scene");

// Append components to scene
scene
.append("Group")
.datum(data)
.call(bars);
scene
.call(viewpoint);

return chartHolder.node();
}
Insert cell
Insert cell
bars4 = {
let chartHolder = d3.select(document.createElement("div"));
chartHolder.attr("style", "height: 420px");

// Construct components
let axis = d3X3d.component.axisThreePlane()
.xScale(xScale)
.yScale(yScale)
.zScale(zScale);
let bars = d3X3d.component.barsMultiSeries()
.colors(colors);
let viewpoint = d3X3d.component.viewpoint();

// Create x3d and scene
let scene = chartHolder
.append("X3D")
.attr("id", "axis")
.attr("width", width + "px")
.attr("height", height + "px")
.append("Scene");

// Append components to scene
scene
.append("Group")
.call(axis);
scene
.append("Group")
.datum(data)
.call(bars);
scene
.call(viewpoint);

return chartHolder.node();
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more