@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 +19 -31
- package/dist/authoring.d.ts +3 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -7
- package/dist/index.mjs +23 -9
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
# @graphysdk/react
|
|
2
2
|
|
|
3
|
-
The
|
|
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
|
-
##
|
|
5
|
+
## Install
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
```bash
|
|
8
|
+
npm install @graphysdk/react
|
|
9
|
+
```
|
|
9
10
|
|
|
10
|
-
|
|
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
|
-
##
|
|
28
|
-
|
|
29
|
-
Two entries, mirroring `@graphysdk/react-renderer`'s own split:
|
|
29
|
+
## Docs
|
|
30
30
|
|
|
31
|
-
-
|
|
32
|
-
-
|
|
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
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
62
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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` —
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { jsx as
|
|
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 :
|
|
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
|
|
14
|
-
const t =
|
|
15
|
-
return /* @__PURE__ */ o
|
|
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
|
-
|
|
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": "
|
|
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.
|
|
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.
|
|
38
|
-
"@graphysdk/viz-engine": "1.8.1-beta.
|
|
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"
|