Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

pattern-wall

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pattern-wall

Generate positions for pattern in an area

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

🌈
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

OptionTypeDefault
widthnumberdocument.body.clientWidth
heightnumberdocument.body.clientHeight
sizenumber200
rationumer0.3

Contribution

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

Author

linyows

Keywords

image

FAQs

Package last updated on 07 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts