Skip to content

Commit 3ebf6d2

Browse files
committed
attempt to improve zoom #121
Still only zooms links, and not yet nodes
1 parent 42b0590 commit 3ebf6d2

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: repometrics
22
Title: Metrics for Your Code Repository
3-
Version: 0.1.6.080
3+
Version: 0.1.6.081
44
Authors@R:
55
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre"),
66
comment = c(ORCID = "0000-0003-2172-5265"))

codemeta.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"codeRepository": "https://github.com/ropensci-review-tools/repometrics",
99
"issueTracker": "https://github.com/ropensci-review-tools/repometrics/issues",
1010
"license": "https://spdx.org/licenses/GPL-3.0",
11-
"version": "0.1.6.080",
11+
"version": "0.1.6.081",
1212
"programmingLanguage": {
1313
"@type": "ComputerLanguage",
1414
"name": "R",

inst/extdata/quarto/network.qmd

+12-2
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,18 @@ chart = {
175175
.call(zoom.translateTo, 0, 0);
176176
177177
simulation.on("tick", () => {
178-
link.attr("d", linkArc);
179-
node.attr("transform", d => `translate(${d.x},${d.y})`);
178+
179+
link
180+
.attr("d", linkArc)
181+
.attr("x1", function(d) { return d.source.x; })
182+
.attr("y1", function(d) { return d.source.y; })
183+
.attr("x2", function(d) { return d.target.x; })
184+
.attr("y2", function(d) { return d.target.y; });
185+
186+
node
187+
.attr("transform", d => `translate(${d.x},${d.y})`)
188+
.attr("cx", function(d) { return d.x; })
189+
.attr("cy", function(d) { return d.y; });
180190
});
181191
182192
invalidation.then(() => simulation.stop());

0 commit comments

Comments
 (0)