@gephi/gephi-lite-broadcast
TypeScript icon, indicating that this package has built-in type declarations

0.6.1 • Public • Published

@gephi/gephi-lite-broadcast

The package @gephi/gephi-lite-broadcast is a browser TypeScript library to control a Gephi Lite instance using the Broadcast Channel API.

It exports a Driver class, that exposes various asynchronous methods to help feed Gephi Lite data, appearance settings, filters...

Here is a simple example to import a Graphology graph in Gephi Lite in a new tab:

import { GephiLiteDriver } from "@gephi/gephi-lite-broadcast";
import Graph from "graphology";

async function openGraphInGephiLite(graph: Graph) {
  const driver = new GephiLiteDriver();

  await new Promise<void>((resolve) => {
    // Wait for new instance to be fully working:
    driver.on("newInstance", () => {
      resolve();
    });
    driver.openGephiLite();
  });

  await driver.importGraph(graph.toJSON());

  driver.destroy();
}

TODO

1. Data update/reading:

  • [x] getGraph(): SerializedFullGraph / importGraph(graph: FullGraph)
  • [x] setGraphDataset / getGraphDataset / mergeGraphDataset
  • [x] setGraphAppearance / getGraphAppearance / mergeGraphAppearance
  • [x] setFilters / getFilters
  • [ ] setSelection / getSelection

2. Other methods:

  • [x] ping (to check broadcast status)
  • [x] getVersion
  • [ ] zoomToNodes / resetZoom
  • [ ] computeMetric
  • [ ] computeLayout / startLayout / stopLayout
  • [ ] notify
  • [ ] exportGraph
  • [ ] methods to handle UI elements (right panel, left tabs, caption, fullscreen)

3. Events

  • [x] instanceCreation
  • [ ] graphUpdate
  • [ ] graphModelUpdate
  • [ ] graphAppearanceUpdate
  • [ ] filtersUpdate
  • [ ] selectionUpdate

Readme

Keywords

none

Package Sidebar

Install

npm i @gephi/gephi-lite-broadcast

Weekly Downloads

2

Version

0.6.1

License

gpl-3.0

Unpacked Size

113 kB

Total Files

13

Last publish

Collaborators

  • jacomyal