ESPlot
⚠️ Experimental - This project is experimental and not feature complete, but the base functionality works.
ESPlot is a data visualization library that combines TypeScript/Node.js chart creation with a native desktop viewer. It allows you to programmatically generate charts using a simple API and display them in a dedicated viewer application.
This package is part of the Weave monorepo and can be built using the centralized build system from the project root.
How It Works
ESPlot consists of two main components:
- Core Library (TypeScript/Node.js): Provides functions for creating charts (bar charts, word clouds, etc.) using Chart.js
- Viewer (Go): A native desktop application that displays the generated charts in real-time
The workflow is:
- Your TypeScript/Node.js code calls chart functions like
barChart()
- The library bundles the chart code using Vite
- The bundled code is sent to the viewer via HTTP
- The viewer displays the chart in a native window
- Multiple charts can be viewed with tabs
Setup
Quick Start
The easiest way to use ESPlot is to add it as a dependency to your project. The pre-built viewer binaries are included in the package:
npm install @arcmantle/esplot
pnpm add @arcmantle/esplot
yarn add @arcmantle/esplot
Then you can directly start creating charts:
import { barChart } from '@arcmantle/esplot';
await barChart(
{ year: 2020, count: 10 },
{ year: 2021, count: 20 },
{ year: 2022, count: 15 }
);
Development Setup
If you want to build from source or contribute to the project:
Prerequisites
- Node.js with TypeScript support
- Go (latest version recommended)
- pnpm (recommended package manager for the monorepo)
Building from Source
ESPlot is part of a larger monorepo. You can build it from the project root:
pnpm build-package @arcmantle/esplot
pnpm build
Building Individual Components
If you need to build components separately:
cd packages/core/esplot
pnpm build
pnpm build-ts
pnpm build-viewer-windows
pnpm build-viewer-macos
Running the Demo
pnpm build
node demo/index.ts
Usage
import { barChart } from '@arcmantle/esplot';
await barChart(
{ year: 2020, count: 10 },
{ year: 2021, count: 20 },
{ year: 2022, count: 15 }
);
The chart will automatically open in the ESPlot viewer window.
Features
- Real-time chart display in native desktop window
- Multiple chart support with tabbed interface
- Built on Chart.js for rich visualization capabilities
- TypeScript support with simple API
- Cross-platform (Windows and macOS)
Current Chart Types
- Bar charts
- Word clouds (experimental)