-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
122 lines (110 loc) · 4.34 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ACORN</title>
<!-- Knob info: https://g200kg.github.io/input-knobs/ -->
<script type="text/javascript" src="assets/input-knob.js"></script>
<!-- CSV parser: https://www.papaparse.com -->
<script type="text/javascript" src="assets/papaparse.min.js"></script>
<!-- Local scripts -->
<script type="text/javascript" src="js/dataHandling.js"></script>
<script type="text/javascript" src="js/UI.js"></script>
<link rel="stylesheet" href="css/style.css">
<style>
@font-face {
font-family: "NotoSans";
src: url("assets/NotoSansMono-Regular.ttf") format("ttf");
}
body {
font-family: "NotoStans", sans-serif;
}
</style>
</head>
<body>
<div class="panel" style="display: flex;">
<div class="grid-container" id="dtmContainer"></div>
<div class="panel-right">
<div class="panel-right-section">
<h3>ACORN</h3>
<p>
An implementation of the Associative Content Retrieval
Network, a queryable document-term matrix described in <a
href="https://apps.dtic.mil/sti/citations/AD0290313"
target="_blank">Giuliano and Jones (1962)</a> and <a
href="https://ieeexplore.ieee.org/document/4323077"
target="_blank">Giuliano (1963)</a>.
</p>
<p>
The first row represents corpus terms; others are
documents. Numbers in cells show how many times a term
appears in a document. Select (i.e. query) terms to view
their associations with documents. Adjusting the knob below
changes the directness of associations: "narrow"
associations squash the indirectness of "free" ones.
</p>
</div>
<div class="panel-right-section">
<label for="header-display"><b>Header Cell Text</b></label>
<div id="header-display"></div>
</div>
<form class="dtm-form panel-right-section" id="pageForm">
<label for="normBy"><b>Association Type</b></label>
<input
type="range"
class="input-knob"
id="normBy"
name="normBy"
value="0.5"
min="0.0001"
max="1"
step="0.01"
data-diameter="64"
data-fgcolor="#000"
data-bgcolor="#888"
/>
<div class="knob-values">
<span id="knob-min">Narrow</span>
<span id="knob-max">Free</span>
</div>
</form>
<div class="panel-right-section">
<label for="terms-displayed"><b>Selected Terms</b></label>
<ul id="terms-displayed"></ul>
</div>
</div>
</div>
</body>
<script>
// Page-specific global parameters
const csvURL = "assets/data/air_force.csv";
const form = document.getElementById("pageForm");
const knob = document.getElementById("normBy");
// Load and display the CSV via an async
(async () => {
try {
// Get the CSV
csvData = await loadCSV(csvURL);
// Populate the queryMap and docAssoc. The latter is an empty
// array of 0s sized to the number of rows in the CSV
queryMap = makeQueryMap(csvData);
docAssoc = Array(csvData.data.length).fill(0);
// Display the CSV
displayCSV(csvData);
} catch (error) {
console.error("Error:", error);
}
})();
// Listen for activity on the form
form.addEventListener("submit", event => {
// Prevent an early form submission
event.preventDefault();
compileForm();
});
// Listen for activity on the knob
knob.addEventListener("input", () => {
compileForm();
})
</script>
</html>