@@ -69,7 +69,7 @@ interface AggregatorTemplates {
6969// ==================== PivotData 관련 타입 ====================
7070interface PivotDataProps {
7171 data : DataRecord [ ] | DataRecord [ ] [ ] | ( ( callback : ( record : DataRecord ) => void ) => void )
72- aggregators ?: Record < string , AggregatorFunction >
72+ aggregators ?: Record < string , AggregatorTemplate >
7373 cols ?: string [ ]
7474 rows ?: string [ ]
7575 vals ?: string [ ]
@@ -103,8 +103,8 @@ interface LocaleStrings {
103103}
104104
105105interface Locale {
106- aggregators ?: Record < string , AggregatorFunction >
107- frAggregators ?: Record < string , AggregatorFunction >
106+ aggregators ?: Record < string , AggregatorTemplate >
107+ frAggregators ?: Record < string , AggregatorTemplate >
108108 localeStrings : LocaleStrings
109109}
110110
@@ -538,72 +538,46 @@ const aggregatorTemplates: AggregatorTemplates = {
538538
539539// ==================== 기본 Aggregators ====================
540540
541- const aggregators : Record < string , AggregatorFunction > = {
542- 'Count' : aggregatorTemplates . count ( usFmtInt ) ( ) ,
543- 'Count Unique Values' : aggregatorTemplates . countUnique ( usFmtInt ) ( ) ,
544- 'List Unique Values' : aggregatorTemplates . listUnique ( ', ' ) ( ) ,
545- 'Sum' : aggregatorTemplates . sum ( usFmt ) ( ) ,
546- 'Integer Sum' : aggregatorTemplates . sum ( usFmtInt ) ( ) ,
547- 'Average' : aggregatorTemplates . average ( usFmt ) ( ) ,
548- 'Median' : aggregatorTemplates . median ( usFmt ) ( ) ,
549- 'Sample Variance' : aggregatorTemplates . var ( 1 , usFmt ) ( ) ,
550- 'Sample Standard Deviation' : aggregatorTemplates . stdev ( 1 , usFmt ) ( ) ,
551- 'Minimum' : aggregatorTemplates . min ( usFmt ) ( ) ,
552- 'Maximum' : aggregatorTemplates . max ( usFmt ) ( ) ,
553- 'First' : aggregatorTemplates . first ( usFmt ) ( ) ,
554- 'Last' : aggregatorTemplates . last ( usFmt ) ( ) ,
555- 'Sum over Sum' : aggregatorTemplates . sumOverSum ( usFmt ) ( ) ,
556- 'Sum as Fraction of Total' : aggregatorTemplates . fractionOf ( aggregatorTemplates . sum ( ) , 'total' , usFmtPct ) ( ) ,
557- 'Sum as Fraction of Rows' : aggregatorTemplates . fractionOf ( aggregatorTemplates . sum ( ) , 'row' , usFmtPct ) ( ) ,
558- 'Sum as Fraction of Columns' : aggregatorTemplates . fractionOf ( aggregatorTemplates . sum ( ) , 'col' , usFmtPct ) ( ) ,
559- 'Count as Fraction of Total' : aggregatorTemplates . fractionOf ( aggregatorTemplates . count ( ) , 'total' , usFmtPct ) ( ) ,
560- 'Count as Fraction of Rows' : aggregatorTemplates . fractionOf ( aggregatorTemplates . count ( ) , 'row' , usFmtPct ) ( ) ,
561- 'Count as Fraction of Columns' : aggregatorTemplates . fractionOf ( aggregatorTemplates . count ( ) , 'col' , usFmtPct ) ( )
541+ const aggregators : Record < string , AggregatorTemplate > = {
542+ 'Count' : aggregatorTemplates . count ( usFmtInt ) ,
543+ 'Count Unique Values' : aggregatorTemplates . countUnique ( usFmtInt ) ,
544+ 'List Unique Values' : aggregatorTemplates . listUnique ( ', ' ) ,
545+ 'Sum' : aggregatorTemplates . sum ( usFmt ) ,
546+ 'Integer Sum' : aggregatorTemplates . sum ( usFmtInt ) ,
547+ 'Average' : aggregatorTemplates . average ( usFmt ) ,
548+ 'Median' : aggregatorTemplates . median ( usFmt ) ,
549+ 'Sample Variance' : aggregatorTemplates . var ( 1 , usFmt ) ,
550+ 'Sample Standard Deviation' : aggregatorTemplates . stdev ( 1 , usFmt ) ,
551+ 'Minimum' : aggregatorTemplates . min ( usFmt ) ,
552+ 'Maximum' : aggregatorTemplates . max ( usFmt ) ,
553+ 'First' : aggregatorTemplates . first ( usFmt ) ,
554+ 'Last' : aggregatorTemplates . last ( usFmt ) ,
555+ 'Sum over Sum' : aggregatorTemplates . sumOverSum ( usFmt ) ,
556+ 'Sum as Fraction of Total' : aggregatorTemplates . fractionOf ( aggregatorTemplates . sum ( ) , 'total' , usFmtPct ) ,
557+ 'Sum as Fraction of Rows' : aggregatorTemplates . fractionOf ( aggregatorTemplates . sum ( ) , 'row' , usFmtPct ) ,
558+ 'Sum as Fraction of Columns' : aggregatorTemplates . fractionOf ( aggregatorTemplates . sum ( ) , 'col' , usFmtPct ) ,
559+ 'Count as Fraction of Total' : aggregatorTemplates . fractionOf ( aggregatorTemplates . count ( ) , 'total' , usFmtPct ) ,
560+ 'Count as Fraction of Rows' : aggregatorTemplates . fractionOf ( aggregatorTemplates . count ( ) , 'row' , usFmtPct ) ,
561+ 'Count as Fraction of Columns' : aggregatorTemplates . fractionOf ( aggregatorTemplates . count ( ) , 'col' , usFmtPct )
562562}
563563
564564// ==================== 프랑스어 Aggregators ====================
565565
566- const frAggregators : Record < string , AggregatorFunction > = {
567- 'Compte' : aggregatorTemplates . count ( usFmtInt ) ( ) ,
568- 'Compter les valeurs uniques' : aggregatorTemplates . countUnique ( usFmtInt ) ( ) ,
569- 'Liste des valeurs uniques' : aggregatorTemplates . listUnique ( ', ' ) ( ) ,
570- 'Somme' : aggregatorTemplates . sum ( usFmt ) ( ) ,
571- 'Somme de nombres entiers' : aggregatorTemplates . sum ( usFmtInt ) ( ) ,
572- 'Moyenne' : aggregatorTemplates . average ( usFmt ) ( ) ,
573- 'Médiane' : aggregatorTemplates . median ( usFmt ) ( ) ,
574- "Variance de l'échantillon" : aggregatorTemplates . var ( 1 , usFmt ) ( ) ,
575- "Écart-type de l'échantillon" : aggregatorTemplates . stdev ( 1 , usFmt ) ( ) ,
576- 'Minimum' : aggregatorTemplates . min ( usFmt ) ( ) ,
577- 'Maximum' : aggregatorTemplates . max ( usFmt ) ( ) ,
578- 'Premier' : aggregatorTemplates . first ( usFmt ) ( ) ,
579- 'Dernier' : aggregatorTemplates . last ( usFmt ) ( ) ,
580- 'Somme Total' : aggregatorTemplates . sumOverSum ( usFmt ) ( ) ,
581- 'Somme en fraction du total' : aggregatorTemplates . fractionOf ( aggregatorTemplates . sum ( ) , 'total' , usFmtPct ) ( ) ,
582- 'Somme en tant que fraction de lignes' : aggregatorTemplates . fractionOf (
583- aggregatorTemplates . sum ( ) ,
584- 'row' ,
585- usFmtPct
586- ) ( ) ,
587- 'Somme en tant que fraction de colonnes' : aggregatorTemplates . fractionOf (
588- aggregatorTemplates . sum ( ) ,
589- 'col' ,
590- usFmtPct
591- ) ( ) ,
592- 'Comptage en tant que fraction du total' : aggregatorTemplates . fractionOf (
593- aggregatorTemplates . count ( ) ,
594- 'total' ,
595- usFmtPct
596- ) ( ) ,
597- 'Comptage en tant que fraction de lignes' : aggregatorTemplates . fractionOf (
598- aggregatorTemplates . count ( ) ,
599- 'row' ,
600- usFmtPct
601- ) ( ) ,
602- 'Comptage en tant que fraction de colonnes' : aggregatorTemplates . fractionOf (
603- aggregatorTemplates . count ( ) ,
604- 'col' ,
605- usFmtPct
606- ) ( )
566+ const frAggregators : Record < string , AggregatorTemplate > = {
567+ 'Compte' : aggregatorTemplates . count ( usFmtInt ) ,
568+ 'Compter les valeurs uniques' : aggregatorTemplates . countUnique ( usFmtInt ) ,
569+ 'Liste des valeurs uniques' : aggregatorTemplates . listUnique ( ', ' ) ,
570+ 'Somme' : aggregatorTemplates . sum ( usFmt ) ,
571+ 'Somme de nombres entiers' : aggregatorTemplates . sum ( usFmtInt ) ,
572+ 'Moyenne' : aggregatorTemplates . average ( usFmt ) ,
573+ 'Médiane' : aggregatorTemplates . median ( usFmt ) ,
574+ "Variance de l'échantillon" : aggregatorTemplates . var ( 1 , usFmt ) ,
575+ "Écart-type de l'échantillon" : aggregatorTemplates . stdev ( 1 , usFmt ) ,
576+ 'Minimum' : aggregatorTemplates . min ( usFmt ) ,
577+ 'Maximum' : aggregatorTemplates . max ( usFmt ) ,
578+ 'Premier' : aggregatorTemplates . first ( usFmt ) ,
579+ 'Dernier' : aggregatorTemplates . last ( usFmt ) ,
580+ 'Somme Total' : aggregatorTemplates . sumOverSum ( usFmt )
607581}
608582
609583// ==================== Locales ====================
@@ -743,7 +717,7 @@ class PivotData {
743717
744718 constructor ( inputProps : Partial < PivotDataProps > = { } ) {
745719 this . props = Object . assign ( { } , PivotData . defaultProps , inputProps )
746- this . aggregator = this . props . aggregators [ this . props . aggregatorName ] !
720+ this . aggregator = this . props . aggregators [ this . props . aggregatorName ] ! ( this . props . vals )
747721 this . tree = { }
748722 this . rowKeys = [ ]
749723 this . colKeys = [ ]
0 commit comments