Published
Edited
Mar 24, 2020
2 stars
Insert cell
md`# d3.zoom`
Insert cell
Insert cell
canvas = {
let width = 400
let svg = d3.create('svg')
.attr('width', width)
.attr('height', width)
.attr('viewBox', '0, 0, 900, 1000')
let _svg = d3.select(raw.documentElement).node();
let g = svg.append('g').html(_svg.innerHTML);
svg.call(d3.zoom().on('zoom', () => {
g.attr('transform', d3.event.transform);
}));
return svg.node();
}
Insert cell
Insert cell
d3 = require('d3@5')
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