This guide explains how to build the React Flow JavaScript bundle that powers the visualization component of dplyneage.
Note for Users: The bundle should be pre-built when you install the package. You typically only need to build it if:
With your working directory at the root of the dplyneage repository:
From the package source directory in a terminal:
The build process creates:
inst/htmlwidgets/lib/reactflow/reactflow-bundle.min.js
- Complete React Flow bundleThis bundle includes:
For active development with auto-rebuild:
This will watch for changes and rebuild automatically.
devtools::load_all()
lineage_flow(
nodes = list(
list(id = "1", position = list(x = 0, y = 0),
data = list(label = "Source")),
list(id = "2", position = list(x = 250, y = 100),
data = list(label = "Transform")),
list(id = "3", position = list(x = 500, y = 0),
data = list(label = "Output"))
),
edges = list(
list(id = "e1-2", source = "1", target = "2"),
list(id = "e2-3", source = "2", target = "3")
)
)If the bundle loads successfully, you’ll see an interactive React Flow diagram with draggable nodes, pan/zoom controls, and a grid background.
If the bundle doesn’t load, it will fallback to the SVG visualization.
Bundle not found: Make sure the build completed
successfully and check that
inst/htmlwidgets/lib/reactflow/reactflow-bundle.min.js
exists.
Build fails:
node --version (should be
v18+)cd srcjs && rm -rf node_modules && npm install && npm run buildWidget shows SVG instead of React Flow: Check browser console for errors. The widget will fallback to SVG if React Flow fails to load.
If you’re modifying the React Flow bundle:
srcjs/src/index.jsnpm run dev in the srcjs
directorydevtools::load_all()The webpack configuration in srcjs/webpack.config.js
handles bundling all dependencies into a single minified file.
The bundle is created using webpack and includes:
The bundle is optimized for production with minification and tree-shaking to reduce file size.