notes links
All checks were successful
Updates the graph by copying the updated files in the right directory / build-and-deploy (push) Successful in 3s
All checks were successful
Updates the graph by copying the updated files in the right directory / build-and-deploy (push) Successful in 3s
This commit is contained in:
parent
1e8288b499
commit
0b02fa6add
1 changed files with 11 additions and 13 deletions
|
|
@ -78,12 +78,14 @@ function update(source) {
|
||||||
return d._children ? "lightsteelblue" : "#fff";
|
return d._children ? "lightsteelblue" : "#fff";
|
||||||
});
|
});
|
||||||
|
|
||||||
nodeEnter
|
var nameLink = nodeEnter
|
||||||
.append("a")
|
.append("a")
|
||||||
.attr("target", "_blank")
|
.attr("target", "_blank")
|
||||||
.attr("xlink:href", function (d) {
|
.attr("xlink:href", function (d) {
|
||||||
return d.url;
|
return d.url;
|
||||||
})
|
});
|
||||||
|
|
||||||
|
nameLink
|
||||||
.append("svg:text")
|
.append("svg:text")
|
||||||
.attr("x", function (d) {
|
.attr("x", function (d) {
|
||||||
return d.children || d._children ? -10 : 10;
|
return d.children || d._children ? -10 : 10;
|
||||||
|
|
@ -95,38 +97,34 @@ function update(source) {
|
||||||
.text(function (d) {
|
.text(function (d) {
|
||||||
return d.name;
|
return d.name;
|
||||||
})
|
})
|
||||||
.style("fill: rgb(0, 0, 0)", function (d) {
|
.style("fill", function (d) {
|
||||||
return d.free ? "black" : "#999";
|
return d.free ? "black" : "#999";
|
||||||
})
|
})
|
||||||
.style("fill-opacity", 1e-6);
|
.style("fill-opacity", 1e-6);
|
||||||
|
|
||||||
|
// Add Notes link for leaf nodes only
|
||||||
nodeEnter
|
nodeEnter
|
||||||
.filter(function (d) {
|
.filter(function (d) {
|
||||||
return !d.children && !d._children;
|
return !d.children && !d._children;
|
||||||
}) // Only leaf nodes
|
})
|
||||||
.append("a")
|
.append("a")
|
||||||
.attr("target", "_blank")
|
.attr("target", "_blank")
|
||||||
.attr("xlink:href", function (d) {
|
.attr("xlink:href", function (d) {
|
||||||
// Assuming your notes are in a "notes" folder with filename based on node name
|
|
||||||
return (
|
return (
|
||||||
"https://git.hackinpovo.it/HackInPovo/resources/src/branch/main/Notes/" +
|
"https://git.hackinpovo.it/HackInPovo/resources/raw/branch/main/Notes/" +
|
||||||
d.name +
|
d.name +
|
||||||
".txt"
|
".txt"
|
||||||
);
|
);
|
||||||
// Or if you have a specific property: return d.notesUrl;
|
|
||||||
})
|
})
|
||||||
.append("svg:text")
|
.append("svg:text")
|
||||||
.attr("x", function (d) {
|
.attr("x", 80) // Fixed position - adjust this number as needed
|
||||||
// Position to the right of the node name
|
|
||||||
// Adjust the offset (60) based on your node name lengths
|
|
||||||
return 10 + 60;
|
|
||||||
})
|
|
||||||
.attr("dy", ".35em")
|
.attr("dy", ".35em")
|
||||||
.attr("text-anchor", "start")
|
.attr("text-anchor", "start")
|
||||||
.text("[Notes]")
|
.text("[Notes]")
|
||||||
.style("fill", "blue")
|
.style("fill", "blue")
|
||||||
.style("fill-opacity", 1e-6)
|
.style("fill-opacity", 1e-6)
|
||||||
.style("text-decoration", "underline");
|
.style("text-decoration", "underline");
|
||||||
|
// END OF NEW CODE
|
||||||
|
|
||||||
nodeEnter.append("svg:title").text(function (d) {
|
nodeEnter.append("svg:title").text(function (d) {
|
||||||
return d.description;
|
return d.description;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue