Jacky Zhao
2022-04-28 3c7ece5405436c85282f156cf387b11d08cc2d87
assets/js/graph.js
@@ -127,7 +127,7 @@
    .attr("fill", color)
    .style("cursor", "pointer")
    .on("click", (_, d) => {
      window.location.href = baseUrl + '/' + decodeURI(d.id).replace(/\s+/g, '-')
      window.location.href = `${baseUrl}/${decodeURI(d.id).replace(/\s+/g, '-')}/`
    })
    .on("mouseover", function(_, d) {
      d3.selectAll(".node")
@@ -185,7 +185,7 @@
  const labels = graphNode.append("text")
    .attr("dx", 12)
    .attr("dy", ".35em")
    .text((d) => content[decodeURI(d.id).replace(/\s+/g, '-')]?.title || d.id.replace("-", " "))
    .text((d) => content[d.id]?.title || d.id.replace("-", " "))
    .style("opacity", 0)
    .style("pointer-events", "none")
    .call(drag(simulation));