-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
268 lines (249 loc) · 10.8 KB
/
Copy pathindex.html
File metadata and controls
268 lines (249 loc) · 10.8 KB
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Depgraph</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
width: 100%; height: 100%; overflow: hidden;
background: #0a0a0f; color: #ccc;
font-family: 'SF Mono', 'Fira Code', ui-monospace, Menlo, monospace;
user-select: none; -webkit-user-select: none;
}
/* Top toolbar — mirrors old_versions/index.html */
#toolbar {
overflow: hidden;
position: fixed; top: 0; left: 0; right: 0; z-index: 10;
background: #111118; border-bottom: 1px solid #2a2a35;
padding: 8px 16px;
display: flex; align-items: center; gap: 12px;
font-size: 12px; height: 44px;
overflow-x: auto;
}
#toolbar strong { color: #e8e8f0; }
#toolbar .sep { width: 1px; height: 20px; background: #333; flex-shrink: 0; }
#toolbar .stat { color: #888; }
#toolbar .stat span { color: #ccc; }
#toolbar label {
color: #888; cursor: pointer; user-select: none;
display: inline-flex; align-items: center; gap: 4px;
white-space: nowrap;
}
#toolbar input[type=text], #toolbar input[type=number] {
background: #1a1a25; color: #ccc; border: 1px solid #333;
border-radius: 4px; padding: 3px 6px;
font-family: inherit; font-size: 11px;
}
#toolbar input[type=range] { accent-color: #666; vertical-align: middle; }
#toolbar .val { color: #666; font-size: 10px; min-width: 28px; text-align: right; }
#toolbar button {
background: #1a1a25; color: #888;
border: 1px solid #333; border-radius: 4px;
padding: 3px 8px;
font-family: inherit; font-size: 11px; cursor: pointer;
}
#toolbar button:hover { color: #ccc; border-color: #555; }
#toolbar .hint { color: #555; margin-left: auto; font-size: 11px; white-space: nowrap; }
#viewport { position: fixed; top: 0; left: 0; right: 0; bottom: 0; }
svg { width: 100%; height: 100%; }
/* SVG node classes */
.node circle.node-circle { cursor: pointer; stroke-width: 1.5; }
.node circle.affinity-ring { pointer-events: none; }
.label { pointer-events: none; user-select: none; }
.hull { transition: fill-opacity 0.2s, stroke-opacity 0.2s; }
.hull-label { pointer-events: none; user-select: none; }
.cluster-label { font-weight: 600; cursor: grab; }
.link { transition: none; }
.meta-link { transition: none; }
.node-circle.selected-glow {
filter: drop-shadow(0 0 6px #ff0) drop-shadow(0 0 12px #ff0);
}
.node-circle.trace-glow {
filter: drop-shadow(0 0 6px currentColor) drop-shadow(0 0 14px currentColor);
}
/* Right-side info panel */
#info-panel {
position: fixed; top: 44px; right: 0; width: 320px; bottom: 0; z-index: 5;
background: #111118ee; border-left: 1px solid #2a2a35;
padding: 16px; overflow-y: auto; font-size: 12px;
transform: translateX(100%); transition: transform 0.2s;
}
#info-panel.open { transform: translateX(0); }
#info-panel h3 { color: #e8e8f0; margin-bottom: 8px; font-size: 14px; word-break: break-all; }
#info-panel .section { margin-bottom: 12px; }
#info-panel .section-title { color: #888; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
#info-panel .tag {
display: inline-block; background: #222; border-radius: 3px;
padding: 2px 6px; margin: 2px; font-size: 11px;
}
#info-panel .affinity-row { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
#info-panel .affinity-bar { height: 6px; border-radius: 3px; min-width: 4px; }
#info-panel .close {
float: right; color: #666; cursor: pointer; font-size: 16px; padding: 0 4px;
}
#info-panel .close:hover { color: #ccc; }
/* Focus panel — top center */
#focus-panel {
position: fixed; top: 56px; left: 50%; transform: translateX(-50%); z-index: 15;
background: #111118ee; border: 1px solid #3a3a50; border-radius: 8px;
padding: 10px 18px; font-size: 12px; max-width: 600px;
opacity: 0; transition: opacity 0.4s; pointer-events: none;
}
#focus-panel.active { opacity: 1; pointer-events: auto; }
#focus-panel .focus-step { color: #7af; font-weight: 600; }
#focus-panel .focus-desc { color: #aab; margin-top: 4px; }
#focus-panel .focus-targets { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
#focus-panel .focus-tag {
display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px;
background: #1a1a2a; border: 1px solid #333;
}
/* Arrangement nav — bottom center */
#arr-nav {
position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
z-index: 5;
background: #111118dd; border: 1px solid #2a2a35; border-radius: 6px;
padding: 6px 14px; font-size: 11px;
display: flex; align-items: center; gap: 10px;
opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
#arr-nav.visible { opacity: 1; pointer-events: auto; }
#arr-nav button {
background: #1a1a25; color: #888;
border: 1px solid #333; border-radius: 4px;
padding: 3px 10px;
font-family: inherit; font-size: 11px; cursor: pointer;
}
#arr-nav button:hover:not(:disabled) { color: #ccc; border-color: #555; }
#arr-nav button:disabled { opacity: 0.3; cursor: default; }
#arr-nav .arr-label { color: #888; min-width: 56px; text-align: center; }
/* Pull-layers panel — bottom left */
#pull-layers {
position: fixed; bottom: 16px; left: 16px; z-index: 5;
background: #111118dd; border: 1px solid #2a2a35; border-radius: 6px;
padding: 10px 14px; font-size: 11px;
max-height: calc(100vh - 100px); overflow-y: auto;
min-width: 180px;
}
#pull-layers .pull-title {
color: #666; font-size: 10px; text-transform: uppercase;
letter-spacing: 1px; margin-bottom: 6px;
}
#pull-layers .layer-row {
display: flex; align-items: center; gap: 6px; margin: 4px 0;
}
#pull-layers .swatch {
display: inline-block; width: 8px; height: 8px; border-radius: 50%;
flex-shrink: 0; cursor: pointer;
}
#pull-layers .layer-name {
color: #aaa; font-size: 11px; min-width: 90px;
cursor: pointer; user-select: none;
}
#pull-layers .layer-row.disabled .swatch { opacity: 0.3; }
#pull-layers .layer-row.disabled .layer-name {
color: #444; text-decoration: line-through;
}
#pull-layers .pull-slider { width: 50px; height: 3px; accent-color: #666; cursor: pointer; }
#pull-layers .pull-val { color: #666; font-size: 10px; min-width: 24px; text-align: right; }
#toolbartogglerui {
top: 0;
left: 0;
width: 20px;
height: 20px;
position: absolute;
z-index: 11;
}
#toolbartoggler {
all: unset;
cursor: pointer;
color: #fff;
}
</style>
</head>
<body>
<div id="toolbartogglerui">
<button data-arr="hidetoolbar" title="Toolbar Toggler" id="toolbartoggler">X</button>
</div>
<div id="toolbar">
<strong>depgraph</strong>
<div class="sep"></div>
<!-- <div class="stat">nodes: <span data-hud="nodes">0</span></div>
<div class="stat">edges: <span data-hud="edges">0</span></div>
<div class="stat">cursor: <span data-hud="cursor">t0</span></div>
<div class="stat">arr: <span data-hud="arr">0 / 0</span></div> -->
<div class="sep"></div>
<label><input type="checkbox" id="show-labels" checked> Labels</label>
<label><input type="checkbox" id="show-hulls" checked> Hulls</label>
<label><input type="checkbox" id="show-cluster-labels" checked> Clusters</label>
<label><input type="checkbox" id="show-boundary-labels" checked> Boundary</label>
<label><input type="checkbox" id="show-meta-edges" checked> Meta</label>
<label title="Stiffen structural hyperedges (e.g. function signatures)"><input type="checkbox" id="runtime-mode"> Runtime</label>
<div class="sep"></div>
<label title="History cursor — drag to scrub through time">t
<input type="range" id="t-slider" min="0" max="0" value="0" style="width:200px">
<span class="val" id="t-val">0/0</span>
</label>
<button id="t-snap" title="Insert current node positions as history rows at this cursor">Snap @ t</button>
<label title="Gradient-descent iterations to run before snapping">iter
<input type="number" id="t-iter" min="1" max="2000" value="200" style="width:56px">
</label>
<button id="t-descend" title="Run gradient descent here, then insert resulting positions">Descend @ t</button>
<div class="sep"></div>
<!-- <label>Search: <input type="text" id="search" placeholder="node id..." style="width:140px"></label>
<div class="sep"></div>
<label title="X-key rewind speed (ms)">X
<input type="range" id="x-speed" min="200" max="5000" step="100" value="3000" style="width:56px">
<span class="val" id="x-speed-val">3.0s</span>
</label>
<label title="Z-key time-travel speed (ms)">Z
<input type="range" id="z-speed" min="200" max="5000" step="100" value="800" style="width:56px">
<span class="val" id="z-speed-val">0.8s</span>
</label>
<label title="T-key trace speed (ms/edge)">T
<input type="range" id="t-speed" min="100" max="3000" step="50" value="1000" style="width:56px">
<span class="val" id="t-speed-val">1.0s</span>
</label> -->
<div class="hint">hold Z · hold X · T = trace · Space = gather · drag</div>
</div>
<div id="viewport">
<svg id="graph"></svg>
</div>
<div id="info-panel">
<span class="close" id="info-close">×</span>
<h3 id="info-name">Select a node</h3>
<div id="info-body"></div>
</div>
<div id="focus-panel">
<div class="focus-step"></div>
<div class="focus-desc"></div>
<div class="focus-targets"></div>
</div>
<div id="arr-nav">
<button data-arr="back" title="Previous arrangement">←</button>
<span class="arr-label" data-arr="label">—</span>
<button data-arr="fwd" title="Next arrangement">→</button>
</div>
<div id="pull-layers">
<div class="pull-title">Edge layers</div>
<!-- rows injected by main.js -->
</div>
<script src="https://d3js.org/d3.v7.min.js"></script>
<script type="module" src="src/main.js"></script>
<script>
let isToolbarToggled = true;
const toggleToolbar = () => {
isToolbarToggled = !isToolbarToggled;
const ids = ['toolbar', 'pull-layers', 'focus-panel', 'arr-nav'];
const visibility = isToolbarToggled ? 'visible' : 'hidden';
ids.map((id) => {
document.getElementById(id).style.visibility = visibility;
})
document.getElementById('toolbartoggler').innerHTML = isToolbarToggled ? 'H' : 'S';
}
document.getElementById('toolbartoggler').addEventListener('click', toggleToolbar);
toggleToolbar();
</script>
</body>
</html>