Hypnotable Footer
Add a footer to your Hypnotable! Great for totals or other reductions of data.
Usage
Install: npm i -S hypnotable-footer
Columns now take a reduce
function. The object returned by reduce
will be fed into property
and then template
:
var columns = title: 'Repos per Follower' { return userpublic_repos / userfollowers } { return val } { memo = memo || public_repos: 0 followers: 0 memopublic_repos += userpublic_repos memofollowers += userfollowers return memo } title: 'Repos' property: 'public_repos' className: 'repositories' { memo = memo || public_repos: 0 memopublic_repos += userpublic_repos return memo } var ht = var htf = htel columns datadata
Example
npm run example
License
MIT