code-kg 0.1.8 → 0.1.9
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 +29 -9
- package/dist/server/ui.js.map +1 -1
- package/package.json +1 -1
package/dist/server/ui.js
CHANGED
|
@@ -580,6 +580,8 @@ function renderUiHtml() {
|
|
|
580
580
|
const EDGE_CHUNK_THRESHOLD = 20000;
|
|
581
581
|
const EDGE_CHUNK_SIZE = 7000;
|
|
582
582
|
const AUX_LOAD_DELAY_MS = 120;
|
|
583
|
+
const POINTER_INTERACTION_MAX_NODES = 9000;
|
|
584
|
+
const POINTER_INTERACTION_MAX_EDGES = 24000;
|
|
583
585
|
|
|
584
586
|
const state = {
|
|
585
587
|
view: 'moduleGraph',
|
|
@@ -1216,14 +1218,32 @@ function renderUiHtml() {
|
|
|
1216
1218
|
graph.d3VelocityDecay(usingWasmLayout ? 0.9 : mode === 'normal' ? 0.28 : mode === 'degraded' ? 0.4 : 0.58);
|
|
1217
1219
|
}
|
|
1218
1220
|
if (typeof graph.nodeResolution === 'function') {
|
|
1219
|
-
graph.nodeResolution(mode === 'normal' ?
|
|
1221
|
+
graph.nodeResolution(mode === 'normal' ? 6 : mode === 'degraded' ? 4 : 3);
|
|
1220
1222
|
}
|
|
1221
1223
|
if (typeof graph.linkResolution === 'function') {
|
|
1222
|
-
graph.linkResolution(mode === 'normal' ?
|
|
1224
|
+
graph.linkResolution(mode === 'normal' ? 3 : mode === 'degraded' ? 2 : 2);
|
|
1223
1225
|
}
|
|
1224
1226
|
|
|
1225
|
-
graph.linkOpacity(mode === 'normal' ? 0.
|
|
1226
|
-
graph.nodeRelSize(mode === 'normal' ? 1.
|
|
1227
|
+
graph.linkOpacity(mode === 'normal' ? 0.44 : mode === 'degraded' ? 0.34 : 0.26);
|
|
1228
|
+
graph.nodeRelSize(mode === 'normal' ? 1.1 : mode === 'degraded' ? 0.95 : 0.82);
|
|
1229
|
+
|
|
1230
|
+
const totalNodes = state.graphMeta && typeof state.graphMeta.totalNodes === 'number'
|
|
1231
|
+
? state.graphMeta.totalNodes
|
|
1232
|
+
: state.graphData.nodes.length;
|
|
1233
|
+
const totalEdges = state.graphMeta && typeof state.graphMeta.totalEdges === 'number'
|
|
1234
|
+
? state.graphMeta.totalEdges
|
|
1235
|
+
: state.graphData.links.length;
|
|
1236
|
+
const allowPointerInteraction =
|
|
1237
|
+
totalNodes <= POINTER_INTERACTION_MAX_NODES &&
|
|
1238
|
+
totalEdges <= POINTER_INTERACTION_MAX_EDGES &&
|
|
1239
|
+
mode === 'normal';
|
|
1240
|
+
|
|
1241
|
+
if (typeof graph.enablePointerInteraction === 'function') {
|
|
1242
|
+
graph.enablePointerInteraction(allowPointerInteraction);
|
|
1243
|
+
}
|
|
1244
|
+
if (typeof graph.enableNodeDrag === 'function') {
|
|
1245
|
+
graph.enableNodeDrag(false);
|
|
1246
|
+
}
|
|
1227
1247
|
|
|
1228
1248
|
if (typeof graph.d3Force === 'function') {
|
|
1229
1249
|
const currentCharge = graph.d3Force('charge');
|
|
@@ -1250,10 +1270,10 @@ function renderUiHtml() {
|
|
|
1250
1270
|
if (renderer && typeof renderer.setPixelRatio === 'function') {
|
|
1251
1271
|
const deviceRatio = window.devicePixelRatio || 1;
|
|
1252
1272
|
const targetRatio = mode === 'normal'
|
|
1253
|
-
? Math.min(
|
|
1273
|
+
? Math.min(1.3, deviceRatio)
|
|
1254
1274
|
: mode === 'degraded'
|
|
1255
|
-
? Math.min(1.
|
|
1256
|
-
:
|
|
1275
|
+
? Math.min(1.0, deviceRatio)
|
|
1276
|
+
: 0.82;
|
|
1257
1277
|
renderer.setPixelRatio(targetRatio);
|
|
1258
1278
|
}
|
|
1259
1279
|
} catch (_error) {
|
|
@@ -1387,8 +1407,8 @@ function renderUiHtml() {
|
|
|
1387
1407
|
return link.__color || '#82cf34';
|
|
1388
1408
|
})
|
|
1389
1409
|
.linkWidth((link) => {
|
|
1390
|
-
const base = state.perfMode === 'normal' ? 0.
|
|
1391
|
-
const highlight = state.perfMode === 'normal' ?
|
|
1410
|
+
const base = state.perfMode === 'normal' ? 0.5 : state.perfMode === 'degraded' ? 0.36 : 0.28;
|
|
1411
|
+
const highlight = state.perfMode === 'normal' ? 1.4 : state.perfMode === 'degraded' ? 1.05 : 0.84;
|
|
1392
1412
|
return link.__highlight ? highlight : base;
|
|
1393
1413
|
})
|
|
1394
1414
|
.linkVisibility((link) => link.__renderVisible !== false)
|
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,oCAi8DC;AAn8DD,2DAAmE;AAEnE,SAAgB,YAAY;IAC1B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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