Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

archimedean-spiral-layout

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

archimedean-spiral-layout

An algorithm that can be used to place items collision-free within a bounding box that contains obstacles.

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

archimedean-spiral-layout

An algorithm that can be used to place items collision-free within a bounding box that contains obstacles.

🚀 Getting Started

Using npm:

npm install --save archimedean-spiral-layout

Using yarn:

yarn add archimedean-spiral-layout

✍️ Example

import shouldLayout from 'archimedean-spiral-layout';

const bounds = [ 0, 0, 1024, 768 ]; // x, y, (x + w), (y + h)

const obstacles = [
  [ 120, 402, 78 ], // x1, y1, r1
  [ 453, 329, 39 ], // x2, y2, r2
];

const objectsToPlace = [ 205, 404, 90 ]; // r1, r2, r3

shouldLayout(bounds, obstacles, objectsToPlace);  // [[701.9283498160538,335.5931622996223],[478.3142838715479,911.9263893090715],[40.82310481594527,645.7505175634124]]

✌️ License

MIT

Keywords

FAQs

Package last updated on 03 Oct 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc