graphein-mcp 0.14.0 → 0.15.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.14.0",
3
+ "version": "0.15.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.14.0",
64
+ "@graphein/node": "^0.15.0",
65
65
  "@modelcontextprotocol/sdk": "^1.20.0",
66
- "graphein": "^0.14.0",
66
+ "graphein": "^0.15.0",
67
67
  "zod": "^3.23.0"
68
68
  }
69
69
  }
@@ -734,5 +734,17 @@ chart.resize(); // re-measure after a layout change
734
734
  chart.destroy(); // remove on teardown (SPA route change, etc.)
735
735
  ```
736
736
 
737
+ ### Inspect & edit from the DOM
738
+
739
+ Every `render`/`renderDashboard` root carries its effective config — the spec **minus its
740
+ `data`** — as JSON in a `data-graphein-spec` attribute, plus a `data-graphein-type` marker.
741
+ A browser tool can find Graphein visuals with
742
+ `document.querySelectorAll('[data-graphein-spec]')` and read what they are without a JS handle.
743
+ It's **two-way**: editing the attribute re-renders the chart, merging your edited config with
744
+ the chart's existing in-memory data. Malformed JSON or specs that fail `validateSpec` are
745
+ ignored, so a partial edit can't break a live chart. Opt out per chart (or dashboard) with
746
+ `inspect: false` — `render(el, spec, { inspect: false })`, `renderDashboard(el, spec, { inspect: false })`,
747
+ or the `inspect` prop on `<Chart>` / `<Dashboard>`.
748
+
737
749
  See the full field‑by‑field [Spec Reference](./spec-reference.md) and the
738
750
  machine‑readable [JSON Schema](./chart-spec.schema.json).