code-kg 0.1.4 → 0.1.5
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 +9 -2
- package/dist/server/ui.js.map +1 -1
- package/package.json +1 -1
package/dist/server/ui.js
CHANGED
|
@@ -799,12 +799,14 @@ function renderUiHtml() {
|
|
|
799
799
|
return false;
|
|
800
800
|
}
|
|
801
801
|
|
|
802
|
-
|
|
802
|
+
let memoryBuffer = wasm.memory && wasm.memory.buffer ? wasm.memory.buffer : null;
|
|
803
803
|
if (!memoryBuffer) {
|
|
804
804
|
return false;
|
|
805
805
|
}
|
|
806
806
|
|
|
807
|
-
|
|
807
|
+
if (edgeArray.length > 0) {
|
|
808
|
+
new Uint32Array(memoryBuffer, edgePtr, edgeArray.length).set(edgeArray);
|
|
809
|
+
}
|
|
808
810
|
const seed = stableHash(seedText || state.view || 'codekg');
|
|
809
811
|
const status = wasm.layout_graph(
|
|
810
812
|
state.graphData.nodes.length,
|
|
@@ -819,6 +821,11 @@ function renderUiHtml() {
|
|
|
819
821
|
return false;
|
|
820
822
|
}
|
|
821
823
|
|
|
824
|
+
// Rust allocations inside layout_graph can grow memory, so always re-read the buffer.
|
|
825
|
+
memoryBuffer = wasm.memory && wasm.memory.buffer ? wasm.memory.buffer : null;
|
|
826
|
+
if (!memoryBuffer) {
|
|
827
|
+
return false;
|
|
828
|
+
}
|
|
822
829
|
const positions = new Float32Array(memoryBuffer, outPtr, outCount);
|
|
823
830
|
for (let index = 0; index < state.graphData.nodes.length; index += 1) {
|
|
824
831
|
const node = state.graphData.nodes[index];
|
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,oCAmkDC;AArkDD,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