| | |
| | | import type { ContentDetails, ContentIndex } from "../../plugins/emitters/contentIndex" |
| | | import type { ContentDetails } from "../../plugins/emitters/contentIndex" |
| | | import * as d3 from "d3" |
| | | import { registerEscapeHandler, removeAllChildren } from "./util" |
| | | import { FullSlug, SimpleSlug, getFullSlug, resolveRelative, simplifySlug } from "../../util/path" |
| | |
| | | // @ts-ignore |
| | | .call(drag(simulation)) |
| | | |
| | | // make tags hollow circles |
| | | node |
| | | .filter((d) => d.id.startsWith("tags/")) |
| | | .attr("stroke", color) |
| | | .attr("stroke-width", 2) |
| | | .attr("fill", "var(--light)") |
| | | |
| | | // draw labels |
| | | const labels = graphNode |
| | | .append("text") |
| | |
| | | |
| | | document.addEventListener("nav", async (e: CustomEventMap["nav"]) => { |
| | | const slug = e.detail.url |
| | | addToVisited(slug) |
| | | addToVisited(simplifySlug(slug)) |
| | | await renderGraph("graph-container", slug) |
| | | |
| | | const containerIcon = document.getElementById("global-graph-icon") |