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

eval-grid

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

eval-grid

Initializes an n-dimensional image

  • 0.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

eval-grid

Initializes an n-dimensional array with a specified function. Useful for plotting and volume visualization.

Installation

Via npm:

npm install eval-grid

Example

Running:

console.log(require("eval-grid")([3, 3, 3], function(x) {
  return x[0] + x[1] + x[2];
});

Prints:

[ [ [ 0, 1, 2 ], [ 1, 2, 3 ], [ 2, 3, 4 ] ],
  [ [ 1, 2, 3 ], [ 2, 3, 4 ], [ 3, 4, 5 ] ],
  [ [ 2, 3, 4 ], [ 3, 4, 5 ], [ 4, 5, 6 ] ] ]
  

require("eval-grid")(dims, func)

This initializes an n-dimensional image, with dimensions dims using func.

  • dims are the dimensions of the image to initialize.
  • func is the function to initialize the grid with. It takes an array of integer coordinates with length = dims.length as input and returns the value to initialize the grid with.

Returns the initialized grid.

Credits

(c) 2013 Mikola Lysenko. BSD License

Keywords

FAQs

Package last updated on 17 Feb 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