code-kg 0.1.5 → 0.1.6
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 +35 -33
- package/dist/server/ui.js.map +1 -1
- package/package.json +1 -1
package/dist/server/ui.js
CHANGED
|
@@ -600,25 +600,27 @@ function renderUiHtml() {
|
|
|
600
600
|
};
|
|
601
601
|
|
|
602
602
|
const NODE_COLORS = {
|
|
603
|
-
file: '#
|
|
604
|
-
function: '#
|
|
605
|
-
class: '#
|
|
606
|
-
interface: '#
|
|
607
|
-
variable: '#
|
|
608
|
-
route: '#
|
|
609
|
-
directory: '#
|
|
610
|
-
entrypoint: '#
|
|
603
|
+
file: '#9cff3f',
|
|
604
|
+
function: '#bf84ff',
|
|
605
|
+
class: '#b66fff',
|
|
606
|
+
interface: '#c889ff',
|
|
607
|
+
variable: '#ab7aff',
|
|
608
|
+
route: '#73efff',
|
|
609
|
+
directory: '#8eff60',
|
|
610
|
+
entrypoint: '#ffe17a',
|
|
611
|
+
module: '#9cff3f'
|
|
611
612
|
};
|
|
612
613
|
|
|
613
614
|
const EDGE_COLORS = {
|
|
614
|
-
IMPORTS: '#
|
|
615
|
-
DEPENDS_ON: '#
|
|
616
|
-
CALLS: '#
|
|
617
|
-
REFERENCES: '#
|
|
618
|
-
HANDLES_ROUTE: '#
|
|
619
|
-
DEFINES: '#
|
|
620
|
-
EXPORTS: '#
|
|
621
|
-
CONTAINS: '#
|
|
615
|
+
IMPORTS: '#9cff3f',
|
|
616
|
+
DEPENDS_ON: '#8fe038',
|
|
617
|
+
CALLS: '#b66fff',
|
|
618
|
+
REFERENCES: '#c889ff',
|
|
619
|
+
HANDLES_ROUTE: '#73efff',
|
|
620
|
+
DEFINES: '#b176ff',
|
|
621
|
+
EXPORTS: '#8dd8ff',
|
|
622
|
+
CONTAINS: '#82cf34',
|
|
623
|
+
MODULE_DEPENDS_ON: '#9cff3f'
|
|
622
624
|
};
|
|
623
625
|
|
|
624
626
|
const els = {
|
|
@@ -654,7 +656,7 @@ function renderUiHtml() {
|
|
|
654
656
|
|
|
655
657
|
function colorForEdge(type) {
|
|
656
658
|
const key = String(type || '').toUpperCase();
|
|
657
|
-
return EDGE_COLORS[key] || '#
|
|
659
|
+
return EDGE_COLORS[key] || '#82cf34';
|
|
658
660
|
}
|
|
659
661
|
|
|
660
662
|
function isQualityMode(value) {
|
|
@@ -933,14 +935,14 @@ function renderUiHtml() {
|
|
|
933
935
|
graph.d3VelocityDecay(usingWasmLayout ? 0.9 : mode === 'normal' ? 0.28 : mode === 'degraded' ? 0.4 : 0.58);
|
|
934
936
|
}
|
|
935
937
|
if (typeof graph.nodeResolution === 'function') {
|
|
936
|
-
graph.nodeResolution(mode === 'normal' ?
|
|
938
|
+
graph.nodeResolution(mode === 'normal' ? 7 : mode === 'degraded' ? 5 : 4);
|
|
937
939
|
}
|
|
938
940
|
if (typeof graph.linkResolution === 'function') {
|
|
939
|
-
graph.linkResolution(mode === 'normal' ?
|
|
941
|
+
graph.linkResolution(mode === 'normal' ? 4 : mode === 'degraded' ? 3 : 2);
|
|
940
942
|
}
|
|
941
943
|
|
|
942
|
-
graph.linkOpacity(mode === 'normal' ? 0.
|
|
943
|
-
graph.nodeRelSize(mode === 'normal' ?
|
|
944
|
+
graph.linkOpacity(mode === 'normal' ? 0.2 : mode === 'degraded' ? 0.16 : 0.13);
|
|
945
|
+
graph.nodeRelSize(mode === 'normal' ? 1.22 : mode === 'degraded' ? 1.02 : 0.88);
|
|
944
946
|
|
|
945
947
|
if (typeof graph.d3Force === 'function') {
|
|
946
948
|
const currentCharge = graph.d3Force('charge');
|
|
@@ -1045,7 +1047,7 @@ function renderUiHtml() {
|
|
|
1045
1047
|
type,
|
|
1046
1048
|
path,
|
|
1047
1049
|
props: node.props || {},
|
|
1048
|
-
baseVal:
|
|
1050
|
+
baseVal: 0.86 + Math.min(3.4, d * 0.12),
|
|
1049
1051
|
__color: colorForNode(type),
|
|
1050
1052
|
__searchText: (String(name) + ' ' + String(path) + ' ' + String(type)).toLowerCase(),
|
|
1051
1053
|
__matched: false,
|
|
@@ -1074,9 +1076,9 @@ function renderUiHtml() {
|
|
|
1074
1076
|
}
|
|
1075
1077
|
|
|
1076
1078
|
const graph = window.ForceGraph3D()(els.graphCanvas)
|
|
1077
|
-
.backgroundColor('#
|
|
1079
|
+
.backgroundColor('#01040f')
|
|
1078
1080
|
.showNavInfo(false)
|
|
1079
|
-
.nodeOpacity(0.
|
|
1081
|
+
.nodeOpacity(0.92)
|
|
1080
1082
|
.nodeVisibility((node) => node.__renderVisible !== false)
|
|
1081
1083
|
.nodeLabel((node) => {
|
|
1082
1084
|
const name = String(node.name || node.id || 'node');
|
|
@@ -1086,10 +1088,10 @@ function renderUiHtml() {
|
|
|
1086
1088
|
})
|
|
1087
1089
|
.nodeColor((node) => {
|
|
1088
1090
|
if (node.__selected) {
|
|
1089
|
-
return '#
|
|
1091
|
+
return '#ff46d9';
|
|
1090
1092
|
}
|
|
1091
1093
|
if (node.__matched) {
|
|
1092
|
-
return '#
|
|
1094
|
+
return '#f3ff77';
|
|
1093
1095
|
}
|
|
1094
1096
|
return node.__color || '#d5f4ff';
|
|
1095
1097
|
})
|
|
@@ -1099,23 +1101,23 @@ function renderUiHtml() {
|
|
|
1099
1101
|
})
|
|
1100
1102
|
.linkColor((link) => {
|
|
1101
1103
|
if (link.__highlight) {
|
|
1102
|
-
return '#
|
|
1104
|
+
return '#f3ff77';
|
|
1103
1105
|
}
|
|
1104
|
-
return link.__color || '#
|
|
1106
|
+
return link.__color || '#82cf34';
|
|
1105
1107
|
})
|
|
1106
1108
|
.linkWidth((link) => {
|
|
1107
|
-
const base = state.perfMode === 'normal' ? 0.
|
|
1108
|
-
const highlight = state.perfMode === 'normal' ?
|
|
1109
|
+
const base = state.perfMode === 'normal' ? 0.22 : state.perfMode === 'degraded' ? 0.18 : 0.14;
|
|
1110
|
+
const highlight = state.perfMode === 'normal' ? 0.9 : state.perfMode === 'degraded' ? 0.66 : 0.54;
|
|
1109
1111
|
return link.__highlight ? highlight : base;
|
|
1110
1112
|
})
|
|
1111
1113
|
.linkVisibility((link) => link.__renderVisible !== false)
|
|
1112
1114
|
.linkDirectionalParticles((link) => {
|
|
1113
|
-
return link.__highlight ? (state.perfMode === 'normal' ?
|
|
1115
|
+
return link.__highlight ? (state.perfMode === 'normal' ? 2 : 1) : 0;
|
|
1114
1116
|
})
|
|
1115
1117
|
.linkDirectionalParticleWidth((link) => {
|
|
1116
|
-
return link.__highlight ? (state.perfMode === 'normal' ?
|
|
1118
|
+
return link.__highlight ? (state.perfMode === 'normal' ? 1.3 : 0.95) : 0;
|
|
1117
1119
|
})
|
|
1118
|
-
.linkDirectionalParticleColor(() => '#
|
|
1120
|
+
.linkDirectionalParticleColor(() => '#f3ff77')
|
|
1119
1121
|
.onNodeClick((node) => {
|
|
1120
1122
|
if (!node || !node.id) {
|
|
1121
1123
|
return;
|
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,oCAqkDC;AAvkDD,2DAAmE;AAEnE,SAAgB,YAAY;IAC1B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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