// MLTimeGraph v1.25.0
Time-series charts that explain what happened
// Gallery
// Features
Why choose MLTimeGraph.
The TypeScript library and its Go port render from the same configuration. A parity test draws the reference charts with both and compares them element by element on every run — a single difference is a failing test.
The renderer returns an SVG string: in the browser, in Node, in a Go CLI or behind an HTTP endpoint. No headless browser, no canvas. The nightly PDF report and the live dashboard show the same picture.
Thresholds with labels and coloured zones, filled regions between a series and a limit, highlighted time ranges, markers, status bands under the plot, and free annotations in data coordinates. A curve becomes a record of what happened.
More →Limits are part of the chart, not a line drawn on top: zones change the colour of the curve where it crosses them, and the area beyond a limit can be filled or hatched.
More →The usual spline overshoots and draws values no reading ever had. 'monotone' stays inside the span between two readings; 'akima' keeps a flat run flat right up to an edge.
More →Min, max and average per time slot as a band or as three lines with a filled envelope — the shape monitoring data actually arrives in. Gaps in the data are shown as gaps.
More →Zoom, minimap and tooltip are a separate layer that computes state and coordinates and leaves the elements to you. Use them, replace them, or leave them out.
More →Zero runtime dependencies, ESM, tree-shakeable, typed throughout. Time axes and number formats follow the locale. A Svelte wrapper ships as its own package.
More →MLTimeGraph turns measurements — time plus values — into a chart you can read, and annotates it well enough to explain what happened. Telemetry, sensors, system metrics, laboratory or process data: the job is narrow on purpose.
It is two libraries that draw the same picture: ml-time-graph in TypeScript and go-time-graph, its server-side Go port. Both take the same JSON configuration and produce the same SVG. A live dashboard, a nightly PDF report and an emailed alarm image should not show three different versions of one measurement.
Install
TypeScript, in the browser or in Node 18+ (ESM only):
npm install ml-time-graph
Go:
go get gitlab.com/mlc0911/mlctimegraph/go-time-graph@latest
Without a build step, straight from an ESM CDN:
<div id="chart"></div>
<script type="module">
import { mount } from 'https://esm.sh/ml-time-graph@1';
mount('#chart', {
series: [{ name: 'Temp', data: [/* … */] }],
});
</script>
Where to go from here
- The manual takes you from the first curve to thresholds, interaction, server-side rendering and the Svelte wrapper.
- The demos run in your browser. Every card has a Code tab and a Values tab; there is nothing to install.
- The playground lets you change an example with autocompletion and type checks and share the result as a link.
Working with an AI coding assistant
The npm package ships an agent skill. After npm install it sits at node_modules/ml-time-graph/skills/ml-time-graph/; copy that folder into your agent's skills directory. It gives a model the shortest path to a correct chart and lists the places where it would otherwise guess wrong, such as timestamps being epoch milliseconds.
What it is not
No hundred chart types, and no GPU-scale rendering: the case is reporting and analysis, not a million points at 60 frames per second. Interaction stays within limits — zoom, pan and tooltips, not a BI tool.
Licence
MIT with an attribution clause, for both libraries. The manual's text is CC BY-NC 4.0.