@kinetica/kinetica-graph-viz
TypeScript icon, indicating that this package has built-in type declarations

1.0.29 • Public • Published

Kinetica Graph Visualization Library

Visualize graph data fom a Kinetica database

Installation

npm install --save @kinetica/kinetica-graph-viz

Usage

npm

import KineticaGraphViz from "@kinetica/kinetica-graph-viz";
const kGraphViz = new KineticaGraphViz("my_graph");

kGraphViz
  .connect("http://127.0.0.1:9191", {
    username: "admin",
    password: "password",
  })
  .nodes("graph.social_ids_nodes", ["id", "name"])
  .edges("graph.social_ids_edges", ["node1", "node2"])
  .limit(1000)
  .graph((graph) => {
    graph
      .cooldownTicks(50)
      .backgroundColor("#00000000")
      .nodeVal(() => Math.random() * 15)
      .nodeLabel((node) => `Node ${node.id}`)
      .nodeColor(() => (Math.random() > 0.5 ? "#4c00b0" : "#FF00FF"))
      .linkColor(() => (Math.random() > 0.5 ? "#4c00b0" : "#FF00FF"))
      .linkWidth(2);
  })
  .render();

self-host/cdn

<script src="build/index.js"></script>;

const KineticaGraphViz = window.KineticaGraphViz.default;
const kGraphViz = new KineticaGraphViz("my_graph");

kGraphViz
  .connect("http://127.0.0.1:9191", {
    username: "admin",
    password: "password",
  })
  .data("graph.nodes_edges", ["EDGE_NODE1_ID", "EDGE_NODE2_ID"])
  .limit(1000)
  .graph((graph) => {
    graph
      .cooldownTicks(50)
      .backgroundColor("#00000000")
      .nodeVal(() => Math.random() * 15)
      .nodeLabel((node) => `Node ${node.id}`)
      .nodeColor(() => (Math.random() > 0.5 ? "#4c00b0" : "#FF00FF"))
      .linkColor(() => (Math.random() > 0.5 ? "#4c00b0" : "#FF00FF"))
      .linkWidth(2);
  })
  .render();

Readme

Keywords

Package Sidebar

Install

npm i @kinetica/kinetica-graph-viz

Weekly Downloads

499

Version

1.0.29

License

MIT

Unpacked Size

3.96 MB

Total Files

8

Last publish

Collaborators

  • pkhunachak
  • eglaser
  • jhutchinskinetica
  • kyle.sutton