@markgrafhq/markgraf-react 0.0.28 → 0.0.29
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 +11 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @markgrafhq/markgraf-react
|
|
2
2
|
|
|
3
|
-
React hook + component for embedding [markgraf](https://github.com/i-am-the-slime/markgraf) animations. Drives play/pause/seek imperatively and exposes `time`, `
|
|
3
|
+
React hook + component for embedding [markgraf](https://github.com/i-am-the-slime/markgraf) animations. Drives play/pause/seek imperatively and exposes `time`, `keyframe`, and `playing` as reactive state.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -9,30 +9,31 @@ bun add @markgrafhq/markgraf-react
|
|
|
9
9
|
# or: npm install @markgrafhq/markgraf-react
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Import the package CSS for player styling:
|
|
13
13
|
|
|
14
14
|
```js
|
|
15
|
-
import "@markgrafhq/markgraf-
|
|
15
|
+
import "@markgrafhq/markgraf-react/css";
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
## `<MarkgrafPlayer src=... />`
|
|
19
19
|
|
|
20
|
-
Headless component
|
|
20
|
+
Headless component that draws the scene directly into the selected Canvas2D, SVG, or WebGL surface. Bring your own controls.
|
|
21
21
|
|
|
22
22
|
```jsx
|
|
23
23
|
import { MarkgrafPlayer } from "@markgrafhq/markgraf-react";
|
|
24
24
|
|
|
25
25
|
const src = `seed 1
|
|
26
|
-
|
|
27
|
-
+
|
|
28
|
-
+
|
|
29
|
-
+
|
|
30
|
-
client
|
|
26
|
+
scene v1 {
|
|
27
|
+
+ client: Client
|
|
28
|
+
+ api: API
|
|
29
|
+
+ client -> api
|
|
30
|
+
client ~> api: GET
|
|
31
31
|
}`;
|
|
32
32
|
|
|
33
33
|
export default function App() {
|
|
34
34
|
return <MarkgrafPlayer src={src} />;
|
|
35
35
|
// Or: <MarkgrafPlayer src={src} renderer="svg" />
|
|
36
|
+
// Or: <MarkgrafPlayer src={src} renderer="sdf" />
|
|
36
37
|
}
|
|
37
38
|
```
|
|
38
39
|
|
|
@@ -84,6 +85,7 @@ export function Player({ src }) {
|
|
|
84
85
|
|
|
85
86
|
- **`canvas`** (default) — Canvas2D with DPR-aware scaling and label springs. Fastest, best for many tokens.
|
|
86
87
|
- **`svg`** — Inline SVG. Easier to inspect/style, scales crisply at any zoom, no DPR concerns. No spring labels.
|
|
88
|
+
- **`sdf`** (alias **`webgl`**) — WebGL raymarched 3D rendering; available through `MarkgrafPlayer` only.
|
|
87
89
|
|
|
88
90
|
## License
|
|
89
91
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markgrafhq/markgraf-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.29",
|
|
4
4
|
"description": "React hook + component for embedding markgraf animations. Drives play/pause/seek and exposes time + keyframe as reactive state.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/markgraf-react.js",
|