heap-grid

1.0.1 • Public • Published

Heap Grid

Demo

Github Demo

Description

Randomly position elements based on heap permutations

Installation

npm install heap-grid

Usage

import HeapGrid from 'heap-grid';
 
var gridEl = document.getElementById('grid');
var grid = new HeapGrid(gridEl, { size: 250 });
 
var elements = [] // GRID ELEMENTS;
                
for (var i = 0; i < elements.length; i++) {
    var style = grid.place();
    for (var s of style) {
        elements[i].style[s] = style[s];
    }
}

Dependents (0)

Package Sidebar

Install

npm i heap-grid

Weekly Downloads

0

Version

1.0.1

License

ISC

Last publish

Collaborators

  • rphansen91