dash-flows wraps @xyflow/react (React Flow 12) for
Plotly Dash. The React components in src/lib/ are the source of truth; the
Python package in dash_flows/ is auto-generated from their PropTypes.
npm install
pip install -r requirements.txt # library + examples
pip install -r requirements-docs.txt # documentation site- Edit React components in
src/lib/components/(neverdash_flows/*.py— they are generated). - Rebuild:
npm run build(webpack bundle →dash_flows/dash_flows.min.js, thendash-generate-componentsregenerates the Python wrappers). - See it running:
python run.py→ http://localhost:8560 — the docs site embeds a live demo of every example. Standalone apps live inexamples/(python examples/01_basic_nodes_and_edges.py).
Run the three validation gates (all CI-friendly, no browser needed):
python scripts/smoke_examples.py # every example imports & registers callbacks
python scripts/smoke_runtime.py # every example serves /, /_dash-layout, /_dash-dependencies
python scripts/validate_docs.py # every docs page renders through markdown2dashBrowser-fidelity tests (need dash[testing] + chromedriver):
pip install -r tests/requirements.txt
pytest- Add
examples/NN_name.py— a standalone app (app = Dash(...), global@callback,app.run()underif __name__ == "__main__":). - Add its embeddable twin
docs/<topic>/exNN.py— exposes a module-levelcomponent, uses global@callback, prefixes every Dash component id withexNN-(callback ids are global across the whole docs app — an unprefixed id will collide with another page's demo and crash startup). - Add a section to
docs/<topic>/<topic>.md: prose +.. exec::docs.<topic>.exNN.. source::examples/NN_name.py+ a "How it works" bullet list. Headings must be plain text (no backticks/bold/links — the renderer builds anchors from the first heading token).
- Re-run the three gates above.
assets/is auto-served by Dash — every.css/.jsthere loads on every docs page.- Version lives in two files: bump
package.jsonandpackage-info.json. - One source-map generator only:
devtoolXORSourceMapDevToolPlugininwebpack.config.js. - Never run
npm audit fix --force— it breaks the build toolchain.