@receptron/graphai_vue_cytoscape 0.0.17 → 0.2.0
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/README.md +4 -3
- package/lib/cytoscape.d.ts +2 -2
- package/lib/cytoscape.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,9 +23,7 @@ export default defineComponent({
|
|
|
23
23
|
|
|
24
24
|
const run = async () => {
|
|
25
25
|
const graphai = new GraphAI(selectdGraph.value, agents);
|
|
26
|
-
graphai.
|
|
27
|
-
updateCytoscape(nodeId, state);
|
|
28
|
-
};
|
|
26
|
+
graphai.registerCallback(updateCytoscape);
|
|
29
27
|
await graphai.run();
|
|
30
28
|
}
|
|
31
29
|
run();
|
|
@@ -37,3 +35,6 @@ export default defineComponent({
|
|
|
37
35
|
});
|
|
38
36
|
```
|
|
39
37
|
|
|
38
|
+
### requirement
|
|
39
|
+
|
|
40
|
+
GraphAI 0.6.23 or above
|
package/lib/cytoscape.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Ref, ComputedRef } from "vue";
|
|
2
|
-
import { GraphData,
|
|
2
|
+
import { GraphData, TransactionLog } from "graphai";
|
|
3
3
|
import { DataSource } from "graphai/lib/type";
|
|
4
4
|
export declare const inputs2dataSources: (inputs: any) => string[];
|
|
5
5
|
export declare const dataSourceNodeIds: (sources: DataSource[]) => string[];
|
|
6
6
|
export declare const useCytoscape: (selectedGraph: ComputedRef<GraphData> | Ref<GraphData>) => {
|
|
7
7
|
cytoscapeRef: Ref<any, any>;
|
|
8
|
-
updateCytoscape: (
|
|
8
|
+
updateCytoscape: (log: TransactionLog) => Promise<void>;
|
|
9
9
|
resetCytoscape: () => void;
|
|
10
10
|
layoutCytoscape: (key: string) => void;
|
|
11
11
|
loadLayout: (key: string) => void;
|
package/lib/cytoscape.js
CHANGED
|
@@ -270,12 +270,13 @@ var useCytoscape = function (selectedGraph) {
|
|
|
270
270
|
var cytoscapeData = (0, vue_1.ref)(cytoscapeFromGraph((_a = selectedGraph.value) !== null && _a !== void 0 ? _a : { nodes: {} }));
|
|
271
271
|
var cytoscapeRef = (0, vue_1.ref)();
|
|
272
272
|
var zoomingEnabled = (0, vue_1.ref)(true);
|
|
273
|
-
var updateCytoscape = function (
|
|
274
|
-
var elements, graph, nodeData;
|
|
273
|
+
var updateCytoscape = function (log) { return __awaiter(void 0, void 0, void 0, function () {
|
|
274
|
+
var nodeId, state, elements, graph, nodeData;
|
|
275
275
|
var _a, _b, _c;
|
|
276
276
|
return __generator(this, function (_d) {
|
|
277
277
|
switch (_d.label) {
|
|
278
278
|
case 0:
|
|
279
|
+
nodeId = log.nodeId, state = log.state;
|
|
279
280
|
if (![graphai_1.NodeState.Completed, graphai_1.NodeState.Waiting].includes(state)) return [3 /*break*/, 2];
|
|
280
281
|
return [4 /*yield*/, (0, graphai_1.sleep)(100)];
|
|
281
282
|
case 1:
|