diff --git a/dependency-graph.js b/dependency-graph.js index b1fae18b2c..ad5b8cbb9f 100644 --- a/dependency-graph.js +++ b/dependency-graph.js @@ -8,7 +8,9 @@ - an element with id "dependency-graph-page" gets a folded labeled graph of every div on its page; - an element with id "dependency-graph-site" gets one tree of every div on the site, and an element with id "dependency-graph-all" and a data-json attribute (comma-separated URLs of - several sites' dependency-graph.json) gets one tree of all those sites together. + several sites' dependency-graph.json) gets one tree of all those sites together, + and says how many of its boxes each site defines. Name this site's own graph by the + relative URL "dependency-graph.json", so that a PR preview joins its own graph, not main's. These have hundreds of nodes, so their boxes carry no text: the kind and title show as hovertext. */ (function () { "use strict"; @@ -210,8 +212,13 @@ var edges = g.edges.filter(function (e) { return ids[e[0]] && ids[e[1]]; }).map(function (e) { return [e[1], e[0]]; }); var levels = layers(keys, nodes, uses), kinds = {}; keys.forEach(function (k) { kinds[nodes[k].kind] = 1; }); + /* A tree joining several sites (g.site is "") says how many boxes each site defines. */ + var bySite = {}, parts = []; + keys.forEach(function (k) { bySite[nodes[k].site] = (bySite[nodes[k].site] || 0) + 1; }); + if (!g.site) Object.keys(bySite).sort().forEach(function (s) { parts.push(bySite[s] + " from " + s); }); var p = document.createElement("p"); - p.textContent = keys.length + " definitions and results, " + edges.length + " dependencies, " + levels.length + " levels."; + p.textContent = keys.length + " definitions and results" + (parts.length ? " (" + parts.join(", ") + ")" : "") + + ", " + edges.length + " dependencies, " + levels.length + " levels."; host.appendChild(p); host.appendChild(legend(kinds, true)); var s = document.createElement("div"); diff --git a/dependency-tree.qmd b/dependency-tree.qmd index b3e0ec68b2..478fdc134a 100644 --- a/dependency-tree.qmd +++ b/dependency-tree.qmd @@ -30,5 +30,5 @@ This tree joins both sets of notes: a box sits below each definition and [theorem](https://morrison-lab.github.io/mcs/proof-writing.html#def-theorem) it uses, in either one, and hovering over a box also shows which notes it is in. -::: {#dependency-graph-all data-json="https://morrison-lab.github.io/mcs/dependency-graph.json,https://morrison-lab.github.io/mds/dependency-graph.json"} +::: {#dependency-graph-all data-json="https://morrison-lab.github.io/mcs/dependency-graph.json,dependency-graph.json"} ::: diff --git a/lychee.toml b/lychee.toml index ba16f05bd6..1d02f0e444 100644 --- a/lychee.toml +++ b/lychee.toml @@ -20,7 +20,7 @@ timeout = 20 exclude = [ # Not a link: the data-json attribute of the joined tree in dependency-tree.qmd, # a comma-separated list of graph files that lychee reads as one URL (each file is live) - "^https://morrison-lab\\.github\\.io/mcs/dependency-graph\\.json,https://morrison-lab\\.github\\.io/mds/dependency-graph\\.json$", + "^https://morrison-lab\\.github\\.io/mcs/dependency-graph\\.json,dependency-graph\\.json$", "https://github.com/YOUR-USERNAME/.*", "https://YOUR-USERNAME.github.io/.*", "https://your-username.github.io/.*",