feat: enhance the process topology graph to support dragging nodes (#158)

This commit is contained in:
Fine0830
2022-09-15 17:18:39 +08:00
committed by GitHub
parent 9ed0121fd0
commit 26817e9f92
9 changed files with 311 additions and 291 deletions

View File

@@ -19,11 +19,11 @@ export default (d3: any, graph: any, diff: number[]) =>
d3
.zoom()
.scaleExtent([0.3, 10])
.on("zoom", (event: any) => {
.on("zoom", (d: any) => {
graph.attr(
"transform",
`translate(${event.transform.x + diff[0]},${
event.transform.y + diff[1]
})scale(${event.transform.k})`
`translate(${d.transform.x + diff[0]},${
d.transform.y + diff[1]
})scale(${d.transform.k})`
);
});