npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pmsite/chronograph

v0.3.0

Published

Reactive state management and scheduling engine for Gantt charts - WASM powered

Downloads

285

Readme

@pmsite/chronograph

A reactive state management and scheduling engine for Gantt charts, powered by Rust and WebAssembly.

Features

  • Reactive Computation Engine: Variables, computed identifiers, automatic dependency tracking
  • Undo/Redo: Built-in transaction history with configurable depth
  • CPM Scheduling: Critical Path Method with forward/backward pass
  • Calendar Support: Working days, hours, holidays, and exceptions
  • Resource Shifts: Define shift patterns (morning, evening, custom) for resources
  • Resource Leveling: Automatic conflict resolution with multiple strategies
  • Custom Fields: User-defined fields with type validation for tasks, resources, and projects
  • Project Save/Load: Export and import complete project state as JSON
  • High Performance: Rust-compiled WASM for near-native speed

Installation

npm install @pmsite/chronograph

Quick Start

Reactive State Management

import init, { ChronoGraph, ChronoGraphConfig } from '@pmsite/chronograph';

await init();

const config = new ChronoGraphConfig();
config.historyLimit = 50;
const graph = new ChronoGraph(config);

// Create reactive variables
const x = graph.variableNamed('x', 10);
const y = graph.variableNamed('y', 20);

// Create computed value
const sum = graph.identifierNamed('sum', () => {
  return graph.readVariable(x) + graph.readVariable(y);
});

console.log(graph.readIdentifier(sum)); // 30

graph.writeVariable(x, 15);
console.log(graph.readIdentifier(sum)); // 35

// Undo/Redo
graph.undo();
console.log(graph.readIdentifier(sum)); // 30

Project Scheduling

import init, { WasmSchedulingEngine } from '@pmsite/chronograph';

await init();

const engine = new WasmSchedulingEngine();
engine.setProjectStart(Date.now());

// Add calendar with holidays
engine.addCalendar(1, 'Work Calendar');
engine.addCalendarException(1, {
  date: 1703462400000,
  is_working: false,
  name: 'Christmas'
});
engine.setProjectCalendar(1);

// Add tasks
engine.addTask({ id: 1, name: 'Design', duration: 432000000 });
engine.addTask({ id: 2, name: 'Development', duration: 864000000 });

// Add dependency
engine.addDependency({
  id: 1,
  predecessor_id: 1,
  successor_id: 2,
  dependency_type: 'FS'
});

// Calculate CPM (respects calendar)
engine.calculateCpmWithCalendar();

// Get results
const criticalPath = engine.getCriticalPath();
const stats = engine.getProjectStats();

Save and Load Projects

// Export project to JSON
const projectData = engine.exportProject();
localStorage.setItem('myProject', JSON.stringify(projectData));

// Import project from JSON
const saved = JSON.parse(localStorage.getItem('myProject'));
engine.importProject(saved);
engine.calculateCpmWithCalendar(); // Recalculate CPM after load

// Clear all project data
engine.clearProject();

Resource Shifts

Define shift patterns for resources to control their working hours:

// Define shifts
const morningShift = engine.addShift({
  id: 1,
  name: 'Morning Shift',
  intervals: [{ start_hour: 6, start_min: 0, end_hour: 14, end_min: 0 }]
});

const eveningShift = engine.addShift({
  id: 2,
  name: 'Evening Shift',
  intervals: [{ start_hour: 14, start_min: 0, end_hour: 22, end_min: 0 }]
});

// Add resource
engine.addResource({ id: 1, name: 'Worker', max_units: 100 });

// Assign shift pattern: Mon-Wed morning, Thu-Fri evening, weekends use calendar
engine.setResourceShiftPattern(1, [
  morningShift,   // Monday
  morningShift,   // Tuesday
  morningShift,   // Wednesday
  eveningShift,   // Thursday
  eveningShift,   // Friday
  null,           // Saturday (use calendar default)
  null            // Sunday (use calendar default)
]);

API Reference

See chronograph_api.md for complete API documentation.

Building from Source

# Install wasm-pack
cargo install wasm-pack

# Build WASM package
npm run build

# Run tests
npm test

License

Proprietary - All rights reserved