Pivot Table from CSV
JavaScript module for converting CSV data into pivot table with configurable columns and rows.
Usage
- Download app.js
- Link to your page
<script type="text/javascript" src="js/app.js"></script>
- load any table data in JSON format into variable
- use pivotTable global function with the data
pivotTabe(data, [rowNames...], [colNames...], callbackFun(items) {
let result = 0;
for (let item of items) {
result += +item['propertyForSummation']
}
return result;
})
Browser support
Latest Chrome and FireFox
Build
npm i
npm build
Unit Tests
npm test