Published
Edited
Jun 11, 2022
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
frame = {
let i = 0
const svg = d3.create('svg').attr("width", f).attr("height", f)
const main = svg.append("g").attr('id','main')
let other = d3.select(SVG)
let group = other.selectAll('.corner').clone(true);
main.selectAll('g')
.data(data).join('g')
.attr("transform", ([i, j, r]) => `translate(${i},${j}) rotate(${r})`)
.attr('id', (d,i) => `C2_${i}`)
.append(() => group.clone(true).node())
return svg.node()
}
Insert cell
data =[[0,0,0], [800,-20,90],[820,780,180],[20,800,270]]
Insert cell
f = 800
Insert cell
w = 400
Insert cell
h= 400
Insert cell
rnd = (a,b) => d3.randomInt(a,b)()
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