@graphein/node 0.4.0 → 0.6.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 -21
- package/README.md +96 -96
- package/dist/index.js.map +1 -1
- package/package.json +61 -61
package/LICENSE
CHANGED
|
@@ -1,21 +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.
|
|
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
CHANGED
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
# @graphein/node
|
|
2
|
-
|
|
3
|
-
> Headless [Graphein](https://github.com/spatney/graphein) rendering for Node — turn any
|
|
4
|
-
> `ChartSpec` into a **PNG buffer plus a machine-readable render report**, with no browser
|
|
5
|
-
> and no JSDOM.
|
|
6
|
-
|
|
7
|
-
This is the server-side half of Graphein's agent feedback loop. The same model build and
|
|
8
|
-
mark renderers that run in the browser run here, so an agent (or a CI job, or a report
|
|
9
|
-
emailer) can **generate → validate → render → critique** a chart entirely on the server.
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install @graphein/node graphein
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
```ts
|
|
16
|
-
import { renderChart } from '@graphein/node';
|
|
17
|
-
import { writeFileSync } from 'node:fs';
|
|
18
|
-
|
|
19
|
-
const { png, report } = renderChart(
|
|
20
|
-
{
|
|
21
|
-
type: 'combo',
|
|
22
|
-
title: 'Revenue vs. conversion',
|
|
23
|
-
data: [
|
|
24
|
-
{ month: 'Jan', revenue: 120, conversion: 0.041 },
|
|
25
|
-
{ month: 'Feb', revenue: 145, conversion: 0.046 },
|
|
26
|
-
{ month: 'Mar', revenue: 138, conversion: 0.044 },
|
|
27
|
-
],
|
|
28
|
-
encoding: { x: { field: 'month' } },
|
|
29
|
-
layers: [
|
|
30
|
-
{ mark: 'bar', encoding: { y: { field: 'revenue', title: 'Revenue ($k)' } } },
|
|
31
|
-
{ mark: 'line', axis: 'right', encoding: { y: { field: 'conversion', format: '.1%' } } },
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
{ width: 900, height: 480, dpr: 2 },
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
if (!report.ok) console.warn('chart has issues:', report.diagnostics);
|
|
38
|
-
writeFileSync('chart.png', png);
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Why it exists
|
|
42
|
-
|
|
43
|
-
Text in Graphein (axis labels, titles, legends, annotations) is normally laid out as a
|
|
44
|
-
crisp HTML overlay. Headless rendering can't use the DOM, so `@graphein/node` drives
|
|
45
|
-
core's dependency-free `renderToContext` — which paints that same text **onto the canvas**
|
|
46
|
-
at the exact computed positions — and wires it to [`@napi-rs/canvas`](https://github.com/Brooooooklyn/canvas)
|
|
47
|
-
for fast, native PNG output. The core `graphein` engine stays **zero-dependency**; the
|
|
48
|
-
native bits live only in this package.
|
|
49
|
-
|
|
50
|
-
## API
|
|
51
|
-
|
|
52
|
-
### `renderChart(spec, options?) → { png, report, width, height }`
|
|
53
|
-
|
|
54
|
-
Renders `spec` and returns the PNG bytes **and** the [`RenderReport`](https://github.com/spatney/graphein/blob/main/docs/spec-reference.md#render-report)
|
|
55
|
-
— `ok`, mark/series/color counts, and any clipping / overlap / contrast diagnostics. The
|
|
56
|
-
report is computed from the resolved model (no pixel read-back), so it's identical to
|
|
57
|
-
`instance.report()` in the browser. This is what lets an agent verify a chart **without a
|
|
58
|
-
vision model**.
|
|
59
|
-
|
|
60
|
-
### `renderToPNG(spec, options?) → Buffer`
|
|
61
|
-
|
|
62
|
-
Convenience wrapper that returns only the PNG bytes.
|
|
63
|
-
|
|
64
|
-
### Options
|
|
65
|
-
|
|
66
|
-
| Option | Default | Description |
|
|
67
|
-
| -------- | ------- | --------------------------------------------------------------------- |
|
|
68
|
-
| `width` | `800` | Logical width in CSS pixels. |
|
|
69
|
-
| `height` | `500` | Logical height in CSS pixels. |
|
|
70
|
-
| `dpr` | `2` | Device pixel ratio — the PNG is rasterized at `width*dpr × height*dpr`. |
|
|
71
|
-
| `fonts` | — | `{ path, family }[]` font files to register before rendering. |
|
|
72
|
-
|
|
73
|
-
### Fonts
|
|
74
|
-
|
|
75
|
-
`@napi-rs/canvas` uses system fonts by default. For pixel-perfect parity with the browser
|
|
76
|
-
(Graphein's default family is **Inter**), register a font file:
|
|
77
|
-
|
|
78
|
-
```ts
|
|
79
|
-
renderChart(spec, {
|
|
80
|
-
fonts: [{ path: '/fonts/Inter-Variable.ttf', family: 'Inter' }],
|
|
81
|
-
});
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
`GlobalFonts` is re-exported if you prefer to register fonts once at startup.
|
|
85
|
-
|
|
86
|
-
## Supported charts
|
|
87
|
-
|
|
88
|
-
Every canvas-backed type: **line, area, bar, scatter, box, pie, heatmap, sankey,
|
|
89
|
-
choropleth, combo, histogram, funnel, treemap, gauge, bullet, calendarHeatmap,
|
|
90
|
-
waterfall, slope, dumbbell**.
|
|
91
|
-
DOM-only visuals (`kpi`, `table`, `matrix`, slicers, `dashboard`) are HTML — they have
|
|
92
|
-
no canvas form and throw a clear error.
|
|
93
|
-
|
|
94
|
-
## License
|
|
95
|
-
|
|
96
|
-
MIT
|
|
1
|
+
# @graphein/node
|
|
2
|
+
|
|
3
|
+
> Headless [Graphein](https://github.com/spatney/graphein) rendering for Node — turn any
|
|
4
|
+
> `ChartSpec` into a **PNG buffer plus a machine-readable render report**, with no browser
|
|
5
|
+
> and no JSDOM.
|
|
6
|
+
|
|
7
|
+
This is the server-side half of Graphein's agent feedback loop. The same model build and
|
|
8
|
+
mark renderers that run in the browser run here, so an agent (or a CI job, or a report
|
|
9
|
+
emailer) can **generate → validate → render → critique** a chart entirely on the server.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @graphein/node graphein
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { renderChart } from '@graphein/node';
|
|
17
|
+
import { writeFileSync } from 'node:fs';
|
|
18
|
+
|
|
19
|
+
const { png, report } = renderChart(
|
|
20
|
+
{
|
|
21
|
+
type: 'combo',
|
|
22
|
+
title: 'Revenue vs. conversion',
|
|
23
|
+
data: [
|
|
24
|
+
{ month: 'Jan', revenue: 120, conversion: 0.041 },
|
|
25
|
+
{ month: 'Feb', revenue: 145, conversion: 0.046 },
|
|
26
|
+
{ month: 'Mar', revenue: 138, conversion: 0.044 },
|
|
27
|
+
],
|
|
28
|
+
encoding: { x: { field: 'month' } },
|
|
29
|
+
layers: [
|
|
30
|
+
{ mark: 'bar', encoding: { y: { field: 'revenue', title: 'Revenue ($k)' } } },
|
|
31
|
+
{ mark: 'line', axis: 'right', encoding: { y: { field: 'conversion', format: '.1%' } } },
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
{ width: 900, height: 480, dpr: 2 },
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
if (!report.ok) console.warn('chart has issues:', report.diagnostics);
|
|
38
|
+
writeFileSync('chart.png', png);
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Why it exists
|
|
42
|
+
|
|
43
|
+
Text in Graphein (axis labels, titles, legends, annotations) is normally laid out as a
|
|
44
|
+
crisp HTML overlay. Headless rendering can't use the DOM, so `@graphein/node` drives
|
|
45
|
+
core's dependency-free `renderToContext` — which paints that same text **onto the canvas**
|
|
46
|
+
at the exact computed positions — and wires it to [`@napi-rs/canvas`](https://github.com/Brooooooklyn/canvas)
|
|
47
|
+
for fast, native PNG output. The core `graphein` engine stays **zero-dependency**; the
|
|
48
|
+
native bits live only in this package.
|
|
49
|
+
|
|
50
|
+
## API
|
|
51
|
+
|
|
52
|
+
### `renderChart(spec, options?) → { png, report, width, height }`
|
|
53
|
+
|
|
54
|
+
Renders `spec` and returns the PNG bytes **and** the [`RenderReport`](https://github.com/spatney/graphein/blob/main/docs/spec-reference.md#render-report)
|
|
55
|
+
— `ok`, mark/series/color counts, and any clipping / overlap / contrast diagnostics. The
|
|
56
|
+
report is computed from the resolved model (no pixel read-back), so it's identical to
|
|
57
|
+
`instance.report()` in the browser. This is what lets an agent verify a chart **without a
|
|
58
|
+
vision model**.
|
|
59
|
+
|
|
60
|
+
### `renderToPNG(spec, options?) → Buffer`
|
|
61
|
+
|
|
62
|
+
Convenience wrapper that returns only the PNG bytes.
|
|
63
|
+
|
|
64
|
+
### Options
|
|
65
|
+
|
|
66
|
+
| Option | Default | Description |
|
|
67
|
+
| -------- | ------- | --------------------------------------------------------------------- |
|
|
68
|
+
| `width` | `800` | Logical width in CSS pixels. |
|
|
69
|
+
| `height` | `500` | Logical height in CSS pixels. |
|
|
70
|
+
| `dpr` | `2` | Device pixel ratio — the PNG is rasterized at `width*dpr × height*dpr`. |
|
|
71
|
+
| `fonts` | — | `{ path, family }[]` font files to register before rendering. |
|
|
72
|
+
|
|
73
|
+
### Fonts
|
|
74
|
+
|
|
75
|
+
`@napi-rs/canvas` uses system fonts by default. For pixel-perfect parity with the browser
|
|
76
|
+
(Graphein's default family is **Inter**), register a font file:
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
renderChart(spec, {
|
|
80
|
+
fonts: [{ path: '/fonts/Inter-Variable.ttf', family: 'Inter' }],
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
`GlobalFonts` is re-exported if you prefer to register fonts once at startup.
|
|
85
|
+
|
|
86
|
+
## Supported charts
|
|
87
|
+
|
|
88
|
+
Every canvas-backed type: **line, area, bar, scatter, box, pie, heatmap, sankey,
|
|
89
|
+
choropleth, combo, histogram, funnel, treemap, gauge, bullet, calendarHeatmap,
|
|
90
|
+
waterfall, slope, dumbbell**.
|
|
91
|
+
DOM-only visuals (`kpi`, `table`, `matrix`, slicers, `dashboard`) are HTML — they have
|
|
92
|
+
no canvas form and throw a clear error.
|
|
93
|
+
|
|
94
|
+
## License
|
|
95
|
+
|
|
96
|
+
MIT
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * `@graphein/node` — headless Graphein rendering for Node.\n *\n * Render any canvas-backed {@link ChartSpec} to a PNG buffer **and** its\n * {@link RenderReport} with no browser and no JSDOM, so the whole\n * generate → validate → render → critique loop can run server-side (CI, agents,\n * email/PDF report assets). It wires `graphein`'s dependency-free\n * `renderToContext` to `@napi-rs/canvas`; the core engine stays zero-dependency.\n *\n * ```ts\n * import { renderChart } from '@graphein/node';\n * const { png, report } = renderChart(spec, { width: 900, height: 480, dpr: 2 });\n * if (!report.ok) console.warn(report.diagnostics);\n * await fs.writeFile('chart.png', png);\n * ```\n */\n\nimport { createCanvas, GlobalFonts } from '@napi-rs/canvas';\nimport { renderToContext, setMeasureContext, type ChartSpec, type RenderReport } from 'graphein';\n\n/** A font file to register before rendering, improving text fidelity. */\nexport interface FontFace {\n /** Absolute path to a `.ttf` / `.otf` / `.woff` file. */\n path: string;\n /**\n * The family name to register the font under. Match this to the family your\n * theme uses (Graphein's default is `Inter`) so text renders in that face.\n */\n family: string;\n}\n\n/** Options for {@link renderChart} / {@link renderToPNG}. */\nexport interface RenderImageOptions {\n /** Logical width in CSS pixels. Default `800`. */\n width?: number;\n /** Logical height in CSS pixels. Default `500`. */\n height?: number;\n /**\n * Device pixel ratio. The PNG is rasterized at `width * dpr × height * dpr`\n * for crisp output. Default `2`.\n */\n dpr?: number;\n /** Extra fonts to register before rendering. */\n fonts?: FontFace[];\n}\n\n/** The result of a headless render: the PNG bytes plus the render report. */\nexport interface NodeRenderResult {\n /** PNG-encoded image bytes. */\n png: Buffer;\n /**\n * The same machine-readable diagnostics as `instance.report()` in the\n * browser — `ok`, mark/series/color counts, and any clipping / overlap /\n * contrast warnings. Lets an agent critique the chart with no vision model.\n */\n report: RenderReport;\n /** Pixel width of the PNG (`width * dpr`, rounded). */\n width: number;\n /** Pixel height of the PNG (`height * dpr`, rounded). */\n height: number;\n}\n\nconst DEFAULT_WIDTH = 800;\nconst DEFAULT_HEIGHT = 500;\nconst DEFAULT_DPR = 2;\n\nfunction registerFonts(fonts: FontFace[] | undefined): void {\n if (!fonts) return;\n for (const f of fonts) {\n try {\n GlobalFonts.registerFromPath(f.path, f.family);\n } catch {\n // An unreadable font path is non-fatal — napi falls back to a system sans.\n }\n }\n}\n\n/**\n * Render `spec` to a PNG buffer and its {@link RenderReport}, entirely in Node.\n *\n * Supports every canvas-backed chart (line, area, bar, scatter, box, pie,\n * heatmap, sankey, choropleth, combo, histogram, funnel). DOM-only kinds\n * (`kpi`, `table`, `matrix`, slicers, `dashboard`) have no canvas form and throw.\n */\nexport function renderChart(spec: ChartSpec, options: RenderImageOptions = {}): NodeRenderResult {\n const width = options.width ?? DEFAULT_WIDTH;\n const height = options.height ?? DEFAULT_HEIGHT;\n const dpr = options.dpr ?? DEFAULT_DPR;\n\n registerFonts(options.fonts);\n\n const pxW = Math.max(1, Math.round(width * dpr));\n const pxH = Math.max(1, Math.round(height * dpr));\n\n const canvas = createCanvas(pxW, pxH);\n const ctx = canvas.getContext('2d');\n ctx.scale(dpr, dpr);\n\n // A dedicated 1×1 context for text measurement so layout uses real font\n // metrics (not the SSR heuristic) without mutating the drawing context.\n const measureCtx = createCanvas(1, 1).getContext('2d');\n\n // The interaction layer is unused on the static path; give it its own canvas\n // so a stray hover-layer paint can never land on the marks canvas.\n const interactionCtx = createCanvas(pxW, pxH).getContext('2d');\n interactionCtx.scale(dpr, dpr);\n\n setMeasureContext(measureCtx as unknown as CanvasRenderingContext2D);\n let report: RenderReport;\n try {\n report = renderToContext(\n {\n marks: ctx as unknown as CanvasRenderingContext2D,\n interaction: interactionCtx as unknown as CanvasRenderingContext2D,\n width,\n height,\n },\n spec,\n );\n } finally {\n setMeasureContext(null);\n }\n\n return { png: canvas.toBuffer('image/png'), report, width: pxW, height: pxH };\n}\n\n/**\n * Convenience wrapper around {@link renderChart} that returns only the PNG bytes.\n */\nexport function renderToPNG(spec: ChartSpec, options?: RenderImageOptions): Buffer {\n return renderChart(spec, options).png;\n}\n\n/** Re-exported so callers can register fonts globally without a second dep. */\nexport { GlobalFonts };\nexport type { ChartSpec, RenderReport } from 'graphein';\n\nexport const VERSION = '0.3.0';\n"],"mappings":";AAiBA,SAAS,cAAc,mBAAmB;AAC1C,SAAS,iBAAiB,yBAA4D;AA4CtF,IAAM,gBAAgB;AACtB,IAAM,iBAAiB;AACvB,IAAM,cAAc;AAEpB,SAAS,cAAc,OAAqC;AAC1D,MAAI,CAAC,MAAO;AACZ,aAAW,KAAK,OAAO;AACrB,QAAI;AACF,kBAAY,iBAAiB,EAAE,MAAM,EAAE,MAAM;AAAA,IAC/C,QAAQ;AAAA,IAER;AAAA,EACF;AACF;AASO,SAAS,YAAY,MAAiB,UAA8B,CAAC,GAAqB;AAC/F,QAAM,QAAQ,QAAQ,SAAS;AAC/B,QAAM,SAAS,QAAQ,UAAU;AACjC,QAAM,MAAM,QAAQ,OAAO;AAE3B,gBAAc,QAAQ,KAAK;AAE3B,QAAM,MAAM,KAAK,IAAI,GAAG,KAAK,MAAM,QAAQ,GAAG,CAAC;AAC/C,QAAM,MAAM,KAAK,IAAI,GAAG,KAAK,MAAM,SAAS,GAAG,CAAC;AAEhD,QAAM,SAAS,aAAa,KAAK,GAAG;AACpC,QAAM,MAAM,OAAO,WAAW,IAAI;AAClC,MAAI,MAAM,KAAK,GAAG;AAIlB,QAAM,aAAa,aAAa,GAAG,CAAC,EAAE,WAAW,IAAI;AAIrD,QAAM,iBAAiB,aAAa,KAAK,GAAG,EAAE,WAAW,IAAI;AAC7D,iBAAe,MAAM,KAAK,GAAG;AAE7B,oBAAkB,UAAiD;AACnE,MAAI;AACJ,MAAI;AACF,aAAS;AAAA,MACP;AAAA,QACE,OAAO;AAAA,QACP,aAAa;AAAA,QACb;AAAA,QACA;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAAA,EACF,UAAE;AACA,sBAAkB,IAAI;AAAA,EACxB;AAEA,SAAO,EAAE,KAAK,OAAO,SAAS,WAAW,GAAG,QAAQ,OAAO,KAAK,QAAQ,IAAI;AAC9E;AAKO,SAAS,YAAY,MAAiB,SAAsC;AACjF,SAAO,YAAY,MAAM,OAAO,EAAE;AACpC;AAMO,IAAM,UAAU;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@graphein/node",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"description": "Headless Graphein rendering for Node — render any ChartSpec to a PNG buffer with a RenderReport, no browser required.",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"author": "Sachin Patney <sachin.patney@gmail.com>",
|
|
8
|
-
"homepage": "https://github.com/spatney/graphein/tree/main/packages/node#readme",
|
|
9
|
-
"repository": {
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/spatney/graphein.git",
|
|
12
|
-
"directory": "packages/node"
|
|
13
|
-
},
|
|
14
|
-
"bugs": {
|
|
15
|
-
"url": "https://github.com/spatney/graphein/issues"
|
|
16
|
-
},
|
|
17
|
-
"keywords": [
|
|
18
|
-
"visualization",
|
|
19
|
-
"charts",
|
|
20
|
-
"dataviz",
|
|
21
|
-
"graphein",
|
|
22
|
-
"agent",
|
|
23
|
-
"headless",
|
|
24
|
-
"server-side",
|
|
25
|
-
"png",
|
|
26
|
-
"canvas"
|
|
27
|
-
],
|
|
28
|
-
"sideEffects": false,
|
|
29
|
-
"main": "./dist/index.js",
|
|
30
|
-
"module": "./dist/index.js",
|
|
31
|
-
"types": "./dist/index.d.ts",
|
|
32
|
-
"exports": {
|
|
33
|
-
".": {
|
|
34
|
-
"types": "./dist/index.d.ts",
|
|
35
|
-
"import": "./dist/index.js"
|
|
36
|
-
},
|
|
37
|
-
"./package.json": "./package.json"
|
|
38
|
-
},
|
|
39
|
-
"files": [
|
|
40
|
-
"dist",
|
|
41
|
-
"README.md",
|
|
42
|
-
"LICENSE"
|
|
43
|
-
],
|
|
44
|
-
"engines": {
|
|
45
|
-
"node": ">=18"
|
|
46
|
-
},
|
|
47
|
-
"publishConfig": {
|
|
48
|
-
"access": "public"
|
|
49
|
-
},
|
|
50
|
-
"scripts": {
|
|
51
|
-
"build": "tsup",
|
|
52
|
-
"dev": "tsup --watch",
|
|
53
|
-
"test": "vitest run",
|
|
54
|
-
"typecheck": "tsc --noEmit",
|
|
55
|
-
"prepack": "tsup"
|
|
56
|
-
},
|
|
57
|
-
"dependencies": {
|
|
58
|
-
"@napi-rs/canvas": "^1.0.1",
|
|
59
|
-
"graphein": "^0.
|
|
60
|
-
}
|
|
61
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@graphein/node",
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Headless Graphein rendering for Node — render any ChartSpec to a PNG buffer with a RenderReport, no browser required.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Sachin Patney <sachin.patney@gmail.com>",
|
|
8
|
+
"homepage": "https://github.com/spatney/graphein/tree/main/packages/node#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/spatney/graphein.git",
|
|
12
|
+
"directory": "packages/node"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/spatney/graphein/issues"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"visualization",
|
|
19
|
+
"charts",
|
|
20
|
+
"dataviz",
|
|
21
|
+
"graphein",
|
|
22
|
+
"agent",
|
|
23
|
+
"headless",
|
|
24
|
+
"server-side",
|
|
25
|
+
"png",
|
|
26
|
+
"canvas"
|
|
27
|
+
],
|
|
28
|
+
"sideEffects": false,
|
|
29
|
+
"main": "./dist/index.js",
|
|
30
|
+
"module": "./dist/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"import": "./dist/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./package.json": "./package.json"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist",
|
|
41
|
+
"README.md",
|
|
42
|
+
"LICENSE"
|
|
43
|
+
],
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=18"
|
|
46
|
+
},
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "tsup",
|
|
52
|
+
"dev": "tsup --watch",
|
|
53
|
+
"test": "vitest run",
|
|
54
|
+
"typecheck": "tsc --noEmit",
|
|
55
|
+
"prepack": "tsup"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@napi-rs/canvas": "^1.0.1",
|
|
59
|
+
"graphein": "^0.6.0"
|
|
60
|
+
}
|
|
61
|
+
}
|