Jacky Zhao
2022-04-28 c8d390dbc5a749af533f1ec05de2d5b6f37fa156
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));