-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtag_map.html
More file actions
329 lines (298 loc) · 8.51 KB
/
tag_map.html
File metadata and controls
329 lines (298 loc) · 8.51 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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Phi-Mesh Tag Map</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
:root {
--bg:#0b0c10; --panel:#10131a; --fg:#e9eef8; --muted:#97a3b6;
--link:#9fc9ff; --accent:#82c7ff; --pulse:#ff8a70;
}
html, body {
height:100%;
margin:0;
background:var(--bg);
color:var(--fg);
font:14px/1.4 system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial;
}
.app {
display:grid;
grid-template-columns:300px 1fr 300px;
height:100%;
}
/* sidebars */
aside {
background:linear-gradient(180deg,var(--panel),rgba(20,20,28,.92));
border-right:1px solid rgba(255,255,255,.06);
display:flex;
flex-direction:column;
}
aside.right {
border-right:none;
border-left:1px solid rgba(255,255,255,.06);
}
header {
padding:12px 14px 8px;
border-bottom:1px solid rgba(255,255,255,.06);
}
#left-hint { color:var(--muted); font-size:12px }
#search {
width:100%;
background:#0f1220;
border:1px solid rgba(255,255,255,.08);
color:var(--fg);
padding:9px 10px;
border-radius:8px;
outline:none;
margin-top:8px;
font-size:16px;
}
#left .content, #right .content {
padding:10px 12px;
overflow:auto;
}
.one-line {
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
display:block;
}
.muted { color:var(--muted) }
.pulse-detail { font-size:13px; }
.pulse-detail a { font-size:12.5px; }
#left .pulse-detail,
#right .pulse-detail {
font-size:12px;
line-height:1.35;
color:#b0b6c2;
}
#left .pulse-detail a,
#right .pulse-detail a {
font-size:12px;
color:#c0c5d0;
text-decoration:none;
}
#left .pulse-detail a:hover,
#right .pulse-detail a:hover {
color:#ffffff;
text-decoration:underline;
}
/* graph */
svg { width:100%; height:100% }
.node ellipse { fill:#74b7ff; stroke:none }
.node.dim text, .node.dim ellipse { opacity:.22 }
.node.selected ellipse { fill:var(--pulse) }
.link { stroke:#b9c7dd; stroke-opacity:.24 }
.link.dim { stroke-opacity:.08 }
.node .tag-label {
pointer-events: none;
dominant-baseline: hanging;
font-size: 12px;
fill: #b9c4d5; /* slightly brighter */
font-weight: 400;
opacity: 0.97;
paint-order: stroke fill;
stroke: #0b0c10; /* subtle dark halo for readability */
stroke-width: 2px;
}
/* — View toggle buttons (Insights / Experiments) — */
.view-toggle {
position: fixed;
top: 12px;
right: 12px;
z-index: 9999;
display: flex;
gap: 6px;
}
.toggle-btn {
padding: 6px 14px;
border: 1px solid #6b7280;
border-radius: 6px;
background: #1f2937;
color: #fff;
text-decoration: none;
font: 500 13px/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
transition: background .15s, border-color .15s;
}
.toggle-btn:hover {
background: #374151;
border-color: #9ca3af;
}
.toggle-btn.active {
background: #7c3aed;
border-color: #7c3aed;
}
/* -------- MOBILE LAYOUT -------- */
.mobile-toolbar {
display:none;
}
@media (max-width: 860px) {
body {
padding-top:44px;
}
.app {
grid-template-columns:1fr;
height:auto;
}
aside {
position:fixed;
top:44px;
bottom:0;
left:0;
width:80%;
max-width:340px;
z-index:9000;
transform:translateX(-100%);
transition:transform .2s ease-out;
}
aside.right {
left:auto;
right:0;
transform:translateX(100%);
}
aside.open {
transform:translateX(0);
}
#graph {
height:100vh;
}
/* mobile toolbar */
.mobile-toolbar {
position:fixed;
top:0;
left:0;
right:0;
height:44px;
background:rgba(11,12,16,.96);
display:flex;
align-items:center;
justify-content:space-between;
padding:0 10px;
z-index:9500;
border-bottom:1px solid rgba(255,255,255,.06);
}
.mobile-title {
font-weight:600;
font-size:13px;
color:var(--fg);
}
.mobile-btn {
border:1px solid rgba(255,255,255,.18);
border-radius:999px;
padding:4px 10px;
background:#111827;
color:var(--fg);
font-size:12px;
}
/* — ACTIVE STATE TINT (Option A) — */
.mobile-btn.active {
background: #1f2a3a;
border-color: #3a4a6a;
}
.view-toggle {
top:54px;
}
}
</style>
<script src="https://cdn.jsdelivr.net/npm/d3@7"></script>
<script src="data.js"></script>
<script src="normalize_data.js"></script>
<script defer src="map.js"></script>
</head>
<body>
<!-- Mobile toolbar (only visible on small screens) -->
<div class="mobile-toolbar">
<button id="toggle-left" class="mobile-btn">Tags / Details</button>
<div class="mobile-title">Phi-Mesh Tag Map</div>
<button id="toggle-right" class="mobile-btn">Pulse list</button>
</div>
<div class="app">
<!-- LEFT -->
<aside id="left">
<header>
<div style="font-weight:700">Phi-Mesh Tag Map</div>
<div id="left-hint">
Hover or tap a tag for its description • Click a tag to list pulses • Click a pulse to see details
</div>
<input id="search" type="search" placeholder="Type to filter…">
</header>
<div id="left-content" class="content"></div>
</aside>
<!-- GRAPH -->
<svg id="graph" role="img" aria-label="Tag Map"></svg>
<!-- RIGHT -->
<aside id="right" class="right">
<header><div style="font-weight:700">Pulses</div></header>
<div class="content">
<div id="pulse-list" class="muted one-line">Click a tag to list its pulses.</div>
</div>
</aside>
</div>
<div id="tooltip" style="position:fixed; left:0; top:0; display:none;
background:#0f1522; color:#e9eef8; border:1px solid rgba(255,255,255,.08);
border-radius:10px; padding:10px 12px; max-width:300px; box-shadow:0 6px 18px rgba(0,0,0,.35);">
</div>
<div class="view-toggle">
<a class="toggle-btn active" href="tag_map.html">Insights</a>
<a class="toggle-btn" href="tag_map_experiments.html">Experiments</a>
<button id="share-link-btn" class="toggle-btn" type="button">Share link</button>
</div>
<!-- Mobile sidebar toggles + helper for tag-click routing -->
<script>
(function() {
const left = document.getElementById('left');
const right = document.getElementById('right');
const tl = document.getElementById('toggle-left');
const tr = document.getElementById('toggle-right');
const graph = document.getElementById('graph');
if (!left || !right || !tl || !tr) return;
function openLeftPanel() {
left.classList.add('open');
right.classList.remove('open');
tl.classList.add('active');
tr.classList.remove('active');
}
function openRightPanel() {
right.classList.add('open');
left.classList.remove('open');
tr.classList.add('active');
tl.classList.remove('active');
}
function closePanels() {
left.classList.remove('open');
right.classList.remove('open');
tl.classList.remove('active');
tr.classList.remove('active');
}
tl.addEventListener('click', function () {
const willOpen = !left.classList.contains('open');
if (willOpen) {
openLeftPanel();
} else {
closePanels();
}
});
tr.addEventListener('click', function () {
const willOpen = !right.classList.contains('open');
if (willOpen) {
openRightPanel();
} else {
closePanels();
}
});
// tap on graph closes panels on mobile AND clears active states
if (graph) {
graph.addEventListener('click', function () {
closePanels();
});
}
// helper for tag clicks (to be called from map.js on mobile)
window.openPulsePanelFromTag = function() {
if (window.innerWidth > 860) return; // only relevant on mobile layout
openRightPanel();
};
})();
</script>
</body>
</html>