pivot-crossfilter

1.0.1 • Public • Published

pivot for crossfilter

This is a simple pivot function for crossfilter, written as an ES6 module. The lib folder contains ES5 code generated by Babel for UMD module system.

The function returns the counts for a given row and column; and the product of the row/col.

data = [{ product: "A", store: "B"},
        {product: "B", store: "A"},
	    {product: "C", store: "B"}]

fact = crossfilter(data);
		
pivot( facts, "product", "store")`

This code will yield the result:

{
	"product": {
		"A": 1,
		"B": 1,
		"C": 1
	},
	"store": {
		"A": 1,
		"B": 2
	},
	"product|store": {
		"A|B": 1,
		"B|A": 1,
		"C|B": 1
	}
}`

Readme

Keywords

Package Sidebar

Install

npm i pivot-crossfilter

Weekly Downloads

4

Version

1.0.1

License

MIT

Last publish

Collaborators

  • petermoresi