Skip to content

petermoresi/pivot-crossfilter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
	}
}`

About

Simple pivot function for crossfilter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published