nnajm / orb

Pivot table javascript library
https://nnajm.github.io/orb/
MIT License
556 stars 173 forks source link

orb

Pivot grid javascript library.

Website: https://nnajm.github.io/orb/

Latest version: 1.0.9 (Release notes)

cdnjs: https://cdnjs.com/libraries/orb

Demo:

Demo

Features

Interactivity

Customization

Data query

Query aggregation results with a simple API:

var orb = require('orb');
var pgrid = new orb.pgrid(config);

// query
var q = pgrid.query()
             .Manufacturer('Adventure Works')
             .Class('Economy');

1 field

q.Amount()

=> 1185.17 

List of fields

q.val('Amount', 'Q')

=> {
     Amount: 1185.17,
     Q: 44
   }

Aggregation func

builtin

q.stdev('Amount', 'Q');

=> {
     Amount: 1377.58,
     Q: 3.9
   }

custom

q.val({
    // count
    aggregateFunc: function(datafield, intersection, datasource) {
        return intersection.length;
    },
    fields: ['Amount', 'Q']
});

=> {
     Amount: 7,
     Q: 7
   }

Licence

MIT