@gregorian09/chart-system
v0.2.0
Published
Browser and Node bindings for the Point & Figure chart system WebAssembly core.
Maintainers
Readme
@gregorian09/chart-system
Browser and Node package for the Point & Figure C++ core compiled to WebAssembly.
What Is New In 0.2.0
- First TypeScript/WASM package for dashboard and browser workflows.
ChartandIndicatorswrappers around the native C++ core.- Native plot export helpers: SVG, PNG, standalone HTML, and Plotly JSON.
- Integer timestamp ABI preserved with Emscripten BigInt support.
- Release banner: version sync, docs coverage,
npm run build:wasm,npm run build, andnpm run checkare part of release readiness.
Advanced scanner, ML feature extraction, local data adapters, and walk-forward optimization are available in the native/Python/Java/Rust/C# bindings. The JS package focuses on browser-safe chart construction, indicator calculation, and chart export.
Install
npm install @gregorian09/chart-systemEnd-To-End Workflow
import createPnfModule from "./pnf_wasm.js";
import {
Chart,
Indicators,
exportHtml,
exportPlotlyJson,
exportPng,
exportSvg,
initPnf,
} from "@gregorian09/chart-system";
await initPnf(createPnfModule, {
locateFile: (file) => new URL(`./${file}`, import.meta.url).toString(),
});
const chart = await Chart.create({
method: "high_low",
boxSizeMethod: "traditional",
reversal: 3,
});
const indicators = await Indicators.create();
try {
chart.addBar({ timestamp: 1700000000, open: 1.0720, high: 1.0740, low: 1.0710, close: 1.0730, volume: 1000 });
chart.addBar({ timestamp: 1700003600, open: 1.0730, high: 1.0780, low: 1.0720, close: 1.0770, volume: 1200 });
chart.addPrice(1.0790, 1700007200);
indicators.calculate(chart);
const svg = await exportSvg(chart, indicators);
const png = await exportPng(chart, indicators);
const html = await exportHtml(chart, indicators);
const plotly = JSON.parse(await exportPlotlyJson(chart, indicators));
console.log(chart.columnCount(), chart.boxSize(), svg.length, png.length, html.length, plotly.data.length);
} finally {
indicators.dispose();
chart.dispose();
}API Map
initPnf(factory, options)Chart.create,addBar,addPrice,columnCount,boxSize,toAscii,toJson,disposeIndicators.create,calculate,summary,disposeexportSvg,exportPng,exportHtml,exportPlotlyJson- Types:
ChartConfig,ConstructionMethod,BoxSizeMethod,OHLC,PnfWasmModule,InitOptions
Build
Build the WebAssembly module with Emscripten:
npm install --no-audit --no-fund
npm run build:wasm
npm run build
npm run checkDocumentation
- JS/WASM binding reference:
docs/bindings/js.md - Cross-language API index:
docs/reference/api-symbol-index.md - Changelog:
CHANGELOG.md
