summaryrefslogtreecommitdiff
path: root/gui-wm/wayfire/graphify-out/graph.html
blob: 68e1eceb81cddb05aa8397922c333a0144f341c7 (plain)
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
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>graphify - graphify-out/graph.html</title>
<script src="https://unpkg.com/vis-network@9.1.6/standalone/umd/vis-network.min.js"
        integrity="sha384-Ux6phic9PEHJ38YtrijhkzyJ8yQlH8i/+buBR8s3mAZOJrP1gwyvAcIYl3GWtpX1"
        crossorigin="anonymous"></script>
<style>
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body { background: #0f0f1a; color: #e0e0e0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; display: flex; height: 100vh; overflow: hidden; }
  #graph { flex: 1; }
  #sidebar { width: 280px; background: #1a1a2e; border-left: 1px solid #2a2a4e; display: flex; flex-direction: column; overflow: hidden; }
  #search-wrap { padding: 12px; border-bottom: 1px solid #2a2a4e; }
  #search { width: 100%; background: #0f0f1a; border: 1px solid #3a3a5e; color: #e0e0e0; padding: 7px 10px; border-radius: 6px; font-size: 13px; outline: none; }
  #search:focus { border-color: #4E79A7; }
  #search-results { max-height: 140px; overflow-y: auto; padding: 4px 12px; border-bottom: 1px solid #2a2a4e; display: none; }
  .search-item { padding: 4px 6px; cursor: pointer; border-radius: 4px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .search-item:hover { background: #2a2a4e; }
  #info-panel { padding: 14px; border-bottom: 1px solid #2a2a4e; min-height: 140px; }
  #info-panel h3 { font-size: 13px; color: #aaa; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
  #info-content { font-size: 13px; color: #ccc; line-height: 1.6; }
  #info-content .field { margin-bottom: 5px; }
  #info-content .field b { color: #e0e0e0; }
  #info-content .empty { color: #555; font-style: italic; }
  .neighbor-link { display: block; padding: 2px 6px; margin: 2px 0; border-radius: 3px; cursor: pointer; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid #333; }
  .neighbor-link:hover { background: #2a2a4e; }
  #neighbors-list { max-height: 160px; overflow-y: auto; margin-top: 4px; }
  #legend-wrap { flex: 1; overflow-y: auto; padding: 12px; }
  #legend-wrap h3 { font-size: 13px; color: #aaa; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
  .legend-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; border-radius: 4px; font-size: 12px; }
  .legend-item:hover { background: #2a2a4e; padding-left: 4px; }
  .legend-item.dimmed { opacity: 0.35; }
  .legend-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
  .legend-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .legend-count { color: #666; font-size: 11px; }
  #stats { padding: 10px 14px; border-top: 1px solid #2a2a4e; font-size: 11px; color: #555; }
  #legend-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 4px 0; }
  #legend-controls label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12px; color: #aaa; user-select: none; }
  #legend-controls label:hover { color: #e0e0e0; }
  .legend-cb, #select-all-cb { appearance: none; -webkit-appearance: none; width: 14px; height: 14px; border: 1.5px solid #3a3a5e; border-radius: 3px; background: #0f0f1a; cursor: pointer; position: relative; flex-shrink: 0; }
  .legend-cb:checked, #select-all-cb:checked { background: #4E79A7; border-color: #4E79A7; }
  .legend-cb:checked::after, #select-all-cb:checked::after { content: ''; position: absolute; left: 3.5px; top: 1px; width: 4px; height: 7px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
  #select-all-cb:indeterminate { background: #4E79A7; border-color: #4E79A7; }
  #select-all-cb:indeterminate::after { content: ''; position: absolute; left: 2px; top: 5px; width: 8px; height: 2px; background: #fff; border: none; transform: none; }
</style>
</head>
<body>
<div id="graph"></div>
<div id="sidebar">
  <div id="search-wrap">
    <input id="search" type="text" placeholder="Search nodes..." autocomplete="off">
    <div id="search-results"></div>
  </div>
  <div id="info-panel">
    <h3>Node Info</h3>
    <div id="info-content"><span class="empty">Click a node to inspect it</span></div>
  </div>
  <div id="legend-wrap">
    <h3>Communities</h3>
    <div id="legend-controls">
      <label><input type="checkbox" id="select-all-cb" checked onchange="toggleAllCommunities(!this.checked)">Select All</label>
    </div>
    <div id="legend"></div>
  </div>
  <div id="stats">54 nodes &middot; 53 edges &middot; 10 communities</div>
</div>
<script>
const RAW_NODES = [{"id": "tests_render_regression_render_test_render_test_t", "label": "render_test_t", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 40.0, "font": {"size": 12, "color": "#ffffff"}, "title": "render_test_t", "community": 3, "community_name": "render_test_t", "source_file": "tests/render-regression/render-test.cpp", "file_type": "code", "degree": 17}, {"id": "tests_render_regression_render_test_render_test_t_fini", "label": ".fini()", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": ".fini()", "community": 3, "community_name": "render_test_t", "source_file": "tests/render-regression/render-test.cpp", "file_type": "code", "degree": 1}, {"id": "tests_render_regression_ipc_ipc", "label": "ipc()", "color": {"background": "#59A14F", "border": "#59A14F", "highlight": {"background": "#ffffff", "border": "#59A14F"}}, "size": 20.6, "font": {"size": 12, "color": "#ffffff"}, "title": "ipc()", "community": 4, "community_name": "ipc", "source_file": "tests/render-regression/ipc.py", "file_type": "code", "degree": 6}, {"id": "tests_render_regression_layer_check_check", "label": "check()", "color": {"background": "#59A14F", "border": "#59A14F", "highlight": {"background": "#ffffff", "border": "#59A14F"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "check()", "community": 4, "community_name": "ipc", "source_file": "tests/render-regression/layer-check.py", "file_type": "code", "degree": 1}, {"id": "tests_render_regression_layer_check_solid", "label": "solid()", "color": {"background": "#59A14F", "border": "#59A14F", "highlight": {"background": "#ffffff", "border": "#59A14F"}}, "size": 13.5, "font": {"size": 0, "color": "#ffffff"}, "title": "solid()", "community": 4, "community_name": "ipc", "source_file": "tests/render-regression/layer-check.py", "file_type": "code", "degree": 2}, {"id": "tests_render_regression_redraw_check_check", "label": "check()", "color": {"background": "#59A14F", "border": "#59A14F", "highlight": {"background": "#ffffff", "border": "#59A14F"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "check()", "community": 4, "community_name": "ipc", "source_file": "tests/render-regression/redraw-check.py", "file_type": "code", "degree": 1}, {"id": "tests_render_regression_redraw_check_shot", "label": "shot()", "color": {"background": "#59A14F", "border": "#59A14F", "highlight": {"background": "#ffffff", "border": "#59A14F"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "shot()", "community": 4, "community_name": "ipc", "source_file": "tests/render-regression/redraw-check.py", "file_type": "code", "degree": 1}, {"id": "tests_render_regression_redraw_check_solid", "label": "solid()", "color": {"background": "#59A14F", "border": "#59A14F", "highlight": {"background": "#ffffff", "border": "#59A14F"}}, "size": 13.5, "font": {"size": 0, "color": "#ffffff"}, "title": "solid()", "community": 4, "community_name": "ipc", "source_file": "tests/render-regression/redraw-check.py", "file_type": "code", "degree": 2}, {"id": "tests_render_regression_render_test_render_test_t_init", "label": ".init()", "color": {"background": "#FF9DA7", "border": "#FF9DA7", "highlight": {"background": "#ffffff", "border": "#FF9DA7"}}, "size": 13.5, "font": {"size": 0, "color": "#ffffff"}, "title": ".init()", "community": 7, "community_name": "string", "source_file": "tests/render-regression/render-test.cpp", "file_type": "code", "degree": 2}, {"id": "files_wayfire_0_10_1_transparent_cube_animation_notes", "label": "wayfire-0.10.1-transparent-cube-animation-notes.md", "color": {"background": "#4E79A7", "border": "#4E79A7", "highlight": {"background": "#ffffff", "border": "#4E79A7"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "wayfire-0.10.1-transparent-cube-animation-notes.md", "community": 0, "community_name": "Transparent cube animation compatibility notes", "source_file": "files/wayfire-0.10.1-transparent-cube-animation-notes.md", "file_type": "document", "degree": 1}, {"id": "files_wayfire_0_10_1_transparent_cube_animation_notes_avoid_for_now", "label": "Avoid for now", "color": {"background": "#4E79A7", "border": "#4E79A7", "highlight": {"background": "#ffffff", "border": "#4E79A7"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "Avoid for now", "community": 0, "community_name": "Transparent cube animation compatibility notes", "source_file": "files/wayfire-0.10.1-transparent-cube-animation-notes.md", "file_type": "document", "degree": 1}, {"id": "files_wayfire_0_10_1_transparent_cube_animation_notes_current_direction", "label": "Current Direction", "color": {"background": "#4E79A7", "border": "#4E79A7", "highlight": {"background": "#ffffff", "border": "#4E79A7"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "Current Direction", "community": 0, "community_name": "Transparent cube animation compatibility notes", "source_file": "files/wayfire-0.10.1-transparent-cube-animation-notes.md", "file_type": "document", "degree": 1}, {"id": "files_wayfire_0_10_1_transparent_cube_animation_notes_goal", "label": "Goal", "color": {"background": "#4E79A7", "border": "#4E79A7", "highlight": {"background": "#ffffff", "border": "#4E79A7"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "Goal", "community": 0, "community_name": "Transparent cube animation compatibility notes", "source_file": "files/wayfire-0.10.1-transparent-cube-animation-notes.md", "file_type": "document", "degree": 1}, {"id": "files_wayfire_0_10_1_transparent_cube_animation_notes_minimum_target", "label": "Minimum target", "color": {"background": "#4E79A7", "border": "#4E79A7", "highlight": {"background": "#ffffff", "border": "#4E79A7"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "Minimum target", "community": 0, "community_name": "Transparent cube animation compatibility notes", "source_file": "files/wayfire-0.10.1-transparent-cube-animation-notes.md", "file_type": "document", "degree": 1}, {"id": "files_wayfire_0_10_1_transparent_cube_animation_notes_transparent_cube_animation_compatibility_notes", "label": "Transparent cube animation compatibility notes", "color": {"background": "#4E79A7", "border": "#4E79A7", "highlight": {"background": "#ffffff", "border": "#4E79A7"}}, "size": 20.6, "font": {"size": 12, "color": "#ffffff"}, "title": "Transparent cube animation compatibility notes", "community": 0, "community_name": "Transparent cube animation compatibility notes", "source_file": "files/wayfire-0.10.1-transparent-cube-animation-notes.md", "file_type": "document", "degree": 6}, {"id": "files_wayfire_0_10_1_transparent_cube_animation_notes_working_theory", "label": "Working theory", "color": {"background": "#4E79A7", "border": "#4E79A7", "highlight": {"background": "#ffffff", "border": "#4E79A7"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "Working theory", "community": 0, "community_name": "Transparent cube animation compatibility notes", "source_file": "files/wayfire-0.10.1-transparent-cube-animation-notes.md", "file_type": "document", "degree": 1}, {"id": "files_wayfire_session", "label": "wayfire-session", "color": {"background": "#F28E2B", "border": "#F28E2B", "highlight": {"background": "#ffffff", "border": "#F28E2B"}}, "size": 18.8, "font": {"size": 12, "color": "#ffffff"}, "title": "wayfire-session", "community": 1, "community_name": "wayfire-session", "source_file": "files/wayfire-session", "file_type": "code", "degree": 5}, {"id": "files_wayfire_session__entry", "label": "wayfire-session script", "color": {"background": "#F28E2B", "border": "#F28E2B", "highlight": {"background": "#ffffff", "border": "#F28E2B"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "wayfire-session script", "community": 1, "community_name": "wayfire-session", "source_file": "files/wayfire-session", "file_type": "code", "degree": 1}, {"id": "files_wayfire_session_gdk_backend", "label": "GDK_BACKEND", "color": {"background": "#F28E2B", "border": "#F28E2B", "highlight": {"background": "#ffffff", "border": "#F28E2B"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "GDK_BACKEND", "community": 1, "community_name": "wayfire-session", "source_file": "files/wayfire-session", "file_type": "code", "degree": 1}, {"id": "files_wayfire_session_moz_enable_wayland", "label": "MOZ_ENABLE_WAYLAND", "color": {"background": "#F28E2B", "border": "#F28E2B", "highlight": {"background": "#ffffff", "border": "#F28E2B"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "MOZ_ENABLE_WAYLAND", "community": 1, "community_name": "wayfire-session", "source_file": "files/wayfire-session", "file_type": "code", "degree": 1}, {"id": "files_wayfire_session_qt_qpa_platform", "label": "QT_QPA_PLATFORM", "color": {"background": "#F28E2B", "border": "#F28E2B", "highlight": {"background": "#ffffff", "border": "#F28E2B"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "QT_QPA_PLATFORM", "community": 1, "community_name": "wayfire-session", "source_file": "files/wayfire-session", "file_type": "code", "degree": 1}, {"id": "files_wayfire_session_xdg_session_type", "label": "XDG_SESSION_TYPE", "color": {"background": "#F28E2B", "border": "#F28E2B", "highlight": {"background": "#ffffff", "border": "#F28E2B"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "XDG_SESSION_TYPE", "community": 1, "community_name": "wayfire-session", "source_file": "files/wayfire-session", "file_type": "code", "degree": 1}, {"id": "files_wayfire_session_2", "label": "wayfire-session-2", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 18.8, "font": {"size": 12, "color": "#ffffff"}, "title": "wayfire-session-2", "community": 2, "community_name": "wayfire-session-2", "source_file": "files/wayfire-session-2", "file_type": "code", "degree": 5}, {"id": "files_wayfire_session_2__entry", "label": "wayfire-session-2 script", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "wayfire-session-2 script", "community": 2, "community_name": "wayfire-session-2", "source_file": "files/wayfire-session-2", "file_type": "code", "degree": 1}, {"id": "files_wayfire_session_2_gdk_backend", "label": "GDK_BACKEND", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "GDK_BACKEND", "community": 2, "community_name": "wayfire-session-2", "source_file": "files/wayfire-session-2", "file_type": "code", "degree": 1}, {"id": "files_wayfire_session_2_moz_enable_wayland", "label": "MOZ_ENABLE_WAYLAND", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "MOZ_ENABLE_WAYLAND", "community": 2, "community_name": "wayfire-session-2", "source_file": "files/wayfire-session-2", "file_type": "code", "degree": 1}, {"id": "files_wayfire_session_2_qt_qpa_platform", "label": "QT_QPA_PLATFORM", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "QT_QPA_PLATFORM", "community": 2, "community_name": "wayfire-session-2", "source_file": "files/wayfire-session-2", "file_type": "code", "degree": 1}, {"id": "files_wayfire_session_2_xdg_session_type", "label": "XDG_SESSION_TYPE", "color": {"background": "#E15759", "border": "#E15759", "highlight": {"background": "#ffffff", "border": "#E15759"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "XDG_SESSION_TYPE", "community": 2, "community_name": "wayfire-session-2", "source_file": "files/wayfire-session-2", "file_type": "code", "degree": 1}, {"id": "color_rect_view_t", "label": "color_rect_view_t", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "color_rect_view_t", "community": 3, "community_name": "render_test_t", "source_file": "", "file_type": "code", "degree": 1}, {"id": "connection_t", "label": "connection_t", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "connection_t", "community": 3, "community_name": "render_test_t", "source_file": "", "file_type": "code", "degree": 1}, {"id": "method_repository_t", "label": "method_repository_t", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "method_repository_t", "community": 3, "community_name": "render_test_t", "source_file": "", "file_type": "code", "degree": 1}, {"id": "plugin_interface_t", "label": "plugin_interface_t", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "plugin_interface_t", "community": 3, "community_name": "render_test_t", "source_file": "", "file_type": "code", "degree": 1}, {"id": "ref_ptr_t", "label": "ref_ptr_t", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "ref_ptr_t", "community": 3, "community_name": "render_test_t", "source_file": "", "file_type": "code", "degree": 1}, {"id": "render_pass_begin_signal", "label": "render_pass_begin_signal", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "render_pass_begin_signal", "community": 3, "community_name": "render_test_t", "source_file": "", "file_type": "code", "degree": 1}, {"id": "shared_ptr", "label": "shared_ptr", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "shared_ptr", "community": 3, "community_name": "render_test_t", "source_file": "", "file_type": "code", "degree": 1}, {"id": "tests_render_regression_render_test_render_test_t_count_passes", "label": "count_passes", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "count_passes", "community": 3, "community_name": "render_test_t", "source_file": "tests/render-regression/render-test.cpp", "file_type": "code", "degree": 1}, {"id": "tests_render_regression_render_test_render_test_t_passes", "label": "passes", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "passes", "community": 3, "community_name": "render_test_t", "source_file": "tests/render-regression/render-test.cpp", "file_type": "code", "degree": 1}, {"id": "tests_render_regression_render_test_render_test_t_rectangle", "label": "rectangle", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "rectangle", "community": 3, "community_name": "render_test_t", "source_file": "tests/render-regression/render-test.cpp", "file_type": "code", "degree": 1}, {"id": "tests_render_regression_render_test_render_test_t_repo", "label": "repo", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "repo", "community": 3, "community_name": "render_test_t", "source_file": "tests/render-regression/render-test.cpp", "file_type": "code", "degree": 1}, {"id": "tests_render_regression_render_test_render_test_t_solids", "label": "solids", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "solids", "community": 3, "community_name": "render_test_t", "source_file": "tests/render-regression/render-test.cpp", "file_type": "code", "degree": 1}, {"id": "tests_render_regression_dynamic_check", "label": "dynamic-check.py", "color": {"background": "#59A14F", "border": "#59A14F", "highlight": {"background": "#ffffff", "border": "#59A14F"}}, "size": 13.5, "font": {"size": 0, "color": "#ffffff"}, "title": "dynamic-check.py", "community": 4, "community_name": "ipc", "source_file": "tests/render-regression/dynamic-check.py", "file_type": "code", "degree": 2}, {"id": "tests_render_regression_ipc", "label": "ipc.py", "color": {"background": "#59A14F", "border": "#59A14F", "highlight": {"background": "#ffffff", "border": "#59A14F"}}, "size": 17.1, "font": {"size": 12, "color": "#ffffff"}, "title": "ipc.py", "community": 4, "community_name": "ipc", "source_file": "tests/render-regression/ipc.py", "file_type": "code", "degree": 4}, {"id": "tests_render_regression_layer_check", "label": "layer-check.py", "color": {"background": "#59A14F", "border": "#59A14F", "highlight": {"background": "#ffffff", "border": "#59A14F"}}, "size": 18.8, "font": {"size": 12, "color": "#ffffff"}, "title": "layer-check.py", "community": 4, "community_name": "ipc", "source_file": "tests/render-regression/layer-check.py", "file_type": "code", "degree": 5}, {"id": "tests_render_regression_redraw_check", "label": "redraw-check.py", "color": {"background": "#59A14F", "border": "#59A14F", "highlight": {"background": "#ffffff", "border": "#59A14F"}}, "size": 18.8, "font": {"size": 12, "color": "#ffffff"}, "title": "redraw-check.py", "community": 4, "community_name": "ipc", "source_file": "tests/render-regression/redraw-check.py", "file_type": "code", "degree": 5}, {"id": "tests_render_regression_layer_check_rationale_1", "label": "Panel replication and popup ordering in the desktop cube.", "color": {"background": "#59A14F", "border": "#59A14F", "highlight": {"background": "#ffffff", "border": "#59A14F"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "Panel replication and popup ordering in the desktop cube.", "community": 4, "community_name": "ipc", "source_file": "tests/render-regression/layer-check.py", "file_type": "rationale", "degree": 1}, {"id": "files_wayfire_0_11_0_cube_rendering_notes", "label": "wayfire-0.11.0-cube-rendering-notes.md", "color": {"background": "#EDC948", "border": "#EDC948", "highlight": {"background": "#ffffff", "border": "#EDC948"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "wayfire-0.11.0-cube-rendering-notes.md", "community": 5, "community_name": "Cube damage and layer ordering, revision 3", "source_file": "files/wayfire-0.11.0-cube-rendering-notes.md", "file_type": "document", "degree": 1}, {"id": "files_wayfire_0_11_0_cube_rendering_notes_cube_damage_and_layer_ordering_revision_3", "label": "Cube damage and layer ordering, revision 3", "color": {"background": "#EDC948", "border": "#EDC948", "highlight": {"background": "#ffffff", "border": "#EDC948"}}, "size": 13.5, "font": {"size": 0, "color": "#ffffff"}, "title": "Cube damage and layer ordering, revision 3", "community": 5, "community_name": "Cube damage and layer ordering, revision 3", "source_file": "files/wayfire-0.11.0-cube-rendering-notes.md", "file_type": "document", "degree": 2}, {"id": "files_wayfire_0_11_0_cube_rendering_notes_revision_4_panels_on_empty_workspaces_and_overlay_ordering", "label": "Revision 4: panels on empty workspaces and overlay ordering", "color": {"background": "#EDC948", "border": "#EDC948", "highlight": {"background": "#ffffff", "border": "#EDC948"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "Revision 4: panels on empty workspaces and overlay ordering", "community": 5, "community_name": "Cube damage and layer ordering, revision 3", "source_file": "files/wayfire-0.11.0-cube-rendering-notes.md", "file_type": "document", "degree": 1}, {"id": "map", "label": "map", "color": {"background": "#B07AA1", "border": "#B07AA1", "highlight": {"background": "#ffffff", "border": "#B07AA1"}}, "size": 13.5, "font": {"size": 0, "color": "#ffffff"}, "title": "map", "community": 6, "community_name": "map", "source_file": "", "file_type": "code", "degree": 2}, {"id": "tests_render_regression_render_test", "label": "render-test.cpp", "color": {"background": "#B07AA1", "border": "#B07AA1", "highlight": {"background": "#ffffff", "border": "#B07AA1"}}, "size": 13.5, "font": {"size": 0, "color": "#ffffff"}, "title": "render-test.cpp", "community": 6, "community_name": "map", "source_file": "tests/render-regression/render-test.cpp", "file_type": "code", "degree": 2}, {"id": "string", "label": "string", "color": {"background": "#FF9DA7", "border": "#FF9DA7", "highlight": {"background": "#ffffff", "border": "#FF9DA7"}}, "size": 13.5, "font": {"size": 0, "color": "#ffffff"}, "title": "string", "community": 7, "community_name": "string", "source_file": "", "file_type": "code", "degree": 2}, {"id": "tests_render_regression_readme", "label": "README.md", "color": {"background": "#9C755F", "border": "#9C755F", "highlight": {"background": "#ffffff", "border": "#9C755F"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "README.md", "community": 8, "community_name": "README.md", "source_file": "tests/render-regression/README.md", "file_type": "document", "degree": 1}, {"id": "tests_render_regression_readme_cube_repaint_and_stacking_regressions", "label": "Cube repaint and stacking regressions", "color": {"background": "#9C755F", "border": "#9C755F", "highlight": {"background": "#ffffff", "border": "#9C755F"}}, "size": 11.8, "font": {"size": 0, "color": "#ffffff"}, "title": "Cube repaint and stacking regressions", "community": 8, "community_name": "README.md", "source_file": "tests/render-regression/README.md", "file_type": "document", "degree": 1}, {"id": "tests_render_regression_run", "label": "run.py", "color": {"background": "#BAB0AC", "border": "#BAB0AC", "highlight": {"background": "#ffffff", "border": "#BAB0AC"}}, "size": 10.0, "font": {"size": 0, "color": "#ffffff"}, "title": "run.py", "community": 9, "community_name": "run.py", "source_file": "tests/render-regression/run.py", "file_type": "code", "degree": 0}];
const RAW_EDGES = [{"from": "tests_render_regression_render_test_render_test_t", "to": "tests_render_regression_render_test_render_test_t_repo", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_render_test_render_test_t", "to": "tests_render_regression_render_test_render_test_t_rectangle", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_render_test_render_test_t", "to": "tests_render_regression_render_test_render_test_t_solids", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_render_test_render_test_t", "to": "tests_render_regression_render_test_render_test_t_passes", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_render_test_render_test_t", "to": "tests_render_regression_render_test_render_test_t_count_passes", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_render_test_render_test_t", "to": "ref_ptr_t", "label": "references", "title": "references [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_render_test_render_test_t", "to": "map", "label": "references", "title": "references [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_render_test_render_test_t", "to": "connection_t", "label": "references", "title": "references [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_render_test_render_test_t", "to": "method_repository_t", "label": "references", "title": "references [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_render_test_render_test_t", "to": "color_rect_view_t", "label": "references", "title": "references [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_render_test_render_test_t", "to": "shared_ptr", "label": "references", "title": "references [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_render_test_render_test_t", "to": "string", "label": "references", "title": "references [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_render_test_render_test_t", "to": "render_pass_begin_signal", "label": "references", "title": "references [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_render_test_render_test_t", "to": "tests_render_regression_render_test", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_render_test_render_test_t", "to": "plugin_interface_t", "label": "inherits", "title": "inherits [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_render_test_render_test_t", "to": "tests_render_regression_render_test_render_test_t_fini", "label": "method", "title": "method [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_render_test_render_test_t", "to": "tests_render_regression_render_test_render_test_t_init", "label": "method", "title": "method [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_ipc_ipc", "to": "tests_render_regression_layer_check_solid", "label": "calls", "title": "calls [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_ipc_ipc", "to": "tests_render_regression_redraw_check_solid", "label": "calls", "title": "calls [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_ipc_ipc", "to": "tests_render_regression_dynamic_check", "label": "imports", "title": "imports [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_ipc_ipc", "to": "tests_render_regression_layer_check", "label": "imports", "title": "imports [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_ipc_ipc", "to": "tests_render_regression_redraw_check", "label": "imports", "title": "imports [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_ipc_ipc", "to": "tests_render_regression_ipc", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_layer_check_check", "to": "tests_render_regression_layer_check", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_layer_check_solid", "to": "tests_render_regression_layer_check", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_redraw_check_check", "to": "tests_render_regression_redraw_check", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_redraw_check_shot", "to": "tests_render_regression_redraw_check", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_redraw_check_solid", "to": "tests_render_regression_redraw_check", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_render_test_render_test_t_init", "to": "string", "label": "calls", "title": "calls [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "files_wayfire_0_10_1_transparent_cube_animation_notes", "to": "files_wayfire_0_10_1_transparent_cube_animation_notes_transparent_cube_animation_compatibility_notes", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "files_wayfire_0_10_1_transparent_cube_animation_notes_avoid_for_now", "to": "files_wayfire_0_10_1_transparent_cube_animation_notes_transparent_cube_animation_compatibility_notes", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "files_wayfire_0_10_1_transparent_cube_animation_notes_current_direction", "to": "files_wayfire_0_10_1_transparent_cube_animation_notes_transparent_cube_animation_compatibility_notes", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "files_wayfire_0_10_1_transparent_cube_animation_notes_goal", "to": "files_wayfire_0_10_1_transparent_cube_animation_notes_transparent_cube_animation_compatibility_notes", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "files_wayfire_0_10_1_transparent_cube_animation_notes_minimum_target", "to": "files_wayfire_0_10_1_transparent_cube_animation_notes_transparent_cube_animation_compatibility_notes", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "files_wayfire_0_10_1_transparent_cube_animation_notes_transparent_cube_animation_compatibility_notes", "to": "files_wayfire_0_10_1_transparent_cube_animation_notes_working_theory", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "files_wayfire_session", "to": "files_wayfire_session__entry", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "files_wayfire_session", "to": "files_wayfire_session_xdg_session_type", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "files_wayfire_session", "to": "files_wayfire_session_gdk_backend", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "files_wayfire_session", "to": "files_wayfire_session_qt_qpa_platform", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "files_wayfire_session", "to": "files_wayfire_session_moz_enable_wayland", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "files_wayfire_session_2", "to": "files_wayfire_session_2__entry", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "files_wayfire_session_2", "to": "files_wayfire_session_2_xdg_session_type", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "files_wayfire_session_2", "to": "files_wayfire_session_2_gdk_backend", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "files_wayfire_session_2", "to": "files_wayfire_session_2_qt_qpa_platform", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "files_wayfire_session_2", "to": "files_wayfire_session_2_moz_enable_wayland", "label": "defines", "title": "defines [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_dynamic_check", "to": "tests_render_regression_ipc", "label": "imports_from", "title": "imports_from [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_ipc", "to": "tests_render_regression_layer_check", "label": "imports_from", "title": "imports_from [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_ipc", "to": "tests_render_regression_redraw_check", "label": "imports_from", "title": "imports_from [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_layer_check", "to": "tests_render_regression_layer_check_rationale_1", "label": "rationale_for", "title": "rationale_for [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "files_wayfire_0_11_0_cube_rendering_notes", "to": "files_wayfire_0_11_0_cube_rendering_notes_cube_damage_and_layer_ordering_revision_3", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "files_wayfire_0_11_0_cube_rendering_notes_cube_damage_and_layer_ordering_revision_3", "to": "files_wayfire_0_11_0_cube_rendering_notes_revision_4_panels_on_empty_workspaces_and_overlay_ordering", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "map", "to": "tests_render_regression_render_test", "label": "imports", "title": "imports [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "tests_render_regression_readme", "to": "tests_render_regression_readme_cube_repaint_and_stacking_regressions", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}];
const LEGEND = [{"cid": 0, "color": "#4E79A7", "label": "Transparent cube animation compatibility notes", "count": 7}, {"cid": 1, "color": "#F28E2B", "label": "wayfire-session", "count": 6}, {"cid": 2, "color": "#E15759", "label": "wayfire-session-2", "count": 6}, {"cid": 3, "color": "#76B7B2", "label": "render_test_t", "count": 14}, {"cid": 4, "color": "#59A14F", "label": "ipc", "count": 11}, {"cid": 5, "color": "#EDC948", "label": "Cube damage and layer ordering, revision 3", "count": 3}, {"cid": 6, "color": "#B07AA1", "label": "map", "count": 2}, {"cid": 7, "color": "#FF9DA7", "label": "string", "count": 2}, {"cid": 8, "color": "#9C755F", "label": "README.md", "count": 2}, {"cid": 9, "color": "#BAB0AC", "label": "run.py", "count": 1}];

// HTML-escape helper — prevents XSS when injecting graph data into innerHTML
function esc(s) {
  return String(s).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;');
}

// Build vis datasets
const nodesDS = new vis.DataSet(RAW_NODES.map(n => ({
  id: n.id, label: n.label, color: n.color, size: n.size,
  font: n.font, title: n.title,
  _community: n.community, _community_name: n.community_name,
  _source_file: n.source_file, _file_type: n.file_type, _degree: n.degree,
})));

const edgesDS = new vis.DataSet(RAW_EDGES.map((e, i) => ({
  id: i, from: e.from, to: e.to,
  label: '',
  title: e.title,
  dashes: e.dashes,
  width: e.width,
  color: e.color,
  arrows: { to: { enabled: true, scaleFactor: 0.5 } },
})));

const container = document.getElementById('graph');
const network = new vis.Network(container, { nodes: nodesDS, edges: edgesDS }, {
  physics: {
    enabled: true,
    solver: 'forceAtlas2Based',
    forceAtlas2Based: {
      gravitationalConstant: -60,
      centralGravity: 0.005,
      springLength: 120,
      springConstant: 0.08,
      damping: 0.4,
      avoidOverlap: 0.8,
    },
    stabilization: { iterations: 200, fit: true },
  },
  interaction: {
    hover: true,
    tooltipDelay: 100,
    hideEdgesOnDrag: true,
    navigationButtons: false,
    keyboard: false,
  },
  nodes: { shape: 'dot', borderWidth: 1.5 },
  edges: { smooth: { type: 'continuous', roundness: 0.2 }, selectionWidth: 3 },
});

network.once('stabilizationIterationsDone', () => {
  network.setOptions({ physics: { enabled: false } });
});

function showInfo(nodeId) {
  const n = nodesDS.get(nodeId);
  if (!n) return;
  const neighborIds = network.getConnectedNodes(nodeId);
  const neighborItems = neighborIds.map(nid => {
    const nb = nodesDS.get(nid);
    const color = nb ? nb.color.background : '#555';
    return `<span class="neighbor-link" style="border-left-color:${esc(color)}" data-nid="${esc(nid)}">${esc(nb ? nb.label : nid)}</span>`;
  }).join('');
  document.getElementById('info-content').innerHTML = `
    <div class="field"><b>${esc(n.label)}</b></div>
    <div class="field">Type: ${esc(n._file_type || 'unknown')}</div>
    <div class="field">Community: ${esc(n._community_name)}</div>
    <div class="field">Source: ${esc(n._source_file || '-')}</div>
    <div class="field">Degree: ${n._degree}</div>
    ${neighborIds.length ? `<div class="field" style="margin-top:8px;color:#aaa;font-size:11px">Neighbors (${neighborIds.length})</div><div id="neighbors-list">${neighborItems}</div>` : ''}
  `;
}

function focusNode(nodeId) {
  network.focus(nodeId, { scale: 1.4, animation: true });
  network.selectNodes([nodeId]);
  showInfo(nodeId);
}

// Neighbor links use a data attribute + one delegated listener rather than an
// inline onclick. A node id/label sourced from a document or a scraped URL
// (graphify add) can contain a double-quote; dropping the stringified id
// unescaped into a quoted onclick both broke every link and allowed a hostile
// source to inject an event handler into the local report (stored XSS, #1838).
// esc() on data-nid keeps the value inside the attribute; the listener reads it
// back verbatim. Bound to document so it survives the innerHTML rebuild that
// recreates #neighbors-list on each showInfo().
document.addEventListener('click', e => {
  const el = e.target.closest('.neighbor-link');
  if (el && el.dataset.nid !== undefined) focusNode(el.dataset.nid);
});

// Track hovered node — hover detection is more reliable than click params
let hoveredNodeId = null;
network.on('hoverNode', params => {
  hoveredNodeId = params.node;
  container.style.cursor = 'pointer';
});
network.on('blurNode', () => {
  hoveredNodeId = null;
  container.style.cursor = 'default';
});
container.addEventListener('click', () => {
  if (hoveredNodeId !== null) {
    showInfo(hoveredNodeId);
    network.selectNodes([hoveredNodeId]);
  }
});
network.on('click', params => {
  if (params.nodes.length > 0) {
    showInfo(params.nodes[0]);
  } else if (hoveredNodeId === null) {
    document.getElementById('info-content').innerHTML = '<span class="empty">Click a node to inspect it</span>';
  }
});

const searchInput = document.getElementById('search');
const searchResults = document.getElementById('search-results');
searchInput.addEventListener('input', () => {
  const q = searchInput.value.toLowerCase().trim();
  searchResults.innerHTML = '';
  if (!q) { searchResults.style.display = 'none'; return; }
  const matches = RAW_NODES.filter(n => n.label.toLowerCase().includes(q)).slice(0, 20);
  if (!matches.length) { searchResults.style.display = 'none'; return; }
  searchResults.style.display = 'block';
  matches.forEach(n => {
    const el = document.createElement('div');
    el.className = 'search-item';
    el.textContent = n.label;
    el.style.borderLeft = `3px solid ${n.color.background}`;
    el.style.paddingLeft = '8px';
    el.onclick = () => {
      network.focus(n.id, { scale: 1.5, animation: true });
      network.selectNodes([n.id]);
      showInfo(n.id);
      searchResults.style.display = 'none';
      searchInput.value = '';
    };
    searchResults.appendChild(el);
  });
});
document.addEventListener('click', e => {
  if (!searchResults.contains(e.target) && e.target !== searchInput)
    searchResults.style.display = 'none';
});

const hiddenCommunities = new Set();

const selectAllCb = document.getElementById('select-all-cb');

function updateSelectAllState() {
  const total = LEGEND.length;
  const hidden = hiddenCommunities.size;
  selectAllCb.checked = hidden === 0;
  selectAllCb.indeterminate = hidden > 0 && hidden < total;
}

function toggleAllCommunities(hide) {
  document.querySelectorAll('.legend-item').forEach(item => {
    hide ? item.classList.add('dimmed') : item.classList.remove('dimmed');
  });
  document.querySelectorAll('.legend-cb').forEach(cb => {
    cb.checked = !hide;
  });
  LEGEND.forEach(c => {
    if (hide) hiddenCommunities.add(c.cid); else hiddenCommunities.delete(c.cid);
  });
  const updates = RAW_NODES.map(n => ({ id: n.id, hidden: hide }));
  nodesDS.update(updates);
  updateSelectAllState();
}

const legendEl = document.getElementById('legend');
LEGEND.forEach(c => {
  const item = document.createElement('div');
  item.className = 'legend-item';
  const cb = document.createElement('input');
  cb.type = 'checkbox';
  cb.className = 'legend-cb';
  cb.checked = true;
  cb.addEventListener('change', (e) => {
    e.stopPropagation();
    if (cb.checked) {
      hiddenCommunities.delete(c.cid);
      item.classList.remove('dimmed');
    } else {
      hiddenCommunities.add(c.cid);
      item.classList.add('dimmed');
    }
    const updates = RAW_NODES
      .filter(n => n.community === c.cid)
      .map(n => ({ id: n.id, hidden: !cb.checked }));
    nodesDS.update(updates);
    updateSelectAllState();
  });
  item.innerHTML = `<div class="legend-dot" style="background:${c.color}"></div>
    <span class="legend-label">${c.label}</span>
    <span class="legend-count">${c.count}</span>`;
  item.prepend(cb);
  item.onclick = (e) => {
    if (e.target === cb) return;
    cb.checked = !cb.checked;
    cb.dispatchEvent(new Event('change'));
  };
  legendEl.appendChild(item);
});
</script>
<script>
// Render hyperedges as shaded regions
const hyperedges = [];
// afterDrawing passes ctx already transformed to network coordinate space.
// Draw node positions raw — no manual pan/zoom/DPR math needed.

// Andrew's monotone chain. Returns the hull in counter-clockwise order, which
// is what the perimeter must be traced in. Collinear and duplicate points
// collapse to the extremes, so degenerate member sets render as a segment
// rather than a zero-area crossed path.
function convexHull(pts) {
    const p = pts.slice().sort((a, b) => (a.x - b.x) || (a.y - b.y));
    if (p.length < 3) return p;
    const cross = (o, a, b) => (a.x - o.x) * (b.y - o.y) - (a.y - o.y) * (b.x - o.x);
    const build = seq => {
        const out = [];
        for (const q of seq) {
            while (out.length >= 2 && cross(out[out.length - 2], out[out.length - 1], q) <= 0) out.pop();
            out.push(q);
        }
        out.pop();
        return out;
    };
    const hull = build(p).concat(build(p.slice().reverse()));
    return hull.length >= 3 ? hull : p;
}
network.on('afterDrawing', function(ctx) {
    hyperedges.forEach(h => {
        const positions = h.nodes
            .map(nid => network.getPositions([nid])[nid])
            .filter(p => p !== undefined);
        if (positions.length < 2) return;
        ctx.save();
        ctx.globalAlpha = 0.12;
        ctx.fillStyle = '#6366f1';
        ctx.strokeStyle = '#6366f1';
        ctx.lineWidth = 2;
        ctx.beginPath();
        // Centroid and expanded hull in network coordinates.
        // The perimeter must follow hull order, not h.nodes order: tracing the
        // raw member order self-intersects whenever the layout does not happen
        // to place members in angular order, filling as crossed wedges.
        const cx = positions.reduce((s, p) => s + p.x, 0) / positions.length;
        const cy = positions.reduce((s, p) => s + p.y, 0) / positions.length;
        const hull = convexHull(positions);
        const expanded = hull.map(p => ({
            x: cx + (p.x - cx) * 1.15,
            y: cy + (p.y - cy) * 1.15
        }));
        ctx.moveTo(expanded[0].x, expanded[0].y);
        expanded.slice(1).forEach(p => ctx.lineTo(p.x, p.y));
        ctx.closePath();
        ctx.fill();
        ctx.globalAlpha = 0.4;
        ctx.stroke();
        // Label
        ctx.globalAlpha = 0.8;
        ctx.fillStyle = '#4f46e5';
        ctx.font = 'bold 11px sans-serif';
        ctx.textAlign = 'center';
        ctx.fillText(h.label, cx, cy - 5);
        ctx.restore();
    });
});
</script>
</body>
</html>