Development
All NiiVue development is public on GitHub. The main branch represents the most current state of NiiVue. Contributions to NiiVue are encouraged and welcomed.
Local Development
The hot-reloadable web page is the most responsive way to test and develop new features in NiiVue. Whenever any core source files are modified, the page at /niivue/packages/niivue/src/index.html automatically reloads to reflect those changes. You can edit this index.html file to load specific datasets or create custom examples that demonstrate new functionality or reproduce issues.
git clone git@github.com:niivue/niivue.git
cd niivue
npm install
npm run dev
The API documentation provides many live demos as recipes to illustrate the functionality. If you want to modify these demos, you can run them (though note that this mode is not hot-reloadable so you will have to re-run npm run demo after changing the core code).
git clone git@github.com:niivue/niivue.git
cd niivue
npm install
npm run demo
Documentation Development
The primary documentation uses Docusaurus. The easiest way to enhance this documentation is to use the hot-reloadable mode, where changes in the code are rapidly reflected in the locally hosted web browser pages.
git clone git@github.com:niivue/niivue.git
cd niivue
npm install
npm run build:niivue
npm run dev:docs
Note the embedded JSDoc annotations that describe the API and include links to live demos are also compiled by build:niivue into web pages.
UIKit Demo Development
The @niivue/niivue-uikit package is a demo that pairs NiiVue rendering with @niivue/uikit UI components. Unlike the core dev server, the demo imports the built bundles of @niivue/niivue (../niivue/dist/index.js) and @niivue/uikit (../uikit/dist/index.es.js) rather than their source. On a fresh clone these dist/ folders do not exist, so the dev server would otherwise fail with Failed to resolve import "../niivue/dist/index.js".
The dev:uikit script has a predev:uikit hook that builds both packages first, so the following works on a clean checkout:
git clone git@github.com:niivue/niivue.git
cd niivue
npm install
npm run dev:uikit
Because the demo consumes the built bundles, changes to the @niivue/niivue or @niivue/uikit source require rebuilding those packages (npm run build:niivue and npm run build:uikit) to be reflected in the demo.
Alternatives
What makes NiiVue unique is its ability to simultaneously display all major neuroimaging data types in the browser—including volumetric voxels, surface meshes, tractography streamlines, statistical overlays, and connectomes. This versatility makes it a strong candidate for integrated web-based visualization. However, before committing development resources to a single platform, it may be worth considering whether an alternative tool better suits your specific needs. Below are some alternative voxel-based web tools worth exploring: