@dhis2/analytics 27.0.0 → 27.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.TruncatedHeaderCell = exports.SmallEmptyRowsShown = exports.SmallEmptyRowsHidden = exports.SimpleTitleSubtitleFilter = exports.SimpleNoRowsSmall = exports.SimpleNoRowsLarge = exports.SimpleNoColumnsSingleCell = exports.SimpleNoColumnsLabel = exports.SimpleNoColumnsDeep = exports.SimpleNoColumns = exports.SimpleDataAsFilter = exports.SimpleCommaDgs = exports.SimpleColumn = exports.SimpleAvgTotalAggregationTypeRows = exports.SimpleAvgTotalAggregationTypeColumns = exports.Simple = exports.NarrativeDataAsFilter = exports.Narrative = exports.LegendFixedText = exports.LegendFixedRow = exports.LegendFixedLightFill = exports.LegendFixedDarkFill = exports.LegendByDataItem = exports.HierarchyRows = exports.HierarchyNone = exports.HierarchyColumns = exports.EmptyRowsShown = exports.EmptyRowsHidden = exports.EmptyColumnsWeeklyShown = exports.EmptyColumnsWeeklyHidden = exports.EmptyColumnsShown = exports.EmptyColumnsHidden = exports.EmptyColumnsAssignedCatsShown = exports.EmptyColumnsAssignedCatsHidden = exports.Degs = exports.DeepTotals = exports.DeepTitleSubtitleFilter = exports.DeepSubtotals = exports.DeepSmallCompact = exports.DeepRow = exports.DeepResize = exports.DeepLargeComfortable = exports.DeepFilter = exports.DeepDimensionLabels = exports.DeepColumn = exports.DeepAllTotals = exports.Deep = exports.CumulativeEmptyColumnsWeeklyShown = exports.CumulativeEmptyColumnsWeeklyHidden = void 0;
6
+ exports.default = exports.TruncatedHeaderCell = exports.SmallEmptyRowsShown = exports.SmallEmptyRowsHidden = exports.SimpleTitleSubtitleFilter = exports.SimpleRow = exports.SimpleNoRowsSmall = exports.SimpleNoRowsLarge = exports.SimpleNoColumnsSingleCell = exports.SimpleNoColumnsLabel = exports.SimpleNoColumnsDeep = exports.SimpleNoColumns = exports.SimpleDataAsFilter = exports.SimpleCommaDgs = exports.SimpleColumn = exports.SimpleAvgTotalAggregationTypeRows = exports.SimpleAvgTotalAggregationTypeColumns = exports.Simple = exports.NarrativeDataAsFilter = exports.Narrative = exports.LegendFixedText = exports.LegendFixedRow = exports.LegendFixedLightFill = exports.LegendFixedDarkFill = exports.LegendByDataItem = exports.HierarchyRows = exports.HierarchyNone = exports.HierarchyColumns = exports.EmptyRowsShown = exports.EmptyRowsHidden = exports.EmptyColumnsWeeklyShown = exports.EmptyColumnsWeeklyHidden = exports.EmptyColumnsShown = exports.EmptyColumnsHidden = exports.EmptyColumnsAssignedCatsShown = exports.EmptyColumnsAssignedCatsHidden = exports.Degs = exports.DeepTotals = exports.DeepTitleSubtitleFilter = exports.DeepSubtotals = exports.DeepSmallCompact = exports.DeepRow = exports.DeepResize = exports.DeepLargeComfortable = exports.DeepFilter = exports.DeepDimensionLabels = exports.DeepColumn = exports.DeepAllTotals = exports.Deep = exports.CumulativeEmptyColumnsWeeklyShown = exports.CumulativeEmptyColumnsWeeklyHidden = void 0;
7
7
  var _ui = require("@dhis2/ui");
8
8
  var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
9
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -208,10 +208,34 @@ exports.SimpleColumn = SimpleColumn;
208
208
  SimpleColumn.story = {
209
209
  name: 'simple - column %'
210
210
  };
211
- const SimpleDataAsFilter = (_, _ref7) => {
211
+ const SimpleRow = (_, _ref7) => {
212
212
  let {
213
213
  pivotTableOptions
214
214
  } = _ref7;
215
+ const visualization = {
216
+ ..._diseaseWeeksVisualization.default,
217
+ ...visualizationReset,
218
+ ...pivotTableOptions,
219
+ numberType: _pivotTableConstants.NUMBER_TYPE_ROW_PERCENTAGE
220
+ };
221
+ return /*#__PURE__*/_react.default.createElement("div", {
222
+ style: {
223
+ width: 800,
224
+ height: 600
225
+ }
226
+ }, /*#__PURE__*/_react.default.createElement(_index.PivotTable, {
227
+ data: diseaseWeeksData,
228
+ visualization: visualization
229
+ }));
230
+ };
231
+ exports.SimpleRow = SimpleRow;
232
+ SimpleRow.story = {
233
+ name: 'simple - row %'
234
+ };
235
+ const SimpleDataAsFilter = (_, _ref8) => {
236
+ let {
237
+ pivotTableOptions
238
+ } = _ref8;
215
239
  const visualization = {
216
240
  ..._simpleVisualization.default,
217
241
  ...visualizationReset,
@@ -233,10 +257,10 @@ exports.SimpleDataAsFilter = SimpleDataAsFilter;
233
257
  SimpleDataAsFilter.story = {
234
258
  name: 'simple - data as filter'
235
259
  };
236
- const SimpleNoColumns = (_, _ref8) => {
260
+ const SimpleNoColumns = (_, _ref9) => {
237
261
  let {
238
262
  pivotTableOptions
239
- } = _ref8;
263
+ } = _ref9;
240
264
  const visualization = {
241
265
  ..._simpleVisualization.default,
242
266
  ...visualizationReset,
@@ -262,10 +286,10 @@ exports.SimpleNoColumns = SimpleNoColumns;
262
286
  SimpleNoColumns.story = {
263
287
  name: 'simple - no columns'
264
288
  };
265
- const SimpleNoColumnsSingleCell = (_, _ref9) => {
289
+ const SimpleNoColumnsSingleCell = (_, _ref10) => {
266
290
  let {
267
291
  pivotTableOptions
268
- } = _ref9;
292
+ } = _ref10;
269
293
  const visualization = {
270
294
  ..._simpleVisualization.default,
271
295
  ...visualizationReset,
@@ -289,10 +313,10 @@ exports.SimpleNoColumnsSingleCell = SimpleNoColumnsSingleCell;
289
313
  SimpleNoColumnsSingleCell.story = {
290
314
  name: 'simple - no columns (single cell)'
291
315
  };
292
- const SimpleNoColumnsDeep = (_, _ref10) => {
316
+ const SimpleNoColumnsDeep = (_, _ref11) => {
293
317
  let {
294
318
  pivotTableOptions
295
- } = _ref10;
319
+ } = _ref11;
296
320
  const visualization = {
297
321
  ..._simpleVisualization.default,
298
322
  ...visualizationReset,
@@ -317,10 +341,10 @@ exports.SimpleNoColumnsDeep = SimpleNoColumnsDeep;
317
341
  SimpleNoColumnsDeep.story = {
318
342
  name: 'simple - no columns (deep)'
319
343
  };
320
- const SimpleNoColumnsLabel = (_, _ref11) => {
344
+ const SimpleNoColumnsLabel = (_, _ref12) => {
321
345
  let {
322
346
  pivotTableOptions
323
- } = _ref11;
347
+ } = _ref12;
324
348
  const visualization = {
325
349
  ..._simpleVisualization.default,
326
350
  ...visualizationReset,
@@ -347,10 +371,10 @@ exports.SimpleNoColumnsLabel = SimpleNoColumnsLabel;
347
371
  SimpleNoColumnsLabel.story = {
348
372
  name: 'simple - no columns (label)'
349
373
  };
350
- const SimpleNoRowsSmall = (_, _ref12) => {
374
+ const SimpleNoRowsSmall = (_, _ref13) => {
351
375
  let {
352
376
  pivotTableOptions
353
- } = _ref12;
377
+ } = _ref13;
354
378
  const visualization = {
355
379
  ..._simpleVisualization.default,
356
380
  ...visualizationReset,
@@ -377,10 +401,10 @@ exports.SimpleNoRowsSmall = SimpleNoRowsSmall;
377
401
  SimpleNoRowsSmall.story = {
378
402
  name: 'simple - no rows (small)'
379
403
  };
380
- const SimpleNoRowsLarge = (_, _ref13) => {
404
+ const SimpleNoRowsLarge = (_, _ref14) => {
381
405
  let {
382
406
  pivotTableOptions
383
- } = _ref13;
407
+ } = _ref14;
384
408
  const visualization = {
385
409
  ..._simpleVisualization.default,
386
410
  ...visualizationReset,
@@ -407,10 +431,10 @@ exports.SimpleNoRowsLarge = SimpleNoRowsLarge;
407
431
  SimpleNoRowsLarge.story = {
408
432
  name: 'simple - no rows (large)'
409
433
  };
410
- const SimpleAvgTotalAggregationTypeColumns = (_, _ref14) => {
434
+ const SimpleAvgTotalAggregationTypeColumns = (_, _ref15) => {
411
435
  let {
412
436
  pivotTableOptions
413
- } = _ref14;
437
+ } = _ref15;
414
438
  const visualization = {
415
439
  ..._avgTotalAggregationTypeVisualization.default,
416
440
  ...visualizationReset,
@@ -432,10 +456,10 @@ exports.SimpleAvgTotalAggregationTypeColumns = SimpleAvgTotalAggregationTypeColu
432
456
  SimpleAvgTotalAggregationTypeColumns.story = {
433
457
  name: 'simple - avg totalAggregationType columns'
434
458
  };
435
- const SimpleAvgTotalAggregationTypeRows = (_, _ref15) => {
459
+ const SimpleAvgTotalAggregationTypeRows = (_, _ref16) => {
436
460
  let {
437
461
  pivotTableOptions
438
- } = _ref15;
462
+ } = _ref16;
439
463
  const visualization = {
440
464
  ..._avgTotalAggregationTypeVisualization.default,
441
465
  ...visualizationReset,
@@ -459,10 +483,10 @@ exports.SimpleAvgTotalAggregationTypeRows = SimpleAvgTotalAggregationTypeRows;
459
483
  SimpleAvgTotalAggregationTypeRows.story = {
460
484
  name: 'simple - avg totalAggregationType rows'
461
485
  };
462
- const Deep = (_, _ref16) => {
486
+ const Deep = (_, _ref17) => {
463
487
  let {
464
488
  pivotTableOptions
465
- } = _ref16;
489
+ } = _ref17;
466
490
  const visualization = {
467
491
  ..._deepVisualization.default,
468
492
  ...visualizationReset,
@@ -483,10 +507,10 @@ exports.Deep = Deep;
483
507
  Deep.story = {
484
508
  name: 'deep'
485
509
  };
486
- const DeepFilter = (_, _ref17) => {
510
+ const DeepFilter = (_, _ref18) => {
487
511
  let {
488
512
  pivotTableOptions
489
- } = _ref17;
513
+ } = _ref18;
490
514
  const visualization = {
491
515
  ..._deepWithFiltersVisualization.default,
492
516
  ...visualizationReset,
@@ -507,10 +531,10 @@ exports.DeepFilter = DeepFilter;
507
531
  DeepFilter.story = {
508
532
  name: 'deep - filter'
509
533
  };
510
- const DeepTitleSubtitleFilter = (_, _ref18) => {
534
+ const DeepTitleSubtitleFilter = (_, _ref19) => {
511
535
  let {
512
536
  pivotTableOptions
513
- } = _ref18;
537
+ } = _ref19;
514
538
  const visualization = {
515
539
  ..._deepVisualization.default,
516
540
  ...visualizationReset,
@@ -533,10 +557,10 @@ exports.DeepTitleSubtitleFilter = DeepTitleSubtitleFilter;
533
557
  DeepTitleSubtitleFilter.story = {
534
558
  name: 'deep - title / subtitle / filter'
535
559
  };
536
- const DeepDimensionLabels = (_, _ref19) => {
560
+ const DeepDimensionLabels = (_, _ref20) => {
537
561
  let {
538
562
  pivotTableOptions
539
- } = _ref19;
563
+ } = _ref20;
540
564
  const visualization = {
541
565
  ..._deepVisualization.default,
542
566
  ...visualizationReset,
@@ -556,10 +580,10 @@ exports.DeepDimensionLabels = DeepDimensionLabels;
556
580
  DeepDimensionLabels.story = {
557
581
  name: 'deep - dimension labels'
558
582
  };
559
- const DeepSmallCompact = (_, _ref20) => {
583
+ const DeepSmallCompact = (_, _ref21) => {
560
584
  let {
561
585
  pivotTableOptions
562
- } = _ref20;
586
+ } = _ref21;
563
587
  const visualization = {
564
588
  ..._deepVisualization.default,
565
589
  ...visualizationReset,
@@ -581,10 +605,10 @@ exports.DeepSmallCompact = DeepSmallCompact;
581
605
  DeepSmallCompact.story = {
582
606
  name: 'deep - small / compact'
583
607
  };
584
- const DeepLargeComfortable = (_, _ref21) => {
608
+ const DeepLargeComfortable = (_, _ref22) => {
585
609
  let {
586
610
  pivotTableOptions
587
- } = _ref21;
611
+ } = _ref22;
588
612
  const visualization = {
589
613
  ..._deepVisualization.default,
590
614
  ...visualizationReset,
@@ -606,10 +630,10 @@ exports.DeepLargeComfortable = DeepLargeComfortable;
606
630
  DeepLargeComfortable.story = {
607
631
  name: 'deep - large / comfortable'
608
632
  };
609
- const DeepRow = (_, _ref22) => {
633
+ const DeepRow = (_, _ref23) => {
610
634
  let {
611
635
  pivotTableOptions
612
- } = _ref22;
636
+ } = _ref23;
613
637
  const visualization = {
614
638
  ..._deepVisualization.default,
615
639
  ...visualizationReset,
@@ -634,10 +658,10 @@ exports.DeepRow = DeepRow;
634
658
  DeepRow.story = {
635
659
  name: 'deep - row %'
636
660
  };
637
- const DeepColumn = (_, _ref23) => {
661
+ const DeepColumn = (_, _ref24) => {
638
662
  let {
639
663
  pivotTableOptions
640
- } = _ref23;
664
+ } = _ref24;
641
665
  const visualization = {
642
666
  ..._deepVisualization.default,
643
667
  ...visualizationReset,
@@ -662,10 +686,10 @@ exports.DeepColumn = DeepColumn;
662
686
  DeepColumn.story = {
663
687
  name: 'deep - column %'
664
688
  };
665
- const ResizingPivotTable = _ref24 => {
689
+ const ResizingPivotTable = _ref25 => {
666
690
  let {
667
691
  visualization
668
- } = _ref24;
692
+ } = _ref25;
669
693
  const [size, setSize] = (0, _react.useState)(() => ({
670
694
  width: 400,
671
695
  height: 300
@@ -696,10 +720,10 @@ const ResizingPivotTable = _ref24 => {
696
720
  ResizingPivotTable.propTypes = {
697
721
  visualization: _propTypes.default.object.isRequired
698
722
  };
699
- const DeepResize = (_, _ref25) => {
723
+ const DeepResize = (_, _ref26) => {
700
724
  let {
701
725
  pivotTableOptions
702
- } = _ref25;
726
+ } = _ref26;
703
727
  const visualization = {
704
728
  ..._deepVisualization.default,
705
729
  ...visualizationReset,
@@ -713,10 +737,10 @@ exports.DeepResize = DeepResize;
713
737
  DeepResize.story = {
714
738
  name: 'deep - resize'
715
739
  };
716
- const DeepTotals = (_, _ref26) => {
740
+ const DeepTotals = (_, _ref27) => {
717
741
  let {
718
742
  pivotTableOptions
719
- } = _ref26;
743
+ } = _ref27;
720
744
  const visualization = {
721
745
  ..._deepVisualization.default,
722
746
  ...visualizationReset,
@@ -738,10 +762,10 @@ exports.DeepTotals = DeepTotals;
738
762
  DeepTotals.story = {
739
763
  name: 'deep - totals'
740
764
  };
741
- const DeepSubtotals = (_, _ref27) => {
765
+ const DeepSubtotals = (_, _ref28) => {
742
766
  let {
743
767
  pivotTableOptions
744
- } = _ref27;
768
+ } = _ref28;
745
769
  const visualization = {
746
770
  ..._deepVisualization.default,
747
771
  ...visualizationReset,
@@ -763,10 +787,10 @@ exports.DeepSubtotals = DeepSubtotals;
763
787
  DeepSubtotals.story = {
764
788
  name: 'deep - subtotals'
765
789
  };
766
- const DeepAllTotals = (_, _ref28) => {
790
+ const DeepAllTotals = (_, _ref29) => {
767
791
  let {
768
792
  pivotTableOptions
769
- } = _ref28;
793
+ } = _ref29;
770
794
  const visualization = {
771
795
  ..._deepVisualization.default,
772
796
  ...visualizationReset,
@@ -790,10 +814,10 @@ exports.DeepAllTotals = DeepAllTotals;
790
814
  DeepAllTotals.story = {
791
815
  name: 'deep - all totals'
792
816
  };
793
- const SmallEmptyRowsShown = (_, _ref29) => {
817
+ const SmallEmptyRowsShown = (_, _ref30) => {
794
818
  let {
795
819
  pivotTableOptions
796
- } = _ref29;
820
+ } = _ref30;
797
821
  const visualization = {
798
822
  ..._diseaseWeeksVisualization.default,
799
823
  ...visualizationReset,
@@ -817,10 +841,10 @@ exports.SmallEmptyRowsShown = SmallEmptyRowsShown;
817
841
  SmallEmptyRowsShown.story = {
818
842
  name: 'small empty rows - shown'
819
843
  };
820
- const SmallEmptyRowsHidden = (_, _ref30) => {
844
+ const SmallEmptyRowsHidden = (_, _ref31) => {
821
845
  let {
822
846
  pivotTableOptions
823
- } = _ref30;
847
+ } = _ref31;
824
848
  const visualization = {
825
849
  ..._diseaseWeeksVisualization.default,
826
850
  ...visualizationReset,
@@ -845,10 +869,10 @@ exports.SmallEmptyRowsHidden = SmallEmptyRowsHidden;
845
869
  SmallEmptyRowsHidden.story = {
846
870
  name: 'small empty rows - hidden'
847
871
  };
848
- const EmptyRowsShown = (_, _ref31) => {
872
+ const EmptyRowsShown = (_, _ref32) => {
849
873
  let {
850
874
  pivotTableOptions
851
- } = _ref31;
875
+ } = _ref32;
852
876
  const visualization = {
853
877
  ..._emptyRowsVisualization.default,
854
878
  ...visualizationReset,
@@ -872,10 +896,10 @@ exports.EmptyRowsShown = EmptyRowsShown;
872
896
  EmptyRowsShown.story = {
873
897
  name: 'empty rows - shown'
874
898
  };
875
- const EmptyRowsHidden = (_, _ref32) => {
899
+ const EmptyRowsHidden = (_, _ref33) => {
876
900
  let {
877
901
  pivotTableOptions
878
- } = _ref32;
902
+ } = _ref33;
879
903
  const visualization = {
880
904
  ..._emptyRowsVisualization.default,
881
905
  ...visualizationReset,
@@ -896,10 +920,10 @@ exports.EmptyRowsHidden = EmptyRowsHidden;
896
920
  EmptyRowsHidden.story = {
897
921
  name: 'empty rows - hidden'
898
922
  };
899
- const EmptyColumnsShown = (_, _ref33) => {
923
+ const EmptyColumnsShown = (_, _ref34) => {
900
924
  let {
901
925
  pivotTableOptions
902
- } = _ref33;
926
+ } = _ref34;
903
927
  const visualization = {
904
928
  ..._lastFiveYearsVisualization.default,
905
929
  ...pivotTableOptions,
@@ -919,10 +943,10 @@ exports.EmptyColumnsShown = EmptyColumnsShown;
919
943
  EmptyColumnsShown.story = {
920
944
  name: 'empty columns - shown'
921
945
  };
922
- const EmptyColumnsHidden = (_, _ref34) => {
946
+ const EmptyColumnsHidden = (_, _ref35) => {
923
947
  let {
924
948
  pivotTableOptions
925
- } = _ref34;
949
+ } = _ref35;
926
950
  const visualization = {
927
951
  ..._lastFiveYearsVisualization.default,
928
952
  ...pivotTableOptions,
@@ -942,10 +966,10 @@ exports.EmptyColumnsHidden = EmptyColumnsHidden;
942
966
  EmptyColumnsHidden.story = {
943
967
  name: 'empty columns - hidden'
944
968
  };
945
- const EmptyColumnsWeeklyShown = (_, _ref35) => {
969
+ const EmptyColumnsWeeklyShown = (_, _ref36) => {
946
970
  let {
947
971
  pivotTableOptions
948
- } = _ref35;
972
+ } = _ref36;
949
973
  const visualization = {
950
974
  ..._weeklyColumnsVisualization.default,
951
975
  ...pivotTableOptions,
@@ -965,10 +989,10 @@ exports.EmptyColumnsWeeklyShown = EmptyColumnsWeeklyShown;
965
989
  EmptyColumnsWeeklyShown.story = {
966
990
  name: 'empty columns (weekly) - shown'
967
991
  };
968
- const CumulativeEmptyColumnsWeeklyShown = (_, _ref36) => {
992
+ const CumulativeEmptyColumnsWeeklyShown = (_, _ref37) => {
969
993
  let {
970
994
  pivotTableOptions
971
- } = _ref36;
995
+ } = _ref37;
972
996
  const visualization = {
973
997
  ..._weeklyColumnsVisualization.default,
974
998
  ...pivotTableOptions,
@@ -989,10 +1013,10 @@ exports.CumulativeEmptyColumnsWeeklyShown = CumulativeEmptyColumnsWeeklyShown;
989
1013
  CumulativeEmptyColumnsWeeklyShown.story = {
990
1014
  name: 'cumulative + empty columns (weekly) - shown'
991
1015
  };
992
- const EmptyColumnsWeeklyHidden = (_, _ref37) => {
1016
+ const EmptyColumnsWeeklyHidden = (_, _ref38) => {
993
1017
  let {
994
1018
  pivotTableOptions
995
- } = _ref37;
1019
+ } = _ref38;
996
1020
  const visualization = {
997
1021
  ..._weeklyColumnsVisualization.default,
998
1022
  ...pivotTableOptions,
@@ -1012,10 +1036,10 @@ exports.EmptyColumnsWeeklyHidden = EmptyColumnsWeeklyHidden;
1012
1036
  EmptyColumnsWeeklyHidden.story = {
1013
1037
  name: 'empty columns (weekly) - hidden'
1014
1038
  };
1015
- const CumulativeEmptyColumnsWeeklyHidden = (_, _ref38) => {
1039
+ const CumulativeEmptyColumnsWeeklyHidden = (_, _ref39) => {
1016
1040
  let {
1017
1041
  pivotTableOptions
1018
- } = _ref38;
1042
+ } = _ref39;
1019
1043
  const visualization = {
1020
1044
  ..._weeklyColumnsVisualization.default,
1021
1045
  ...pivotTableOptions,
@@ -1036,10 +1060,10 @@ exports.CumulativeEmptyColumnsWeeklyHidden = CumulativeEmptyColumnsWeeklyHidden;
1036
1060
  CumulativeEmptyColumnsWeeklyHidden.story = {
1037
1061
  name: 'cumulative + empty columns (weekly) - hidden'
1038
1062
  };
1039
- const EmptyColumnsAssignedCatsShown = (_, _ref39) => {
1063
+ const EmptyColumnsAssignedCatsShown = (_, _ref40) => {
1040
1064
  let {
1041
1065
  pivotTableOptions
1042
- } = _ref39;
1066
+ } = _ref40;
1043
1067
  const visualization = {
1044
1068
  ..._emptyColumnsVisualization.default,
1045
1069
  ...visualizationReset,
@@ -1060,10 +1084,10 @@ exports.EmptyColumnsAssignedCatsShown = EmptyColumnsAssignedCatsShown;
1060
1084
  EmptyColumnsAssignedCatsShown.story = {
1061
1085
  name: 'empty columns + assigned cats (shown)'
1062
1086
  };
1063
- const EmptyColumnsAssignedCatsHidden = (_, _ref40) => {
1087
+ const EmptyColumnsAssignedCatsHidden = (_, _ref41) => {
1064
1088
  let {
1065
1089
  pivotTableOptions
1066
- } = _ref40;
1090
+ } = _ref41;
1067
1091
  const visualization = {
1068
1092
  ..._emptyColumnsVisualization.default,
1069
1093
  ...visualizationReset,
@@ -1084,10 +1108,10 @@ exports.EmptyColumnsAssignedCatsHidden = EmptyColumnsAssignedCatsHidden;
1084
1108
  EmptyColumnsAssignedCatsHidden.story = {
1085
1109
  name: 'empty columns + assigned cats (hidden)'
1086
1110
  };
1087
- const LegendFixedLightFill = (_, _ref41) => {
1111
+ const LegendFixedLightFill = (_, _ref42) => {
1088
1112
  let {
1089
1113
  pivotTableOptions
1090
- } = _ref41;
1114
+ } = _ref42;
1091
1115
  const visualization = {
1092
1116
  ..._targetWithLegendVisualization.default,
1093
1117
  ...visualizationReset,
@@ -1116,10 +1140,10 @@ exports.LegendFixedLightFill = LegendFixedLightFill;
1116
1140
  LegendFixedLightFill.story = {
1117
1141
  name: 'legend - fixed (light fill)'
1118
1142
  };
1119
- const LegendFixedDarkFill = (_, _ref42) => {
1143
+ const LegendFixedDarkFill = (_, _ref43) => {
1120
1144
  let {
1121
1145
  pivotTableOptions
1122
- } = _ref42;
1146
+ } = _ref43;
1123
1147
  const visualization = {
1124
1148
  ..._targetWithLegendVisualization.default,
1125
1149
  ...visualizationReset,
@@ -1149,10 +1173,10 @@ exports.LegendFixedDarkFill = LegendFixedDarkFill;
1149
1173
  LegendFixedDarkFill.story = {
1150
1174
  name: 'legend - fixed (dark fill)'
1151
1175
  };
1152
- const LegendFixedText = (_, _ref43) => {
1176
+ const LegendFixedText = (_, _ref44) => {
1153
1177
  let {
1154
1178
  pivotTableOptions
1155
- } = _ref43;
1179
+ } = _ref44;
1156
1180
  const visualization = {
1157
1181
  ..._targetWithLegendVisualization.default,
1158
1182
  ...visualizationReset,
@@ -1177,10 +1201,10 @@ exports.LegendFixedText = LegendFixedText;
1177
1201
  LegendFixedText.story = {
1178
1202
  name: 'legend - fixed (text)'
1179
1203
  };
1180
- const LegendFixedRow = (_, _ref44) => {
1204
+ const LegendFixedRow = (_, _ref45) => {
1181
1205
  let {
1182
1206
  pivotTableOptions
1183
- } = _ref44;
1207
+ } = _ref45;
1184
1208
  const visualization = {
1185
1209
  ..._targetWithLegendVisualization.default,
1186
1210
  ...visualizationReset,
@@ -1208,10 +1232,10 @@ exports.LegendFixedRow = LegendFixedRow;
1208
1232
  LegendFixedRow.story = {
1209
1233
  name: 'legend - fixed (% row)'
1210
1234
  };
1211
- const LegendByDataItem = (_, _ref45) => {
1235
+ const LegendByDataItem = (_, _ref46) => {
1212
1236
  let {
1213
1237
  pivotTableOptions
1214
- } = _ref45;
1238
+ } = _ref46;
1215
1239
  const visualization = {
1216
1240
  ..._targetWithLegendVisualization.default,
1217
1241
  ...visualizationReset,
@@ -1243,10 +1267,10 @@ exports.LegendByDataItem = LegendByDataItem;
1243
1267
  LegendByDataItem.story = {
1244
1268
  name: 'legend - by data item'
1245
1269
  };
1246
- const HierarchyNone = (_, _ref46) => {
1270
+ const HierarchyNone = (_, _ref47) => {
1247
1271
  let {
1248
1272
  pivotTableOptions
1249
- } = _ref46;
1273
+ } = _ref47;
1250
1274
  const visualization = {
1251
1275
  ..._hierarchyVisualization.default,
1252
1276
  ...visualizationReset,
@@ -1271,10 +1295,10 @@ exports.HierarchyNone = HierarchyNone;
1271
1295
  HierarchyNone.story = {
1272
1296
  name: 'hierarchy - none'
1273
1297
  };
1274
- const HierarchyRows = (_, _ref47) => {
1298
+ const HierarchyRows = (_, _ref48) => {
1275
1299
  let {
1276
1300
  pivotTableOptions
1277
- } = _ref47;
1301
+ } = _ref48;
1278
1302
  const visualization = {
1279
1303
  ..._hierarchyVisualization.default,
1280
1304
  ...visualizationReset,
@@ -1298,10 +1322,10 @@ exports.HierarchyRows = HierarchyRows;
1298
1322
  HierarchyRows.story = {
1299
1323
  name: 'hierarchy - rows'
1300
1324
  };
1301
- const HierarchyColumns = (_, _ref48) => {
1325
+ const HierarchyColumns = (_, _ref49) => {
1302
1326
  let {
1303
1327
  pivotTableOptions
1304
- } = _ref48;
1328
+ } = _ref49;
1305
1329
  const visualization = {
1306
1330
  ..._hierarchyVisualization.default,
1307
1331
  ...visualizationReset,
@@ -1327,10 +1351,10 @@ exports.HierarchyColumns = HierarchyColumns;
1327
1351
  HierarchyColumns.story = {
1328
1352
  name: 'hierarchy - columns'
1329
1353
  };
1330
- const Narrative = (_, _ref49) => {
1354
+ const Narrative = (_, _ref50) => {
1331
1355
  let {
1332
1356
  pivotTableOptions
1333
- } = _ref49;
1357
+ } = _ref50;
1334
1358
  const visualization = {
1335
1359
  ..._narrativeVisualization.default,
1336
1360
  ...visualizationReset,
@@ -1352,10 +1376,10 @@ exports.Narrative = Narrative;
1352
1376
  Narrative.story = {
1353
1377
  name: 'narrative'
1354
1378
  };
1355
- const NarrativeDataAsFilter = (_, _ref50) => {
1379
+ const NarrativeDataAsFilter = (_, _ref51) => {
1356
1380
  let {
1357
1381
  pivotTableOptions
1358
- } = _ref50;
1382
+ } = _ref51;
1359
1383
  const visualization = {
1360
1384
  ..._narrativeVisualization.default,
1361
1385
  ...visualizationReset,
@@ -1383,10 +1407,10 @@ exports.NarrativeDataAsFilter = NarrativeDataAsFilter;
1383
1407
  NarrativeDataAsFilter.story = {
1384
1408
  name: 'narrative - data as filter'
1385
1409
  };
1386
- const Degs = (_, _ref51) => {
1410
+ const Degs = (_, _ref52) => {
1387
1411
  let {
1388
1412
  pivotTableOptions
1389
- } = _ref51;
1413
+ } = _ref52;
1390
1414
  const visualization = {
1391
1415
  ..._degsVisualization.default,
1392
1416
  ...visualizationReset,
@@ -1406,10 +1430,10 @@ exports.Degs = Degs;
1406
1430
  Degs.story = {
1407
1431
  name: 'DEGS'
1408
1432
  };
1409
- const TruncatedHeaderCell = (_, _ref52) => {
1433
+ const TruncatedHeaderCell = (_, _ref53) => {
1410
1434
  let {
1411
1435
  pivotTableOptions
1412
- } = _ref52;
1436
+ } = _ref53;
1413
1437
  const widths = [250, 200, 500];
1414
1438
  const [width, setWidth] = (0, _react.useState)(250);
1415
1439
  const toggleWidth = () => setWidth(currentWidth => {
@@ -250,10 +250,10 @@ class PivotTableEngine {
250
250
  rawValue = (0, _parseValue.parseValue)(rawValue);
251
251
  switch (this.visualization.numberType) {
252
252
  case _pivotTableConstants.NUMBER_TYPE_ROW_PERCENTAGE:
253
- renderedValue = rawValue / this.percentageTotals[row].value;
253
+ rawCell.pctValue = renderedValue = rawValue / this.percentageTotals[row].value;
254
254
  break;
255
255
  case _pivotTableConstants.NUMBER_TYPE_COLUMN_PERCENTAGE:
256
- renderedValue = rawValue / this.percentageTotals[column].value;
256
+ rawCell.pctValue = renderedValue = rawValue / this.percentageTotals[column].value;
257
257
  break;
258
258
  default:
259
259
  break;
@@ -265,6 +265,19 @@ class PivotTableEngine {
265
265
  rawCell.rawValue = rawValue;
266
266
  rawCell.renderedValue = renderedValue;
267
267
  }
268
+
269
+ // show the original value in the tooltip
270
+ if ([_pivotTableConstants.NUMBER_TYPE_COLUMN_PERCENTAGE, _pivotTableConstants.NUMBER_TYPE_ROW_PERCENTAGE].includes(this.visualization.numberType)) {
271
+ rawCell.titleValue = _d2I18n.default.t('Value: {{value}}', {
272
+ value: (0, _renderValue.renderValue)(rawCell.rawValue, valueType,
273
+ // force VALUE for formatting the original value
274
+ {
275
+ ...this.visualization,
276
+ numberType: _pivotTableConstants.NUMBER_TYPE_VALUE
277
+ }),
278
+ nsSeparator: '^^'
279
+ });
280
+ }
268
281
  if ([_pivotTableConstants.CELL_TYPE_TOTAL, _pivotTableConstants.CELL_TYPE_SUBTOTAL].includes(rawCell.cellType) && rawCell.rawValue === _pivotTableConstants.AGGREGATE_TYPE_NA) {
269
282
  rawCell.titleValue = _d2I18n.default.t('Not applicable');
270
283
  }
@@ -957,7 +970,11 @@ class PivotTableEngine {
957
970
  if (!valueB || valueB.empty) {
958
971
  return 1 * order;
959
972
  }
960
- if (valueA.valueType === _valueTypes.VALUE_TYPE_NUMBER && valueB.valueType === _valueTypes.VALUE_TYPE_NUMBER) {
973
+ if (
974
+ // for percentage strings, use the pctValue (percentage value) in the sort comparison
975
+ [_pivotTableConstants.NUMBER_TYPE_ROW_PERCENTAGE, _pivotTableConstants.NUMBER_TYPE_COLUMN_PERCENTAGE].includes(this.visualization.numberType)) {
976
+ return (valueA.pctValue - valueB.pctValue) * order;
977
+ } else if (valueA.valueType === _valueTypes.VALUE_TYPE_NUMBER && valueB.valueType === _valueTypes.VALUE_TYPE_NUMBER) {
961
978
  return (valueA.rawValue - valueB.rawValue) * order;
962
979
  }
963
980
  return valueA.renderedValue.localeCompare(valueB.renderedValue) * order;
@@ -195,10 +195,33 @@ export const SimpleColumn = (_, _ref6) => {
195
195
  SimpleColumn.story = {
196
196
  name: 'simple - column %'
197
197
  };
198
- export const SimpleDataAsFilter = (_, _ref7) => {
198
+ export const SimpleRow = (_, _ref7) => {
199
199
  let {
200
200
  pivotTableOptions
201
201
  } = _ref7;
202
+ const visualization = {
203
+ ...diseaseWeeksVisualization,
204
+ ...visualizationReset,
205
+ ...pivotTableOptions,
206
+ numberType: NUMBER_TYPE_ROW_PERCENTAGE
207
+ };
208
+ return /*#__PURE__*/React.createElement("div", {
209
+ style: {
210
+ width: 800,
211
+ height: 600
212
+ }
213
+ }, /*#__PURE__*/React.createElement(PivotTable, {
214
+ data: diseaseWeeksData,
215
+ visualization: visualization
216
+ }));
217
+ };
218
+ SimpleRow.story = {
219
+ name: 'simple - row %'
220
+ };
221
+ export const SimpleDataAsFilter = (_, _ref8) => {
222
+ let {
223
+ pivotTableOptions
224
+ } = _ref8;
202
225
  const visualization = {
203
226
  ...simpleVisualization,
204
227
  ...visualizationReset,
@@ -219,10 +242,10 @@ export const SimpleDataAsFilter = (_, _ref7) => {
219
242
  SimpleDataAsFilter.story = {
220
243
  name: 'simple - data as filter'
221
244
  };
222
- export const SimpleNoColumns = (_, _ref8) => {
245
+ export const SimpleNoColumns = (_, _ref9) => {
223
246
  let {
224
247
  pivotTableOptions
225
- } = _ref8;
248
+ } = _ref9;
226
249
  const visualization = {
227
250
  ...simpleVisualization,
228
251
  ...visualizationReset,
@@ -247,10 +270,10 @@ export const SimpleNoColumns = (_, _ref8) => {
247
270
  SimpleNoColumns.story = {
248
271
  name: 'simple - no columns'
249
272
  };
250
- export const SimpleNoColumnsSingleCell = (_, _ref9) => {
273
+ export const SimpleNoColumnsSingleCell = (_, _ref10) => {
251
274
  let {
252
275
  pivotTableOptions
253
- } = _ref9;
276
+ } = _ref10;
254
277
  const visualization = {
255
278
  ...simpleVisualization,
256
279
  ...visualizationReset,
@@ -273,10 +296,10 @@ export const SimpleNoColumnsSingleCell = (_, _ref9) => {
273
296
  SimpleNoColumnsSingleCell.story = {
274
297
  name: 'simple - no columns (single cell)'
275
298
  };
276
- export const SimpleNoColumnsDeep = (_, _ref10) => {
299
+ export const SimpleNoColumnsDeep = (_, _ref11) => {
277
300
  let {
278
301
  pivotTableOptions
279
- } = _ref10;
302
+ } = _ref11;
280
303
  const visualization = {
281
304
  ...simpleVisualization,
282
305
  ...visualizationReset,
@@ -300,10 +323,10 @@ export const SimpleNoColumnsDeep = (_, _ref10) => {
300
323
  SimpleNoColumnsDeep.story = {
301
324
  name: 'simple - no columns (deep)'
302
325
  };
303
- export const SimpleNoColumnsLabel = (_, _ref11) => {
326
+ export const SimpleNoColumnsLabel = (_, _ref12) => {
304
327
  let {
305
328
  pivotTableOptions
306
- } = _ref11;
329
+ } = _ref12;
307
330
  const visualization = {
308
331
  ...simpleVisualization,
309
332
  ...visualizationReset,
@@ -329,10 +352,10 @@ export const SimpleNoColumnsLabel = (_, _ref11) => {
329
352
  SimpleNoColumnsLabel.story = {
330
353
  name: 'simple - no columns (label)'
331
354
  };
332
- export const SimpleNoRowsSmall = (_, _ref12) => {
355
+ export const SimpleNoRowsSmall = (_, _ref13) => {
333
356
  let {
334
357
  pivotTableOptions
335
- } = _ref12;
358
+ } = _ref13;
336
359
  const visualization = {
337
360
  ...simpleVisualization,
338
361
  ...visualizationReset,
@@ -358,10 +381,10 @@ export const SimpleNoRowsSmall = (_, _ref12) => {
358
381
  SimpleNoRowsSmall.story = {
359
382
  name: 'simple - no rows (small)'
360
383
  };
361
- export const SimpleNoRowsLarge = (_, _ref13) => {
384
+ export const SimpleNoRowsLarge = (_, _ref14) => {
362
385
  let {
363
386
  pivotTableOptions
364
- } = _ref13;
387
+ } = _ref14;
365
388
  const visualization = {
366
389
  ...simpleVisualization,
367
390
  ...visualizationReset,
@@ -387,10 +410,10 @@ export const SimpleNoRowsLarge = (_, _ref13) => {
387
410
  SimpleNoRowsLarge.story = {
388
411
  name: 'simple - no rows (large)'
389
412
  };
390
- export const SimpleAvgTotalAggregationTypeColumns = (_, _ref14) => {
413
+ export const SimpleAvgTotalAggregationTypeColumns = (_, _ref15) => {
391
414
  let {
392
415
  pivotTableOptions
393
- } = _ref14;
416
+ } = _ref15;
394
417
  const visualization = {
395
418
  ...avgVisualization,
396
419
  ...visualizationReset,
@@ -411,10 +434,10 @@ export const SimpleAvgTotalAggregationTypeColumns = (_, _ref14) => {
411
434
  SimpleAvgTotalAggregationTypeColumns.story = {
412
435
  name: 'simple - avg totalAggregationType columns'
413
436
  };
414
- export const SimpleAvgTotalAggregationTypeRows = (_, _ref15) => {
437
+ export const SimpleAvgTotalAggregationTypeRows = (_, _ref16) => {
415
438
  let {
416
439
  pivotTableOptions
417
- } = _ref15;
440
+ } = _ref16;
418
441
  const visualization = {
419
442
  ...avgVisualization,
420
443
  ...visualizationReset,
@@ -437,10 +460,10 @@ export const SimpleAvgTotalAggregationTypeRows = (_, _ref15) => {
437
460
  SimpleAvgTotalAggregationTypeRows.story = {
438
461
  name: 'simple - avg totalAggregationType rows'
439
462
  };
440
- export const Deep = (_, _ref16) => {
463
+ export const Deep = (_, _ref17) => {
441
464
  let {
442
465
  pivotTableOptions
443
- } = _ref16;
466
+ } = _ref17;
444
467
  const visualization = {
445
468
  ...deepVisualization,
446
469
  ...visualizationReset,
@@ -460,10 +483,10 @@ export const Deep = (_, _ref16) => {
460
483
  Deep.story = {
461
484
  name: 'deep'
462
485
  };
463
- export const DeepFilter = (_, _ref17) => {
486
+ export const DeepFilter = (_, _ref18) => {
464
487
  let {
465
488
  pivotTableOptions
466
- } = _ref17;
489
+ } = _ref18;
467
490
  const visualization = {
468
491
  ...deepWithFiltersVisualization,
469
492
  ...visualizationReset,
@@ -483,10 +506,10 @@ export const DeepFilter = (_, _ref17) => {
483
506
  DeepFilter.story = {
484
507
  name: 'deep - filter'
485
508
  };
486
- export const DeepTitleSubtitleFilter = (_, _ref18) => {
509
+ export const DeepTitleSubtitleFilter = (_, _ref19) => {
487
510
  let {
488
511
  pivotTableOptions
489
- } = _ref18;
512
+ } = _ref19;
490
513
  const visualization = {
491
514
  ...deepVisualization,
492
515
  ...visualizationReset,
@@ -508,10 +531,10 @@ export const DeepTitleSubtitleFilter = (_, _ref18) => {
508
531
  DeepTitleSubtitleFilter.story = {
509
532
  name: 'deep - title / subtitle / filter'
510
533
  };
511
- export const DeepDimensionLabels = (_, _ref19) => {
534
+ export const DeepDimensionLabels = (_, _ref20) => {
512
535
  let {
513
536
  pivotTableOptions
514
- } = _ref19;
537
+ } = _ref20;
515
538
  const visualization = {
516
539
  ...deepVisualization,
517
540
  ...visualizationReset,
@@ -530,10 +553,10 @@ export const DeepDimensionLabels = (_, _ref19) => {
530
553
  DeepDimensionLabels.story = {
531
554
  name: 'deep - dimension labels'
532
555
  };
533
- export const DeepSmallCompact = (_, _ref20) => {
556
+ export const DeepSmallCompact = (_, _ref21) => {
534
557
  let {
535
558
  pivotTableOptions
536
- } = _ref20;
559
+ } = _ref21;
537
560
  const visualization = {
538
561
  ...deepVisualization,
539
562
  ...visualizationReset,
@@ -554,10 +577,10 @@ export const DeepSmallCompact = (_, _ref20) => {
554
577
  DeepSmallCompact.story = {
555
578
  name: 'deep - small / compact'
556
579
  };
557
- export const DeepLargeComfortable = (_, _ref21) => {
580
+ export const DeepLargeComfortable = (_, _ref22) => {
558
581
  let {
559
582
  pivotTableOptions
560
- } = _ref21;
583
+ } = _ref22;
561
584
  const visualization = {
562
585
  ...deepVisualization,
563
586
  ...visualizationReset,
@@ -578,10 +601,10 @@ export const DeepLargeComfortable = (_, _ref21) => {
578
601
  DeepLargeComfortable.story = {
579
602
  name: 'deep - large / comfortable'
580
603
  };
581
- export const DeepRow = (_, _ref22) => {
604
+ export const DeepRow = (_, _ref23) => {
582
605
  let {
583
606
  pivotTableOptions
584
- } = _ref22;
607
+ } = _ref23;
585
608
  const visualization = {
586
609
  ...deepVisualization,
587
610
  ...visualizationReset,
@@ -605,10 +628,10 @@ export const DeepRow = (_, _ref22) => {
605
628
  DeepRow.story = {
606
629
  name: 'deep - row %'
607
630
  };
608
- export const DeepColumn = (_, _ref23) => {
631
+ export const DeepColumn = (_, _ref24) => {
609
632
  let {
610
633
  pivotTableOptions
611
- } = _ref23;
634
+ } = _ref24;
612
635
  const visualization = {
613
636
  ...deepVisualization,
614
637
  ...visualizationReset,
@@ -632,10 +655,10 @@ export const DeepColumn = (_, _ref23) => {
632
655
  DeepColumn.story = {
633
656
  name: 'deep - column %'
634
657
  };
635
- const ResizingPivotTable = _ref24 => {
658
+ const ResizingPivotTable = _ref25 => {
636
659
  let {
637
660
  visualization
638
- } = _ref24;
661
+ } = _ref25;
639
662
  const [size, setSize] = useState(() => ({
640
663
  width: 400,
641
664
  height: 300
@@ -666,10 +689,10 @@ const ResizingPivotTable = _ref24 => {
666
689
  ResizingPivotTable.propTypes = {
667
690
  visualization: PropTypes.object.isRequired
668
691
  };
669
- export const DeepResize = (_, _ref25) => {
692
+ export const DeepResize = (_, _ref26) => {
670
693
  let {
671
694
  pivotTableOptions
672
- } = _ref25;
695
+ } = _ref26;
673
696
  const visualization = {
674
697
  ...deepVisualization,
675
698
  ...visualizationReset,
@@ -682,10 +705,10 @@ export const DeepResize = (_, _ref25) => {
682
705
  DeepResize.story = {
683
706
  name: 'deep - resize'
684
707
  };
685
- export const DeepTotals = (_, _ref26) => {
708
+ export const DeepTotals = (_, _ref27) => {
686
709
  let {
687
710
  pivotTableOptions
688
- } = _ref26;
711
+ } = _ref27;
689
712
  const visualization = {
690
713
  ...deepVisualization,
691
714
  ...visualizationReset,
@@ -706,10 +729,10 @@ export const DeepTotals = (_, _ref26) => {
706
729
  DeepTotals.story = {
707
730
  name: 'deep - totals'
708
731
  };
709
- export const DeepSubtotals = (_, _ref27) => {
732
+ export const DeepSubtotals = (_, _ref28) => {
710
733
  let {
711
734
  pivotTableOptions
712
- } = _ref27;
735
+ } = _ref28;
713
736
  const visualization = {
714
737
  ...deepVisualization,
715
738
  ...visualizationReset,
@@ -730,10 +753,10 @@ export const DeepSubtotals = (_, _ref27) => {
730
753
  DeepSubtotals.story = {
731
754
  name: 'deep - subtotals'
732
755
  };
733
- export const DeepAllTotals = (_, _ref28) => {
756
+ export const DeepAllTotals = (_, _ref29) => {
734
757
  let {
735
758
  pivotTableOptions
736
- } = _ref28;
759
+ } = _ref29;
737
760
  const visualization = {
738
761
  ...deepVisualization,
739
762
  ...visualizationReset,
@@ -756,10 +779,10 @@ export const DeepAllTotals = (_, _ref28) => {
756
779
  DeepAllTotals.story = {
757
780
  name: 'deep - all totals'
758
781
  };
759
- export const SmallEmptyRowsShown = (_, _ref29) => {
782
+ export const SmallEmptyRowsShown = (_, _ref30) => {
760
783
  let {
761
784
  pivotTableOptions
762
- } = _ref29;
785
+ } = _ref30;
763
786
  const visualization = {
764
787
  ...diseaseWeeksVisualization,
765
788
  ...visualizationReset,
@@ -782,10 +805,10 @@ export const SmallEmptyRowsShown = (_, _ref29) => {
782
805
  SmallEmptyRowsShown.story = {
783
806
  name: 'small empty rows - shown'
784
807
  };
785
- export const SmallEmptyRowsHidden = (_, _ref30) => {
808
+ export const SmallEmptyRowsHidden = (_, _ref31) => {
786
809
  let {
787
810
  pivotTableOptions
788
- } = _ref30;
811
+ } = _ref31;
789
812
  const visualization = {
790
813
  ...diseaseWeeksVisualization,
791
814
  ...visualizationReset,
@@ -809,10 +832,10 @@ export const SmallEmptyRowsHidden = (_, _ref30) => {
809
832
  SmallEmptyRowsHidden.story = {
810
833
  name: 'small empty rows - hidden'
811
834
  };
812
- export const EmptyRowsShown = (_, _ref31) => {
835
+ export const EmptyRowsShown = (_, _ref32) => {
813
836
  let {
814
837
  pivotTableOptions
815
- } = _ref31;
838
+ } = _ref32;
816
839
  const visualization = {
817
840
  ...emptyRowsVisualization,
818
841
  ...visualizationReset,
@@ -835,10 +858,10 @@ export const EmptyRowsShown = (_, _ref31) => {
835
858
  EmptyRowsShown.story = {
836
859
  name: 'empty rows - shown'
837
860
  };
838
- export const EmptyRowsHidden = (_, _ref32) => {
861
+ export const EmptyRowsHidden = (_, _ref33) => {
839
862
  let {
840
863
  pivotTableOptions
841
- } = _ref32;
864
+ } = _ref33;
842
865
  const visualization = {
843
866
  ...emptyRowsVisualization,
844
867
  ...visualizationReset,
@@ -858,10 +881,10 @@ export const EmptyRowsHidden = (_, _ref32) => {
858
881
  EmptyRowsHidden.story = {
859
882
  name: 'empty rows - hidden'
860
883
  };
861
- export const EmptyColumnsShown = (_, _ref33) => {
884
+ export const EmptyColumnsShown = (_, _ref34) => {
862
885
  let {
863
886
  pivotTableOptions
864
- } = _ref33;
887
+ } = _ref34;
865
888
  const visualization = {
866
889
  ...lastFiveYearsVisualization,
867
890
  ...pivotTableOptions,
@@ -880,10 +903,10 @@ export const EmptyColumnsShown = (_, _ref33) => {
880
903
  EmptyColumnsShown.story = {
881
904
  name: 'empty columns - shown'
882
905
  };
883
- export const EmptyColumnsHidden = (_, _ref34) => {
906
+ export const EmptyColumnsHidden = (_, _ref35) => {
884
907
  let {
885
908
  pivotTableOptions
886
- } = _ref34;
909
+ } = _ref35;
887
910
  const visualization = {
888
911
  ...lastFiveYearsVisualization,
889
912
  ...pivotTableOptions,
@@ -902,10 +925,10 @@ export const EmptyColumnsHidden = (_, _ref34) => {
902
925
  EmptyColumnsHidden.story = {
903
926
  name: 'empty columns - hidden'
904
927
  };
905
- export const EmptyColumnsWeeklyShown = (_, _ref35) => {
928
+ export const EmptyColumnsWeeklyShown = (_, _ref36) => {
906
929
  let {
907
930
  pivotTableOptions
908
- } = _ref35;
931
+ } = _ref36;
909
932
  const visualization = {
910
933
  ...weeklyColumnsVisualization,
911
934
  ...pivotTableOptions,
@@ -924,10 +947,10 @@ export const EmptyColumnsWeeklyShown = (_, _ref35) => {
924
947
  EmptyColumnsWeeklyShown.story = {
925
948
  name: 'empty columns (weekly) - shown'
926
949
  };
927
- export const CumulativeEmptyColumnsWeeklyShown = (_, _ref36) => {
950
+ export const CumulativeEmptyColumnsWeeklyShown = (_, _ref37) => {
928
951
  let {
929
952
  pivotTableOptions
930
- } = _ref36;
953
+ } = _ref37;
931
954
  const visualization = {
932
955
  ...weeklyColumnsVisualization,
933
956
  ...pivotTableOptions,
@@ -947,10 +970,10 @@ export const CumulativeEmptyColumnsWeeklyShown = (_, _ref36) => {
947
970
  CumulativeEmptyColumnsWeeklyShown.story = {
948
971
  name: 'cumulative + empty columns (weekly) - shown'
949
972
  };
950
- export const EmptyColumnsWeeklyHidden = (_, _ref37) => {
973
+ export const EmptyColumnsWeeklyHidden = (_, _ref38) => {
951
974
  let {
952
975
  pivotTableOptions
953
- } = _ref37;
976
+ } = _ref38;
954
977
  const visualization = {
955
978
  ...weeklyColumnsVisualization,
956
979
  ...pivotTableOptions,
@@ -969,10 +992,10 @@ export const EmptyColumnsWeeklyHidden = (_, _ref37) => {
969
992
  EmptyColumnsWeeklyHidden.story = {
970
993
  name: 'empty columns (weekly) - hidden'
971
994
  };
972
- export const CumulativeEmptyColumnsWeeklyHidden = (_, _ref38) => {
995
+ export const CumulativeEmptyColumnsWeeklyHidden = (_, _ref39) => {
973
996
  let {
974
997
  pivotTableOptions
975
- } = _ref38;
998
+ } = _ref39;
976
999
  const visualization = {
977
1000
  ...weeklyColumnsVisualization,
978
1001
  ...pivotTableOptions,
@@ -992,10 +1015,10 @@ export const CumulativeEmptyColumnsWeeklyHidden = (_, _ref38) => {
992
1015
  CumulativeEmptyColumnsWeeklyHidden.story = {
993
1016
  name: 'cumulative + empty columns (weekly) - hidden'
994
1017
  };
995
- export const EmptyColumnsAssignedCatsShown = (_, _ref39) => {
1018
+ export const EmptyColumnsAssignedCatsShown = (_, _ref40) => {
996
1019
  let {
997
1020
  pivotTableOptions
998
- } = _ref39;
1021
+ } = _ref40;
999
1022
  const visualization = {
1000
1023
  ...emptyColumnsVisualization,
1001
1024
  ...visualizationReset,
@@ -1015,10 +1038,10 @@ export const EmptyColumnsAssignedCatsShown = (_, _ref39) => {
1015
1038
  EmptyColumnsAssignedCatsShown.story = {
1016
1039
  name: 'empty columns + assigned cats (shown)'
1017
1040
  };
1018
- export const EmptyColumnsAssignedCatsHidden = (_, _ref40) => {
1041
+ export const EmptyColumnsAssignedCatsHidden = (_, _ref41) => {
1019
1042
  let {
1020
1043
  pivotTableOptions
1021
- } = _ref40;
1044
+ } = _ref41;
1022
1045
  const visualization = {
1023
1046
  ...emptyColumnsVisualization,
1024
1047
  ...visualizationReset,
@@ -1038,10 +1061,10 @@ export const EmptyColumnsAssignedCatsHidden = (_, _ref40) => {
1038
1061
  EmptyColumnsAssignedCatsHidden.story = {
1039
1062
  name: 'empty columns + assigned cats (hidden)'
1040
1063
  };
1041
- export const LegendFixedLightFill = (_, _ref41) => {
1064
+ export const LegendFixedLightFill = (_, _ref42) => {
1042
1065
  let {
1043
1066
  pivotTableOptions
1044
- } = _ref41;
1067
+ } = _ref42;
1045
1068
  const visualization = {
1046
1069
  ...targetVisualization,
1047
1070
  ...visualizationReset,
@@ -1069,10 +1092,10 @@ export const LegendFixedLightFill = (_, _ref41) => {
1069
1092
  LegendFixedLightFill.story = {
1070
1093
  name: 'legend - fixed (light fill)'
1071
1094
  };
1072
- export const LegendFixedDarkFill = (_, _ref42) => {
1095
+ export const LegendFixedDarkFill = (_, _ref43) => {
1073
1096
  let {
1074
1097
  pivotTableOptions
1075
- } = _ref42;
1098
+ } = _ref43;
1076
1099
  const visualization = {
1077
1100
  ...targetVisualization,
1078
1101
  ...visualizationReset,
@@ -1101,10 +1124,10 @@ export const LegendFixedDarkFill = (_, _ref42) => {
1101
1124
  LegendFixedDarkFill.story = {
1102
1125
  name: 'legend - fixed (dark fill)'
1103
1126
  };
1104
- export const LegendFixedText = (_, _ref43) => {
1127
+ export const LegendFixedText = (_, _ref44) => {
1105
1128
  let {
1106
1129
  pivotTableOptions
1107
- } = _ref43;
1130
+ } = _ref44;
1108
1131
  const visualization = {
1109
1132
  ...targetVisualization,
1110
1133
  ...visualizationReset,
@@ -1128,10 +1151,10 @@ export const LegendFixedText = (_, _ref43) => {
1128
1151
  LegendFixedText.story = {
1129
1152
  name: 'legend - fixed (text)'
1130
1153
  };
1131
- export const LegendFixedRow = (_, _ref44) => {
1154
+ export const LegendFixedRow = (_, _ref45) => {
1132
1155
  let {
1133
1156
  pivotTableOptions
1134
- } = _ref44;
1157
+ } = _ref45;
1135
1158
  const visualization = {
1136
1159
  ...targetVisualization,
1137
1160
  ...visualizationReset,
@@ -1158,10 +1181,10 @@ export const LegendFixedRow = (_, _ref44) => {
1158
1181
  LegendFixedRow.story = {
1159
1182
  name: 'legend - fixed (% row)'
1160
1183
  };
1161
- export const LegendByDataItem = (_, _ref45) => {
1184
+ export const LegendByDataItem = (_, _ref46) => {
1162
1185
  let {
1163
1186
  pivotTableOptions
1164
- } = _ref45;
1187
+ } = _ref46;
1165
1188
  const visualization = {
1166
1189
  ...targetVisualization,
1167
1190
  ...visualizationReset,
@@ -1192,10 +1215,10 @@ export const LegendByDataItem = (_, _ref45) => {
1192
1215
  LegendByDataItem.story = {
1193
1216
  name: 'legend - by data item'
1194
1217
  };
1195
- export const HierarchyNone = (_, _ref46) => {
1218
+ export const HierarchyNone = (_, _ref47) => {
1196
1219
  let {
1197
1220
  pivotTableOptions
1198
- } = _ref46;
1221
+ } = _ref47;
1199
1222
  const visualization = {
1200
1223
  ...hierarchyVisualization,
1201
1224
  ...visualizationReset,
@@ -1219,10 +1242,10 @@ export const HierarchyNone = (_, _ref46) => {
1219
1242
  HierarchyNone.story = {
1220
1243
  name: 'hierarchy - none'
1221
1244
  };
1222
- export const HierarchyRows = (_, _ref47) => {
1245
+ export const HierarchyRows = (_, _ref48) => {
1223
1246
  let {
1224
1247
  pivotTableOptions
1225
- } = _ref47;
1248
+ } = _ref48;
1226
1249
  const visualization = {
1227
1250
  ...hierarchyVisualization,
1228
1251
  ...visualizationReset,
@@ -1245,10 +1268,10 @@ export const HierarchyRows = (_, _ref47) => {
1245
1268
  HierarchyRows.story = {
1246
1269
  name: 'hierarchy - rows'
1247
1270
  };
1248
- export const HierarchyColumns = (_, _ref48) => {
1271
+ export const HierarchyColumns = (_, _ref49) => {
1249
1272
  let {
1250
1273
  pivotTableOptions
1251
- } = _ref48;
1274
+ } = _ref49;
1252
1275
  const visualization = {
1253
1276
  ...hierarchyVisualization,
1254
1277
  ...visualizationReset,
@@ -1273,10 +1296,10 @@ export const HierarchyColumns = (_, _ref48) => {
1273
1296
  HierarchyColumns.story = {
1274
1297
  name: 'hierarchy - columns'
1275
1298
  };
1276
- export const Narrative = (_, _ref49) => {
1299
+ export const Narrative = (_, _ref50) => {
1277
1300
  let {
1278
1301
  pivotTableOptions
1279
- } = _ref49;
1302
+ } = _ref50;
1280
1303
  const visualization = {
1281
1304
  ...narrativeVisualization,
1282
1305
  ...visualizationReset,
@@ -1297,10 +1320,10 @@ export const Narrative = (_, _ref49) => {
1297
1320
  Narrative.story = {
1298
1321
  name: 'narrative'
1299
1322
  };
1300
- export const NarrativeDataAsFilter = (_, _ref50) => {
1323
+ export const NarrativeDataAsFilter = (_, _ref51) => {
1301
1324
  let {
1302
1325
  pivotTableOptions
1303
- } = _ref50;
1326
+ } = _ref51;
1304
1327
  const visualization = {
1305
1328
  ...narrativeVisualization,
1306
1329
  ...visualizationReset,
@@ -1327,10 +1350,10 @@ export const NarrativeDataAsFilter = (_, _ref50) => {
1327
1350
  NarrativeDataAsFilter.story = {
1328
1351
  name: 'narrative - data as filter'
1329
1352
  };
1330
- export const Degs = (_, _ref51) => {
1353
+ export const Degs = (_, _ref52) => {
1331
1354
  let {
1332
1355
  pivotTableOptions
1333
- } = _ref51;
1356
+ } = _ref52;
1334
1357
  const visualization = {
1335
1358
  ...degsVisualization,
1336
1359
  ...visualizationReset,
@@ -1349,10 +1372,10 @@ export const Degs = (_, _ref51) => {
1349
1372
  Degs.story = {
1350
1373
  name: 'DEGS'
1351
1374
  };
1352
- export const TruncatedHeaderCell = (_, _ref52) => {
1375
+ export const TruncatedHeaderCell = (_, _ref53) => {
1353
1376
  let {
1354
1377
  pivotTableOptions
1355
- } = _ref52;
1378
+ } = _ref53;
1356
1379
  const widths = [250, 200, 500];
1357
1380
  const [width, setWidth] = useState(250);
1358
1381
  const toggleWidth = () => setWidth(currentWidth => {
@@ -243,10 +243,10 @@ export class PivotTableEngine {
243
243
  rawValue = parseValue(rawValue);
244
244
  switch (this.visualization.numberType) {
245
245
  case NUMBER_TYPE_ROW_PERCENTAGE:
246
- renderedValue = rawValue / this.percentageTotals[row].value;
246
+ rawCell.pctValue = renderedValue = rawValue / this.percentageTotals[row].value;
247
247
  break;
248
248
  case NUMBER_TYPE_COLUMN_PERCENTAGE:
249
- renderedValue = rawValue / this.percentageTotals[column].value;
249
+ rawCell.pctValue = renderedValue = rawValue / this.percentageTotals[column].value;
250
250
  break;
251
251
  default:
252
252
  break;
@@ -258,6 +258,19 @@ export class PivotTableEngine {
258
258
  rawCell.rawValue = rawValue;
259
259
  rawCell.renderedValue = renderedValue;
260
260
  }
261
+
262
+ // show the original value in the tooltip
263
+ if ([NUMBER_TYPE_COLUMN_PERCENTAGE, NUMBER_TYPE_ROW_PERCENTAGE].includes(this.visualization.numberType)) {
264
+ rawCell.titleValue = i18n.t('Value: {{value}}', {
265
+ value: renderValue(rawCell.rawValue, valueType,
266
+ // force VALUE for formatting the original value
267
+ {
268
+ ...this.visualization,
269
+ numberType: NUMBER_TYPE_VALUE
270
+ }),
271
+ nsSeparator: '^^'
272
+ });
273
+ }
261
274
  if ([CELL_TYPE_TOTAL, CELL_TYPE_SUBTOTAL].includes(rawCell.cellType) && rawCell.rawValue === AGGREGATE_TYPE_NA) {
262
275
  rawCell.titleValue = i18n.t('Not applicable');
263
276
  }
@@ -950,7 +963,11 @@ export class PivotTableEngine {
950
963
  if (!valueB || valueB.empty) {
951
964
  return 1 * order;
952
965
  }
953
- if (valueA.valueType === VALUE_TYPE_NUMBER && valueB.valueType === VALUE_TYPE_NUMBER) {
966
+ if (
967
+ // for percentage strings, use the pctValue (percentage value) in the sort comparison
968
+ [NUMBER_TYPE_ROW_PERCENTAGE, NUMBER_TYPE_COLUMN_PERCENTAGE].includes(this.visualization.numberType)) {
969
+ return (valueA.pctValue - valueB.pctValue) * order;
970
+ } else if (valueA.valueType === VALUE_TYPE_NUMBER && valueB.valueType === VALUE_TYPE_NUMBER) {
954
971
  return (valueA.rawValue - valueB.rawValue) * order;
955
972
  }
956
973
  return valueA.renderedValue.localeCompare(valueB.renderedValue) * order;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2/analytics",
3
- "version": "27.0.0",
3
+ "version": "27.0.1",
4
4
  "main": "./build/cjs/index.js",
5
5
  "module": "./build/es/index.js",
6
6
  "exports": {