0.1.0 • Published 5 years ago
dortmund v0.1.0
dortmund
randomly generate rectangles on a grid
Installation
$ npm install dortmund
API
dortmund(options) ⇒ Array
Randomly generate rectangles on a grid
Kind: global function Returns: Array - Array of rectangles, to be converted to svg with dainty
Param | Type | Default | Description |
---|---|---|---|
options | Object | Configuration options | |
options.amountOfRectangles | number | The amount of rectangles to generate | |
options.maxSvgWidth | number | The width of the svg canvas | |
options.maxSvgHeight | number | The height of the svg canvas | |
options.rectWidth | number | The width of the rectangles to generate | |
options.rectHeight | number | The height of the rectangles to generate | |
options.getX | number | The function that will generate a random x-coordinate, receives all options | |
options.getY | number | The function that will generate a random y-coordinate, receives all options | |
options.rectAttributes | Object | {} | Optional attributes to add to the rectangle element |
License
0.1.0
5 years ago