@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 CHANGED
@@ -5,8 +5,7 @@
5
5
  [![npm version](https://img.shields.io/npm/v/%40datnguye%2Ferd-flow)](https://www.npmjs.com/package/@datnguye/erd-flow)
6
6
  [![npm downloads](https://img.shields.io/npm/dm/%40datnguye%2Ferd-flow)](https://www.npmjs.com/package/@datnguye/erd-flow)
7
7
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
8
- [![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178c6.svg)](./tsconfig.json)
9
- [![React](https://img.shields.io/badge/React-18-61dafb.svg)](https://react.dev)
8
+ [![GitHub stars](https://img.shields.io/github/stars/datnguye/erd-flow)](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
+ ![The erd-flow demo: table cards with PK/FK badges and self-drawing foreign-key edges landing on the joined rows, in the hierarchical layout](docs/demo.png)
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
@@ -944,6 +944,7 @@ function no(t) {
944
944
  zoomOnDoubleClick: a,
945
945
  nodesDraggable: a,
946
946
  panOnScroll: !1,
947
+ preventScrolling: a,
947
948
  children: [
948
949
  I ? /* @__PURE__ */ b(je, {}) : null,
949
950
  y ? /* @__PURE__ */ b(Ve, {}) : null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datnguye/erd-flow",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "An entity-relationship diagram component for dbt projects — table nodes, self-drawing foreign-key edges, and pluggable layouts.",
5
5
  "type": "module",
6
6
  "license": "MIT",