pattern-wall
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

🌈
Pattern Wall

Pattern Wall: Generate positions for pattern in an area.



Installation

$ npm install --save pattern-wall

Usage

import PatternWall from 'pattern-wall'
 
const names = ['foo', 'bar', 'baz', 'qux']
const width = 1000
const height = 1000
 
const pattern = new PatternWall(names, { width, height })
const result = pattern.generate()
console.log(result)
 
// [ { name: 'foo', position: { x: 775, y: 509 } },
//   { name: 'qux', position: { x: 633, y: 213 } },
//   { name: 'baz', position: { x: 323, y: 319 } },
//   { name: 'bar', position: { x: 515, y: 602 } } ]

Options

Option Type Default
width number document.body.clientWidth
height number document.body.clientHeight
size number 200
ratio numer 0.3

Contribution

  1. Fork (https://github.com/linyows/pattern-wall/fork)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Run test suite with the npm ci command and confirm that it passes
  6. Create a new Pull Request

Author

linyows

Readme

Keywords

Package Sidebar

Install

npm i pattern-wall

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

12.8 kB

Total Files

8

Last publish

Collaborators

  • linyows