helixmind 0.2.21 → 0.2.22
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../src/cli/brain/template.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../src/cli/brain/template.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CA07D3D"}
|
|
@@ -436,9 +436,15 @@ canvas { display: block; }
|
|
|
436
436
|
<div class="control-group">
|
|
437
437
|
<label>Relations</label>
|
|
438
438
|
<span class="toggle-btn active" data-edge="all">All</span>
|
|
439
|
-
<span class="toggle-btn" data-edge="
|
|
439
|
+
<span class="toggle-btn" data-edge="references">Refs</span>
|
|
440
440
|
<span class="toggle-btn" data-edge="depends_on">Depends</span>
|
|
441
441
|
<span class="toggle-btn" data-edge="related_to">Related</span>
|
|
442
|
+
<span class="toggle-btn" data-edge="evolved_from">Evolved</span>
|
|
443
|
+
<span class="toggle-btn" data-edge="supports">Supports</span>
|
|
444
|
+
<span class="toggle-btn" data-edge="extends">Extends</span>
|
|
445
|
+
<span class="toggle-btn" data-edge="implements">Impl</span>
|
|
446
|
+
<span class="toggle-btn" data-edge="uses">Uses</span>
|
|
447
|
+
<span class="toggle-btn" data-edge="imports">Imports</span>
|
|
442
448
|
</div>
|
|
443
449
|
</div>
|
|
444
450
|
|
|
@@ -582,14 +588,17 @@ const EDGE_COLORS = {
|
|
|
582
588
|
belongs_to: '#ff6600', part_of: '#ff6600', supersedes: '#ff4444',
|
|
583
589
|
default: '#334466',
|
|
584
590
|
};
|
|
591
|
+
// 6 clearly separated horizontal layers — like floors of a building
|
|
592
|
+
// yBase has LARGE gaps (200 units), yS is SMALL (tight layer thickness)
|
|
585
593
|
const SPATIAL = {
|
|
586
|
-
5: { iR:
|
|
587
|
-
4: { iR:
|
|
588
|
-
3: { iR:
|
|
589
|
-
2: { iR:
|
|
590
|
-
1: { iR:
|
|
591
|
-
6: { iR:
|
|
594
|
+
5: { iR: 40, oR: 160, yBase: 500, yS: 30, size: 48, pulse: 0.3 },
|
|
595
|
+
4: { iR: 60, oR: 220, yBase: 300, yS: 35, size: 40, pulse: 0.5 },
|
|
596
|
+
3: { iR: 80, oR: 280, yBase: 100, yS: 40, size: 34, pulse: 0.8 },
|
|
597
|
+
2: { iR: 100, oR: 340, yBase: -100, yS: 40, size: 28, pulse: 1.2 },
|
|
598
|
+
1: { iR: 120, oR: 400, yBase: -300, yS: 45, size: 22, pulse: 2.0 },
|
|
599
|
+
6: { iR: 140, oR: 460, yBase: -500, yS: 45, size: 30, pulse: 0.6 },
|
|
592
600
|
};
|
|
601
|
+
const MAX_RENDERED_EDGES = 8000; // cap for performance + clarity
|
|
593
602
|
|
|
594
603
|
function srand(s) { const x = Math.sin(s * 9301 + 49297) * 49297; return x - Math.floor(x); }
|
|
595
604
|
function escapeHtml(s) { return s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>'); }
|
|
@@ -602,19 +611,19 @@ document.body.prepend(renderer.domElement);
|
|
|
602
611
|
|
|
603
612
|
const scene = new THREE.Scene();
|
|
604
613
|
scene.background = new THREE.Color('#030308');
|
|
605
|
-
scene.fog = new THREE.FogExp2('#030308', 0.
|
|
614
|
+
scene.fog = new THREE.FogExp2('#030308', 0.00025);
|
|
606
615
|
|
|
607
|
-
const camera = new THREE.PerspectiveCamera(50, window.innerWidth / window.innerHeight, 1,
|
|
608
|
-
camera.position.set(
|
|
616
|
+
const camera = new THREE.PerspectiveCamera(50, window.innerWidth / window.innerHeight, 1, 12000);
|
|
617
|
+
camera.position.set(600, 400, 900);
|
|
609
618
|
|
|
610
619
|
const controls = new OrbitControls(camera, renderer.domElement);
|
|
611
|
-
controls.target.set(0,
|
|
620
|
+
controls.target.set(0, 0, 0);
|
|
612
621
|
controls.enableDamping = true;
|
|
613
622
|
controls.dampingFactor = 0.06;
|
|
614
623
|
controls.autoRotate = true;
|
|
615
624
|
controls.autoRotateSpeed = 0.08;
|
|
616
625
|
controls.minDistance = 80;
|
|
617
|
-
controls.maxDistance =
|
|
626
|
+
controls.maxDistance = 4000;
|
|
618
627
|
controls.maxPolarAngle = Math.PI * 0.85;
|
|
619
628
|
controls.minPolarAngle = Math.PI * 0.15;
|
|
620
629
|
controls.update();
|
|
@@ -805,11 +814,21 @@ function rebuildScene() {
|
|
|
805
814
|
scene.add(nodePoints);
|
|
806
815
|
|
|
807
816
|
// ---- EDGES (LineSegments) ----
|
|
808
|
-
|
|
817
|
+
// Prioritize cross-level edges (vertical) over intra-level (horizontal)
|
|
818
|
+
const allEdges = [];
|
|
809
819
|
BRAIN_DATA.edges.forEach((e, i) => {
|
|
810
820
|
const si = nodeIdxMap[e.source], ti = nodeIdxMap[e.target];
|
|
811
|
-
if (si !== undefined && ti !== undefined)
|
|
821
|
+
if (si !== undefined && ti !== undefined) {
|
|
822
|
+
const crossLevel = nodes[si].level !== nodes[ti].level;
|
|
823
|
+
allEdges.push({ si, ti, weight: e.weight, type: e.type, idx: i, crossLevel });
|
|
824
|
+
}
|
|
825
|
+
});
|
|
826
|
+
// Sort: cross-level edges first (they create the beautiful vertical connections)
|
|
827
|
+
allEdges.sort((a, b) => {
|
|
828
|
+
if (a.crossLevel !== b.crossLevel) return b.crossLevel ? 1 : -1;
|
|
829
|
+
return b.weight - a.weight; // then by weight
|
|
812
830
|
});
|
|
831
|
+
validEdges = allEdges.slice(0, MAX_RENDERED_EDGES);
|
|
813
832
|
|
|
814
833
|
eCount = validEdges.length;
|
|
815
834
|
const ePos = new Float32Array(eCount * 6);
|
|
@@ -817,8 +836,11 @@ function rebuildScene() {
|
|
|
817
836
|
const eAlpha = new Float32Array(eCount * 2);
|
|
818
837
|
const sc = new THREE.Color(), dc = new THREE.Color();
|
|
819
838
|
|
|
839
|
+
// Scale alpha down when there are many edges
|
|
840
|
+
const alphaScale = Math.min(1.0, 3000 / eCount);
|
|
841
|
+
|
|
820
842
|
for (let i = 0; i < eCount; i++) {
|
|
821
|
-
const { si, ti, weight } = validEdges[i];
|
|
843
|
+
const { si, ti, weight, crossLevel } = validEdges[i];
|
|
822
844
|
const s = positions[si], t = positions[ti];
|
|
823
845
|
const o = i * 6;
|
|
824
846
|
ePos[o] = s.x; ePos[o + 1] = s.y; ePos[o + 2] = s.z;
|
|
@@ -827,8 +849,10 @@ function rebuildScene() {
|
|
|
827
849
|
dc.set(LEVEL_COLORS_HEX[nodes[ti].level] || 0x00FFFF);
|
|
828
850
|
eCol[o] = sc.r; eCol[o + 1] = sc.g; eCol[o + 2] = sc.b;
|
|
829
851
|
eCol[o + 3] = dc.r; eCol[o + 4] = dc.g; eCol[o + 5] = dc.b;
|
|
830
|
-
|
|
831
|
-
|
|
852
|
+
// Cross-level edges brighter, intra-level edges dimmer
|
|
853
|
+
const baseAlpha = crossLevel ? (0.08 + weight * 0.12) : (0.03 + weight * 0.04);
|
|
854
|
+
eAlpha[i * 2] = baseAlpha * alphaScale;
|
|
855
|
+
eAlpha[i * 2 + 1] = baseAlpha * alphaScale;
|
|
832
856
|
}
|
|
833
857
|
|
|
834
858
|
edgeGeo = new THREE.BufferGeometry();
|
|
@@ -838,14 +862,17 @@ function rebuildScene() {
|
|
|
838
862
|
edgeLines = new THREE.LineSegments(edgeGeo, edgeMat);
|
|
839
863
|
scene.add(edgeLines);
|
|
840
864
|
|
|
841
|
-
// ---- FLOWING PARTICLES ----
|
|
865
|
+
// ---- FLOWING PARTICLES (only on cross-level edges for clarity) ----
|
|
842
866
|
pData = [];
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
867
|
+
const maxParticleEdges = Math.min(eCount, 2000);
|
|
868
|
+
for (let i = 0; i < maxParticleEdges; i++) {
|
|
869
|
+
const { si, ti, weight, crossLevel } = validEdges[i];
|
|
870
|
+
if (!crossLevel) continue; // only particles on vertical connections
|
|
871
|
+
const particleCount = weight > 0.6 ? 2 : 1;
|
|
872
|
+
for (let j = 0; j < particleCount; j++) {
|
|
846
873
|
pData.push({
|
|
847
874
|
edgeIdx: i, progress: srand(i * 100 + j * 31),
|
|
848
|
-
speed: 0.
|
|
875
|
+
speed: 0.15 + weight * 0.4 + srand(i * 70 + j * 17) * 0.1,
|
|
849
876
|
srcIdx: si, tgtIdx: ti
|
|
850
877
|
});
|
|
851
878
|
}
|
|
@@ -982,16 +1009,22 @@ function updateHighlights() {
|
|
|
982
1009
|
|
|
983
1010
|
// Edge highlights
|
|
984
1011
|
const activeEdgeTypes = getActiveEdgeTypes();
|
|
1012
|
+
const alphaS = Math.min(1.0, 3000 / eCount);
|
|
985
1013
|
for (let i = 0; i < eCount; i++) {
|
|
986
|
-
const { si, ti, weight, type } = validEdges[i];
|
|
987
|
-
|
|
1014
|
+
const { si, ti, weight, type, crossLevel } = validEdges[i];
|
|
1015
|
+
const baseA = crossLevel ? (0.08 + weight * 0.12) : (0.03 + weight * 0.04);
|
|
1016
|
+
let a = baseA * alphaS;
|
|
1017
|
+
|
|
1018
|
+
// Level toggle: hide edges connected to hidden levels
|
|
1019
|
+
const sLv = nodes[si].level, tLv = nodes[ti].level;
|
|
1020
|
+
if (levelToggles[sLv] === false || levelToggles[tLv] === false) { a = 0; ea.array[i * 2] = 0; ea.array[i * 2 + 1] = 0; continue; }
|
|
988
1021
|
|
|
989
1022
|
// Edge type filter
|
|
990
1023
|
if (activeEdgeTypes !== null && !activeEdgeTypes.has(type)) { a = 0; }
|
|
991
1024
|
|
|
992
1025
|
if (hasFocus) {
|
|
993
1026
|
const connected = (si === selectedIdx || ti === selectedIdx);
|
|
994
|
-
a = connected ? 0.4 + weight * 0.3 : 0.
|
|
1027
|
+
a = connected ? 0.4 + weight * 0.3 : 0.01;
|
|
995
1028
|
}
|
|
996
1029
|
if (hoveredIdx >= 0) {
|
|
997
1030
|
const connected = (si === hoveredIdx || ti === hoveredIdx);
|
|
@@ -1000,7 +1033,7 @@ function updateHighlights() {
|
|
|
1000
1033
|
if (hasSearch) {
|
|
1001
1034
|
const sm = nodes[si].label.toLowerCase().includes(searchQuery);
|
|
1002
1035
|
const tm = nodes[ti].label.toLowerCase().includes(searchQuery);
|
|
1003
|
-
if (!sm && !tm) a = 0.
|
|
1036
|
+
if (!sm && !tm) a = 0.01;
|
|
1004
1037
|
}
|
|
1005
1038
|
ea.array[i * 2] = a;
|
|
1006
1039
|
ea.array[i * 2 + 1] = a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/cli/brain/template.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,iBAAiB,CAAC,IAAiB;IACjD,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAEtC,OAAO;;;;;;0CAMiC,IAAI,CAAC,IAAI,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAsZxB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