PageSourceSearch

https://compphil.github.io/assets/js/nli.js

js compphil.github.io collected 2026-10-03 08:49:28 UTC 1,041 bytes, 39 lines download raw bytes

1d3.select("#nliframe")
2    .on("mouseenter", () => {
3        d3.select("#nliframe")
4            .classed("glow-medium", false);
5    });
6
7var prop1 = 0, prop2 = 2;
8const nliWeights = [
9    [1.0, 0.0, 0.24, 0.71, 0.05, 0.0],
10    [0.0, 1.0, 0.07, 0.35, 0.05, 0.0],
11    [1.0, 1.0, 1.0, 0.59, 0.06, 0.0],
12    [0.2, 0.22, 0.43, 1.0, 0.0, 0.0],
13    [0.23, 0.26, 0.29, 0.0, 1.0, 0.1],
14    [0.06, 0.06, 0.08, 0.0, 1.0, 1.0],
15]
16var colorInterpolator = d3.interpolateRgbBasis(["red", "red", "black", "green", "green"]);
17
18d3.select("#nliprop1")
19    .on("change", (e) => {
20        prop1 = e.target.value;
21        weighArcs();
22    });
23
24d3.select("#nliprop2")
25    .on("change", (e) => {
26        prop2 = e.target.value;
27        weighArcs();
28    });
29
30function weighArcs() {
31    d3.select("#nli12")
32        .style("color", colorInterpolator(nliWeights[prop1][prop2]))
33        .text(nliWeights[prop1][prop2]);
34    d3.select("#nli21")
35        .style("color", colorInterpolator(nliWeights[prop2][prop1]))
36        .text(nliWeights[prop2][prop1]);
37}
38
39weighArcs();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.