Skip to content

lukelowry/latkit

Repository files navigation

Latkit visualization banner

Latkit

CI Documentation Status

Latkit is a TypeScript package family for interactive, browser-based WebGPU visualization of network topology and time-series data.

Documentation · Getting started · API reference · Examples

Packages

Install only the packages your application needs.

Package Description
@latkit/network Interactive WebGPU network topology views
@latkit/monitor WebGPU time-series and signal monitor views
@latkit/gpu Core WebGPU device and canvas presentation primitives
@latkit/colormaps Named colormaps, labels, and CSS gradient helpers
@latkit/model Shared model primitives for the Latkit package family

Requirements

  • A WebGPU-capable browser for @latkit/network and @latkit/monitor
  • An ESM-capable bundler or development server
  • Node.js 22 or newer when developing Latkit locally

Installation

For network visualization:

npm install @latkit/gpu @latkit/network @latkit/colormaps

For monitor visualization:

npm install @latkit/gpu @latkit/monitor @latkit/colormaps

Quick start

import { colormap } from '@latkit/colormaps';
import { requestDevice } from '@latkit/gpu';
import { createNetwork, type Topology } from '@latkit/network';

const canvas = document.querySelector<HTMLCanvasElement>('#network');
if (!canvas) {
  throw new Error('Missing #network canvas.');
}

const topology: Topology = {
  vertexCount: 3,
  vertexCoords: new Float32Array([-96, 30, -95, 31, -94, 30]),
  edges: new Uint32Array([0, 1, 1, 2]),
  polylineStart: new Uint32Array([0, 0, 0]),
};

const device = await requestDevice();
const network = await createNetwork(device, canvas, {
  colormap: colormap('viridis'),
  graticule: true,
});

network.load(topology);
network.setChannel('vertexColor', new Float32Array([0.1, 0.8, 0.4]), [0, 1]);
network.fadeIn();

See the network quickstart and monitor quickstart for complete usage and lifecycle guidance.

Examples

Install the workspace dependencies, then run either example in a WebGPU-capable browser:

pnpm install
pnpm --filter @latkit/network-example dev
pnpm --filter @latkit/monitor-example dev

The network example runs at http://127.0.0.1:5188; the monitor example runs at http://127.0.0.1:5190.

Documentation

The full guides and generated TypeScript API reference are published on Read the Docs. Documentation sources live in docs/ and use MyST Markdown with Sphinx.

Build the documentation locally with:

pnpm docs:build

Development

pnpm install
pnpm quality

The quality command checks formatting, linting, types, and tests across the workspace. See the release process for package publishing details.

Related work

Selected related projects include:

Author

Latkit is developed by Luke Lowery and began during his PhD studies at Texas A&M University. See his Google Scholar profile for publications and the author page for more information.

License

Latkit packages are released under the MIT License.

About

WebGPU Power System Visualization

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors