This repository provides the infrastructure to bundle the pure JavaScript library for loading VTK.wasm.
The full usage documentation of vtk-wasm can be found at: https://kitware.github.io/vtk-wasm/
src/
— Source code for the library.dist/
— Bundled output files.wasm/
— WebAssembly binaries and related assets.scripts/
— Utility scripts for building and packaging.README.md
— Project documentation.package.json
— Project metadata and build scripts.
The following scripts are available in package.json
:
npm run docs:build
- Builds the guide pages for VTK.wasmnpm run build
— Builds the ESM and UMD bundles for both RemoteSession and StandaloneSession.npm run build:esm
— Builds only the ESM bundles.npm run build:vtk
— Builds only the UMD bundle for StandaloneSession.npm run build:viewer
- Builds the vtkWASMViewer JavaScript library.npm run clean
— Cleans thedist/
directory.npm run lint
— Runs code linting on the source files.
- ESM Bundles: For both RemoteSession and StandaloneSession.
- UMD Bundle: For StandaloneSession, exposed as the
VTK
namespace for use in browser environments.
Refer to the package.json
for the full list of scripts and configuration details.
import { RemoteSession } from "@kitware/vtk-wasm/remote"
import { createVtkObjectProxy, createNamespace } from "@kitware/vtk-wasm/vtk"
import { ExportViewer, createViewer } from "@kitware/vtk-wasm/viewer"
import "@kitware/vtk-wasm/viewer.css";
import "@kitware/vtk-wasm/viewer-umd.js";
import "@kitware/vtk-wasm/vtk-umd.js";