@graphysdk/react 2.0.0-beta.1786440210947 → 2.0.0-beta.1787253424098
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 +28 -30
- package/dist/authoring.d.ts +3 -0
- package/dist/editable.browser.d.ts +6 -0
- package/dist/editable.browser.mjs +73193 -0
- package/dist/index.browser.mjs +37405 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -7
- package/dist/index.mjs +23 -9
- package/licenses/PolyForm-Free-Trial-1.0.0.md +93 -0
- package/licenses/PolyForm-NonCommercial-1.0.0.md +131 -0
- package/licenses/PolyForm-Small-Business-1.0.0.md +121 -0
- package/package.json +15 -5
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
|
+
```
|
|
10
|
+
|
|
11
|
+
Requires React 19. There is no stylesheet to import.
|
|
9
12
|
|
|
10
|
-
|
|
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,17 @@ 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
|
An explicit setting always wins over this package's default.
|
|
64
|
+
|
|
65
|
+
## Licence
|
|
66
|
+
|
|
67
|
+
This package is available under PolyForm Noncommercial, Small Business, or a 32-day Free Trial. Free Trial is local or internal evaluation only — it does not cover a public page. See [what you can do under the trial](https://docs.graphy.dev/licence/evaluation).
|
|
68
|
+
|
|
69
|
+
- [`@graphysdk/react-renderer`](https://www.npmjs.com/package/@graphysdk/react-renderer) — same React components, mark off by default
|
|
70
|
+
- [`@graphysdk/viz-engine`](https://www.npmjs.com/package/@graphysdk/viz-engine) — the engine alone, for non-React hosts
|
|
71
|
+
|
|
72
|
+
## Support
|
|
73
|
+
|
|
74
|
+
Questions and community help: [Discord](https://discord.gg/yGmYCjkSr).
|
|
@@ -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';
|