@apart-tech/apart-intelligence 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/graph.js +545 -149
- package/dist/commands/graph.js.map +1 -1
- package/package.json +3 -3
package/dist/commands/graph.js
CHANGED
|
@@ -49,23 +49,13 @@ function truncate(str, max) {
|
|
|
49
49
|
return str.length > max ? str.slice(0, max - 1) + "…" : str;
|
|
50
50
|
}
|
|
51
51
|
function generateHtml(nodes, edges, types) {
|
|
52
|
-
// Deterministic color palette — enough hues for common types
|
|
53
52
|
const PALETTE = [
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
{ bg: "#79c0ff", border: "#58a6ff", font: "#0d1117" },
|
|
58
|
-
{ bg: "#e3b341", border: "#d29922", font: "#0d1117" },
|
|
59
|
-
{ bg: "#3fb950", border: "#2ea043", font: "#0d1117" },
|
|
60
|
-
{ bg: "#f778ba", border: "#db61a2", font: "#0d1117" },
|
|
61
|
-
{ bg: "#ff7b72", border: "#f85149", font: "#0d1117" },
|
|
62
|
-
{ bg: "#7ee787", border: "#56d364", font: "#0d1117" },
|
|
63
|
-
{ bg: "#a5d6ff", border: "#79c0ff", font: "#0d1117" },
|
|
64
|
-
{ bg: "#ffa657", border: "#d29922", font: "#0d1117" },
|
|
65
|
-
{ bg: "#d2a8ff", border: "#bc8cff", font: "#0d1117" },
|
|
53
|
+
"#f85149", "#bc8cff", "#58a6ff", "#79c0ff",
|
|
54
|
+
"#e3b341", "#3fb950", "#f778ba", "#ff7b72",
|
|
55
|
+
"#7ee787", "#a5d6ff", "#ffa657", "#d2a8ff",
|
|
66
56
|
];
|
|
67
57
|
const REL_PALETTE = [
|
|
68
|
-
"#
|
|
58
|
+
"#505860", "#f85149", "#bc8cff", "#3fb950",
|
|
69
59
|
"#e3b341", "#58a6ff", "#79c0ff", "#f778ba",
|
|
70
60
|
"#ff7b72", "#ffa657",
|
|
71
61
|
];
|
|
@@ -78,16 +68,19 @@ function generateHtml(nodes, edges, types) {
|
|
|
78
68
|
relTypes.forEach((r, i) => {
|
|
79
69
|
relColors[r] = REL_PALETTE[i % REL_PALETTE.length];
|
|
80
70
|
});
|
|
81
|
-
const legendItems = types
|
|
82
|
-
.map((t) => ` <div class="legend-item"><div class="legend-dot" style="background:${typeColors[t].bg}"></div>${capitalize(t)}</div>`)
|
|
83
|
-
.join("\n");
|
|
84
71
|
return `<!DOCTYPE html>
|
|
85
72
|
<html lang="en">
|
|
86
73
|
<head>
|
|
87
74
|
<meta charset="UTF-8">
|
|
88
75
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
89
76
|
<title>Knowledge Graph — Apart Intelligence</title>
|
|
90
|
-
<script
|
|
77
|
+
<script src="https://unpkg.com/three@0.160.0/build/three.min.js"><\/script>
|
|
78
|
+
<script src="https://unpkg.com/three@0.160.0/examples/js/postprocessing/EffectComposer.js"><\/script>
|
|
79
|
+
<script src="https://unpkg.com/three@0.160.0/examples/js/postprocessing/RenderPass.js"><\/script>
|
|
80
|
+
<script src="https://unpkg.com/three@0.160.0/examples/js/postprocessing/UnrealBloomPass.js"><\/script>
|
|
81
|
+
<script src="https://unpkg.com/three@0.160.0/examples/js/shaders/LuminosityHighPassShader.js"><\/script>
|
|
82
|
+
<script src="https://unpkg.com/three@0.160.0/examples/js/shaders/CopyShader.js"><\/script>
|
|
83
|
+
<script src="https://unpkg.com/3d-force-graph@1.73.3/dist/3d-force-graph.min.js"><\/script>
|
|
91
84
|
<style>
|
|
92
85
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
93
86
|
body {
|
|
@@ -99,9 +92,75 @@ function generateHtml(nodes, edges, types) {
|
|
|
99
92
|
width: 100vw;
|
|
100
93
|
}
|
|
101
94
|
#graph-container { width: 100%; height: 100vh; }
|
|
102
|
-
|
|
95
|
+
|
|
96
|
+
/* Search bar */
|
|
97
|
+
#search-bar {
|
|
103
98
|
position: absolute;
|
|
104
99
|
top: 16px;
|
|
100
|
+
left: 50%;
|
|
101
|
+
transform: translateX(-50%);
|
|
102
|
+
z-index: 30;
|
|
103
|
+
display: flex;
|
|
104
|
+
gap: 0;
|
|
105
|
+
}
|
|
106
|
+
#search-bar input {
|
|
107
|
+
width: 320px;
|
|
108
|
+
padding: 10px 16px;
|
|
109
|
+
background: rgba(22, 27, 34, 0.95);
|
|
110
|
+
border: 1px solid #30363d;
|
|
111
|
+
border-radius: 8px 0 0 8px;
|
|
112
|
+
color: #e6edf3;
|
|
113
|
+
font-size: 14px;
|
|
114
|
+
outline: none;
|
|
115
|
+
}
|
|
116
|
+
#search-bar input:focus { border-color: #58a6ff; }
|
|
117
|
+
#search-bar input::placeholder { color: #484f58; }
|
|
118
|
+
#search-bar button {
|
|
119
|
+
padding: 10px 16px;
|
|
120
|
+
background: #21262d;
|
|
121
|
+
border: 1px solid #30363d;
|
|
122
|
+
border-left: none;
|
|
123
|
+
border-radius: 0 8px 8px 0;
|
|
124
|
+
color: #c9d1d9;
|
|
125
|
+
cursor: pointer;
|
|
126
|
+
font-size: 13px;
|
|
127
|
+
}
|
|
128
|
+
#search-bar button:hover { background: #30363d; }
|
|
129
|
+
#search-results {
|
|
130
|
+
position: absolute;
|
|
131
|
+
top: 48px;
|
|
132
|
+
left: 50%;
|
|
133
|
+
transform: translateX(-50%);
|
|
134
|
+
width: 360px;
|
|
135
|
+
max-height: 240px;
|
|
136
|
+
overflow-y: auto;
|
|
137
|
+
background: rgba(22, 27, 34, 0.98);
|
|
138
|
+
border: 1px solid #30363d;
|
|
139
|
+
border-radius: 8px;
|
|
140
|
+
z-index: 31;
|
|
141
|
+
display: none;
|
|
142
|
+
}
|
|
143
|
+
#search-results .result-item {
|
|
144
|
+
padding: 8px 16px;
|
|
145
|
+
cursor: pointer;
|
|
146
|
+
font-size: 13px;
|
|
147
|
+
border-bottom: 1px solid #21262d;
|
|
148
|
+
display: flex;
|
|
149
|
+
align-items: center;
|
|
150
|
+
gap: 8px;
|
|
151
|
+
}
|
|
152
|
+
#search-results .result-item:hover { background: #161b22; }
|
|
153
|
+
#search-results .result-dot {
|
|
154
|
+
width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
|
|
155
|
+
}
|
|
156
|
+
#search-results .result-type {
|
|
157
|
+
font-size: 11px; color: #8b949e; margin-left: auto;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* Legend */
|
|
161
|
+
#legend {
|
|
162
|
+
position: absolute;
|
|
163
|
+
top: 70px;
|
|
105
164
|
left: 16px;
|
|
106
165
|
background: rgba(22, 27, 34, 0.92);
|
|
107
166
|
border: 1px solid #30363d;
|
|
@@ -109,10 +168,21 @@ function generateHtml(nodes, edges, types) {
|
|
|
109
168
|
padding: 14px 18px;
|
|
110
169
|
z-index: 10;
|
|
111
170
|
font-size: 13px;
|
|
171
|
+
max-height: calc(100vh - 160px);
|
|
172
|
+
overflow-y: auto;
|
|
112
173
|
}
|
|
113
174
|
#legend h3 { margin-bottom: 10px; font-size: 14px; color: #e6edf3; }
|
|
114
|
-
.legend-item {
|
|
175
|
+
.legend-item {
|
|
176
|
+
display: flex; align-items: center; margin-bottom: 6px;
|
|
177
|
+
cursor: pointer; user-select: none; transition: opacity 0.2s;
|
|
178
|
+
}
|
|
179
|
+
.legend-item.disabled { opacity: 0.3; }
|
|
180
|
+
.legend-item:hover { opacity: 0.8; }
|
|
115
181
|
.legend-dot { width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; flex-shrink: 0; }
|
|
182
|
+
.legend-label { flex: 1; }
|
|
183
|
+
.legend-count { font-size: 11px; color: #484f58; margin-left: 8px; }
|
|
184
|
+
|
|
185
|
+
/* Stats */
|
|
116
186
|
#stats {
|
|
117
187
|
position: absolute;
|
|
118
188
|
bottom: 16px;
|
|
@@ -125,18 +195,45 @@ function generateHtml(nodes, edges, types) {
|
|
|
125
195
|
font-size: 13px;
|
|
126
196
|
}
|
|
127
197
|
#stats span { color: #58a6ff; font-weight: 600; }
|
|
198
|
+
|
|
199
|
+
/* Controls hint */
|
|
200
|
+
#controls-hint {
|
|
201
|
+
position: absolute;
|
|
202
|
+
bottom: 16px;
|
|
203
|
+
right: 16px;
|
|
204
|
+
background: rgba(22, 27, 34, 0.92);
|
|
205
|
+
border: 1px solid #30363d;
|
|
206
|
+
border-radius: 8px;
|
|
207
|
+
padding: 12px 18px;
|
|
208
|
+
z-index: 10;
|
|
209
|
+
font-size: 11px;
|
|
210
|
+
color: #484f58;
|
|
211
|
+
line-height: 1.8;
|
|
212
|
+
}
|
|
213
|
+
#controls-hint kbd {
|
|
214
|
+
background: #21262d;
|
|
215
|
+
border: 1px solid #30363d;
|
|
216
|
+
border-radius: 3px;
|
|
217
|
+
padding: 1px 5px;
|
|
218
|
+
font-family: monospace;
|
|
219
|
+
font-size: 11px;
|
|
220
|
+
color: #8b949e;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/* Detail panel */
|
|
128
224
|
#detail-panel {
|
|
129
225
|
position: absolute;
|
|
130
226
|
top: 0;
|
|
131
|
-
right: -
|
|
132
|
-
width:
|
|
227
|
+
right: -400px;
|
|
228
|
+
width: 400px;
|
|
133
229
|
height: 100vh;
|
|
134
|
-
background:
|
|
230
|
+
background: rgba(22, 27, 34, 0.98);
|
|
135
231
|
border-left: 1px solid #30363d;
|
|
136
232
|
z-index: 20;
|
|
137
233
|
transition: right 0.3s ease;
|
|
138
234
|
padding: 24px;
|
|
139
235
|
overflow-y: auto;
|
|
236
|
+
backdrop-filter: blur(12px);
|
|
140
237
|
}
|
|
141
238
|
#detail-panel.open { right: 0; }
|
|
142
239
|
#detail-panel .close-btn {
|
|
@@ -157,15 +254,23 @@ function generateHtml(nodes, edges, types) {
|
|
|
157
254
|
}
|
|
158
255
|
#detail-panel ul { list-style: none; padding: 0; }
|
|
159
256
|
#detail-panel li {
|
|
160
|
-
padding:
|
|
257
|
+
padding: 6px 8px; font-size: 13px; border-bottom: 1px solid #21262d;
|
|
258
|
+
cursor: pointer; border-radius: 4px; transition: background 0.15s;
|
|
259
|
+
}
|
|
260
|
+
#detail-panel li:hover { color: #58a6ff; background: rgba(88, 166, 255, 0.08); }
|
|
261
|
+
#detail-panel li .rel-label {
|
|
262
|
+
font-size: 10px; color: #8b949e; margin-left: 4px;
|
|
263
|
+
background: #21262d; padding: 1px 6px; border-radius: 8px;
|
|
161
264
|
}
|
|
162
|
-
#detail-panel li:hover { color: #58a6ff; }
|
|
163
|
-
#detail-panel li .rel-label { font-size: 11px; color: #8b949e; margin-left: 4px; }
|
|
164
265
|
#detail-panel .node-id { font-size: 11px; color: #484f58; font-family: monospace; margin-bottom: 12px; }
|
|
266
|
+
#detail-panel .conn-count {
|
|
267
|
+
font-size: 12px; color: #58a6ff; font-weight: 600;
|
|
268
|
+
margin-bottom: 4px;
|
|
269
|
+
}
|
|
165
270
|
#detail-content {
|
|
166
271
|
font-size: 13px; line-height: 1.6; color: #c9d1d9;
|
|
167
272
|
white-space: pre-wrap; word-wrap: break-word;
|
|
168
|
-
max-height:
|
|
273
|
+
max-height: 35vh; overflow-y: auto;
|
|
169
274
|
padding: 12px; background: #0d1117; border-radius: 6px;
|
|
170
275
|
border: 1px solid #21262d;
|
|
171
276
|
}
|
|
@@ -175,13 +280,30 @@ function generateHtml(nodes, edges, types) {
|
|
|
175
280
|
|
|
176
281
|
<div id="graph-container"></div>
|
|
177
282
|
|
|
283
|
+
<div id="search-bar">
|
|
284
|
+
<input type="text" id="search-input" placeholder="Search nodes... (Ctrl+K)" autocomplete="off">
|
|
285
|
+
<button onclick="clearSearch()">Clear</button>
|
|
286
|
+
</div>
|
|
287
|
+
<div id="search-results"></div>
|
|
288
|
+
|
|
178
289
|
<div id="legend">
|
|
179
290
|
<h3>Node Types</h3>
|
|
180
|
-
|
|
291
|
+
<div id="legend-items"></div>
|
|
181
292
|
</div>
|
|
182
293
|
|
|
183
294
|
<div id="stats">
|
|
184
|
-
Nodes: <span id="node-count">0</span> |
|
|
295
|
+
Nodes: <span id="node-count">0</span> |
|
|
296
|
+
Edges: <span id="edge-count">0</span> |
|
|
297
|
+
Visible: <span id="visible-count">0</span>
|
|
298
|
+
</div>
|
|
299
|
+
|
|
300
|
+
<div id="controls-hint">
|
|
301
|
+
<kbd>Click</kbd> Select node
|
|
302
|
+
<kbd>Scroll</kbd> Zoom
|
|
303
|
+
<kbd>Drag</kbd> Rotate<br>
|
|
304
|
+
<kbd>Right-drag</kbd> Pan
|
|
305
|
+
<kbd>Ctrl+K</kbd> Search
|
|
306
|
+
<kbd>Esc</kbd> Close panel
|
|
185
307
|
</div>
|
|
186
308
|
|
|
187
309
|
<div id="detail-panel">
|
|
@@ -195,142 +317,416 @@ ${legendItems}
|
|
|
195
317
|
</div>
|
|
196
318
|
|
|
197
319
|
<script>
|
|
198
|
-
|
|
199
|
-
var
|
|
320
|
+
(function() {
|
|
321
|
+
var TYPE_COLORS = ${JSON.stringify(typeColors)};
|
|
322
|
+
var REL_COLORS = ${JSON.stringify(relColors)};
|
|
323
|
+
var HUB_KEYWORDS = ['Overview', 'Company', 'Platform'];
|
|
200
324
|
|
|
201
|
-
|
|
325
|
+
function isHub(title) {
|
|
326
|
+
return HUB_KEYWORDS.some(function(k) { return title.indexOf(k) !== -1; });
|
|
327
|
+
}
|
|
202
328
|
|
|
203
|
-
function
|
|
204
|
-
|
|
205
|
-
|
|
329
|
+
function hexToRgb(hex) {
|
|
330
|
+
var r = parseInt(hex.slice(1,3), 16);
|
|
331
|
+
var g = parseInt(hex.slice(3,5), 16);
|
|
332
|
+
var b = parseInt(hex.slice(5,7), 16);
|
|
333
|
+
return { r: r, g: g, b: b };
|
|
334
|
+
}
|
|
206
335
|
|
|
207
|
-
var rawNodes = ${JSON.stringify(nodes)};
|
|
208
|
-
var rawEdges = ${JSON.stringify(edges)};
|
|
209
|
-
|
|
210
|
-
var nodes = new vis.DataSet(rawNodes.map(function(arr) {
|
|
211
|
-
var id = arr[0], type = arr[1], title = arr[2], content = arr[3];
|
|
212
|
-
var tc = TYPE_COLORS[type] || { bg: '#525a65', border: '#484f58', font: '#c9d1d9' };
|
|
213
|
-
var hub = isHub(title);
|
|
214
|
-
var sz = hub ? 32 : 18;
|
|
215
|
-
return {
|
|
216
|
-
id: id, label: title,
|
|
217
|
-
title: title + '\\n[' + type + ']',
|
|
218
|
-
size: sz, shape: 'dot',
|
|
219
|
-
color: { background: tc.bg, border: tc.border, highlight: { background: tc.bg, border: '#fff' } },
|
|
220
|
-
font: { color: tc.font, size: hub ? 14 : 11, face: 'sans-serif' },
|
|
221
|
-
borderWidth: hub ? 3 : 1,
|
|
222
|
-
_type: type, _title: title, _content: content
|
|
223
|
-
};
|
|
224
|
-
}));
|
|
225
|
-
|
|
226
|
-
var edges = new vis.DataSet(rawEdges.map(function(arr, i) {
|
|
227
|
-
var from = arr[0], to = arr[1], rel = arr[2];
|
|
228
|
-
return {
|
|
229
|
-
id: 'e' + i, from: from, to: to, label: rel,
|
|
230
|
-
arrows: { to: { enabled: true, scaleFactor: 0.5 } },
|
|
231
|
-
color: { color: REL_COLORS[rel] || '#30363d', opacity: 0.6, highlight: '#fff' },
|
|
232
|
-
font: { color: '#8b949e', size: 9, strokeWidth: 0, align: 'middle' },
|
|
233
|
-
smooth: { type: 'continuous' },
|
|
234
|
-
width: rel === 'contains' ? 1 : 1.5,
|
|
235
|
-
_rel: rel
|
|
236
|
-
};
|
|
237
|
-
}));
|
|
238
|
-
|
|
239
|
-
document.getElementById('node-count').textContent = nodes.length;
|
|
240
|
-
document.getElementById('edge-count').textContent = edges.length;
|
|
241
|
-
|
|
242
|
-
var container = document.getElementById('graph-container');
|
|
243
|
-
var network = new vis.Network(container, { nodes: nodes, edges: edges }, {
|
|
244
|
-
physics: {
|
|
245
|
-
stabilization: { iterations: 300 },
|
|
246
|
-
solver: 'forceAtlas2Based',
|
|
247
|
-
forceAtlas2Based: {
|
|
248
|
-
gravitationalConstant: -80,
|
|
249
|
-
centralGravity: 0.008,
|
|
250
|
-
springLength: 140,
|
|
251
|
-
springConstant: 0.04,
|
|
252
|
-
damping: 0.4,
|
|
253
|
-
avoidOverlap: 0.6
|
|
254
|
-
},
|
|
255
|
-
maxVelocity: 50
|
|
256
|
-
},
|
|
257
|
-
interaction: { hover: true, tooltipDelay: 200, zoomView: true, dragView: true },
|
|
258
|
-
nodes: { scaling: { min: 8, max: 40 } },
|
|
259
|
-
edges: { selectionWidth: 2 },
|
|
260
|
-
layout: { improvedLayout: true }
|
|
261
|
-
});
|
|
262
|
-
|
|
263
|
-
var panel = document.getElementById('detail-panel');
|
|
264
|
-
|
|
265
|
-
function closePanel() {
|
|
266
|
-
panel.classList.remove('open');
|
|
267
|
-
network.unselectAll();
|
|
268
|
-
}
|
|
336
|
+
var rawNodes = ${JSON.stringify(nodes)};
|
|
337
|
+
var rawEdges = ${JSON.stringify(edges)};
|
|
269
338
|
|
|
270
|
-
|
|
271
|
-
var
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
var contentEl = document.getElementById('detail-content');
|
|
280
|
-
contentEl.textContent = node._content || '(no content)';
|
|
281
|
-
|
|
282
|
-
var allEdges = edges.get();
|
|
283
|
-
var outgoing = [], incoming = [];
|
|
284
|
-
allEdges.forEach(function(e) {
|
|
285
|
-
if (e.from === nodeId) {
|
|
286
|
-
var t = nodes.get(e.to);
|
|
287
|
-
outgoing.push({ id: e.to, label: t ? t._title : e.to, rel: e._rel });
|
|
288
|
-
} else if (e.to === nodeId) {
|
|
289
|
-
var s = nodes.get(e.from);
|
|
290
|
-
incoming.push({ id: e.from, label: s ? s._title : e.from, rel: e._rel });
|
|
291
|
-
}
|
|
339
|
+
// Build graph data
|
|
340
|
+
var graphNodes = rawNodes.map(function(arr) {
|
|
341
|
+
var id = arr[0], type = arr[1], title = arr[2], content = arr[3];
|
|
342
|
+
var color = TYPE_COLORS[type] || '#525a65';
|
|
343
|
+
var hub = isHub(title);
|
|
344
|
+
return {
|
|
345
|
+
id: id, type: type, title: title, content: content,
|
|
346
|
+
color: color, val: hub ? 8 : 3, hub: hub
|
|
347
|
+
};
|
|
292
348
|
});
|
|
293
349
|
|
|
294
|
-
var
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
350
|
+
var graphLinks = rawEdges.map(function(arr) {
|
|
351
|
+
return {
|
|
352
|
+
source: arr[0], target: arr[1], rel: arr[2],
|
|
353
|
+
color: REL_COLORS[arr[2]] || '#30363d'
|
|
354
|
+
};
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
// Compute connection counts for node sizing
|
|
358
|
+
var connCount = {};
|
|
359
|
+
graphLinks.forEach(function(l) {
|
|
360
|
+
connCount[l.source] = (connCount[l.source] || 0) + 1;
|
|
361
|
+
connCount[l.target] = (connCount[l.target] || 0) + 1;
|
|
362
|
+
});
|
|
363
|
+
graphNodes.forEach(function(n) {
|
|
364
|
+
var conns = connCount[n.id] || 0;
|
|
365
|
+
n.val = n.hub ? Math.max(8, conns * 1.5) : Math.max(2, conns * 0.8);
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
// Type counts for legend
|
|
369
|
+
var typeCounts = {};
|
|
370
|
+
graphNodes.forEach(function(n) {
|
|
371
|
+
typeCounts[n.type] = (typeCounts[n.type] || 0) + 1;
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
// Build legend
|
|
375
|
+
var disabledTypes = {};
|
|
376
|
+
var legendContainer = document.getElementById('legend-items');
|
|
377
|
+
Object.keys(TYPE_COLORS).sort().forEach(function(t) {
|
|
378
|
+
var item = document.createElement('div');
|
|
379
|
+
item.className = 'legend-item';
|
|
380
|
+
item.innerHTML =
|
|
381
|
+
'<div class="legend-dot" style="background:' + TYPE_COLORS[t] + '"><\/div>' +
|
|
382
|
+
'<span class="legend-label">' + t.charAt(0).toUpperCase() + t.slice(1) + '<\/span>' +
|
|
383
|
+
'<span class="legend-count">' + (typeCounts[t] || 0) + '<\/span>';
|
|
384
|
+
item.onclick = function() {
|
|
385
|
+
if (disabledTypes[t]) {
|
|
386
|
+
delete disabledTypes[t];
|
|
387
|
+
item.classList.remove('disabled');
|
|
388
|
+
} else {
|
|
389
|
+
disabledTypes[t] = true;
|
|
390
|
+
item.classList.add('disabled');
|
|
391
|
+
}
|
|
392
|
+
updateVisibility();
|
|
393
|
+
};
|
|
394
|
+
legendContainer.appendChild(item);
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
// Stats
|
|
398
|
+
document.getElementById('node-count').textContent = graphNodes.length;
|
|
399
|
+
document.getElementById('edge-count').textContent = graphLinks.length;
|
|
400
|
+
document.getElementById('visible-count').textContent = graphNodes.length;
|
|
401
|
+
|
|
402
|
+
// Highlighted state
|
|
403
|
+
var highlightNodes = new Set();
|
|
404
|
+
var highlightLinks = new Set();
|
|
405
|
+
var hoverNode = null;
|
|
406
|
+
var selectedNode = null;
|
|
407
|
+
|
|
408
|
+
// Create the 3D graph
|
|
409
|
+
var Graph = ForceGraph3D()(document.getElementById('graph-container'))
|
|
410
|
+
.graphData({ nodes: graphNodes, links: graphLinks })
|
|
411
|
+
.backgroundColor('#0d1117')
|
|
412
|
+
.nodeVal('val')
|
|
413
|
+
.nodeLabel(function(n) { return n.title + ' [' + n.type + ']'; })
|
|
414
|
+
.nodeColor(function(n) {
|
|
415
|
+
if (highlightNodes.size > 0) {
|
|
416
|
+
return highlightNodes.has(n) ? n.color : 'rgba(40,44,52,0.3)';
|
|
417
|
+
}
|
|
418
|
+
return n.color;
|
|
419
|
+
})
|
|
420
|
+
.nodeOpacity(0.95)
|
|
421
|
+
.nodeResolution(16)
|
|
422
|
+
.linkColor(function(l) {
|
|
423
|
+
if (highlightLinks.size > 0) {
|
|
424
|
+
return highlightLinks.has(l) ? l.color : 'rgba(40,44,52,0.1)';
|
|
425
|
+
}
|
|
426
|
+
return l.color;
|
|
427
|
+
})
|
|
428
|
+
.linkOpacity(0.4)
|
|
429
|
+
.linkWidth(function(l) {
|
|
430
|
+
return highlightLinks.has(l) ? 2 : 0.5;
|
|
431
|
+
})
|
|
432
|
+
.linkDirectionalArrowLength(4)
|
|
433
|
+
.linkDirectionalArrowRelPos(1)
|
|
434
|
+
.linkDirectionalParticles(function(l) {
|
|
435
|
+
return highlightLinks.has(l) ? 4 : 0;
|
|
436
|
+
})
|
|
437
|
+
.linkDirectionalParticleWidth(2)
|
|
438
|
+
.linkDirectionalParticleColor(function(l) { return l.color; })
|
|
439
|
+
.linkDirectionalParticleSpeed(0.006)
|
|
440
|
+
.linkLabel(function(l) { return l.rel; })
|
|
441
|
+
.onNodeHover(function(node) {
|
|
442
|
+
if ((!node && !hoverNode) || (node && hoverNode && node.id === hoverNode.id)) return;
|
|
443
|
+
highlightNodes.clear();
|
|
444
|
+
highlightLinks.clear();
|
|
445
|
+
if (node && !selectedNode) {
|
|
446
|
+
highlightNodes.add(node);
|
|
447
|
+
var data = Graph.graphData();
|
|
448
|
+
data.links.forEach(function(link) {
|
|
449
|
+
var src = typeof link.source === 'object' ? link.source : data.nodes.find(function(n) { return n.id === link.source; });
|
|
450
|
+
var tgt = typeof link.target === 'object' ? link.target : data.nodes.find(function(n) { return n.id === link.target; });
|
|
451
|
+
if (src === node || tgt === node) {
|
|
452
|
+
highlightLinks.add(link);
|
|
453
|
+
if (src) highlightNodes.add(src);
|
|
454
|
+
if (tgt) highlightNodes.add(tgt);
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
hoverNode = node;
|
|
459
|
+
Graph.nodeColor(Graph.nodeColor())
|
|
460
|
+
.linkColor(Graph.linkColor())
|
|
461
|
+
.linkWidth(Graph.linkWidth())
|
|
462
|
+
.linkDirectionalParticles(Graph.linkDirectionalParticles());
|
|
463
|
+
})
|
|
464
|
+
.onNodeClick(function(node) {
|
|
465
|
+
selectedNode = node;
|
|
466
|
+
highlightNodes.clear();
|
|
467
|
+
highlightLinks.clear();
|
|
468
|
+
highlightNodes.add(node);
|
|
469
|
+
var data = Graph.graphData();
|
|
470
|
+
data.links.forEach(function(link) {
|
|
471
|
+
var src = typeof link.source === 'object' ? link.source : data.nodes.find(function(n) { return n.id === link.source; });
|
|
472
|
+
var tgt = typeof link.target === 'object' ? link.target : data.nodes.find(function(n) { return n.id === link.target; });
|
|
473
|
+
if (src === node || tgt === node) {
|
|
474
|
+
highlightLinks.add(link);
|
|
475
|
+
if (src) highlightNodes.add(src);
|
|
476
|
+
if (tgt) highlightNodes.add(tgt);
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
Graph.nodeColor(Graph.nodeColor())
|
|
480
|
+
.linkColor(Graph.linkColor())
|
|
481
|
+
.linkWidth(Graph.linkWidth())
|
|
482
|
+
.linkDirectionalParticles(Graph.linkDirectionalParticles());
|
|
483
|
+
showNodeDetail(node);
|
|
484
|
+
// Fly camera to node
|
|
485
|
+
var dist = 120;
|
|
486
|
+
var pos = node;
|
|
487
|
+
Graph.cameraPosition(
|
|
488
|
+
{ x: pos.x + dist, y: pos.y + dist / 2, z: pos.z + dist },
|
|
489
|
+
pos, 1200
|
|
490
|
+
);
|
|
491
|
+
})
|
|
492
|
+
.onBackgroundClick(function() {
|
|
493
|
+
selectedNode = null;
|
|
494
|
+
highlightNodes.clear();
|
|
495
|
+
highlightLinks.clear();
|
|
496
|
+
Graph.nodeColor(Graph.nodeColor())
|
|
497
|
+
.linkColor(Graph.linkColor())
|
|
498
|
+
.linkWidth(Graph.linkWidth())
|
|
499
|
+
.linkDirectionalParticles(Graph.linkDirectionalParticles());
|
|
500
|
+
closePanel();
|
|
501
|
+
})
|
|
502
|
+
.warmupTicks(80)
|
|
503
|
+
.cooldownTicks(200);
|
|
504
|
+
|
|
505
|
+
// Add bloom post-processing
|
|
506
|
+
var renderer = Graph.renderer();
|
|
507
|
+
var scene = Graph.scene();
|
|
508
|
+
var camera = Graph.camera();
|
|
509
|
+
var composer = new THREE.EffectComposer(renderer);
|
|
510
|
+
var renderPass = new THREE.RenderPass(scene, camera);
|
|
511
|
+
composer.addPass(renderPass);
|
|
512
|
+
var bloomPass = new THREE.UnrealBloomPass(
|
|
513
|
+
new THREE.Vector2(window.innerWidth, window.innerHeight),
|
|
514
|
+
1.2, // strength
|
|
515
|
+
0.5, // radius
|
|
516
|
+
0.3 // threshold
|
|
517
|
+
);
|
|
518
|
+
composer.addPass(bloomPass);
|
|
519
|
+
|
|
520
|
+
// Override render loop to use bloom
|
|
521
|
+
Graph.postProcessingComposer(composer);
|
|
522
|
+
|
|
523
|
+
// Add ambient glow background particles
|
|
524
|
+
var particleCount = 300;
|
|
525
|
+
var pGeom = new THREE.BufferGeometry();
|
|
526
|
+
var pPositions = new Float32Array(particleCount * 3);
|
|
527
|
+
for (var i = 0; i < particleCount; i++) {
|
|
528
|
+
pPositions[i * 3] = (Math.random() - 0.5) * 800;
|
|
529
|
+
pPositions[i * 3 + 1] = (Math.random() - 0.5) * 800;
|
|
530
|
+
pPositions[i * 3 + 2] = (Math.random() - 0.5) * 800;
|
|
531
|
+
}
|
|
532
|
+
pGeom.setAttribute('position', new THREE.BufferAttribute(pPositions, 3));
|
|
533
|
+
var pMat = new THREE.PointsMaterial({ color: 0x1a2332, size: 1.5, transparent: true, opacity: 0.4 });
|
|
534
|
+
var particles = new THREE.Points(pGeom, pMat);
|
|
535
|
+
scene.add(particles);
|
|
536
|
+
|
|
537
|
+
// Node text labels via CSS2D would require additional dep, so we use the built-in label
|
|
538
|
+
|
|
539
|
+
// Type filtering
|
|
540
|
+
function updateVisibility() {
|
|
541
|
+
var filteredNodes = graphNodes.filter(function(n) { return !disabledTypes[n.type]; });
|
|
542
|
+
var filteredNodeIds = new Set(filteredNodes.map(function(n) { return n.id; }));
|
|
543
|
+
var filteredLinks = graphLinks.filter(function(l) {
|
|
544
|
+
var srcId = typeof l.source === 'object' ? l.source.id : l.source;
|
|
545
|
+
var tgtId = typeof l.target === 'object' ? l.target.id : l.target;
|
|
546
|
+
return filteredNodeIds.has(srcId) && filteredNodeIds.has(tgtId);
|
|
299
547
|
});
|
|
300
|
-
|
|
548
|
+
document.getElementById('visible-count').textContent = filteredNodes.length;
|
|
549
|
+
Graph.graphData({ nodes: filteredNodes, links: filteredLinks });
|
|
301
550
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
551
|
+
|
|
552
|
+
// Search functionality
|
|
553
|
+
var searchInput = document.getElementById('search-input');
|
|
554
|
+
var searchResults = document.getElementById('search-results');
|
|
555
|
+
|
|
556
|
+
searchInput.addEventListener('input', function() {
|
|
557
|
+
var query = searchInput.value.trim().toLowerCase();
|
|
558
|
+
if (!query) { searchResults.style.display = 'none'; return; }
|
|
559
|
+
var matches = graphNodes.filter(function(n) {
|
|
560
|
+
return n.title.toLowerCase().indexOf(query) !== -1 ||
|
|
561
|
+
n.type.toLowerCase().indexOf(query) !== -1 ||
|
|
562
|
+
n.content.toLowerCase().indexOf(query) !== -1;
|
|
563
|
+
}).slice(0, 12);
|
|
564
|
+
if (matches.length === 0) { searchResults.style.display = 'none'; return; }
|
|
565
|
+
searchResults.innerHTML = matches.map(function(n) {
|
|
566
|
+
return '<div class="result-item" data-id="' + n.id + '">' +
|
|
567
|
+
'<div class="result-dot" style="background:' + n.color + '"><\/div>' +
|
|
568
|
+
'<span>' + escapeHtml(n.title) + '<\/span>' +
|
|
569
|
+
'<span class="result-type">' + n.type + '<\/span>' +
|
|
570
|
+
'<\/div>';
|
|
571
|
+
}).join('');
|
|
572
|
+
searchResults.style.display = 'block';
|
|
573
|
+
searchResults.querySelectorAll('.result-item').forEach(function(el) {
|
|
574
|
+
el.addEventListener('click', function() {
|
|
575
|
+
var id = el.getAttribute('data-id');
|
|
576
|
+
var node = graphNodes.find(function(n) { return n.id === id; });
|
|
577
|
+
if (node) {
|
|
578
|
+
navigateTo(node);
|
|
579
|
+
searchResults.style.display = 'none';
|
|
580
|
+
searchInput.value = '';
|
|
581
|
+
}
|
|
582
|
+
});
|
|
306
583
|
});
|
|
307
|
-
|
|
584
|
+
});
|
|
585
|
+
|
|
586
|
+
searchInput.addEventListener('keydown', function(e) {
|
|
587
|
+
if (e.key === 'Escape') {
|
|
588
|
+
searchResults.style.display = 'none';
|
|
589
|
+
searchInput.blur();
|
|
590
|
+
}
|
|
591
|
+
});
|
|
592
|
+
|
|
593
|
+
function clearSearch() {
|
|
594
|
+
searchInput.value = '';
|
|
595
|
+
searchResults.style.display = 'none';
|
|
596
|
+
selectedNode = null;
|
|
597
|
+
highlightNodes.clear();
|
|
598
|
+
highlightLinks.clear();
|
|
599
|
+
Graph.nodeColor(Graph.nodeColor())
|
|
600
|
+
.linkColor(Graph.linkColor())
|
|
601
|
+
.linkWidth(Graph.linkWidth())
|
|
602
|
+
.linkDirectionalParticles(Graph.linkDirectionalParticles());
|
|
603
|
+
closePanel();
|
|
308
604
|
}
|
|
309
|
-
|
|
310
|
-
|
|
605
|
+
|
|
606
|
+
function escapeHtml(s) {
|
|
607
|
+
var div = document.createElement('div');
|
|
608
|
+
div.textContent = s;
|
|
609
|
+
return div.innerHTML;
|
|
311
610
|
}
|
|
312
|
-
document.getElementById('detail-connections').innerHTML = html;
|
|
313
|
-
panel.classList.add('open');
|
|
314
|
-
}
|
|
315
611
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
612
|
+
// Keyboard shortcut
|
|
613
|
+
document.addEventListener('keydown', function(e) {
|
|
614
|
+
if ((e.ctrlKey || e.metaKey) && e.key === 'k') {
|
|
615
|
+
e.preventDefault();
|
|
616
|
+
searchInput.focus();
|
|
617
|
+
searchInput.select();
|
|
618
|
+
}
|
|
619
|
+
if (e.key === 'Escape') {
|
|
620
|
+
closePanel();
|
|
621
|
+
searchResults.style.display = 'none';
|
|
622
|
+
}
|
|
623
|
+
});
|
|
624
|
+
|
|
625
|
+
// Detail panel
|
|
626
|
+
var panel = document.getElementById('detail-panel');
|
|
627
|
+
|
|
628
|
+
window.closePanel = function() {
|
|
629
|
+
panel.classList.remove('open');
|
|
630
|
+
selectedNode = null;
|
|
631
|
+
highlightNodes.clear();
|
|
632
|
+
highlightLinks.clear();
|
|
633
|
+
Graph.nodeColor(Graph.nodeColor())
|
|
634
|
+
.linkColor(Graph.linkColor())
|
|
635
|
+
.linkWidth(Graph.linkWidth())
|
|
636
|
+
.linkDirectionalParticles(Graph.linkDirectionalParticles());
|
|
637
|
+
};
|
|
638
|
+
|
|
639
|
+
function showNodeDetail(node) {
|
|
640
|
+
var color = TYPE_COLORS[node.type] || '#525a65';
|
|
641
|
+
document.getElementById('detail-title').textContent = node.title;
|
|
642
|
+
document.getElementById('detail-id').textContent = 'ID: ' + node.id;
|
|
643
|
+
document.getElementById('detail-type').innerHTML =
|
|
644
|
+
'<span class="type-badge" style="background:' + color + ';color:#fff">' + node.type + '<\/span>';
|
|
645
|
+
|
|
646
|
+
document.getElementById('detail-content').textContent = node.content || '(no content)';
|
|
321
647
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
648
|
+
var data = Graph.graphData();
|
|
649
|
+
var outgoing = [], incoming = [];
|
|
650
|
+
data.links.forEach(function(l) {
|
|
651
|
+
var srcId = typeof l.source === 'object' ? l.source.id : l.source;
|
|
652
|
+
var tgtId = typeof l.target === 'object' ? l.target.id : l.target;
|
|
653
|
+
if (srcId === node.id) {
|
|
654
|
+
var tgt = data.nodes.find(function(n) { return n.id === tgtId; });
|
|
655
|
+
if (tgt) outgoing.push({ node: tgt, rel: l.rel });
|
|
656
|
+
} else if (tgtId === node.id) {
|
|
657
|
+
var src = data.nodes.find(function(n) { return n.id === srcId; });
|
|
658
|
+
if (src) incoming.push({ node: src, rel: l.rel });
|
|
659
|
+
}
|
|
660
|
+
});
|
|
661
|
+
|
|
662
|
+
var html = '<div class="conn-count">' + (outgoing.length + incoming.length) + ' connections<\/div>';
|
|
663
|
+
if (outgoing.length) {
|
|
664
|
+
html += '<div class="section-title">Outgoing (' + outgoing.length + ')<\/div><ul>';
|
|
665
|
+
outgoing.forEach(function(c) {
|
|
666
|
+
html += '<li data-id="' + c.node.id + '">' + escapeHtml(c.node.title) +
|
|
667
|
+
' <span class="rel-label">' + c.rel + '<\/span><\/li>';
|
|
668
|
+
});
|
|
669
|
+
html += '<\/ul>';
|
|
670
|
+
}
|
|
671
|
+
if (incoming.length) {
|
|
672
|
+
html += '<div class="section-title">Incoming (' + incoming.length + ')<\/div><ul>';
|
|
673
|
+
incoming.forEach(function(c) {
|
|
674
|
+
html += '<li data-id="' + c.node.id + '">' + escapeHtml(c.node.title) +
|
|
675
|
+
' <span class="rel-label">' + c.rel + '<\/span><\/li>';
|
|
676
|
+
});
|
|
677
|
+
html += '<\/ul>';
|
|
678
|
+
}
|
|
679
|
+
if (!outgoing.length && !incoming.length) {
|
|
680
|
+
html = '<div class="section-title">No connections<\/div>';
|
|
681
|
+
}
|
|
682
|
+
document.getElementById('detail-connections').innerHTML = html;
|
|
683
|
+
|
|
684
|
+
// Add click handlers to connection items
|
|
685
|
+
document.querySelectorAll('#detail-connections li[data-id]').forEach(function(el) {
|
|
686
|
+
el.addEventListener('click', function() {
|
|
687
|
+
var id = el.getAttribute('data-id');
|
|
688
|
+
var target = graphNodes.find(function(n) { return n.id === id; });
|
|
689
|
+
if (target) navigateTo(target);
|
|
690
|
+
});
|
|
691
|
+
});
|
|
326
692
|
|
|
327
|
-
|
|
328
|
-
if (params.nodes.length > 0) {
|
|
329
|
-
network.focus(params.nodes[0], { scale: 1.5, animation: { duration: 500, easingFunction: 'easeInOutQuad' } });
|
|
693
|
+
panel.classList.add('open');
|
|
330
694
|
}
|
|
331
|
-
});
|
|
332
695
|
|
|
333
|
-
|
|
696
|
+
window.navigateTo = function(node) {
|
|
697
|
+
selectedNode = node;
|
|
698
|
+
highlightNodes.clear();
|
|
699
|
+
highlightLinks.clear();
|
|
700
|
+
highlightNodes.add(node);
|
|
701
|
+
var data = Graph.graphData();
|
|
702
|
+
data.links.forEach(function(link) {
|
|
703
|
+
var src = typeof link.source === 'object' ? link.source : data.nodes.find(function(n) { return n.id === link.source; });
|
|
704
|
+
var tgt = typeof link.target === 'object' ? link.target : data.nodes.find(function(n) { return n.id === link.target; });
|
|
705
|
+
if (src === node || tgt === node) {
|
|
706
|
+
highlightLinks.add(link);
|
|
707
|
+
if (src) highlightNodes.add(src);
|
|
708
|
+
if (tgt) highlightNodes.add(tgt);
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
Graph.nodeColor(Graph.nodeColor())
|
|
712
|
+
.linkColor(Graph.linkColor())
|
|
713
|
+
.linkWidth(Graph.linkWidth())
|
|
714
|
+
.linkDirectionalParticles(Graph.linkDirectionalParticles());
|
|
715
|
+
showNodeDetail(node);
|
|
716
|
+
var dist = 120;
|
|
717
|
+
Graph.cameraPosition(
|
|
718
|
+
{ x: node.x + dist, y: node.y + dist / 2, z: node.z + dist },
|
|
719
|
+
node, 1200
|
|
720
|
+
);
|
|
721
|
+
};
|
|
722
|
+
|
|
723
|
+
// Close results on outside click
|
|
724
|
+
document.addEventListener('click', function(e) {
|
|
725
|
+
if (!searchResults.contains(e.target) && e.target !== searchInput) {
|
|
726
|
+
searchResults.style.display = 'none';
|
|
727
|
+
}
|
|
728
|
+
});
|
|
729
|
+
})();
|
|
334
730
|
<\/script>
|
|
335
731
|
</body>
|
|
336
732
|
</html>`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.js","sourceRoot":"","sources":["../../src/commands/graph.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,UAAU,YAAY,CAAC,OAAgB;IAC3C,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,mEAAmE,CAAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA2YhC,CAAC;AACT,CAAC;AAED,SAAS,UAAU,CAAC,CAAS;IAC3B,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apart-tech/apart-intelligence",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Apart Intelligence — the knowledge graph CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@prisma/client": "^6.6.0",
|
|
24
24
|
"@prisma/extension-accelerate": "^3.0.1",
|
|
25
|
-
"@apart-tech/intelligence-api-client": "
|
|
26
|
-
"@apart-tech/intelligence-core": "
|
|
25
|
+
"@apart-tech/intelligence-api-client": "^0.1.0",
|
|
26
|
+
"@apart-tech/intelligence-core": "^1.2.0",
|
|
27
27
|
"chalk": "^5.4.0",
|
|
28
28
|
"commander": "^13.0.0",
|
|
29
29
|
"prompts": "^2.4.2",
|