https://github.com/formsandlines/vmap-svg
formform module to visualize vmaps in SVG format
https://github.com/formsandlines/vmap-svg
formform svg vmap
Last synced: about 2 months ago
JSON representation
formform module to visualize vmaps in SVG format
- Host: GitHub
- URL: https://github.com/formsandlines/vmap-svg
- Owner: formsandlines
- License: mit
- Created: 2021-05-24T16:34:44.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-06-19T21:09:34.000Z (almost 4 years ago)
- Last Synced: 2025-03-15T00:48:01.222Z (about 2 months ago)
- Topics: formform, svg, vmap
- Language: JavaScript
- Homepage: https://formform.dev
- Size: 269 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vmap-svg
**formform** module to draw [*vmap*](https://observablehq.com/@formsandlines/recursive-mapping-of-4-valued-forms-with-vmaps) trees in SVG format for visualization in the browser, in PDFs, etc.
## Usage
Install [formform](https://github.com/formsandlines/formform) if you haven't already.
Then install the module:
```bash
npm install vmap_svg
``````js
// ES6:
import vmap_svg from 'vmap-svg';// CommonJS:
let vmap_svg = require('vmap-svg');
```You can then use the module like this:
```js
const vmap = formform.dna.vmap('((a)b)');
const vmapSVG = vmap_svg.draw(vmap.tree, vmap.input, vmap.varorder, vmap.options);document.body.appendChild(document.createElement('div')).innerHTML = vmapSVG.elem;
```
## Documentation
Coming soon…