aliencharts 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +94 -0
- package/dist/index.cjs +4910 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.js +4887 -0
- package/dist/index.js.map +7 -0
- package/package.json +51 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 FarangLab
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# AlienCharts
|
|
2
|
+
|
|
3
|
+
GPU-rendered chart grid for multi-metric dashboards — such as monitoring AI training runs, where you need many live-updating charts with millions of points each.
|
|
4
|
+
|
|
5
|
+
By rendering every series with WebGL, AlienCharts keeps dense chart grids smooth where SVG/Canvas libraries stall.
|
|
6
|
+
|
|
7
|
+
> **Note:** AlienCharts currently supports **line charts** only. Other chart types may be added in the future.
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- **High performance** — render many metrics in a grid with millions of points each, all drawn through a single shared WebGL context.
|
|
16
|
+
- **Live data** — append points to a series and the chart follows the latest values.
|
|
17
|
+
- **Level of Detail (LOD)** — each zoom level draws only the points it needs.
|
|
18
|
+
- **Chart interactions** — crosshair, zoom, pan, fullscreen mode, drawings, and moving averages. All have their own hotkeys.
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install aliencharts
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
`react` and `react-dom` (v18+) are peer dependencies, so make sure they are installed in your app.
|
|
27
|
+
|
|
28
|
+
## Quick start
|
|
29
|
+
|
|
30
|
+
Build an array of `charts`, where each chart has an `id`, a `title`, and one or more `series` created with `createSeries`. Pass them to `<ChartGrid>`:
|
|
31
|
+
|
|
32
|
+
```jsx
|
|
33
|
+
import { ChartGrid, createSeries } from "aliencharts";
|
|
34
|
+
|
|
35
|
+
const charts = [
|
|
36
|
+
{
|
|
37
|
+
id: "loss",
|
|
38
|
+
title: "train/loss",
|
|
39
|
+
series: [
|
|
40
|
+
createSeries({
|
|
41
|
+
id: "run-1",
|
|
42
|
+
name: "Run 1",
|
|
43
|
+
color: "#38bdf8",
|
|
44
|
+
x: [0, 1, 2, 3, 4],
|
|
45
|
+
y: [2.5, 1.9, 1.4, 1.1, 0.9],
|
|
46
|
+
}),
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
export default function Dashboard() {
|
|
52
|
+
return <ChartGrid charts={charts} columns={2} />;
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
For a fuller example, including live appending and theming — see [`examples/DemoPage.jsx`](./examples/DemoPage.jsx).
|
|
57
|
+
|
|
58
|
+
## API
|
|
59
|
+
|
|
60
|
+
### `createSeries(options)`
|
|
61
|
+
|
|
62
|
+
Creates a line series.
|
|
63
|
+
|
|
64
|
+
| Option | Type | Description |
|
|
65
|
+
| --- | --- | --- |
|
|
66
|
+
| `id` | `string` | Unique series id. |
|
|
67
|
+
| `name` | `string` | Display name (defaults to `id`). |
|
|
68
|
+
| `color` | `string` | CSS color of the line (defaults to `#38bdf8`). |
|
|
69
|
+
| `x` | `number[] \| Float64Array` | X values (e.g. step / time). |
|
|
70
|
+
| `y` | `number[] \| Float32Array` | Y values. |
|
|
71
|
+
|
|
72
|
+
The returned series has an `append(xValues, yValues)` method for streaming in new points.
|
|
73
|
+
|
|
74
|
+
### `createMockCharts(options?)`
|
|
75
|
+
|
|
76
|
+
Generates an array of charts with synthetic data for demos and benchmarking. Options: `chartCount`, `seriesPerChart`, `pointCount`.
|
|
77
|
+
|
|
78
|
+
### `<ChartGrid>`
|
|
79
|
+
|
|
80
|
+
Renders a responsive grid of charts. Commonly used props:
|
|
81
|
+
|
|
82
|
+
| Prop | Type | Default | Description |
|
|
83
|
+
| --- | --- | --- | --- |
|
|
84
|
+
| `charts` | `Chart[]` | — | Charts to render. Each is `{ id, title, series }`. |
|
|
85
|
+
| `columns` | `number` | `2` | Number of columns in the grid. |
|
|
86
|
+
| `dataRevision` | `number` | `0` | Bump this after appending points to trigger a re-render. |
|
|
87
|
+
| `followLatest` | `boolean` | `false` | Keep the view pinned to the newest data. |
|
|
88
|
+
| `xAxisLabel` | `string` | `"STEP"` | Label shown on the x-axis. |
|
|
89
|
+
| `backgroundColor` | `string` | — | Chart background color. |
|
|
90
|
+
| `antialiasLines` | `boolean` | `false` | Enable line antialiasing. |
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
[MIT](./LICENSE) © FarangLab
|