0.0.4 • Published 1 year ago

@receptron/graphai_vue_cytoscape v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Composable to show GraphAI state to Vue using cytoscape

install

yarn add @receptron/graphai_vue_cytoscape

Usage

import { defineComponent, ref } from "vue";

import { GraphAI } from "graphai";
import { useCytoscape } from "@receptron/graphai_vue_cytoscape";

export default defineComponent({
  setup() {
    const selectdGraph = ref(graphData)
    const { updateCytoscape, cytoscapeRef, resetCytoscape } = useCytoscape(selectdGraph);
    
    const run = async () => {
      const graphai = new GraphAI(selectdGraph.value, agents);
      graphai.onLogCallback = async ({ nodeId, state }) => {
        updateCytoscape(nodeId, state);
      };
      await graphai.run();
    }
    run();

    return {
      cytoscapeRef
    };
  }
});
0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago