Skip to content
This repository was archived by the owner on Jun 12, 2020. It is now read-only.

Commit 96e4489

Browse files
rootroot
authored andcommitted
add zoom
1 parent 6d9d3a2 commit 96e4489

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

frontend/src/components/GraphicsGrid.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ export default ({search}) => {
6464
.on("end", dragended);
6565
}
6666
const svg = d3.select(graphicsD3.current)
67-
.attr("viewBox", [-width / 2, -height / 2, width, height]);
67+
.attr("viewBox", [-width / 2, -height / 2, width, height])
68+
.call(d3.zoom().on("zoom", function () {
69+
svg.attr("transform", d3.event.transform)
70+
}))
6871
const root = d3.stratify()(data);
6972
const links = root.links();
7073
const nodes = root.descendants();

0 commit comments

Comments
 (0)