code-kg 0.1.9 → 0.1.10
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/server/ui.js +32 -30
- package/dist/server/ui.js.map +1 -1
- package/package.json +1 -1
package/dist/server/ui.js
CHANGED
|
@@ -577,14 +577,14 @@ function renderUiHtml() {
|
|
|
577
577
|
const WASM_LAYOUT_ASSET = '/assets/vendor/graph-layout.wasm';
|
|
578
578
|
const WASM_LAYOUT_ITERATIONS = 56;
|
|
579
579
|
const WASM_WORKER_TIMEOUT_MS = 9000;
|
|
580
|
-
const EDGE_CHUNK_THRESHOLD =
|
|
581
|
-
const EDGE_CHUNK_SIZE =
|
|
580
|
+
const EDGE_CHUNK_THRESHOLD = 50000;
|
|
581
|
+
const EDGE_CHUNK_SIZE = 15000;
|
|
582
582
|
const AUX_LOAD_DELAY_MS = 120;
|
|
583
|
-
const POINTER_INTERACTION_MAX_NODES =
|
|
584
|
-
const POINTER_INTERACTION_MAX_EDGES =
|
|
583
|
+
const POINTER_INTERACTION_MAX_NODES = 6000;
|
|
584
|
+
const POINTER_INTERACTION_MAX_EDGES = 15000;
|
|
585
585
|
|
|
586
586
|
const state = {
|
|
587
|
-
view: '
|
|
587
|
+
view: 'all',
|
|
588
588
|
graph: null,
|
|
589
589
|
graphData: { nodes: [], links: [], nodeById: new Map() },
|
|
590
590
|
graphMeta: null,
|
|
@@ -1221,10 +1221,10 @@ function renderUiHtml() {
|
|
|
1221
1221
|
graph.nodeResolution(mode === 'normal' ? 6 : mode === 'degraded' ? 4 : 3);
|
|
1222
1222
|
}
|
|
1223
1223
|
if (typeof graph.linkResolution === 'function') {
|
|
1224
|
-
graph.linkResolution(mode === 'normal' ?
|
|
1224
|
+
graph.linkResolution(mode === 'normal' ? 2 : 1);
|
|
1225
1225
|
}
|
|
1226
1226
|
|
|
1227
|
-
graph.linkOpacity(mode === 'normal' ? 0.
|
|
1227
|
+
graph.linkOpacity(mode === 'normal' ? 0.62 : mode === 'degraded' ? 0.5 : 0.38);
|
|
1228
1228
|
graph.nodeRelSize(mode === 'normal' ? 1.1 : mode === 'degraded' ? 0.95 : 0.82);
|
|
1229
1229
|
|
|
1230
1230
|
const totalNodes = state.graphMeta && typeof state.graphMeta.totalNodes === 'number'
|
|
@@ -1270,10 +1270,10 @@ function renderUiHtml() {
|
|
|
1270
1270
|
if (renderer && typeof renderer.setPixelRatio === 'function') {
|
|
1271
1271
|
const deviceRatio = window.devicePixelRatio || 1;
|
|
1272
1272
|
const targetRatio = mode === 'normal'
|
|
1273
|
-
? Math.min(1.
|
|
1273
|
+
? Math.min(1.6, deviceRatio)
|
|
1274
1274
|
: mode === 'degraded'
|
|
1275
|
-
? Math.min(1.
|
|
1276
|
-
: 0.
|
|
1275
|
+
? Math.min(1.2, deviceRatio)
|
|
1276
|
+
: Math.min(0.9, deviceRatio);
|
|
1277
1277
|
renderer.setPixelRatio(targetRatio);
|
|
1278
1278
|
}
|
|
1279
1279
|
} catch (_error) {
|
|
@@ -1376,7 +1376,12 @@ function renderUiHtml() {
|
|
|
1376
1376
|
return false;
|
|
1377
1377
|
}
|
|
1378
1378
|
|
|
1379
|
-
const graph = window.ForceGraph3D(
|
|
1379
|
+
const graph = window.ForceGraph3D({
|
|
1380
|
+
rendererConfig: {
|
|
1381
|
+
antialias: false,
|
|
1382
|
+
powerPreference: 'high-performance'
|
|
1383
|
+
}
|
|
1384
|
+
})(els.graphCanvas)
|
|
1380
1385
|
.backgroundColor('#01040f')
|
|
1381
1386
|
.showNavInfo(false)
|
|
1382
1387
|
.nodeOpacity(0.92)
|
|
@@ -1407,10 +1412,10 @@ function renderUiHtml() {
|
|
|
1407
1412
|
return link.__color || '#82cf34';
|
|
1408
1413
|
})
|
|
1409
1414
|
.linkWidth((link) => {
|
|
1410
|
-
const base = state.perfMode === 'normal' ? 0.
|
|
1411
|
-
const highlight = state.perfMode === 'normal' ? 1.
|
|
1412
|
-
|
|
1413
|
-
|
|
1415
|
+
const base = state.perfMode === 'normal' ? 0.95 : state.perfMode === 'degraded' ? 0.72 : 0.52;
|
|
1416
|
+
const highlight = state.perfMode === 'normal' ? 1.9 : state.perfMode === 'degraded' ? 1.45 : 1.1;
|
|
1417
|
+
return link.__highlight ? highlight : base;
|
|
1418
|
+
})
|
|
1414
1419
|
.linkVisibility((link) => link.__renderVisible !== false)
|
|
1415
1420
|
.linkDirectionalParticles((link) => {
|
|
1416
1421
|
return link.__highlight ? (state.perfMode === 'normal' ? 2 : 1) : 0;
|
|
@@ -1557,6 +1562,17 @@ function renderUiHtml() {
|
|
|
1557
1562
|
if (view === 'moduleGraph' || view === 'symbolGraph') {
|
|
1558
1563
|
return 0;
|
|
1559
1564
|
}
|
|
1565
|
+
if (view === 'all' || view === 'fileDeps') {
|
|
1566
|
+
const counts = state.lastMeta && state.lastMeta.counts ? state.lastMeta.counts : null;
|
|
1567
|
+
const totalNodes = counts && typeof counts.nodes === 'number' ? counts.nodes : 0;
|
|
1568
|
+
if (totalNodes >= 260000) {
|
|
1569
|
+
return 52000;
|
|
1570
|
+
}
|
|
1571
|
+
if (totalNodes >= 180000) {
|
|
1572
|
+
return 76000;
|
|
1573
|
+
}
|
|
1574
|
+
return 0;
|
|
1575
|
+
}
|
|
1560
1576
|
const counts = state.lastMeta && state.lastMeta.counts ? state.lastMeta.counts : null;
|
|
1561
1577
|
const totalNodes = counts && typeof counts.nodes === 'number' ? counts.nodes : 0;
|
|
1562
1578
|
if (totalNodes >= 120000) {
|
|
@@ -1585,21 +1601,7 @@ function renderUiHtml() {
|
|
|
1585
1601
|
state.graphData.nodes.length,
|
|
1586
1602
|
state.graphData.links.length
|
|
1587
1603
|
);
|
|
1588
|
-
|
|
1589
|
-
? state.lastMeta.counts.nodes
|
|
1590
|
-
: normalizedMeta.totalNodes;
|
|
1591
|
-
const totalEdges = state.lastMeta && state.lastMeta.counts && typeof state.lastMeta.counts.edges === 'number'
|
|
1592
|
-
? state.lastMeta.counts.edges
|
|
1593
|
-
: normalizedMeta.totalEdges;
|
|
1594
|
-
state.graphMeta = {
|
|
1595
|
-
totalNodes: Math.max(normalizedMeta.totalNodes, totalNodes),
|
|
1596
|
-
totalEdges: Math.max(normalizedMeta.totalEdges, totalEdges),
|
|
1597
|
-
queryMs: normalizedMeta.queryMs,
|
|
1598
|
-
recommendedQualityMode: inferQualityMode(
|
|
1599
|
-
Math.max(normalizedMeta.totalNodes, totalNodes),
|
|
1600
|
-
Math.max(normalizedMeta.totalEdges, totalEdges)
|
|
1601
|
-
)
|
|
1602
|
-
};
|
|
1604
|
+
state.graphMeta = normalizedMeta;
|
|
1603
1605
|
const usedWasm = await applyWasmLayout(
|
|
1604
1606
|
view + ':' + state.graphData.nodes.length + ':' + state.graphData.links.length
|
|
1605
1607
|
);
|
package/dist/server/ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/server/ui.ts"],"names":[],"mappings":";;AAEA,
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/server/ui.ts"],"names":[],"mappings":";;AAEA,oCAm8DC;AAr8DD,2DAAmE;AAEnE,SAAgB,YAAY;IAC1B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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