graphein 0.3.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Sachin Patney
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,60 @@
1
+ # graphein
2
+
3
+ > The framework-agnostic, **zero-dependency** engine behind [Graphein](https://github.com/spatney/graphein) —
4
+ > a beautiful, high-performance, **agent-first** data visualization library.
5
+
6
+ One chart is one JSON object. Hand the engine a declarative, JSON-serializable
7
+ `ChartSpec` and it renders Tableau-class visuals with a tiny hybrid Canvas2D + DOM core —
8
+ scales, ticks, color, shapes, the pivot engine, and the renderer are all hand-written
9
+ (no D3/charting dependencies).
10
+
11
+ Install the zero-dependency engine:
12
+
13
+ ```bash
14
+ npm install graphein
15
+ ```
16
+
17
+ ```ts
18
+ import { render, type ChartSpec } from 'graphein';
19
+
20
+ const spec: ChartSpec = {
21
+ type: 'line',
22
+ title: 'Monthly active users',
23
+ data: [
24
+ { month: '2024-01', users: 4200 },
25
+ { month: '2024-02', users: 4650 },
26
+ { month: '2024-03', users: 5010 },
27
+ ],
28
+ encoding: {
29
+ x: { field: 'month', type: 'temporal' },
30
+ y: { field: 'users', type: 'quantitative', format: ',d' },
31
+ },
32
+ };
33
+
34
+ const chart = render('#app', spec);
35
+ chart.update(nextSpec); // new data/config (animated)
36
+ chart.resize(); // re-measure after a layout change
37
+ chart.destroy(); // tear down
38
+ ```
39
+
40
+ ## Chart types
41
+
42
+ `line` · `area` · `bar` · `scatter` · `pie`/donut · `heatmap` · `kpi` · `table` ·
43
+ `matrix` (pivot) · `box` (box-and-whisker) · `sankey` · `choropleth`.
44
+
45
+ ## Validation
46
+
47
+ ```ts
48
+ import { validateSpec } from 'graphein';
49
+
50
+ const { valid, errors, warnings } = validateSpec(spec);
51
+ ```
52
+
53
+ ## Documentation
54
+
55
+ - [Agent Guide](https://github.com/spatney/graphein/blob/main/docs/agent-guide.md)
56
+ - [Spec Reference](https://github.com/spatney/graphein/blob/main/docs/spec-reference.md)
57
+ - [JSON Schema](https://github.com/spatney/graphein/blob/main/docs/chart-spec.schema.json)
58
+ - [Examples](https://github.com/spatney/graphein/tree/main/docs/examples)
59
+
60
+ MIT © Sachin Patney
@@ -0,0 +1,7 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+
5
+ export { __publicField };
6
+ //# sourceMappingURL=chunk-V6TY7KAL.js.map
7
+ //# sourceMappingURL=chunk-V6TY7KAL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-V6TY7KAL.js"}