reducir y renombrar opciones de lista de calculos

This commit is contained in:
dehernandezm 2024-12-16 21:06:05 -06:00
parent c2fb5802cd
commit cb0837905f
8 changed files with 28 additions and 26 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/__tests__/*

View File

@ -1 +1 @@
{"version":3,"sources":["src/PivotTable.jsx"],"names":["PivotTable","Renderer","props","renderers","rendererName","Object","keys","React","PureComponent","propTypes","assign","PivotData","PropTypes","string","objectOf","func","defaultProps","TableRenderers"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;;;AAEA;AACA;;IAEMA,U;;;;;;;;;;;6BACK;AACP,UAAMC,WAAW,KAAKC,KAAL,CAAWC,SAAX,CACf,KAAKD,KAAL,CAAWE,YAAX,IAA2B,KAAKF,KAAL,CAAWC,SAAtC,GACI,KAAKD,KAAL,CAAWE,YADf,GAEIC,OAAOC,IAAP,CAAY,KAAKJ,KAAL,CAAWC,SAAvB,EAAkC,CAAlC,CAHW,CAAjB;AAKA,aAAO,8BAAC,QAAD,EAAc,KAAKD,KAAnB,CAAP;AACD;;;;EARsBK,gBAAMC,a;;AAW/BR,WAAWS,SAAX,GAAuBJ,OAAOK,MAAP,CAAc,EAAd,EAAkBC,qBAAUF,SAA5B,EAAuC;AAC5DL,gBAAcQ,oBAAUC,MADoC;AAE5DV,aAAWS,oBAAUE,QAAV,CAAmBF,oBAAUG,IAA7B;AAFiD,CAAvC,CAAvB;;AAKAf,WAAWgB,YAAX,GAA0BX,OAAOK,MAAP,CAAc,EAAd,EAAkBC,qBAAUK,YAA5B,EAA0C;AAClEZ,gBAAc,OADoD;AAElED,aAAWc;AAFuD,CAA1C,CAA1B;;kBAKejB,U","file":"PivotTable.js","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {PivotData} from './Utilities';\nimport TableRenderers from './TableRenderers';\n\n/* eslint-disable react/prop-types */\n// eslint can't see inherited propTypes!\n\nclass PivotTable extends React.PureComponent {\n render() {\n const Renderer = this.props.renderers[\n this.props.rendererName in this.props.renderers\n ? this.props.rendererName\n : Object.keys(this.props.renderers)[0]\n ];\n return <Renderer {...this.props} />;\n }\n}\n\nPivotTable.propTypes = Object.assign({}, PivotData.propTypes, {\n rendererName: PropTypes.string,\n renderers: PropTypes.objectOf(PropTypes.func),\n});\n\nPivotTable.defaultProps = Object.assign({}, PivotData.defaultProps, {\n rendererName: 'Table',\n renderers: TableRenderers,\n});\n\nexport default PivotTable;\n"]}
{"version":3,"sources":["../src/PivotTable.jsx"],"names":["PivotTable","Renderer","props","renderers","rendererName","Object","keys","React","PureComponent","propTypes","assign","PivotData","PropTypes","string","objectOf","func","defaultProps","TableRenderers"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;;;AAEA;AACA;;IAEMA,U;;;;;;;;;;;6BACK;AACP,UAAMC,WAAW,KAAKC,KAAL,CAAWC,SAAX,CACf,KAAKD,KAAL,CAAWE,YAAX,IAA2B,KAAKF,KAAL,CAAWC,SAAtC,GACI,KAAKD,KAAL,CAAWE,YADf,GAEIC,OAAOC,IAAP,CAAY,KAAKJ,KAAL,CAAWC,SAAvB,EAAkC,CAAlC,CAHW,CAAjB;AAKA,aAAO,8BAAC,QAAD,EAAc,KAAKD,KAAnB,CAAP;AACD;;;;EARsBK,gBAAMC,a;;AAW/BR,WAAWS,SAAX,GAAuBJ,OAAOK,MAAP,CAAc,EAAd,EAAkBC,qBAAUF,SAA5B,EAAuC;AAC5DL,gBAAcQ,oBAAUC,MADoC;AAE5DV,aAAWS,oBAAUE,QAAV,CAAmBF,oBAAUG,IAA7B;AAFiD,CAAvC,CAAvB;;AAKAf,WAAWgB,YAAX,GAA0BX,OAAOK,MAAP,CAAc,EAAd,EAAkBC,qBAAUK,YAA5B,EAA0C;AAClEZ,gBAAc,OADoD;AAElED,aAAWc;AAFuD,CAA1C,CAA1B;;kBAKejB,U","file":"PivotTable.js","sourcesContent":["import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport {PivotData} from './Utilities';\r\nimport TableRenderers from './TableRenderers';\r\n\r\n/* eslint-disable react/prop-types */\r\n// eslint can't see inherited propTypes!\r\n\r\nclass PivotTable extends React.PureComponent {\r\n render() {\r\n const Renderer = this.props.renderers[\r\n this.props.rendererName in this.props.renderers\r\n ? this.props.rendererName\r\n : Object.keys(this.props.renderers)[0]\r\n ];\r\n return <Renderer {...this.props} />;\r\n }\r\n}\r\n\r\nPivotTable.propTypes = Object.assign({}, PivotData.propTypes, {\r\n rendererName: PropTypes.string,\r\n renderers: PropTypes.objectOf(PropTypes.func),\r\n});\r\n\r\nPivotTable.defaultProps = Object.assign({}, PivotData.defaultProps, {\r\n rendererName: 'Table',\r\n renderers: TableRenderers,\r\n});\r\n\r\nexport default PivotTable;\r\n"]}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -485,26 +485,26 @@ aggregatorTemplates.stdev = function (ddof, f) {
// default aggregators & renderers use US naming and number formatting
var aggregators = function (tpl) {
return {
Count: tpl.count(usFmtInt),
'Count Unique Values': tpl.countUnique(usFmtInt),
'List Unique Values': tpl.listUnique(', '),
Sum: tpl.sum(usFmt),
'Integer Sum': tpl.sum(usFmtInt),
Average: tpl.average(usFmt),
Median: tpl.median(usFmt),
'Sample Variance': tpl.var(1, usFmt),
'Sample Standard Deviation': tpl.stdev(1, usFmt),
Minimum: tpl.min(usFmt),
Maximum: tpl.max(usFmt),
First: tpl.first(usFmt),
Last: tpl.last(usFmt),
'Sum over Sum': tpl.sumOverSum(usFmt),
'Sum as Fraction of Total': tpl.fractionOf(tpl.sum(), 'total', usFmtPct),
'Sum as Fraction of Rows': tpl.fractionOf(tpl.sum(), 'row', usFmtPct),
'Sum as Fraction of Columns': tpl.fractionOf(tpl.sum(), 'col', usFmtPct),
'Count as Fraction of Total': tpl.fractionOf(tpl.count(), 'total', usFmtPct),
'Count as Fraction of Rows': tpl.fractionOf(tpl.count(), 'row', usFmtPct),
'Count as Fraction of Columns': tpl.fractionOf(tpl.count(), 'col', usFmtPct)
// Count: tpl.count(usFmtInt),
// 'Count Unique Values': tpl.countUnique(usFmtInt),
// 'List Unique Values': tpl.listUnique(', '),
Suma: tpl.sum(usFmt),
// 'Integer Sum': tpl.sum(usFmtInt),
Promedio: tpl.average(usFmt),
// Median: tpl.median(usFmt),
// 'Sample Variance': tpl.var(1, usFmt),
// 'Sample Standard Deviation': tpl.stdev(1, usFmt),
"Mínimo": tpl.min(usFmt),
"Máximo": tpl.max(usFmt)
// First: tpl.first(usFmt),
// Last: tpl.last(usFmt),
// 'Sum over Sum': tpl.sumOverSum(usFmt),
// 'Sum as Fraction of Total': tpl.fractionOf(tpl.sum(), 'total', usFmtPct),
// 'Sum as Fraction of Rows': tpl.fractionOf(tpl.sum(), 'row', usFmtPct),
// 'Sum as Fraction of Columns': tpl.fractionOf(tpl.sum(), 'col', usFmtPct),
// 'Count as Fraction of Total': tpl.fractionOf(tpl.count(), 'total', usFmtPct),
// 'Count as Fraction of Rows': tpl.fractionOf(tpl.count(), 'row', usFmtPct),
// 'Count as Fraction of Columns': tpl.fractionOf(tpl.count(), 'col', usFmtPct),
};
}(aggregatorTemplates);

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "v-react-pivottable",
"version": "0.11.1",
"version": "0.11.2",
"description": "A React-based pivot table",
"main": "PivotTableUI.js",
"files": [