@particle-academy/fancy-echarts 3.0.1 → 3.0.2
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 +18 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -261,6 +261,24 @@ import { DataDiagram, Flowchart, Mindmap, OrgChart } from "@particle-academy/fan
|
|
|
261
261
|
|
|
262
262
|
See [docs/Diagram.md](docs/Diagram.md) for schemas, props, and layout details.
|
|
263
263
|
|
|
264
|
+
## Inertia.js integration
|
|
265
|
+
|
|
266
|
+
If your app uses Inertia, install [`@particle-academy/fancy-inertia`](https://github.com/Particle-Academy/fancy-inertia). Three things to know:
|
|
267
|
+
|
|
268
|
+
1. **`<FancyAppRoot withECharts>`** auto-calls `registerAll()` and `registerBuiltinThemes()` on the client only — drop it once at app entry and every page below it has charts ready.
|
|
269
|
+
2. **SSR**: every fancy-echarts component (`<EChart>`, `<EChart3D>`, `<EChartGraphic>`, and the diagram presets) needs `window` to initialize. Wrap in `<FancyClientOnly>` if Inertia SSR is enabled.
|
|
270
|
+
3. **Schema mode**: pass `withECharts: true` to `registerFancyComponents()` and your fancy-screens schemas can reference `EChart`, `DataDiagram`, `Flowchart`, `Mindmap`, `OrgChart` by name from server-supplied JSON.
|
|
271
|
+
|
|
272
|
+
```tsx
|
|
273
|
+
import { FancyAppRoot, FancyClientOnly } from "@particle-academy/fancy-inertia";
|
|
274
|
+
|
|
275
|
+
<FancyAppRoot withECharts>
|
|
276
|
+
<FancyClientOnly fallback={<div className="h-80 animate-pulse rounded bg-zinc-100" />}>
|
|
277
|
+
<EChart option={option} />
|
|
278
|
+
</FancyClientOnly>
|
|
279
|
+
</FancyAppRoot>
|
|
280
|
+
```
|
|
281
|
+
|
|
264
282
|
## Documentation
|
|
265
283
|
|
|
266
284
|
Full component documentation is available in the [docs/](docs/) folder:
|