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

grid-graph

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

grid-graph

Generates a grid shaped graph

  • 0.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

grid-graph

Generates n-dimensional grid graphs.

Install

npm install grid-graph

Example


var gridGen = require("grid-graph")

//A 5x5 grid
console.log(gridGen([5, 5]))

//A 3x3x3 cube
console.log(gridGen([3, 3, 3]))

//Periodic grids are allowed too.  Example, 4x6 torus:
console.log(gridGen([3,4], true))

//You can also make the grid periodic along only some axes.  Example cylinder:
console.log(gridGen([5,5], [true, false]))

require("grid-graph")(shape[, periodic])

Generates a grid graph

  • shape is an array of the dimensions of each axis
  • periodic is an optional argument which is either an array of truthy values which determine whether or not to make some axis periodic.

Returns An array of edges for the newly generated grid.

Credits

(c) 2013 Mikola Lysenko. MIT License

Keywords

FAQs

Package last updated on 04 Apr 2013

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