@graphysdk/react 1.8.1-beta.1787065194945 → 1.8.1-beta.1787131914625

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/README.md CHANGED
@@ -1,17 +1,19 @@
1
1
  # @graphysdk/react
2
2
 
3
- The recommended, batteries-included React entry point for Graphy.
3
+ The Graphy charting SDK for React. Build a chart spec and render it from one package. The "Powered by Graphy" mark is on by default.
4
4
 
5
- ## Docs
5
+ ## Install
6
6
 
7
- - [Quickstart](https://docs.graphy.dev/sdk-next/quickstart)
8
- - [Provider and renderer](https://docs.graphy.dev/sdk-next/rendering/provider-and-renderer)
7
+ ```bash
8
+ npm install @graphysdk/react
9
+ ```
9
10
 
10
- It re-exports the `@graphysdk/react-renderer` surface across the same two entry points — the read-only main entry and `/editable` — with one opinionated default: the **provenance mark is shown by default**.
11
+ Requires React 19. There is no stylesheet to import.
12
+
13
+ ## Usage
11
14
 
12
15
  ```tsx
13
- import { GraphProvider, GraphRenderer } from '@graphysdk/react';
14
- import { createSpec, pipe, geom, scale } from '@graphysdk/viz-engine';
16
+ import { GraphProvider, GraphRenderer, createSpec, pipe, geom, scale } from '@graphysdk/react';
15
17
 
16
18
  const input = pipe(createSpec({ x: 'month', y: 'revenue' }), geom.bar(), scale.x(), scale.y());
17
19
 
@@ -24,14 +26,12 @@ export function Chart({ data }) {
24
26
  }
25
27
  ```
26
28
 
27
- ## Entry points
28
-
29
- Two entries, mirroring `@graphysdk/react-renderer`'s own split:
29
+ ## Docs
30
30
 
31
- - **`@graphysdk/react`** — the read-only surface: `GraphProvider`, `GraphRenderer`, hooks, slots, theme, and types. This is where the batteries-included `GraphProvider` lives.
32
- - **`@graphysdk/react/editable`** — the editing surface: `EditableGraphRenderer`, `EditorPanel`, its sections, and the default controls. Kept separate so a read-only embed never bundles the editor or its stylesheet.
31
+ - [Quickstart](https://docs.graphy.dev/sdk-next/quickstart)
32
+ - [Provider and renderer](https://docs.graphy.dev/sdk-next/rendering/provider-and-renderer)
33
33
 
34
- The provenance default lives on `GraphProvider`, so editable mode inherits it — mount the editor inside the same provider:
34
+ ## Editable charts
35
35
 
36
36
  ```tsx
37
37
  import { GraphProvider } from '@graphysdk/react';
@@ -46,20 +46,11 @@ export function EditableChart({ data, input, isEditing }) {
46
46
  }
47
47
  ```
48
48
 
49
- ## Which package should I use?
50
-
51
- - **`@graphysdk/react` (this package)** — start here. The provenance mark is on by default; everything else is identical to the renderer.
52
- - **`@graphysdk/react-renderer`** — the neutral, unopinionated layer. The mark is **off** by default. Reach for it directly when embedding into another product or building your own opinionated wrapper.
53
-
54
- Both share the same API (same two entry points), so moving between them is a one-line import change.
55
-
56
- ## Turning the mark off
57
-
58
- The mark is a developer config flag, never a paywall. Opt out per chart with either API:
49
+ ## Hiding the mark
59
50
 
60
51
  ```tsx
61
- // Low-level spec config
62
- import { config } from '@graphysdk/viz-engine';
52
+ import { config, createSpec, geom, pipe } from '@graphysdk/react';
53
+
63
54
  const input = pipe(
64
55
  createSpec({ x: 'month', y: 'revenue' }),
65
56
  geom.bar(),
@@ -67,10 +58,7 @@ const input = pipe(
67
58
  );
68
59
  ```
69
60
 
70
- ```tsx
71
- // High-level GraphConfig API
72
- import { convertGraphConfig } from '@graphysdk/viz-engine/graph-config';
73
- const input = convertGraphConfig({ type: 'column', content: { isBrandMarkHidden: true } }, data);
74
- ```
61
+ ## Other packages
75
62
 
76
- An explicit setting always wins over this package's default.
63
+ - [`@graphysdk/react-renderer`](https://www.npmjs.com/package/@graphysdk/react-renderer) same React components, mark off by default
64
+ - [`@graphysdk/viz-engine`](https://www.npmjs.com/package/@graphysdk/viz-engine) — the engine alone, for non-React hosts
@@ -0,0 +1,3 @@
1
+ /** Viz-engine builders and types for the `@graphysdk/react` entry. */
2
+ export type { Data, Spec, SpecInput } from '@graphysdk/viz-engine';
3
+ export { annotation, config, coord, createSpec, geom, highlight, mapping, pipe, scale, stat, style, styles, token, transform, } from '@graphysdk/viz-engine';
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let n=require("react"),t=require("@graphysdk/react-renderer"),i=require("@graphysdk/viz-engine"),a=require("react/jsx-runtime");function u(e){const r=e.config.content;return r?.isBrandMarkVisible!==void 0||r?.brandMark?.enabled!==void 0?e:(0,i.updateSpec)(e,{config:{content:{isBrandMarkVisible:!0,brandMark:{enabled:!0}}}})}var o=e=>{const r=(0,n.useMemo)(()=>u(e.input),[e.input]);return(0,a.jsx)(t.GraphProvider,{...e,input:r})};exports.GraphProvider=o;Object.keys(t).forEach(function(e){e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})});
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let e=require("@graphysdk/viz-engine"),u=require("react"),n=require("@graphysdk/react-renderer"),i=require("react/jsx-runtime");function o(r){const t=r.config.content;return t?.isBrandMarkVisible!==void 0||t?.brandMark?.enabled!==void 0?r:(0,e.updateSpec)(r,{config:{content:{isBrandMarkVisible:!0,brandMark:{enabled:!0}}}})}var a=r=>{const t=(0,u.useMemo)(()=>o(r.input),[r.input]);return(0,i.jsx)(n.GraphProvider,{...r,input:t})};exports.GraphProvider=a;Object.defineProperty(exports,"annotation",{enumerable:!0,get:function(){return e.annotation}});Object.defineProperty(exports,"config",{enumerable:!0,get:function(){return e.config}});Object.defineProperty(exports,"coord",{enumerable:!0,get:function(){return e.coord}});Object.defineProperty(exports,"createSpec",{enumerable:!0,get:function(){return e.createSpec}});Object.defineProperty(exports,"geom",{enumerable:!0,get:function(){return e.geom}});Object.defineProperty(exports,"highlight",{enumerable:!0,get:function(){return e.highlight}});Object.defineProperty(exports,"mapping",{enumerable:!0,get:function(){return e.mapping}});Object.defineProperty(exports,"pipe",{enumerable:!0,get:function(){return e.pipe}});Object.defineProperty(exports,"scale",{enumerable:!0,get:function(){return e.scale}});Object.defineProperty(exports,"stat",{enumerable:!0,get:function(){return e.stat}});Object.defineProperty(exports,"style",{enumerable:!0,get:function(){return e.style}});Object.defineProperty(exports,"styles",{enumerable:!0,get:function(){return e.styles}});Object.defineProperty(exports,"token",{enumerable:!0,get:function(){return e.token}});Object.defineProperty(exports,"transform",{enumerable:!0,get:function(){return e.transform}});Object.keys(n).forEach(function(r){r!=="default"&&!Object.prototype.hasOwnProperty.call(exports,r)&&Object.defineProperty(exports,r,{enumerable:!0,get:function(){return n[r]}})});
package/dist/index.d.ts CHANGED
@@ -1,11 +1,7 @@
1
1
  /**
2
- * `@graphysdk/react` — the recommended, batteries-included React entry point.
3
- *
4
- * This main entry mirrors the `@graphysdk/react-renderer` read-only (`.`) surface, but swaps in a
5
- * `GraphProvider` whose Made with Graphy provenance badge is on by default. The editing surface
6
- * lives at the `@graphysdk/react/editable` subpath (mirroring `@graphysdk/react-renderer/editable`),
7
- * kept separate so a read-only embed never pulls in the editor. The low-level `@graphysdk/react-renderer`
8
- * stays mark-free by default for embedders and advanced integrators.
2
+ * `@graphysdk/react` — renderer surface, mark on by default, plus spec builders.
3
+ * Editing lives at `@graphysdk/react/editable`.
9
4
  */
5
+ export * from './authoring';
10
6
  export { GraphProvider } from './graph-provider';
11
7
  export * from '@graphysdk/react-renderer';
package/dist/index.mjs CHANGED
@@ -1,22 +1,36 @@
1
- import { useMemo as e } from "react";
2
- import { GraphProvider as n } from "@graphysdk/react-renderer";
3
- import { updateSpec as i } from "@graphysdk/viz-engine";
4
- import { jsx as o } from "react/jsx-runtime";
1
+ import { annotation as d, config as p, coord as m, createSpec as s, geom as f, highlight as u, mapping as l, pipe as h, scale as g, stat as k, style as M, styles as b, token as v, transform as x, updateSpec as e } from "@graphysdk/viz-engine";
2
+ import { useMemo as n } from "react";
3
+ import { GraphProvider as o } from "@graphysdk/react-renderer";
4
+ import { jsx as i } from "react/jsx-runtime";
5
5
  export * from "@graphysdk/react-renderer";
6
6
  function a(r) {
7
7
  const t = r.config.content;
8
- return t?.isBrandMarkVisible !== void 0 || t?.brandMark?.enabled !== void 0 ? r : i(r, { config: { content: {
8
+ return t?.isBrandMarkVisible !== void 0 || t?.brandMark?.enabled !== void 0 ? r : e(r, { config: { content: {
9
9
  isBrandMarkVisible: !0,
10
10
  brandMark: { enabled: !0 }
11
11
  } } });
12
12
  }
13
- var c = (r) => {
14
- const t = e(() => a(r.input), [r.input]);
15
- return /* @__PURE__ */ o(n, {
13
+ var y = (r) => {
14
+ const t = n(() => a(r.input), [r.input]);
15
+ return /* @__PURE__ */ i(o, {
16
16
  ...r,
17
17
  input: t
18
18
  });
19
19
  };
20
20
  export {
21
- c as GraphProvider
21
+ y as GraphProvider,
22
+ d as annotation,
23
+ p as config,
24
+ m as coord,
25
+ s as createSpec,
26
+ f as geom,
27
+ u as highlight,
28
+ l as mapping,
29
+ h as pipe,
30
+ g as scale,
31
+ k as stat,
32
+ M as style,
33
+ b as styles,
34
+ v as token,
35
+ x as transform
22
36
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@graphysdk/react",
3
3
  "author": "Graphy",
4
- "description": "Batteries-included React chart SDK for Graphy (provenance mark on by default)",
4
+ "description": "Graphy charting SDK for React",
5
5
  "homepage": "https://docs.graphy.dev/sdk-next/quickstart",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
7
7
  "keywords": [
@@ -11,7 +11,7 @@
11
11
  "visualization",
12
12
  "grammar-of-graphics"
13
13
  ],
14
- "version": "1.8.1-beta.1787065194945",
14
+ "version": "1.8.1-beta.1787131914625",
15
15
  "type": "module",
16
16
  "sideEffects": false,
17
17
  "types": "./dist/index.d.ts",
@@ -34,8 +34,8 @@
34
34
  }
35
35
  },
36
36
  "dependencies": {
37
- "@graphysdk/react-renderer": "1.8.1-beta.1787065194945",
38
- "@graphysdk/viz-engine": "1.8.1-beta.1787065194945"
37
+ "@graphysdk/react-renderer": "1.8.1-beta.1787131914625",
38
+ "@graphysdk/viz-engine": "1.8.1-beta.1787131914625"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "react": "^19.0.0"