npm

@receptron/graphai_vue_cytoscape
TypeScript icon, indicating that this package has built-in type declarations

0.0.11 • Public • Published

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
    };
  }
});

Readme

Keywords

none

Package Sidebar

Install

npm i @receptron/graphai_vue_cytoscape

Weekly Downloads

222

Version

0.0.11

License

MIT

Unpacked Size

104 kB

Total Files

15

Last publish

Collaborators

  • snakajima
  • isamu