Public
Edited
Apr 24, 2023
Insert cell
Insert cell
data = ([{name: 'root', some: 'data here'}, {name: "root.child"}, {name: "root.child.third"}, {name: 'root.another'}, {name: 'root.service'}, {name: 'root.api'}, {name: 'root.frontend'}])
Insert cell
chart = {
let plot = Plot.plot({
axis: null,
inset: 10,
insetLeft: 10,
insetRight: 160,
width: 1152,
marks: [
Plot.tree(data, { path: "name", delimiter: "." })
]
})

d3.select(plot).selectAll('circle').on('click', (d, n) => { console.log('CLICKED A CIRCLE', d, n) })
return plot
}
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