@shapeshop/core
v0.0.4
Published
A TS library to generate SVG data based on user mouse/pointer input
Downloads
73
Maintainers
Readme
ShapeShop
api
The ShapeShop constructor accepts 3 arguments.
- [required] an HTMLElement, in the dom, you wish to capture mouse events on
- [required] the default
ShapeTypeyou want ShapeShop to interpret from these events - [optional] a callback you want to execute on each mouse event, which is passed a
CanvasUpdatewhen invoked.
const shapeshop = new ShapeShop({
el: $el,
defaultShape: ShapeType.Rect,
onCanvasUpdate: (update) => {
console.log(update);
}
});When you are done with shapeshop, call the destroy method to clean up its mouse event listeners
shapeshop.destroy();