webwaspjs is a JavaScript library for loading and growing discrete aggregation systems in the browser.
npm install webwaspjs threethree is a required peer dependency and must be installed by the consuming application.
import { createAggregationFromData } from 'webwaspjs';
const aggregation = createAggregationFromData(aggregationData);
const roundtripExport = aggregation.toData();
const fileExport = aggregation.toFileData();
console.log(Object.keys(aggregation.parts));
console.log(aggregation.rules.length);
console.log(JSON.stringify(roundtripExport));
console.log(JSON.stringify(fileExport));Main entry points:
createAggregationFromData(data)to rebuild an aggregation from serialized dataaggregation.toData()to export the full roundtrip/core aggregation dataaggregation.toFileData()to export the compact placed-parts file formatAggregationfor direct access to the core modelVisualizerfor simple browser rendering
Requirements:
- Node.js 18+
- npm 9+
Commands:
npm installnpm run lintnpm testnpm run build
src/ library source
src/tests/ vitest suite
src/tests/fixtures/ JSON fixtures used by tests
dist/ build output
- Roger Winkler — rogerwinkler.de
- Andrea Rossi — thecomputationalhive.com
Based on the original WASP Grasshopper plug-in by Andrea Rossi.
MIT. See LICENSE.txt.