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";
|
||||
});
|
||||
|
||||
nodeEnter
|
||||
var nameLink = nodeEnter
|
||||
.append("a")
|
||||
.attr("target", "_blank")
|
||||
.attr("xlink:href", function (d) {
|
||||
return d.url;
|
||||
})
|
||||
});
|
||||
|
||||
nameLink
|
||||
.append("svg:text")
|
||||
.attr("x", function (d) {
|
||||
return d.children || d._children ? -10 : 10;
|
||||
|
|
@ -95,38 +97,34 @@ function update(source) {
|
|||
.text(function (d) {
|
||||
return d.name;
|
||||
})
|
||||
.style("fill: rgb(0, 0, 0)", function (d) {
|
||||
.style("fill", function (d) {
|
||||
return d.free ? "black" : "#999";
|
||||
})
|
||||
.style("fill-opacity", 1e-6);
|
||||
|
||||
// Add Notes link for leaf nodes only
|
||||
nodeEnter
|
||||
.filter(function (d) {
|
||||
return !d.children && !d._children;
|
||||
}) // Only leaf nodes
|
||||
})
|
||||
.append("a")
|
||||
.attr("target", "_blank")
|
||||
.attr("xlink:href", function (d) {
|
||||
// Assuming your notes are in a "notes" folder with filename based on node name
|
||||
return (
|
||||
"https://git.hackinpovo.it/HackInPovo/resources/src/branch/main/Notes/" +
|
||||
"https://git.hackinpovo.it/HackInPovo/resources/raw/branch/main/Notes/" +
|
||||
d.name +
|
||||
".txt"
|
||||
);
|
||||
// Or if you have a specific property: return d.notesUrl;
|
||||
})
|
||||
.append("svg:text")
|
||||
.attr("x", function (d) {
|
||||
// Position to the right of the node name
|
||||
// Adjust the offset (60) based on your node name lengths
|
||||
return 10 + 60;
|
||||
})
|
||||
.attr("x", 80) // Fixed position - adjust this number as needed
|
||||
.attr("dy", ".35em")
|
||||
.attr("text-anchor", "start")
|
||||
.text("[Notes]")
|
||||
.style("fill", "blue")
|
||||
.style("fill-opacity", 1e-6)
|
||||
.style("text-decoration", "underline");
|
||||
// END OF NEW CODE
|
||||
|
||||
nodeEnter.append("svg:title").text(function (d) {
|
||||
return d.description;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue