graphein-mcp 0.16.2 → 0.17.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphein-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Model Context Protocol server for Graphein — wraps generate → validate → repair → render → critique into one tool call, and serves Graphein's schema + agent guide as resources so a model that never saw the API can still build correct charts.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"prepack": "tsup"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@graphein/node": "^0.
|
|
64
|
+
"@graphein/node": "^0.17.0",
|
|
65
65
|
"@modelcontextprotocol/sdk": "^1.20.0",
|
|
66
|
-
"graphein": "^0.
|
|
66
|
+
"graphein": "^0.17.0",
|
|
67
67
|
"zod": "^3.23.0"
|
|
68
68
|
}
|
|
69
69
|
}
|
package/resources/agent-guide.md
CHANGED
|
@@ -621,6 +621,24 @@ optional `seed`. Reach for it for a casual, low‑fidelity, "napkin sketch" feel
|
|
|
621
621
|
(brainstorms, draft dashboards, playful reports); keep it off for precise/formal
|
|
622
622
|
charts. The output is deterministic, so the same spec always looks identical.
|
|
623
623
|
|
|
624
|
+
## Debug mode
|
|
625
|
+
|
|
626
|
+
Add `"debug": true` to **any** spec to replace the chart with an interactive **debug
|
|
627
|
+
view** — a diagnostic layout that visualizes the spec and its data instead of drawing
|
|
628
|
+
the chart. It composes a **live preview** of the real chart with the resolved **spec**
|
|
629
|
+
(collapsible JSON), a **data** sample (with inferred column types + row count), the
|
|
630
|
+
**validation** errors/warnings, the **render report** diagnostics, and the NL
|
|
631
|
+
**summary**. The original `type` is preserved, so clearing the flag restores the chart.
|
|
632
|
+
|
|
633
|
+
```jsonc
|
|
634
|
+
{ "type": "bar", "data": [/* … */], "encoding": { "x": { "field": "q" }, "y": { "field": "v" } }, "debug": true }
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
Pass an object to narrow it: `sections` (`preview`|`spec`|`data`|`validation`|`report`|
|
|
638
|
+
`summary`) and `rows` (data-sample cap). Reach for it when a chart doesn't look right and
|
|
639
|
+
you want to see exactly what the spec resolved to. It's a browser/DOM view; headless PNG
|
|
640
|
+
export gets a plain-text fallback, and `chart.report()` still reflects the real chart.
|
|
641
|
+
|
|
624
642
|
## Validation & gotchas
|
|
625
643
|
|
|
626
644
|
- **`encoding` is required** for `line`/`area`/`bar`/`scatter`/`box` (`x`+`y`), `pie`
|
|
@@ -409,6 +409,17 @@
|
|
|
409
409
|
],
|
|
410
410
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
411
411
|
},
|
|
412
|
+
"debug": {
|
|
413
|
+
"anyOf": [
|
|
414
|
+
{
|
|
415
|
+
"type": "boolean"
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
"$ref": "#/$defs/DebugConfig"
|
|
419
|
+
}
|
|
420
|
+
],
|
|
421
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
422
|
+
},
|
|
412
423
|
"params": {
|
|
413
424
|
"type": "array",
|
|
414
425
|
"items": {
|
|
@@ -701,6 +712,17 @@
|
|
|
701
712
|
],
|
|
702
713
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
703
714
|
},
|
|
715
|
+
"debug": {
|
|
716
|
+
"anyOf": [
|
|
717
|
+
{
|
|
718
|
+
"type": "boolean"
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
"$ref": "#/$defs/DebugConfig"
|
|
722
|
+
}
|
|
723
|
+
],
|
|
724
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
725
|
+
},
|
|
704
726
|
"params": {
|
|
705
727
|
"type": "array",
|
|
706
728
|
"items": {
|
|
@@ -997,6 +1019,17 @@
|
|
|
997
1019
|
],
|
|
998
1020
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
999
1021
|
},
|
|
1022
|
+
"debug": {
|
|
1023
|
+
"anyOf": [
|
|
1024
|
+
{
|
|
1025
|
+
"type": "boolean"
|
|
1026
|
+
},
|
|
1027
|
+
{
|
|
1028
|
+
"$ref": "#/$defs/DebugConfig"
|
|
1029
|
+
}
|
|
1030
|
+
],
|
|
1031
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
1032
|
+
},
|
|
1000
1033
|
"params": {
|
|
1001
1034
|
"type": "array",
|
|
1002
1035
|
"items": {
|
|
@@ -1220,6 +1253,17 @@
|
|
|
1220
1253
|
],
|
|
1221
1254
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
1222
1255
|
},
|
|
1256
|
+
"debug": {
|
|
1257
|
+
"anyOf": [
|
|
1258
|
+
{
|
|
1259
|
+
"type": "boolean"
|
|
1260
|
+
},
|
|
1261
|
+
{
|
|
1262
|
+
"$ref": "#/$defs/DebugConfig"
|
|
1263
|
+
}
|
|
1264
|
+
],
|
|
1265
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
1266
|
+
},
|
|
1223
1267
|
"params": {
|
|
1224
1268
|
"type": "array",
|
|
1225
1269
|
"items": {
|
|
@@ -1412,6 +1456,17 @@
|
|
|
1412
1456
|
],
|
|
1413
1457
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
1414
1458
|
},
|
|
1459
|
+
"debug": {
|
|
1460
|
+
"anyOf": [
|
|
1461
|
+
{
|
|
1462
|
+
"type": "boolean"
|
|
1463
|
+
},
|
|
1464
|
+
{
|
|
1465
|
+
"$ref": "#/$defs/DebugConfig"
|
|
1466
|
+
}
|
|
1467
|
+
],
|
|
1468
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
1469
|
+
},
|
|
1415
1470
|
"params": {
|
|
1416
1471
|
"type": "array",
|
|
1417
1472
|
"items": {
|
|
@@ -1709,6 +1764,17 @@
|
|
|
1709
1764
|
],
|
|
1710
1765
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
1711
1766
|
},
|
|
1767
|
+
"debug": {
|
|
1768
|
+
"anyOf": [
|
|
1769
|
+
{
|
|
1770
|
+
"type": "boolean"
|
|
1771
|
+
},
|
|
1772
|
+
{
|
|
1773
|
+
"$ref": "#/$defs/DebugConfig"
|
|
1774
|
+
}
|
|
1775
|
+
],
|
|
1776
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
1777
|
+
},
|
|
1712
1778
|
"params": {
|
|
1713
1779
|
"type": "array",
|
|
1714
1780
|
"items": {
|
|
@@ -2000,6 +2066,17 @@
|
|
|
2000
2066
|
],
|
|
2001
2067
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
2002
2068
|
},
|
|
2069
|
+
"debug": {
|
|
2070
|
+
"anyOf": [
|
|
2071
|
+
{
|
|
2072
|
+
"type": "boolean"
|
|
2073
|
+
},
|
|
2074
|
+
{
|
|
2075
|
+
"$ref": "#/$defs/DebugConfig"
|
|
2076
|
+
}
|
|
2077
|
+
],
|
|
2078
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
2079
|
+
},
|
|
2003
2080
|
"params": {
|
|
2004
2081
|
"type": "array",
|
|
2005
2082
|
"items": {
|
|
@@ -2615,6 +2692,17 @@
|
|
|
2615
2692
|
],
|
|
2616
2693
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
2617
2694
|
},
|
|
2695
|
+
"debug": {
|
|
2696
|
+
"anyOf": [
|
|
2697
|
+
{
|
|
2698
|
+
"type": "boolean"
|
|
2699
|
+
},
|
|
2700
|
+
{
|
|
2701
|
+
"$ref": "#/$defs/DebugConfig"
|
|
2702
|
+
}
|
|
2703
|
+
],
|
|
2704
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
2705
|
+
},
|
|
2618
2706
|
"params": {
|
|
2619
2707
|
"type": "array",
|
|
2620
2708
|
"items": {
|
|
@@ -2688,6 +2776,36 @@
|
|
|
2688
2776
|
"additionalProperties": true,
|
|
2689
2777
|
"description": "A single data record (row). Agent-supplied data is an array of these."
|
|
2690
2778
|
},
|
|
2779
|
+
"DebugConfig": {
|
|
2780
|
+
"type": "object",
|
|
2781
|
+
"properties": {
|
|
2782
|
+
"sections": {
|
|
2783
|
+
"type": "array",
|
|
2784
|
+
"items": {
|
|
2785
|
+
"$ref": "#/$defs/DebugSection"
|
|
2786
|
+
},
|
|
2787
|
+
"description": "Which panels to show, in order. Omit for all of them."
|
|
2788
|
+
},
|
|
2789
|
+
"rows": {
|
|
2790
|
+
"type": "number",
|
|
2791
|
+
"description": "Max number of data rows to list in the data table (default 50)."
|
|
2792
|
+
}
|
|
2793
|
+
},
|
|
2794
|
+
"additionalProperties": false,
|
|
2795
|
+
"description": "Debug-view options. Set `debug: true` on any spec to replace the chart with a diagnostic view, or pass this object to tune it. All fields are plain JSON so specs still round-trip through `JSON.stringify`. See BaseSpec.debug."
|
|
2796
|
+
},
|
|
2797
|
+
"DebugSection": {
|
|
2798
|
+
"type": "string",
|
|
2799
|
+
"enum": [
|
|
2800
|
+
"preview",
|
|
2801
|
+
"spec",
|
|
2802
|
+
"data",
|
|
2803
|
+
"validation",
|
|
2804
|
+
"report",
|
|
2805
|
+
"summary"
|
|
2806
|
+
],
|
|
2807
|
+
"description": "Individual panels the debug view can render."
|
|
2808
|
+
},
|
|
2691
2809
|
"Dimensions": {
|
|
2692
2810
|
"type": "object",
|
|
2693
2811
|
"properties": {
|
|
@@ -2810,6 +2928,17 @@
|
|
|
2810
2928
|
],
|
|
2811
2929
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
2812
2930
|
},
|
|
2931
|
+
"debug": {
|
|
2932
|
+
"anyOf": [
|
|
2933
|
+
{
|
|
2934
|
+
"type": "boolean"
|
|
2935
|
+
},
|
|
2936
|
+
{
|
|
2937
|
+
"$ref": "#/$defs/DebugConfig"
|
|
2938
|
+
}
|
|
2939
|
+
],
|
|
2940
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
2941
|
+
},
|
|
2813
2942
|
"params": {
|
|
2814
2943
|
"type": "array",
|
|
2815
2944
|
"items": {
|
|
@@ -2982,6 +3111,17 @@
|
|
|
2982
3111
|
],
|
|
2983
3112
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
2984
3113
|
},
|
|
3114
|
+
"debug": {
|
|
3115
|
+
"anyOf": [
|
|
3116
|
+
{
|
|
3117
|
+
"type": "boolean"
|
|
3118
|
+
},
|
|
3119
|
+
{
|
|
3120
|
+
"$ref": "#/$defs/DebugConfig"
|
|
3121
|
+
}
|
|
3122
|
+
],
|
|
3123
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
3124
|
+
},
|
|
2985
3125
|
"params": {
|
|
2986
3126
|
"type": "array",
|
|
2987
3127
|
"items": {
|
|
@@ -3574,6 +3714,17 @@
|
|
|
3574
3714
|
],
|
|
3575
3715
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
3576
3716
|
},
|
|
3717
|
+
"debug": {
|
|
3718
|
+
"anyOf": [
|
|
3719
|
+
{
|
|
3720
|
+
"type": "boolean"
|
|
3721
|
+
},
|
|
3722
|
+
{
|
|
3723
|
+
"$ref": "#/$defs/DebugConfig"
|
|
3724
|
+
}
|
|
3725
|
+
],
|
|
3726
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
3727
|
+
},
|
|
3577
3728
|
"params": {
|
|
3578
3729
|
"type": "array",
|
|
3579
3730
|
"items": {
|
|
@@ -3784,6 +3935,17 @@
|
|
|
3784
3935
|
],
|
|
3785
3936
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
3786
3937
|
},
|
|
3938
|
+
"debug": {
|
|
3939
|
+
"anyOf": [
|
|
3940
|
+
{
|
|
3941
|
+
"type": "boolean"
|
|
3942
|
+
},
|
|
3943
|
+
{
|
|
3944
|
+
"$ref": "#/$defs/DebugConfig"
|
|
3945
|
+
}
|
|
3946
|
+
],
|
|
3947
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
3948
|
+
},
|
|
3787
3949
|
"params": {
|
|
3788
3950
|
"type": "array",
|
|
3789
3951
|
"items": {
|
|
@@ -4118,6 +4280,17 @@
|
|
|
4118
4280
|
],
|
|
4119
4281
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
4120
4282
|
},
|
|
4283
|
+
"debug": {
|
|
4284
|
+
"anyOf": [
|
|
4285
|
+
{
|
|
4286
|
+
"type": "boolean"
|
|
4287
|
+
},
|
|
4288
|
+
{
|
|
4289
|
+
"$ref": "#/$defs/DebugConfig"
|
|
4290
|
+
}
|
|
4291
|
+
],
|
|
4292
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
4293
|
+
},
|
|
4121
4294
|
"params": {
|
|
4122
4295
|
"type": "array",
|
|
4123
4296
|
"items": {
|
|
@@ -4368,6 +4541,17 @@
|
|
|
4368
4541
|
],
|
|
4369
4542
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
4370
4543
|
},
|
|
4544
|
+
"debug": {
|
|
4545
|
+
"anyOf": [
|
|
4546
|
+
{
|
|
4547
|
+
"type": "boolean"
|
|
4548
|
+
},
|
|
4549
|
+
{
|
|
4550
|
+
"$ref": "#/$defs/DebugConfig"
|
|
4551
|
+
}
|
|
4552
|
+
],
|
|
4553
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
4554
|
+
},
|
|
4371
4555
|
"params": {
|
|
4372
4556
|
"type": "array",
|
|
4373
4557
|
"items": {
|
|
@@ -4696,6 +4880,17 @@
|
|
|
4696
4880
|
],
|
|
4697
4881
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
4698
4882
|
},
|
|
4883
|
+
"debug": {
|
|
4884
|
+
"anyOf": [
|
|
4885
|
+
{
|
|
4886
|
+
"type": "boolean"
|
|
4887
|
+
},
|
|
4888
|
+
{
|
|
4889
|
+
"$ref": "#/$defs/DebugConfig"
|
|
4890
|
+
}
|
|
4891
|
+
],
|
|
4892
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
4893
|
+
},
|
|
4699
4894
|
"params": {
|
|
4700
4895
|
"type": "array",
|
|
4701
4896
|
"items": {
|
|
@@ -4940,6 +5135,17 @@
|
|
|
4940
5135
|
],
|
|
4941
5136
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
4942
5137
|
},
|
|
5138
|
+
"debug": {
|
|
5139
|
+
"anyOf": [
|
|
5140
|
+
{
|
|
5141
|
+
"type": "boolean"
|
|
5142
|
+
},
|
|
5143
|
+
{
|
|
5144
|
+
"$ref": "#/$defs/DebugConfig"
|
|
5145
|
+
}
|
|
5146
|
+
],
|
|
5147
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
5148
|
+
},
|
|
4943
5149
|
"params": {
|
|
4944
5150
|
"type": "array",
|
|
4945
5151
|
"items": {
|
|
@@ -5187,6 +5393,17 @@
|
|
|
5187
5393
|
],
|
|
5188
5394
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
5189
5395
|
},
|
|
5396
|
+
"debug": {
|
|
5397
|
+
"anyOf": [
|
|
5398
|
+
{
|
|
5399
|
+
"type": "boolean"
|
|
5400
|
+
},
|
|
5401
|
+
{
|
|
5402
|
+
"$ref": "#/$defs/DebugConfig"
|
|
5403
|
+
}
|
|
5404
|
+
],
|
|
5405
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
5406
|
+
},
|
|
5190
5407
|
"params": {
|
|
5191
5408
|
"type": "array",
|
|
5192
5409
|
"items": {
|
|
@@ -5444,6 +5661,17 @@
|
|
|
5444
5661
|
],
|
|
5445
5662
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
5446
5663
|
},
|
|
5664
|
+
"debug": {
|
|
5665
|
+
"anyOf": [
|
|
5666
|
+
{
|
|
5667
|
+
"type": "boolean"
|
|
5668
|
+
},
|
|
5669
|
+
{
|
|
5670
|
+
"$ref": "#/$defs/DebugConfig"
|
|
5671
|
+
}
|
|
5672
|
+
],
|
|
5673
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
5674
|
+
},
|
|
5447
5675
|
"params": {
|
|
5448
5676
|
"type": "array",
|
|
5449
5677
|
"items": {
|
|
@@ -5740,6 +5968,17 @@
|
|
|
5740
5968
|
],
|
|
5741
5969
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
5742
5970
|
},
|
|
5971
|
+
"debug": {
|
|
5972
|
+
"anyOf": [
|
|
5973
|
+
{
|
|
5974
|
+
"type": "boolean"
|
|
5975
|
+
},
|
|
5976
|
+
{
|
|
5977
|
+
"$ref": "#/$defs/DebugConfig"
|
|
5978
|
+
}
|
|
5979
|
+
],
|
|
5980
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
5981
|
+
},
|
|
5743
5982
|
"params": {
|
|
5744
5983
|
"type": "array",
|
|
5745
5984
|
"items": {
|
|
@@ -6021,6 +6260,17 @@
|
|
|
6021
6260
|
],
|
|
6022
6261
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
6023
6262
|
},
|
|
6263
|
+
"debug": {
|
|
6264
|
+
"anyOf": [
|
|
6265
|
+
{
|
|
6266
|
+
"type": "boolean"
|
|
6267
|
+
},
|
|
6268
|
+
{
|
|
6269
|
+
"$ref": "#/$defs/DebugConfig"
|
|
6270
|
+
}
|
|
6271
|
+
],
|
|
6272
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
6273
|
+
},
|
|
6024
6274
|
"params": {
|
|
6025
6275
|
"type": "array",
|
|
6026
6276
|
"items": {
|
|
@@ -6201,6 +6451,17 @@
|
|
|
6201
6451
|
],
|
|
6202
6452
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
6203
6453
|
},
|
|
6454
|
+
"debug": {
|
|
6455
|
+
"anyOf": [
|
|
6456
|
+
{
|
|
6457
|
+
"type": "boolean"
|
|
6458
|
+
},
|
|
6459
|
+
{
|
|
6460
|
+
"$ref": "#/$defs/DebugConfig"
|
|
6461
|
+
}
|
|
6462
|
+
],
|
|
6463
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
6464
|
+
},
|
|
6204
6465
|
"params": {
|
|
6205
6466
|
"type": "array",
|
|
6206
6467
|
"items": {
|
|
@@ -6480,6 +6741,17 @@
|
|
|
6480
6741
|
],
|
|
6481
6742
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
6482
6743
|
},
|
|
6744
|
+
"debug": {
|
|
6745
|
+
"anyOf": [
|
|
6746
|
+
{
|
|
6747
|
+
"type": "boolean"
|
|
6748
|
+
},
|
|
6749
|
+
{
|
|
6750
|
+
"$ref": "#/$defs/DebugConfig"
|
|
6751
|
+
}
|
|
6752
|
+
],
|
|
6753
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
6754
|
+
},
|
|
6483
6755
|
"params": {
|
|
6484
6756
|
"type": "array",
|
|
6485
6757
|
"items": {
|
|
@@ -6705,6 +6977,17 @@
|
|
|
6705
6977
|
],
|
|
6706
6978
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
6707
6979
|
},
|
|
6980
|
+
"debug": {
|
|
6981
|
+
"anyOf": [
|
|
6982
|
+
{
|
|
6983
|
+
"type": "boolean"
|
|
6984
|
+
},
|
|
6985
|
+
{
|
|
6986
|
+
"$ref": "#/$defs/DebugConfig"
|
|
6987
|
+
}
|
|
6988
|
+
],
|
|
6989
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
6990
|
+
},
|
|
6708
6991
|
"params": {
|
|
6709
6992
|
"type": "array",
|
|
6710
6993
|
"items": {
|
|
@@ -7022,6 +7305,17 @@
|
|
|
7022
7305
|
],
|
|
7023
7306
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
7024
7307
|
},
|
|
7308
|
+
"debug": {
|
|
7309
|
+
"anyOf": [
|
|
7310
|
+
{
|
|
7311
|
+
"type": "boolean"
|
|
7312
|
+
},
|
|
7313
|
+
{
|
|
7314
|
+
"$ref": "#/$defs/DebugConfig"
|
|
7315
|
+
}
|
|
7316
|
+
],
|
|
7317
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
7318
|
+
},
|
|
7025
7319
|
"params": {
|
|
7026
7320
|
"type": "array",
|
|
7027
7321
|
"items": {
|
|
@@ -7312,6 +7606,17 @@
|
|
|
7312
7606
|
],
|
|
7313
7607
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
7314
7608
|
},
|
|
7609
|
+
"debug": {
|
|
7610
|
+
"anyOf": [
|
|
7611
|
+
{
|
|
7612
|
+
"type": "boolean"
|
|
7613
|
+
},
|
|
7614
|
+
{
|
|
7615
|
+
"$ref": "#/$defs/DebugConfig"
|
|
7616
|
+
}
|
|
7617
|
+
],
|
|
7618
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
7619
|
+
},
|
|
7315
7620
|
"params": {
|
|
7316
7621
|
"type": "array",
|
|
7317
7622
|
"items": {
|
|
@@ -7845,6 +8150,17 @@
|
|
|
7845
8150
|
],
|
|
7846
8151
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
7847
8152
|
},
|
|
8153
|
+
"debug": {
|
|
8154
|
+
"anyOf": [
|
|
8155
|
+
{
|
|
8156
|
+
"type": "boolean"
|
|
8157
|
+
},
|
|
8158
|
+
{
|
|
8159
|
+
"$ref": "#/$defs/DebugConfig"
|
|
8160
|
+
}
|
|
8161
|
+
],
|
|
8162
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
8163
|
+
},
|
|
7848
8164
|
"params": {
|
|
7849
8165
|
"type": "array",
|
|
7850
8166
|
"items": {
|
|
@@ -8169,6 +8485,17 @@
|
|
|
8169
8485
|
],
|
|
8170
8486
|
"description": "Render the chart in a hand-drawn (\"sketch\") style — wobbly outlines, hachure fills, and a handwriting font. `true` uses the defaults; pass a `SketchConfig` to tune it. Omit (or `false`) for the default clean rendering."
|
|
8171
8487
|
},
|
|
8488
|
+
"debug": {
|
|
8489
|
+
"anyOf": [
|
|
8490
|
+
{
|
|
8491
|
+
"type": "boolean"
|
|
8492
|
+
},
|
|
8493
|
+
{
|
|
8494
|
+
"$ref": "#/$defs/DebugConfig"
|
|
8495
|
+
}
|
|
8496
|
+
],
|
|
8497
|
+
"description": "Replace the chart with an interactive **debug view** — a live preview of the real chart alongside the resolved spec (JSON), a sample of the data (with inferred column types and row count), validation errors/warnings, render-report diagnostics, and the plain-English summary. `true` shows every panel; pass a DebugConfig to select panels or cap the data sample. Omit (or `false`) to render normally. The original `type` is preserved, so clearing the flag restores the chart. Rich HTML view in the browser; headless PNG export (`@graphein/node`) gets a simple text fallback."
|
|
8498
|
+
},
|
|
8172
8499
|
"params": {
|
|
8173
8500
|
"type": "array",
|
|
8174
8501
|
"items": {
|
|
@@ -50,6 +50,7 @@ Runnable JSON for every chart type lives in [`docs/examples/`](./examples).
|
|
|
50
50
|
- [Conditional formatting](#conditional-formatting)
|
|
51
51
|
- [Themes](#themes)
|
|
52
52
|
- [Sketch (hand-drawn) mode](#sketchconfig)
|
|
53
|
+
- [Debug mode](#debugconfig)
|
|
53
54
|
- [Format mini‑language](#format-mini-language)
|
|
54
55
|
- [Enumerations](#enumerations)
|
|
55
56
|
- [Runtime API](#runtime-api)
|
|
@@ -78,6 +79,7 @@ Shared by **all** chart types.
|
|
|
78
79
|
| `padding` | `Partial<Insets>` | auto | Extra `{ top, right, bottom, left }` px around the plot. |
|
|
79
80
|
| `background` | `string` | theme bg | CSS color override for the chart surface. |
|
|
80
81
|
| `sketch` | `boolean \| SketchConfig` | `false` | Render with the hand‑drawn ("sketch") look — wobbly outlines, hachure fills, and a handwriting font (see [`SketchConfig`](#sketchconfig)). |
|
|
82
|
+
| `debug` | `boolean \| DebugConfig` | `false` | Replace the chart with a **debug view** — live preview + resolved spec + data sample + validation + report + summary (see [`DebugConfig`](#debugconfig)). |
|
|
81
83
|
| `params` | `SelectionParam[]` | — | Named selections this visual **publishes** (click/brush/slicer). See [Interactivity](#interactivity-selection--highlight--filter). |
|
|
82
84
|
| `highlight` | `HighlightConfig \| HighlightConfig[]` | — | Emphasize rows matching a param; dim the rest. An array unions sources. |
|
|
83
85
|
| `filter` | `FilterClause[]` | — | Subset rows to those matching **every** clause (a `{ param }` or a literal predicate). |
|
|
@@ -135,6 +137,45 @@ sketch charts are safe to snapshot/screenshot‑test. Turning sketch off restore
|
|
|
135
137
|
default crisp rendering path exactly (zero cost when unused — the font and engine are
|
|
136
138
|
code‑split and only loaded on the sketch path).
|
|
137
139
|
|
|
140
|
+
### `DebugConfig`
|
|
141
|
+
|
|
142
|
+
Set **`debug: true`** on *any* spec to swap the chart for an interactive **debug
|
|
143
|
+
view** — a diagnostic panel layout that visualizes the spec and its data instead of
|
|
144
|
+
drawing the chart. The original `type` is preserved, so removing the flag restores
|
|
145
|
+
the chart exactly. Useful for inspecting *why* a chart renders the way it does.
|
|
146
|
+
|
|
147
|
+
The view shows, side by side:
|
|
148
|
+
|
|
149
|
+
- **Live preview** — the real chart, rendered from the same spec with debug off.
|
|
150
|
+
- **Summary** — the deterministic natural‑language one‑liner ([`summarize`](#render-report)).
|
|
151
|
+
- **Validation** — every `error`/`warning` from [`validateSpec`](#validation--linting).
|
|
152
|
+
- **Render report** — [`RenderReport`](#render-report) diagnostics (mark count, clipped
|
|
153
|
+
labels, low‑contrast colors, …) for the previewed chart.
|
|
154
|
+
- **Spec** — the resolved spec as syntax‑highlighted, collapsible JSON (the `data`
|
|
155
|
+
array is summarized to a row count; see the Data panel for the rows).
|
|
156
|
+
- **Data** — a scrollable table of the rows with inferred per‑column types and the
|
|
157
|
+
total row/column count.
|
|
158
|
+
|
|
159
|
+
Pass an object to narrow it:
|
|
160
|
+
|
|
161
|
+
| Field | Type | Default | Notes |
|
|
162
|
+
| --- | --- | --- | --- |
|
|
163
|
+
| `sections` | `('preview' \| 'spec' \| 'data' \| 'validation' \| 'report' \| 'summary')[]` | all | Which panels to show, in order. |
|
|
164
|
+
| `rows` | `number` | `50` | Max data rows listed in the Data panel (the true total is always shown). |
|
|
165
|
+
|
|
166
|
+
```jsonc
|
|
167
|
+
// Everything
|
|
168
|
+
{ "type": "bar", "data": [/* … */], "encoding": { /* … */ }, "debug": true }
|
|
169
|
+
|
|
170
|
+
// Just the resolved spec + a 10-row data sample
|
|
171
|
+
{ "type": "line", "data": [/* … */], "encoding": { /* … */ }, "debug": { "sections": ["spec", "data"], "rows": 10 } }
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
The debug view is a **browser/DOM** experience (rich HTML panels). Headless PNG export
|
|
175
|
+
(`@graphein/node`) instead paints a plain‑text fallback (type + validation summary +
|
|
176
|
+
spec JSON). `chart.report()` on a debug chart returns the *underlying* chart's report,
|
|
177
|
+
so programmatic diagnostics keep working.
|
|
178
|
+
|
|
138
179
|
---
|
|
139
180
|
|
|
140
181
|
## Encoding & `FieldDef`
|