-
Notifications
You must be signed in to change notification settings - Fork 144
Home
dcchuck edited this page Sep 14, 2017
·
16 revisions
Hypergrid is a canvas grid rendering engine built with focus on performance.
Builds of the latest version of Hypergrid are available on the Github CDN here or on NPM as a node module for bundling.
npm install fin-hypergrid
const Hypergrid = require('fin-hypergrid');
const myGrid = new Hypergrid(container, options);
// The script tag exposes the Hypergrid constructor as fin.Hypergrid
const myGrid = new fin.Hypergrid(container, options);
Takes a dom element ID as a string (i.e. #myGrid
) to mount Hypergrid in. If no parameter is sent in, Hypergrid will mount in a div with id hypergrid
.
An object. These are the options used to instantiate the grid, i.e. data
.
The data
you pass in to the options or via the .setData()
method is an array of congruent objects.
const data = [
{ name: 'Company 1', price: 300 },
{ name: 'Company 2', price: 200 },
{ name: 'Company 3', price: 150 },
{ name: 'Company 4', price: 500 },
{ name: 'Company 5', price: 999 }
];
Column properties can then be defined in the grid's behavior.
The grid is then rendered with as defined in the default settings here, unless overridden in the instantiation.