diff --git a/public/arf.json b/public/arf.json index 039661b..4c06a87 100644 --- a/public/arf.json +++ b/public/arf.json @@ -215,7 +215,7 @@ "url": "https://github.com/vec2text/vec2text" }, { - "name": "Text Embeddings Reveal (Almost) As Much As Text", + "name": "Text Embeddings Reveal (Almost) As Much As Text [N]", "type": "url", "url": "https://openreview.net/pdf?id=wK7wUdiM5g0" } diff --git a/public/js/arf.js b/public/js/arf.js index 19c3103..ec30825 100644 --- a/public/js/arf.js +++ b/public/js/arf.js @@ -102,22 +102,19 @@ function update(source) { }) .style("fill-opacity", 1e-6); - // Add Notes link for leaf nodes only + // Add Notes link for leaf nodes whose name ends with [N] nodeEnter .filter(function (d) { - return !d.children && !d._children; + // foglia + nome che termina con [N] + return !d.children && !d._children && /\[N\]$/.test(d.name); }) .append("a") .attr("target", "_blank") - .attr("xlink:href", (d) => "viewer.html?file=notes/" + d.name + ".md") - .attr("target", "_blank") // ← open in new tab - /* .attr("xlink:href", function (d) { - return ( - "https://git.hackinpovo.it/HackInPovo/resources/raw/branch/main/notes/" + - d.name + - ".txt" - ); - })*/ + .attr("xlink:href", function (d) { + // stesso nome ma senza [N] per il file delle note + var baseName = d.name.replace(/\s*\[N\]$/, ""); + return "viewer.html?file=notes/" + baseName + ".md"; + }) .append("svg:text") .attr("x", function (d) { // Get the sibling text element (the node name) and calculate position @@ -134,6 +131,7 @@ function update(source) { .style("font-size", "0.85em") // Smaller font .style("fill-opacity", 1e-6) .style("text-decoration", "underline"); + // END OF NEW CODE nodeEnter.append("svg:title").text(function (d) {