1.0.1 • Published 5 years ago

pattern-wall v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

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

OptionTypeDefault
widthnumberdocument.body.clientWidth
heightnumberdocument.body.clientHeight
sizenumber200
rationumer0.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