Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions dependency-graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion dependency-tree.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
:::
2 changes: 1 addition & 1 deletion lychee.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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/.*",
Expand Down
Loading