|
|
@ -13,6 +13,7 @@
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
const index = {{$.Site.Data.linkIndex.index}}
|
|
|
|
const index = {{$.Site.Data.linkIndex.index}}
|
|
|
|
const links = {{$.Site.Data.linkIndex.links}}
|
|
|
|
const links = {{$.Site.Data.linkIndex.links}}
|
|
|
|
|
|
|
|
const content = {{$.Site.Data.contentIndex}}
|
|
|
|
const curPage = {{ strings.TrimRight "/" .Page.RelPermalink }}
|
|
|
|
const curPage = {{ strings.TrimRight "/" .Page.RelPermalink }}
|
|
|
|
const pathColors = {{$.Site.Data.graphConfig.paths}}
|
|
|
|
const pathColors = {{$.Site.Data.graphConfig.paths}}
|
|
|
|
|
|
|
|
|
|
|
@ -137,7 +138,7 @@
|
|
|
|
const neighbours = parseIdsFromLinks([...(index.links[d.id] || []), ...(index.backlinks[d.id] || [])])
|
|
|
|
const neighbours = parseIdsFromLinks([...(index.links[d.id] || []), ...(index.backlinks[d.id] || [])])
|
|
|
|
const neighbourNodes = d3.selectAll(".node").filter(d => neighbours.includes(d.id))
|
|
|
|
const neighbourNodes = d3.selectAll(".node").filter(d => neighbours.includes(d.id))
|
|
|
|
const currentId = d.id
|
|
|
|
const currentId = d.id
|
|
|
|
const links = d3.selectAll(".link").filter(d => d.source.id === currentId || d.target.id === currentId)
|
|
|
|
const linkNodes = d3.selectAll(".link").filter(d => d.source.id === currentId || d.target.id === currentId)
|
|
|
|
|
|
|
|
|
|
|
|
// highlight neighbour nodes
|
|
|
|
// highlight neighbour nodes
|
|
|
|
neighbourNodes
|
|
|
|
neighbourNodes
|
|
|
@ -146,7 +147,7 @@
|
|
|
|
.attr("fill", color)
|
|
|
|
.attr("fill", color)
|
|
|
|
|
|
|
|
|
|
|
|
// highlight links
|
|
|
|
// highlight links
|
|
|
|
links
|
|
|
|
linkNodes
|
|
|
|
.transition()
|
|
|
|
.transition()
|
|
|
|
.duration(200)
|
|
|
|
.duration(200)
|
|
|
|
.attr("stroke", "var(--g-link-active)")
|
|
|
|
.attr("stroke", "var(--g-link-active)")
|
|
|
@ -165,9 +166,9 @@
|
|
|
|
.attr("fill", color)
|
|
|
|
.attr("fill", color)
|
|
|
|
|
|
|
|
|
|
|
|
const currentId = d.id
|
|
|
|
const currentId = d.id
|
|
|
|
const links = d3.selectAll(".link").filter(d => d.source.id === currentId || d.target.id === currentId)
|
|
|
|
const linkNodes = d3.selectAll(".link").filter(d => d.source.id === currentId || d.target.id === currentId)
|
|
|
|
|
|
|
|
|
|
|
|
links
|
|
|
|
linkNodes
|
|
|
|
.transition()
|
|
|
|
.transition()
|
|
|
|
.duration(200)
|
|
|
|
.duration(200)
|
|
|
|
.attr("stroke", "var(--g-link)")
|
|
|
|
.attr("stroke", "var(--g-link)")
|
|
|
@ -184,7 +185,7 @@
|
|
|
|
const labels = graphNode.append("text")
|
|
|
|
const labels = graphNode.append("text")
|
|
|
|
.attr("dx", 12)
|
|
|
|
.attr("dx", 12)
|
|
|
|
.attr("dy", ".35em")
|
|
|
|
.attr("dy", ".35em")
|
|
|
|
.text((d) => d.id.replace("%20", "-"))
|
|
|
|
.text((d) => content[d.id.replace("%20", "-")].title)
|
|
|
|
.style("opacity", 0)
|
|
|
|
.style("opacity", 0)
|
|
|
|
.style("pointer-events", "none")
|
|
|
|
.style("pointer-events", "none")
|
|
|
|
.call(drag(simulation));
|
|
|
|
.call(drag(simulation));
|
|
|
|