@datnguye/erd-flow 1.0.0 → 1.0.1
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 +22 -3
- package/dist/index.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/@datnguye/erd-flow)
|
|
6
6
|
[](https://www.npmjs.com/package/@datnguye/erd-flow)
|
|
7
7
|
[](./LICENSE)
|
|
8
|
-
[](https://react.dev)
|
|
8
|
+
[](https://github.com/datnguye/erd-flow/stargazers)
|
|
10
9
|
|
|
11
10
|
A [React Flow](https://reactflow.dev) entity-relationship diagram for
|
|
12
11
|
dbt projects: table nodes with per-column PK/FK badges, self-drawing foreign-key
|
|
@@ -20,6 +19,26 @@ static docs SPA) and [dbterd-vscode](https://github.com/datnguye/dbterd-vscode)
|
|
|
20
19
|
(a VS Code webview). Turns out one diagram is enough for two very different
|
|
21
20
|
homes.
|
|
22
21
|
|
|
22
|
+
## Demo
|
|
23
|
+
|
|
24
|
+

|
|
25
|
+
|
|
26
|
+
The repo ships a Vite playground wired to a sample dbt-style payload — the
|
|
27
|
+
fastest way to see the diagram move before writing a line of host code:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
git clone https://github.com/datnguye/erd-flow
|
|
31
|
+
cd erd-flow
|
|
32
|
+
npm install
|
|
33
|
+
npm run dev
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Open the printed URL at `/demo/index.html`. The toolbar switches layout
|
|
37
|
+
(hierarchical / radial / force), focuses a table's FK neighbourhood, toggles
|
|
38
|
+
column collapsing, and locks the canvas. The same knobs work as URL params for
|
|
39
|
+
sharable states: `?layout=hierarchical`, `?focus=<node-id>`, `?collapse=off`,
|
|
40
|
+
`?locked=on`.
|
|
41
|
+
|
|
23
42
|
## Install
|
|
24
43
|
|
|
25
44
|
```bash
|
|
@@ -66,7 +85,7 @@ export function Diagram({ payload }) {
|
|
|
66
85
|
| `collapseColumns` | `boolean` | Collapse wide tables to a few rows with a "N more" toggle (default `true`). `false` shows every column — for a focused view where join columns must stay visible. |
|
|
67
86
|
| `expandAll` | `boolean` | Controlled expand-all: forces every collapsible table open (`true`) or closed (`false`). Omit to let per-table toggles work independently. |
|
|
68
87
|
| `onExpandStateChange` | `({ allExpanded, canExpand }) => void` | Reports the aggregate expand state so a host can label/disable its own expand-all button. |
|
|
69
|
-
| `interactive` | `boolean` | Pan / zoom / drag (default `true`). `false` locks the canvas — gate it behind a "click to unlock" affordance. |
|
|
88
|
+
| `interactive` | `boolean` | Pan / zoom / drag (default `true`). `false` locks the canvas and releases the wheel so the page scrolls past it — gate it behind a "click to unlock" affordance. |
|
|
70
89
|
| `onNodeActivate` | `(node \| null) => void` | Header click activates; pane click clears. Render your own details pane. |
|
|
71
90
|
| `onOpenNode` | `(node) => void` | Table double-click — open the backing model. |
|
|
72
91
|
| `resourceMeta` | `Record<string, ResourceMeta>` | Colour/icon per `resource_type`. Merged over dbt defaults. |
|
package/dist/index.js
CHANGED
package/package.json
CHANGED