Skip to content

Commit

Permalink
feat(Vis View): ✨ Functional zooming on arcDiagram
Browse files Browse the repository at this point in the history
It's not ideal though, I just zoom the entire svg, not the specific elements
  • Loading branch information
SkepticMystic committed Aug 9, 2021
1 parent ffc91a5 commit 27a22bf
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/Visualisations/ArcDiagram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ text {
// )
.attr("d", arc);

const step = 14;
const step = 104;

const nodeClick = (event: MouseEvent, dest: string) => {
const currFile = app.workspace.getActiveFile();
Expand Down Expand Up @@ -186,7 +186,7 @@ text {
// viewof order.addEventListener("input", update);
// invalidation.then(() => viewof order.removeEventListener("input", update));

function arc(d) {
function arc(d: { source: { y: number }; target: { y: number } }) {
const y1 = d.source.y;
const y2 = d.target.y;
const r = Math.abs(y2 - y1) / 2;
Expand All @@ -196,13 +196,7 @@ text {
}

function zoomed({ transform }) {
overlay.attr("transform", transform);
path.attr("transform", transform);
label.attr("transform", transform);
svg.selectAll("circle").attr("transform", transform);
svg.selectAll("text").attr("transform", transform);
svg.selectAll("rect").attr("transform", transform);
svg.selectAll("g").attr("transform", transform);
svg.attr("transform", transform);
}
svg.call(
d3
Expand Down

0 comments on commit 27a22bf

Please sign in to comment.