Skip to content

winroger/waspjs

Repository files navigation

webwaspjs

npm version npm downloads CI status license

webwaspjs is a JavaScript library for loading and growing discrete aggregation systems in the browser.

Install

npm install webwaspjs three

three is a required peer dependency and must be installed by the consuming application.

Quick start

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 data
  • aggregation.toData() to export the full roundtrip/core aggregation data
  • aggregation.toFileData() to export the compact placed-parts file format
  • Aggregation for direct access to the core model
  • Visualizer for simple browser rendering

Development

Requirements:

  • Node.js 18+
  • npm 9+

Commands:

  • npm install
  • npm run lint
  • npm test
  • npm run build

Project layout

src/                    library source
src/tests/              vitest suite
src/tests/fixtures/     JSON fixtures used by tests
dist/                   build output

Related repositories

Credits

Based on the original WASP Grasshopper plug-in by Andrea Rossi.

License

MIT. See LICENSE.txt.

About

Discrete Aggregations on the Web

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors