Public
Edited
May 29, 2023
Fork of Drag & Click
Insert cell
Insert cell
Insert cell
Insert cell
viewof button = Inputs.button("Add", {value: null, reduce: () => add()})
Insert cell
function add(){
//updateData()
//reRender()
}
Insert cell
addNode()
Insert cell
(function addRootNode(){
const svg = d3
.create("svg")
.attr("id","rootNode")
.attr("viewBox", [0, 0, width, 200])
const node = svg
.append("g")
.attr("id","some")
.append("circle")
.attr("cx",20)
.attr("cy",20)
.attr("r",5)
.attr("fill","black")
return svg.node()
})()
Insert cell
function addNode(id){
let newNode = {
"name": "kid",
"id":"root.kid",
"children":[]
}
mutable tree.children.push({newNode})
}
Insert cell
mutable tree = {
return {
name:"root",
id:"root",
children:[
]
}
}
Insert cell
height = 600
Insert cell
radius = 32
Insert cell
d3 = require("d3@7")
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