@dhis2/analytics 26.0.8 → 26.0.9
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.
- package/build/cjs/__demo__/CalculationModal.stories.js +0 -5
- package/build/cjs/__demo__/DimensionsPanel.stories.js +0 -7
- package/build/cjs/__demo__/DynamicDimension.stories.js +0 -4
- package/build/cjs/__demo__/FileMenu.stories.js +2 -7
- package/build/cjs/__demo__/Filter.stories.js +0 -10
- package/build/cjs/__demo__/FixedPeriodSelect.stories.js +0 -6
- package/build/cjs/__demo__/OpenFileDialog.stories.js +1 -9
- package/build/cjs/__demo__/OrgUnitDimension.stories.js +1 -9
- package/build/cjs/__demo__/PeriodDimension.stories.js +0 -5
- package/build/cjs/__demo__/PivotTable.stories.js +100 -104
- package/build/cjs/__demo__/Toolbar.stories.js +0 -6
- package/build/cjs/__fixtures__/fixtures.js +0 -7
- package/build/cjs/api/__tests__/dimensions.spec.js +0 -3
- package/build/cjs/api/analytics/Analytics.js +1 -12
- package/build/cjs/api/analytics/AnalyticsAggregate.js +2 -9
- package/build/cjs/api/analytics/AnalyticsBase.js +8 -21
- package/build/cjs/api/analytics/AnalyticsEnrollments.js +0 -5
- package/build/cjs/api/analytics/AnalyticsEvents.js +3 -11
- package/build/cjs/api/analytics/AnalyticsRequest.js +15 -34
- package/build/cjs/api/analytics/AnalyticsRequestBase.js +7 -28
- package/build/cjs/api/analytics/AnalyticsRequestDimensionsMixin.js +3 -16
- package/build/cjs/api/analytics/AnalyticsRequestFiltersMixin.js +3 -16
- package/build/cjs/api/analytics/AnalyticsRequestPropertiesMixin.js +55 -140
- package/build/cjs/api/analytics/AnalyticsResponse.js +21 -45
- package/build/cjs/api/analytics/AnalyticsResponseHeader.js +0 -6
- package/build/cjs/api/analytics/__mocks__/DataEngine.js +0 -5
- package/build/cjs/api/analytics/__tests__/Analytics.spec.js +0 -5
- package/build/cjs/api/analytics/__tests__/AnalyticsAggregate.spec.js +11 -8
- package/build/cjs/api/analytics/__tests__/AnalyticsBase.spec.js +0 -2
- package/build/cjs/api/analytics/__tests__/AnalyticsEnrollments.spec.js +0 -7
- package/build/cjs/api/analytics/__tests__/AnalyticsEvents.spec.js +0 -7
- package/build/cjs/api/analytics/__tests__/AnalyticsRequest.spec.js +17 -19
- package/build/cjs/api/analytics/__tests__/AnalyticsRequestBase.spec.js +4 -9
- package/build/cjs/api/analytics/__tests__/AnalyticsResponse.spec.js +3 -5
- package/build/cjs/api/analytics/__tests__/AnalyticsResponseHeader.spec.js +2 -4
- package/build/cjs/api/analytics/utils.js +1 -3
- package/build/cjs/api/dimensions.js +41 -91
- package/build/cjs/api/index.js +1 -2
- package/build/cjs/api/organisationUnits.js +5 -16
- package/build/cjs/assets/AssignedCategoriesIcon.js +0 -4
- package/build/cjs/assets/DimensionItemIcons/CalculationIcon.js +0 -4
- package/build/cjs/assets/DimensionItemIcons/DataElementIcon.js +0 -4
- package/build/cjs/assets/DimensionItemIcons/GenericIcon.js +0 -4
- package/build/cjs/assets/DimensionItemIcons/PeriodIcon.js +0 -4
- package/build/cjs/assets/DynamicDimensionIcon.js +0 -4
- package/build/cjs/assets/FormulaIcon.js +0 -4
- package/build/cjs/components/AboutAOUnit/AboutAOUnit.js +19 -47
- package/build/cjs/components/AboutAOUnit/styles/AboutAOUnit.style.js +1 -3
- package/build/cjs/components/AboutAOUnit/utils.js +0 -5
- package/build/cjs/components/CachedDataQueryProvider.js +0 -17
- package/build/cjs/components/DataDimension/Calculation/CalculationModal.js +26 -73
- package/build/cjs/components/DataDimension/Calculation/DataElementOption.js +6 -19
- package/build/cjs/components/DataDimension/Calculation/DataElementSelector.js +16 -51
- package/build/cjs/components/DataDimension/Calculation/DndContext.js +6 -36
- package/build/cjs/components/DataDimension/Calculation/DragHandleIcon.js +0 -4
- package/build/cjs/components/DataDimension/Calculation/DraggingItem.js +3 -15
- package/build/cjs/components/DataDimension/Calculation/DropZone.js +1 -12
- package/build/cjs/components/DataDimension/Calculation/FormulaField.js +5 -21
- package/build/cjs/components/DataDimension/Calculation/FormulaItem.js +13 -41
- package/build/cjs/components/DataDimension/Calculation/MathOperatorSelector.js +4 -14
- package/build/cjs/components/DataDimension/Calculation/Operator.js +5 -18
- package/build/cjs/components/DataDimension/Calculation/styles/CalculationModal.style.js +1 -3
- package/build/cjs/components/DataDimension/Calculation/styles/DataElementOption.style.js +1 -3
- package/build/cjs/components/DataDimension/Calculation/styles/DataElementSelector.style.js +1 -3
- package/build/cjs/components/DataDimension/Calculation/styles/DraggingItem.style.js +1 -3
- package/build/cjs/components/DataDimension/Calculation/styles/DropZone.style.js +1 -3
- package/build/cjs/components/DataDimension/Calculation/styles/FormulaField.style.js +1 -3
- package/build/cjs/components/DataDimension/Calculation/styles/FormulaItem.style.js +1 -3
- package/build/cjs/components/DataDimension/Calculation/styles/MathOperatorSelector.style.js +1 -3
- package/build/cjs/components/DataDimension/Calculation/styles/Operator.style.js +1 -3
- package/build/cjs/components/DataDimension/DataDimension.js +1 -11
- package/build/cjs/components/DataDimension/DataTypeSelector.js +3 -14
- package/build/cjs/components/DataDimension/DetailSelector.js +2 -13
- package/build/cjs/components/DataDimension/GroupSelector.js +7 -26
- package/build/cjs/components/DataDimension/ItemSelector.js +45 -94
- package/build/cjs/components/DataDimension/MetricSelector.js +3 -14
- package/build/cjs/components/DataDimension/styles/DataTypeSelector.style.js +1 -3
- package/build/cjs/components/DataDimension/styles/DetailSelector.style.js +1 -3
- package/build/cjs/components/DataDimension/styles/GroupSelector.style.js +1 -3
- package/build/cjs/components/DataDimension/styles/MetricSelector.style.js +1 -3
- package/build/cjs/components/DimensionMenu.js +18 -35
- package/build/cjs/components/DimensionsPanel/DimensionsPanel.js +5 -19
- package/build/cjs/components/DimensionsPanel/List/DimensionItem.js +11 -32
- package/build/cjs/components/DimensionsPanel/List/DimensionList.js +11 -30
- package/build/cjs/components/DimensionsPanel/List/OptionsButton.js +0 -6
- package/build/cjs/components/DimensionsPanel/List/RecommendedIcon.js +0 -8
- package/build/cjs/components/DimensionsPanel/List/__tests__/DimensionItem.spec.js +0 -7
- package/build/cjs/components/DimensionsPanel/List/styles/DimensionItem.style.js +0 -2
- package/build/cjs/components/DimensionsPanel/List/styles/DimensionList.style.js +2 -4
- package/build/cjs/components/DimensionsPanel/List/styles/RecommendedIcon.style.js +0 -2
- package/build/cjs/components/DimensionsPanel/__tests__/DimensionsPanel.spec.js +0 -8
- package/build/cjs/components/DimensionsPanel/styles/DimensionsPanel.style.js +1 -3
- package/build/cjs/components/DynamicDimension/DynamicDimension.js +4 -23
- package/build/cjs/components/DynamicDimension/ItemSelector.js +15 -41
- package/build/cjs/components/DynamicDimension/styles/DynamicDimension.style.js +1 -3
- package/build/cjs/components/FileMenu/DeleteDialog.js +0 -12
- package/build/cjs/components/FileMenu/FileMenu.js +0 -29
- package/build/cjs/components/FileMenu/FileMenu.styles.js +2 -4
- package/build/cjs/components/FileMenu/GetLinkDialog.js +5 -15
- package/build/cjs/components/FileMenu/GetLinkDialog.styles.js +1 -3
- package/build/cjs/components/FileMenu/RenameDialog.js +1 -17
- package/build/cjs/components/FileMenu/SaveAsDialog.js +3 -16
- package/build/cjs/components/FileMenu/__tests__/DeleteDialog.spec.js +1 -9
- package/build/cjs/components/FileMenu/__tests__/FileMenu.spec.js +28 -51
- package/build/cjs/components/FileMenu/__tests__/GetLinkDialog.spec.js +0 -9
- package/build/cjs/components/FileMenu/__tests__/RenameDialog.spec.js +1 -9
- package/build/cjs/components/FileMenu/__tests__/SaveAsDialog.spec.js +1 -9
- package/build/cjs/components/FileMenu/utils.js +4 -19
- package/build/cjs/components/Filter/Filter.js +1 -9
- package/build/cjs/components/Filter/__tests__/Filter.spec.js +0 -8
- package/build/cjs/components/Filter/styles/Filter.style.js +1 -3
- package/build/cjs/components/Interpretations/InterpretationModal/Comment.js +0 -12
- package/build/cjs/components/Interpretations/InterpretationModal/CommentAddForm.js +1 -14
- package/build/cjs/components/Interpretations/InterpretationModal/CommentDeleteButton.js +1 -11
- package/build/cjs/components/Interpretations/InterpretationModal/CommentUpdateForm.js +2 -14
- package/build/cjs/components/Interpretations/InterpretationModal/InterpretationModal.js +2 -26
- package/build/cjs/components/Interpretations/InterpretationModal/InterpretationThread.js +0 -15
- package/build/cjs/components/Interpretations/InterpretationModal/index.js +0 -1
- package/build/cjs/components/Interpretations/InterpretationModal/useModalContentWidth.js +0 -7
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationForm.js +2 -15
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationList.js +1 -16
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js +2 -15
- package/build/cjs/components/Interpretations/InterpretationsUnit/index.js +0 -1
- package/build/cjs/components/Interpretations/common/Interpretation/Interpretation.js +0 -13
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js +0 -10
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationSharingLink.js +1 -11
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js +1 -14
- package/build/cjs/components/Interpretations/common/Interpretation/index.js +0 -2
- package/build/cjs/components/Interpretations/common/Interpretation/useLike.js +1 -7
- package/build/cjs/components/Interpretations/common/Message/Message.js +1 -10
- package/build/cjs/components/Interpretations/common/Message/MessageButtonStrip.js +1 -8
- package/build/cjs/components/Interpretations/common/Message/MessageEditorContainer.js +1 -8
- package/build/cjs/components/Interpretations/common/Message/MessageIconButton.js +5 -13
- package/build/cjs/components/Interpretations/common/Message/MessageInput.js +2 -10
- package/build/cjs/components/Interpretations/common/Message/MessageStatsBar.js +1 -8
- package/build/cjs/components/Interpretations/common/Message/index.js +0 -6
- package/build/cjs/components/Interpretations/common/RichTextEditor/RichTextEditor.js +15 -35
- package/build/cjs/components/Interpretations/common/RichTextEditor/index.js +0 -1
- package/build/cjs/components/Interpretations/common/RichTextEditor/markdownHandler.js +4 -22
- package/build/cjs/components/Interpretations/common/RichTextEditor/styles/RichTextEditor.style.js +3 -5
- package/build/cjs/components/Interpretations/common/UserMention/UserList.js +1 -9
- package/build/cjs/components/Interpretations/common/UserMention/UserMentionWrapper.js +18 -46
- package/build/cjs/components/Interpretations/common/UserMention/styles/UserMentionWrapper.style.js +1 -6
- package/build/cjs/components/Interpretations/common/UserMention/useUserSearchResults.js +1 -9
- package/build/cjs/components/Interpretations/common/index.js +0 -6
- package/build/cjs/components/LegendKey/LegendKey.js +9 -17
- package/build/cjs/components/LegendKey/styles/LegendKey.style.js +1 -3
- package/build/cjs/components/OfflineTooltip.js +1 -12
- package/build/cjs/components/OpenFileDialog/CreatedByFilter.js +1 -8
- package/build/cjs/components/OpenFileDialog/CustomSelectOption.js +2 -13
- package/build/cjs/components/OpenFileDialog/DateField.js +0 -6
- package/build/cjs/components/OpenFileDialog/FileList.js +0 -8
- package/build/cjs/components/OpenFileDialog/NameFilter.js +0 -7
- package/build/cjs/components/OpenFileDialog/OpenFileDialog.js +29 -64
- package/build/cjs/components/OpenFileDialog/OpenFileDialog.styles.js +1 -3
- package/build/cjs/components/OpenFileDialog/PaginationControls.js +0 -7
- package/build/cjs/components/OpenFileDialog/VisTypeFilter.js +0 -10
- package/build/cjs/components/OpenFileDialog/styles/CustomSelectOption.style.js +1 -3
- package/build/cjs/components/OpenFileDialog/utils.js +0 -5
- package/build/cjs/components/Options/VisualizationOptions.js +0 -16
- package/build/cjs/components/Options/styles/VisualizationOptions.style.js +11 -14
- package/build/cjs/components/OrgUnitDimension/OrgUnitDimension.js +12 -47
- package/build/cjs/components/OrgUnitDimension/styles/OrgUnitDimension.style.js +1 -3
- package/build/cjs/components/PeriodDimension/FixedPeriodFilter.js +5 -16
- package/build/cjs/components/PeriodDimension/FixedPeriodSelect.js +5 -27
- package/build/cjs/components/PeriodDimension/PeriodDimension.js +0 -11
- package/build/cjs/components/PeriodDimension/PeriodTransfer.js +12 -41
- package/build/cjs/components/PeriodDimension/RelativePeriodFilter.js +2 -13
- package/build/cjs/components/PeriodDimension/__tests__/FixedPeriodSingleSelect.spec.js +0 -7
- package/build/cjs/components/PeriodDimension/__tests__/PeriodDimension.spec.js +0 -7
- package/build/cjs/components/PeriodDimension/__tests__/PeriodSelector.spec.js +0 -7
- package/build/cjs/components/PeriodDimension/__tests__/fixedPeriods.spec.js +2 -2
- package/build/cjs/components/PeriodDimension/__tests__/utils.spec.js +0 -3
- package/build/cjs/components/PeriodDimension/styles/FixedPeriodSelect.style.js +1 -3
- package/build/cjs/components/PeriodDimension/styles/PeriodFilter.style.js +1 -3
- package/build/cjs/components/PeriodDimension/utils/fixedPeriods.js +2 -35
- package/build/cjs/components/PeriodDimension/utils/index.js +0 -2
- package/build/cjs/components/PeriodDimension/utils/relativePeriods.js +0 -19
- package/build/cjs/components/PivotTable/PivotTable.js +0 -15
- package/build/cjs/components/PivotTable/PivotTableBody.js +0 -8
- package/build/cjs/components/PivotTable/PivotTableCell.js +4 -14
- package/build/cjs/components/PivotTable/PivotTableClippedAxis.js +0 -5
- package/build/cjs/components/PivotTable/PivotTableColumnHeaderCell.js +4 -18
- package/build/cjs/components/PivotTable/PivotTableColumnHeaders.js +0 -11
- package/build/cjs/components/PivotTable/PivotTableContainer.js +2 -11
- package/build/cjs/components/PivotTable/PivotTableDimensionLabelCell.js +4 -16
- package/build/cjs/components/PivotTable/PivotTableEmptyCell.js +3 -10
- package/build/cjs/components/PivotTable/PivotTableEmptyRow.js +0 -7
- package/build/cjs/components/PivotTable/PivotTableEngineContext.js +0 -10
- package/build/cjs/components/PivotTable/PivotTableHead.js +0 -7
- package/build/cjs/components/PivotTable/PivotTableHeaderCell.js +0 -5
- package/build/cjs/components/PivotTable/PivotTableRow.js +0 -11
- package/build/cjs/components/PivotTable/PivotTableRowHeaderCell.js +2 -10
- package/build/cjs/components/PivotTable/PivotTableSortIcon.js +2 -14
- package/build/cjs/components/PivotTable/PivotTableTitleRow.js +2 -13
- package/build/cjs/components/PivotTable/PivotTableTitleRows.js +0 -9
- package/build/cjs/components/PivotTable/PivotTableValueCell.js +4 -19
- package/build/cjs/components/PivotTable/icons/SortIconAscending.js +0 -4
- package/build/cjs/components/PivotTable/icons/SortIconDescending.js +0 -4
- package/build/cjs/components/PivotTable/icons/SortIconIdle.js +0 -4
- package/build/cjs/components/PivotTable/styles/PivotTable.style.js +3 -6
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuBar.js +0 -14
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuDropdown.js +1 -14
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuList.js +1 -16
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuListItem.js +4 -21
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuListItem.styles.js +1 -3
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuBar.spec.js +0 -50
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuDropdown.spec.js +1 -4
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuList.spec.js +2 -6
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuListItem.spec.js +1 -6
- package/build/cjs/components/Toolbar/HoverMenuBar/index.js +0 -4
- package/build/cjs/components/Toolbar/InterpretationsAndDetailsToggler.js +1 -10
- package/build/cjs/components/Toolbar/MenuButton.styles.js +1 -3
- package/build/cjs/components/Toolbar/Toolbar.js +1 -8
- package/build/cjs/components/Toolbar/ToolbarSidebar.js +1 -9
- package/build/cjs/components/Toolbar/UpdateButton.js +2 -13
- package/build/cjs/components/Toolbar/__tests__/InterpretationsAndDetailsToggler.spec.js +0 -5
- package/build/cjs/components/Toolbar/__tests__/Toolbar.spec.js +0 -4
- package/build/cjs/components/Toolbar/__tests__/ToolbarSidebar.spec.js +0 -4
- package/build/cjs/components/Toolbar/__tests__/UpdateButton.spec.js +0 -5
- package/build/cjs/components/Toolbar/index.js +0 -6
- package/build/cjs/components/TransferOption.js +7 -20
- package/build/cjs/components/TranslationDialog/TranslationModal/LocalesSelect.js +2 -12
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationForm.js +3 -27
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModal.js +0 -12
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModalActions.js +0 -11
- package/build/cjs/components/TranslationDialog/TranslationModal/useTranslationsResults.js +1 -7
- package/build/cjs/components/TranslationDialog/index.js +0 -1
- package/build/cjs/components/VisTypeIcon.js +0 -24
- package/build/cjs/components/styles/DimensionSelector.style.js +1 -3
- package/build/cjs/components/styles/DimensionsPanel.style.js +0 -2
- package/build/cjs/components/styles/TransferOption.style.js +1 -3
- package/build/cjs/index.js +0 -84
- package/build/cjs/locales/es/translations.json +7 -7
- package/build/cjs/locales/index.js +1 -74
- package/build/cjs/modules/__tests__/expressions.spec.js +4 -4
- package/build/cjs/modules/__tests__/getAdaptedUiLayoutByType.spec.js +0 -4
- package/build/cjs/modules/__tests__/getColorByValueFromLegendSet.spec.js +1 -2
- package/build/cjs/modules/__tests__/getOuLevelAndGroupText.spec.js +0 -1
- package/build/cjs/modules/__tests__/hash.spec.js +0 -2
- package/build/cjs/modules/__tests__/parseExpression.spec.js +0 -1
- package/build/cjs/modules/__tests__/renderValue.spec.js +19 -13
- package/build/cjs/modules/axis.js +1 -17
- package/build/cjs/modules/dataSets.js +0 -3
- package/build/cjs/modules/dataTypes.js +0 -9
- package/build/cjs/modules/dimensionListItem.js +0 -24
- package/build/cjs/modules/expressions.js +2 -21
- package/build/cjs/modules/fontStyle.js +15 -27
- package/build/cjs/modules/getAdaptedUiLayoutByType.js +7 -39
- package/build/cjs/modules/getOuLevelAndGroupText.js +0 -18
- package/build/cjs/modules/hash.js +0 -10
- package/build/cjs/modules/layout/__tests__/axisGetAllItems.spec.js +0 -2
- package/build/cjs/modules/layout/__tests__/axisGetDimension.spec.js +0 -3
- package/build/cjs/modules/layout/__tests__/axisGetDimensionIds.spec.js +0 -5
- package/build/cjs/modules/layout/__tests__/axisHasDataDimension.spec.js +0 -2
- package/build/cjs/modules/layout/__tests__/axisHasDimension.spec.js +0 -3
- package/build/cjs/modules/layout/__tests__/axisHasOuDimension.spec.js +0 -2
- package/build/cjs/modules/layout/__tests__/axisHasPeriodDimension.spec.js +0 -2
- package/build/cjs/modules/layout/__tests__/axisIsEmpty.spec.js +0 -2
- package/build/cjs/modules/layout/__tests__/dimensionCreate.spec.js +0 -5
- package/build/cjs/modules/layout/__tests__/dimensionGetId.spec.js +0 -3
- package/build/cjs/modules/layout/__tests__/dimensionGetItemIds.spec.js +0 -4
- package/build/cjs/modules/layout/__tests__/dimensionGetItems.spec.js +0 -3
- package/build/cjs/modules/layout/__tests__/dimensionHasRelativeItems.spec.js +0 -2
- package/build/cjs/modules/layout/__tests__/dimensionIs.spec.js +0 -3
- package/build/cjs/modules/layout/__tests__/dimensionIsEmpty.spec.js +0 -2
- package/build/cjs/modules/layout/__tests__/dimensionIsValid.spec.js +0 -2
- package/build/cjs/modules/layout/__tests__/itemGetId.spec.js +0 -3
- package/build/cjs/modules/layout/__tests__/itemIsValid.spec.js +0 -2
- package/build/cjs/modules/layout/__tests__/layoutFilterDimensions.spec.js +0 -5
- package/build/cjs/modules/layout/__tests__/layoutGetAllAxes.spec.js +0 -2
- package/build/cjs/modules/layout/__tests__/layoutGetAllDimensions.spec.js +0 -2
- package/build/cjs/modules/layout/__tests__/layoutGetAllItemIds.spec.js +0 -3
- package/build/cjs/modules/layout/__tests__/layoutGetAllItems.spec.js +0 -2
- package/build/cjs/modules/layout/__tests__/layoutGetAxisIdDimensionIdsObject.spec.js +0 -4
- package/build/cjs/modules/layout/__tests__/layoutGetDimension.spec.js +0 -3
- package/build/cjs/modules/layout/__tests__/layoutGetDimensionIdItemIdsObject.spec.js +0 -6
- package/build/cjs/modules/layout/__tests__/layoutGetDimensionItems.spec.js +0 -3
- package/build/cjs/modules/layout/__tests__/layoutHasDataDimension.spec.js +2 -4
- package/build/cjs/modules/layout/__tests__/layoutHasDimension.spec.js +2 -5
- package/build/cjs/modules/layout/__tests__/layoutHasDynamicDimension.spec.js +2 -4
- package/build/cjs/modules/layout/__tests__/layoutHasPeriodDimension.spec.js +2 -4
- package/build/cjs/modules/layout/__tests__/layoutReplaceDimension.spec.js +0 -3
- package/build/cjs/modules/layout/axis.js +5 -3
- package/build/cjs/modules/layout/axisGetAllItems.js +0 -3
- package/build/cjs/modules/layout/axisGetDimension.js +0 -4
- package/build/cjs/modules/layout/axisGetDimensionIds.js +0 -4
- package/build/cjs/modules/layout/axisHasDataDimension.js +0 -4
- package/build/cjs/modules/layout/axisHasDimension.js +0 -3
- package/build/cjs/modules/layout/axisHasOuDimension.js +0 -4
- package/build/cjs/modules/layout/axisHasPeriodDimension.js +0 -4
- package/build/cjs/modules/layout/axisHasRelativeItems.js +0 -3
- package/build/cjs/modules/layout/axisIsEmpty.js +0 -2
- package/build/cjs/modules/layout/dimension.js +3 -5
- package/build/cjs/modules/layout/dimensionCreate.js +0 -3
- package/build/cjs/modules/layout/dimensionGetId.js +1 -5
- package/build/cjs/modules/layout/dimensionGetItemIds.js +0 -4
- package/build/cjs/modules/layout/dimensionGetItems.js +0 -4
- package/build/cjs/modules/layout/dimensionHasRelativeItems.js +0 -5
- package/build/cjs/modules/layout/dimensionIs.js +0 -3
- package/build/cjs/modules/layout/dimensionIsEmpty.js +0 -3
- package/build/cjs/modules/layout/dimensionIsValid.js +0 -9
- package/build/cjs/modules/layout/item.js +3 -5
- package/build/cjs/modules/layout/itemGetId.js +0 -3
- package/build/cjs/modules/layout/itemIsValid.js +0 -5
- package/build/cjs/modules/layout/layout.js +0 -3
- package/build/cjs/modules/layout/layoutFilterDimensions.js +0 -6
- package/build/cjs/modules/layout/layoutGetAllAxes.js +0 -3
- package/build/cjs/modules/layout/layoutGetAllDimensions.js +0 -3
- package/build/cjs/modules/layout/layoutGetAllItemIds.js +0 -4
- package/build/cjs/modules/layout/layoutGetAllItems.js +0 -4
- package/build/cjs/modules/layout/layoutGetAxisIdDimensionIdsObject.js +0 -5
- package/build/cjs/modules/layout/layoutGetDimension.js +0 -4
- package/build/cjs/modules/layout/layoutGetDimensionIdItemIdsObject.js +0 -5
- package/build/cjs/modules/layout/layoutGetDimensionItems.js +0 -4
- package/build/cjs/modules/layout/layoutHasDataDimension.js +0 -4
- package/build/cjs/modules/layout/layoutHasDimension.js +0 -3
- package/build/cjs/modules/layout/layoutHasDynamicDimension.js +0 -5
- package/build/cjs/modules/layout/layoutHasPeriodDimension.js +0 -4
- package/build/cjs/modules/layout/layoutReplaceDimension.js +0 -8
- package/build/cjs/modules/layout/testResources.js +7 -9
- package/build/cjs/modules/layoutUiRules/__tests__/rules.spec.js +6 -14
- package/build/cjs/modules/layoutUiRules/index.js +0 -2
- package/build/cjs/modules/layoutUiRules/rules.js +10 -26
- package/build/cjs/modules/layoutUiRules/rulesHelper.js +1 -11
- package/build/cjs/modules/layoutUiRules/rulesUtils.js +6 -16
- package/build/cjs/modules/legends.js +0 -8
- package/build/cjs/modules/list.js +0 -4
- package/build/cjs/modules/ouIdHelper/__tests__/index.spec.js +0 -1
- package/build/cjs/modules/ouIdHelper/index.js +2 -8
- package/build/cjs/modules/ouLevelUtils/__tests__/index.spec.js +0 -1
- package/build/cjs/modules/ouLevelUtils/index.js +0 -13
- package/build/cjs/modules/outliers/__tests__/index.spec.js +0 -1
- package/build/cjs/modules/outliers/__tests__/iqr.spec.js +0 -1
- package/build/cjs/modules/outliers/__tests__/modZScore.spec.js +0 -1
- package/build/cjs/modules/outliers/__tests__/xyStats.spec.js +0 -1
- package/build/cjs/modules/outliers/index.js +6 -28
- package/build/cjs/modules/outliers/iqr.js +0 -19
- package/build/cjs/modules/outliers/modZScore.js +10 -34
- package/build/cjs/modules/outliers/normalization.js +2 -9
- package/build/cjs/modules/outliers/xyStats.js +0 -4
- package/build/cjs/modules/outliers/zScore.js +0 -13
- package/build/cjs/modules/pivotTable/AdaptiveClippingController.js +4 -33
- package/build/cjs/modules/pivotTable/PivotTableEngine.js +20 -190
- package/build/cjs/modules/pivotTable/applyLegendSet.js +0 -23
- package/build/cjs/modules/pivotTable/clipAxis.js +3 -6
- package/build/cjs/modules/pivotTable/clipPartitionedAxis.js +0 -8
- package/build/cjs/modules/pivotTable/getHeaderForDisplay.js +0 -9
- package/build/cjs/modules/pivotTable/isColorBright.js +0 -6
- package/build/cjs/modules/pivotTable/measureText.js +5 -21
- package/build/cjs/modules/pivotTable/parseValue.js +0 -4
- package/build/cjs/modules/pivotTable/useParentSize.js +0 -11
- package/build/cjs/modules/pivotTable/useScrollPosition.js +0 -7
- package/build/cjs/modules/pivotTable/useSortableColumns.js +0 -7
- package/build/cjs/modules/pivotTable/useTableClipping.js +0 -6
- package/build/cjs/modules/predefinedDimensions.js +2 -18
- package/build/cjs/modules/relativeItems/__tests__/index.spec.js +0 -2
- package/build/cjs/modules/relativeItems/index.js +0 -5
- package/build/cjs/modules/renderValue.js +0 -18
- package/build/cjs/modules/utils.js +0 -5
- package/build/cjs/modules/valueTypes.js +1 -3
- package/build/cjs/modules/visTypeToLayoutType.js +0 -5
- package/build/cjs/modules/visTypes.js +1 -27
- package/build/cjs/visualizations/config/adapters/dhis_dhis/index.js +2 -8
- package/build/cjs/visualizations/config/adapters/dhis_dhis/subtitle/__tests__/index.spec.js +0 -3
- package/build/cjs/visualizations/config/adapters/dhis_dhis/subtitle/__tests__/singleValue.spec.js +0 -2
- package/build/cjs/visualizations/config/adapters/dhis_dhis/subtitle/index.js +0 -11
- package/build/cjs/visualizations/config/adapters/dhis_dhis/subtitle/singleValue.js +0 -3
- package/build/cjs/visualizations/config/adapters/dhis_dhis/title/__tests__/index.spec.js +0 -3
- package/build/cjs/visualizations/config/adapters/dhis_dhis/title/__tests__/singleValue.spec.js +0 -2
- package/build/cjs/visualizations/config/adapters/dhis_dhis/title/index.js +0 -10
- package/build/cjs/visualizations/config/adapters/dhis_dhis/title/singleValue.js +0 -4
- package/build/cjs/visualizations/config/adapters/dhis_dhis/type.js +0 -3
- package/build/cjs/visualizations/config/adapters/dhis_dhis/value/index.js +3 -7
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +30 -113
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/axis.js +6 -37
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/chart.js +0 -5
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/customAxes.js +8 -10
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getAxisTitle.js +1 -8
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getCategories.js +0 -3
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getCumulativeData.js +6 -15
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getFormatter.js +0 -3
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getScatterData.js +0 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getSortedConfig.js +7 -19
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getStackedData.js +0 -4
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getSteps.js +0 -3
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getTextAlignOption.js +0 -7
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +4 -31
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getTwoCategorySplitSerieData.js +0 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/index.js +21 -56
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/legend.js +1 -8
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/legendSet.js +5 -14
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/noData.js +0 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/pane/gauge.js +0 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/pane/index.js +0 -5
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/plotOptions.js +1 -15
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/series/gauge.js +0 -5
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/series/index.js +13 -48
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/series/pie.js +0 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/series/scatter.js +9 -11
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/subtitle/gauge.js +0 -3
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/subtitle/index.js +3 -18
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/title/index.js +1 -18
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/title/scatter.js +1 -5
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/title/yearOverYear.js +0 -6
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/type.js +0 -9
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/xAxis/index.js +1 -28
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/xAxis/radar.js +0 -11
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/xAxis/scatter.js +0 -12
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/xAxis/twoCategory.js +4 -11
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/xAxis/yearOnYear.js +0 -11
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +3 -28
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/yAxis/index.js +8 -37
- package/build/cjs/visualizations/config/adapters/index.js +0 -4
- package/build/cjs/visualizations/config/generators/dhis/index.js +0 -8
- package/build/cjs/visualizations/config/generators/dhis/singleValue.js +41 -70
- package/build/cjs/visualizations/config/generators/highcharts/index.js +9 -24
- package/build/cjs/visualizations/config/generators/index.js +0 -4
- package/build/cjs/visualizations/config/index.js +9 -22
- package/build/cjs/visualizations/config/validators/dhis/index.js +0 -1
- package/build/cjs/visualizations/config/validators/index.js +0 -4
- package/build/cjs/visualizations/index.js +0 -10
- package/build/cjs/visualizations/store/adapters/dhis_dhis/index.js +3 -13
- package/build/cjs/visualizations/store/adapters/dhis_dhis/singleValue.js +0 -1
- package/build/cjs/visualizations/store/adapters/dhis_highcharts/gauge.js +0 -1
- package/build/cjs/visualizations/store/adapters/dhis_highcharts/index.js +8 -26
- package/build/cjs/visualizations/store/adapters/dhis_highcharts/pie.js +0 -2
- package/build/cjs/visualizations/store/adapters/dhis_highcharts/twoCategory.js +3 -6
- package/build/cjs/visualizations/store/adapters/dhis_highcharts/yearOnYear.js +3 -4
- package/build/cjs/visualizations/store/adapters/index.js +0 -4
- package/build/cjs/visualizations/store/index.js +2 -12
- package/build/cjs/visualizations/store/validators/dhis/index.js +6 -22
- package/build/cjs/visualizations/store/validators/index.js +0 -4
- package/build/cjs/visualizations/util/__tests__/getFilterText.spec.js +0 -2
- package/build/cjs/visualizations/util/axes.js +0 -2
- package/build/cjs/visualizations/util/axisId.js +1 -3
- package/build/cjs/visualizations/util/colors/colorSets.js +0 -4
- package/build/cjs/visualizations/util/colors/gradientColorGenerator.js +3 -10
- package/build/cjs/visualizations/util/colors/index.js +0 -3
- package/build/cjs/visualizations/util/getFilterText.js +4 -13
- package/build/es/__demo__/DimensionsPanel.stories.js +0 -2
- package/build/es/__demo__/FileMenu.stories.js +2 -1
- package/build/es/__demo__/Filter.stories.js +0 -5
- package/build/es/__demo__/OpenFileDialog.stories.js +1 -3
- package/build/es/__demo__/OrgUnitDimension.stories.js +1 -3
- package/build/es/__demo__/PivotTable.stories.js +100 -57
- package/build/es/__demo__/Toolbar.stories.js +0 -2
- package/build/es/__fixtures__/fixtures.js +0 -5
- package/build/es/api/__tests__/dimensions.spec.js +0 -2
- package/build/es/api/analytics/Analytics.js +2 -6
- package/build/es/api/analytics/AnalyticsAggregate.js +3 -7
- package/build/es/api/analytics/AnalyticsBase.js +8 -17
- package/build/es/api/analytics/AnalyticsEnrollments.js +1 -3
- package/build/es/api/analytics/AnalyticsEvents.js +4 -9
- package/build/es/api/analytics/AnalyticsRequest.js +16 -27
- package/build/es/api/analytics/AnalyticsRequestBase.js +8 -25
- package/build/es/api/analytics/AnalyticsRequestDimensionsMixin.js +4 -14
- package/build/es/api/analytics/AnalyticsRequestFiltersMixin.js +4 -14
- package/build/es/api/analytics/AnalyticsRequestPropertiesMixin.js +57 -138
- package/build/es/api/analytics/AnalyticsResponse.js +21 -41
- package/build/es/api/analytics/AnalyticsResponseHeader.js +0 -5
- package/build/es/api/analytics/__mocks__/DataEngine.js +0 -4
- package/build/es/api/analytics/__tests__/AnalyticsAggregate.spec.js +11 -1
- package/build/es/api/analytics/__tests__/AnalyticsRequest.spec.js +17 -15
- package/build/es/api/analytics/__tests__/AnalyticsRequestBase.spec.js +4 -6
- package/build/es/api/analytics/__tests__/AnalyticsResponse.spec.js +3 -1
- package/build/es/api/analytics/__tests__/AnalyticsResponseHeader.spec.js +2 -1
- package/build/es/api/analytics/utils.js +1 -1
- package/build/es/api/dimensions.js +43 -78
- package/build/es/api/index.js +1 -0
- package/build/es/api/organisationUnits.js +5 -4
- package/build/es/assets/AssignedCategoriesIcon.js +0 -2
- package/build/es/assets/DynamicDimensionIcon.js +0 -2
- package/build/es/assets/FormulaIcon.js +0 -2
- package/build/es/components/AboutAOUnit/AboutAOUnit.js +19 -31
- package/build/es/components/AboutAOUnit/styles/AboutAOUnit.style.js +1 -1
- package/build/es/components/CachedDataQueryProvider.js +0 -7
- package/build/es/components/DataDimension/Calculation/CalculationModal.js +26 -54
- package/build/es/components/DataDimension/Calculation/DataElementOption.js +6 -10
- package/build/es/components/DataDimension/Calculation/DataElementSelector.js +16 -35
- package/build/es/components/DataDimension/Calculation/DndContext.js +6 -28
- package/build/es/components/DataDimension/Calculation/DraggingItem.js +3 -5
- package/build/es/components/DataDimension/Calculation/DropZone.js +1 -5
- package/build/es/components/DataDimension/Calculation/FormulaField.js +5 -8
- package/build/es/components/DataDimension/Calculation/FormulaItem.js +13 -26
- package/build/es/components/DataDimension/Calculation/MathOperatorSelector.js +4 -6
- package/build/es/components/DataDimension/Calculation/Operator.js +5 -9
- package/build/es/components/DataDimension/Calculation/styles/CalculationModal.style.js +1 -1
- package/build/es/components/DataDimension/Calculation/styles/DataElementOption.style.js +1 -1
- package/build/es/components/DataDimension/Calculation/styles/DataElementSelector.style.js +1 -1
- package/build/es/components/DataDimension/Calculation/styles/DraggingItem.style.js +1 -1
- package/build/es/components/DataDimension/Calculation/styles/DropZone.style.js +1 -1
- package/build/es/components/DataDimension/Calculation/styles/FormulaField.style.js +1 -1
- package/build/es/components/DataDimension/Calculation/styles/FormulaItem.style.js +1 -1
- package/build/es/components/DataDimension/Calculation/styles/MathOperatorSelector.style.js +1 -1
- package/build/es/components/DataDimension/Calculation/styles/Operator.style.js +1 -1
- package/build/es/components/DataDimension/DataDimension.js +1 -5
- package/build/es/components/DataDimension/DataTypeSelector.js +3 -6
- package/build/es/components/DataDimension/DetailSelector.js +2 -4
- package/build/es/components/DataDimension/GroupSelector.js +7 -12
- package/build/es/components/DataDimension/ItemSelector.js +45 -74
- package/build/es/components/DataDimension/MetricSelector.js +3 -3
- package/build/es/components/DataDimension/styles/DataTypeSelector.style.js +1 -1
- package/build/es/components/DataDimension/styles/DetailSelector.style.js +1 -1
- package/build/es/components/DataDimension/styles/GroupSelector.style.js +1 -1
- package/build/es/components/DataDimension/styles/MetricSelector.style.js +1 -1
- package/build/es/components/DimensionMenu.js +18 -24
- package/build/es/components/DimensionsPanel/DimensionsPanel.js +5 -10
- package/build/es/components/DimensionsPanel/List/DimensionItem.js +11 -21
- package/build/es/components/DimensionsPanel/List/DimensionList.js +11 -21
- package/build/es/components/DimensionsPanel/List/OptionsButton.js +0 -2
- package/build/es/components/DimensionsPanel/List/RecommendedIcon.js +0 -2
- package/build/es/components/DimensionsPanel/List/__tests__/DimensionItem.spec.js +0 -3
- package/build/es/components/DimensionsPanel/List/styles/DimensionList.style.js +2 -2
- package/build/es/components/DimensionsPanel/__tests__/DimensionsPanel.spec.js +0 -3
- package/build/es/components/DimensionsPanel/styles/DimensionsPanel.style.js +1 -1
- package/build/es/components/DynamicDimension/DynamicDimension.js +4 -10
- package/build/es/components/DynamicDimension/ItemSelector.js +15 -29
- package/build/es/components/DynamicDimension/styles/DynamicDimension.style.js +1 -1
- package/build/es/components/FileMenu/DeleteDialog.js +0 -2
- package/build/es/components/FileMenu/FileMenu.js +0 -12
- package/build/es/components/FileMenu/FileMenu.styles.js +2 -2
- package/build/es/components/FileMenu/GetLinkDialog.js +5 -4
- package/build/es/components/FileMenu/GetLinkDialog.styles.js +1 -1
- package/build/es/components/FileMenu/RenameDialog.js +1 -5
- package/build/es/components/FileMenu/SaveAsDialog.js +3 -3
- package/build/es/components/FileMenu/__tests__/DeleteDialog.spec.js +1 -4
- package/build/es/components/FileMenu/__tests__/FileMenu.spec.js +28 -20
- package/build/es/components/FileMenu/__tests__/GetLinkDialog.spec.js +0 -3
- package/build/es/components/FileMenu/__tests__/RenameDialog.spec.js +1 -4
- package/build/es/components/FileMenu/__tests__/SaveAsDialog.spec.js +1 -4
- package/build/es/components/FileMenu/utils.js +4 -10
- package/build/es/components/Filter/Filter.js +1 -3
- package/build/es/components/Filter/__tests__/Filter.spec.js +0 -3
- package/build/es/components/Filter/styles/Filter.style.js +1 -1
- package/build/es/components/Interpretations/InterpretationModal/Comment.js +0 -2
- package/build/es/components/Interpretations/InterpretationModal/CommentAddForm.js +1 -1
- package/build/es/components/Interpretations/InterpretationModal/CommentDeleteButton.js +1 -3
- package/build/es/components/Interpretations/InterpretationModal/CommentUpdateForm.js +2 -2
- package/build/es/components/Interpretations/InterpretationModal/InterpretationModal.js +2 -13
- package/build/es/components/Interpretations/InterpretationModal/InterpretationThread.js +0 -3
- package/build/es/components/Interpretations/InterpretationModal/useModalContentWidth.js +0 -3
- package/build/es/components/Interpretations/InterpretationsUnit/InterpretationForm.js +2 -2
- package/build/es/components/Interpretations/InterpretationsUnit/InterpretationList.js +1 -8
- package/build/es/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js +2 -2
- package/build/es/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js +0 -2
- package/build/es/components/Interpretations/common/Interpretation/InterpretationSharingLink.js +1 -3
- package/build/es/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js +1 -1
- package/build/es/components/Interpretations/common/Interpretation/useLike.js +1 -5
- package/build/es/components/Interpretations/common/Message/Message.js +1 -3
- package/build/es/components/Interpretations/common/Message/MessageButtonStrip.js +1 -3
- package/build/es/components/Interpretations/common/Message/MessageEditorContainer.js +1 -3
- package/build/es/components/Interpretations/common/Message/MessageIconButton.js +6 -8
- package/build/es/components/Interpretations/common/Message/MessageInput.js +2 -4
- package/build/es/components/Interpretations/common/Message/MessageStatsBar.js +1 -3
- package/build/es/components/Interpretations/common/RichTextEditor/RichTextEditor.js +15 -23
- package/build/es/components/Interpretations/common/RichTextEditor/markdownHandler.js +4 -19
- package/build/es/components/Interpretations/common/RichTextEditor/styles/RichTextEditor.style.js +3 -3
- package/build/es/components/Interpretations/common/UserMention/UserList.js +1 -2
- package/build/es/components/Interpretations/common/UserMention/UserMentionWrapper.js +18 -33
- package/build/es/components/Interpretations/common/UserMention/styles/UserMentionWrapper.style.js +1 -2
- package/build/es/components/Interpretations/common/UserMention/useUserSearchResults.js +1 -2
- package/build/es/components/LegendKey/LegendKey.js +9 -11
- package/build/es/components/LegendKey/styles/LegendKey.style.js +1 -1
- package/build/es/components/OfflineTooltip.js +1 -3
- package/build/es/components/OpenFileDialog/CreatedByFilter.js +3 -1
- package/build/es/components/OpenFileDialog/CustomSelectOption.js +2 -4
- package/build/es/components/OpenFileDialog/OpenFileDialog.js +29 -45
- package/build/es/components/OpenFileDialog/OpenFileDialog.styles.js +1 -1
- package/build/es/components/OpenFileDialog/styles/CustomSelectOption.style.js +1 -1
- package/build/es/components/Options/VisualizationOptions.js +0 -8
- package/build/es/components/Options/styles/VisualizationOptions.style.js +11 -12
- package/build/es/components/OrgUnitDimension/OrgUnitDimension.js +12 -31
- package/build/es/components/OrgUnitDimension/styles/OrgUnitDimension.style.js +1 -1
- package/build/es/components/PeriodDimension/FixedPeriodFilter.js +5 -7
- package/build/es/components/PeriodDimension/FixedPeriodSelect.js +5 -17
- package/build/es/components/PeriodDimension/PeriodDimension.js +0 -4
- package/build/es/components/PeriodDimension/PeriodTransfer.js +12 -25
- package/build/es/components/PeriodDimension/RelativePeriodFilter.js +2 -4
- package/build/es/components/PeriodDimension/__tests__/FixedPeriodSingleSelect.spec.js +0 -3
- package/build/es/components/PeriodDimension/__tests__/PeriodDimension.spec.js +0 -3
- package/build/es/components/PeriodDimension/__tests__/PeriodSelector.spec.js +0 -3
- package/build/es/components/PeriodDimension/__tests__/fixedPeriods.spec.js +2 -1
- package/build/es/components/PeriodDimension/styles/FixedPeriodSelect.style.js +1 -1
- package/build/es/components/PeriodDimension/styles/PeriodFilter.style.js +1 -1
- package/build/es/components/PeriodDimension/utils/fixedPeriods.js +2 -23
- package/build/es/components/PeriodDimension/utils/relativePeriods.js +0 -11
- package/build/es/components/PivotTable/PivotTable.js +0 -2
- package/build/es/components/PivotTable/PivotTableCell.js +4 -6
- package/build/es/components/PivotTable/PivotTableColumnHeaderCell.js +4 -7
- package/build/es/components/PivotTable/PivotTableContainer.js +2 -2
- package/build/es/components/PivotTable/PivotTableDimensionLabelCell.js +4 -9
- package/build/es/components/PivotTable/PivotTableEmptyCell.js +3 -4
- package/build/es/components/PivotTable/PivotTableRowHeaderCell.js +2 -2
- package/build/es/components/PivotTable/PivotTableSortIcon.js +2 -2
- package/build/es/components/PivotTable/PivotTableTitleRow.js +2 -2
- package/build/es/components/PivotTable/PivotTableTitleRows.js +0 -1
- package/build/es/components/PivotTable/PivotTableValueCell.js +4 -6
- package/build/es/components/PivotTable/styles/PivotTable.style.js +3 -3
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuBar.js +0 -7
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuDropdown.js +1 -1
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuList.js +1 -7
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuListItem.js +4 -9
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuListItem.styles.js +1 -1
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuBar.spec.js +0 -2
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuDropdown.spec.js +1 -0
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuList.spec.js +2 -2
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuListItem.spec.js +1 -0
- package/build/es/components/Toolbar/InterpretationsAndDetailsToggler.js +1 -1
- package/build/es/components/Toolbar/MenuButton.styles.js +1 -1
- package/build/es/components/Toolbar/Toolbar.js +1 -1
- package/build/es/components/Toolbar/ToolbarSidebar.js +1 -1
- package/build/es/components/Toolbar/UpdateButton.js +2 -2
- package/build/es/components/Toolbar/__tests__/InterpretationsAndDetailsToggler.spec.js +0 -1
- package/build/es/components/Toolbar/__tests__/UpdateButton.spec.js +0 -1
- package/build/es/components/TransferOption.js +7 -11
- package/build/es/components/TranslationDialog/TranslationModal/LocalesSelect.js +2 -3
- package/build/es/components/TranslationDialog/TranslationModal/TranslationForm.js +3 -15
- package/build/es/components/TranslationDialog/TranslationModal/TranslationModalActions.js +0 -2
- package/build/es/components/TranslationDialog/TranslationModal/useTranslationsResults.js +1 -1
- package/build/es/components/VisTypeIcon.js +0 -17
- package/build/es/components/styles/DimensionSelector.style.js +1 -1
- package/build/es/components/styles/TransferOption.style.js +1 -1
- package/build/es/index.js +53 -19
- package/build/es/locales/es/translations.json +7 -7
- package/build/es/modules/__tests__/expressions.spec.js +4 -3
- package/build/es/modules/__tests__/getColorByValueFromLegendSet.spec.js +1 -1
- package/build/es/modules/__tests__/renderValue.spec.js +19 -10
- package/build/es/modules/axis.js +1 -8
- package/build/es/modules/dataTypes.js +0 -3
- package/build/es/modules/dimensionListItem.js +0 -12
- package/build/es/modules/expressions.js +2 -6
- package/build/es/modules/fontStyle.js +16 -16
- package/build/es/modules/getAdaptedUiLayoutByType.js +7 -22
- package/build/es/modules/getOuLevelAndGroupText.js +0 -10
- package/build/es/modules/hash.js +0 -3
- package/build/es/modules/layout/__tests__/layoutHasDataDimension.spec.js +2 -1
- package/build/es/modules/layout/__tests__/layoutHasDimension.spec.js +2 -1
- package/build/es/modules/layout/__tests__/layoutHasDynamicDimension.spec.js +2 -1
- package/build/es/modules/layout/__tests__/layoutHasPeriodDimension.spec.js +2 -1
- package/build/es/modules/layout/axis.js +6 -2
- package/build/es/modules/layout/dimension.js +6 -2
- package/build/es/modules/layout/dimensionGetId.js +1 -2
- package/build/es/modules/layout/dimensionIsValid.js +0 -5
- package/build/es/modules/layout/item.js +6 -2
- package/build/es/modules/layout/itemIsValid.js +0 -1
- package/build/es/modules/layout/layoutGetAxisIdDimensionIdsObject.js +0 -1
- package/build/es/modules/layout/layoutReplaceDimension.js +0 -3
- package/build/es/modules/layout/testResources.js +12 -4
- package/build/es/modules/layoutUiRules/__tests__/rules.spec.js +8 -12
- package/build/es/modules/layoutUiRules/rules.js +11 -11
- package/build/es/modules/layoutUiRules/rulesHelper.js +3 -1
- package/build/es/modules/layoutUiRules/rulesUtils.js +6 -4
- package/build/es/modules/legends.js +0 -2
- package/build/es/modules/ouIdHelper/index.js +2 -8
- package/build/es/modules/ouLevelUtils/index.js +0 -7
- package/build/es/modules/outliers/index.js +6 -17
- package/build/es/modules/outliers/iqr.js +0 -9
- package/build/es/modules/outliers/modZScore.js +13 -9
- package/build/es/modules/outliers/normalization.js +3 -5
- package/build/es/modules/outliers/xyStats.js +0 -2
- package/build/es/modules/outliers/zScore.js +0 -2
- package/build/es/modules/pivotTable/AdaptiveClippingController.js +4 -29
- package/build/es/modules/pivotTable/PivotTableEngine.js +20 -179
- package/build/es/modules/pivotTable/applyLegendSet.js +0 -19
- package/build/es/modules/pivotTable/clipAxis.js +3 -2
- package/build/es/modules/pivotTable/clipPartitionedAxis.js +0 -6
- package/build/es/modules/pivotTable/getHeaderForDisplay.js +0 -7
- package/build/es/modules/pivotTable/isColorBright.js +0 -4
- package/build/es/modules/pivotTable/measureText.js +5 -18
- package/build/es/modules/pivotTable/parseValue.js +0 -2
- package/build/es/modules/pivotTable/useParentSize.js +0 -5
- package/build/es/modules/pivotTable/useScrollPosition.js +0 -2
- package/build/es/modules/pivotTable/useSortableColumns.js +0 -3
- package/build/es/modules/predefinedDimensions.js +2 -1
- package/build/es/modules/renderValue.js +0 -15
- package/build/es/modules/valueTypes.js +1 -0
- package/build/es/modules/visTypes.js +1 -3
- package/build/es/visualizations/config/adapters/dhis_dhis/index.js +2 -2
- package/build/es/visualizations/config/adapters/dhis_dhis/subtitle/index.js +0 -7
- package/build/es/visualizations/config/adapters/dhis_dhis/title/index.js +0 -6
- package/build/es/visualizations/config/adapters/dhis_dhis/title/singleValue.js +0 -1
- package/build/es/visualizations/config/adapters/dhis_dhis/type.js +0 -1
- package/build/es/visualizations/config/adapters/dhis_dhis/value/index.js +3 -3
- package/build/es/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +30 -101
- package/build/es/visualizations/config/adapters/dhis_highcharts/axis.js +6 -19
- package/build/es/visualizations/config/adapters/dhis_highcharts/chart.js +0 -2
- package/build/es/visualizations/config/adapters/dhis_highcharts/customAxes.js +8 -7
- package/build/es/visualizations/config/adapters/dhis_highcharts/getAxisTitle.js +1 -3
- package/build/es/visualizations/config/adapters/dhis_highcharts/getCumulativeData.js +6 -11
- package/build/es/visualizations/config/adapters/dhis_highcharts/getScatterData.js +0 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/getSortedConfig.js +7 -12
- package/build/es/visualizations/config/adapters/dhis_highcharts/getStackedData.js +0 -2
- package/build/es/visualizations/config/adapters/dhis_highcharts/getTextAlignOption.js +0 -4
- package/build/es/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +4 -26
- package/build/es/visualizations/config/adapters/dhis_highcharts/getTwoCategorySplitSerieData.js +0 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/index.js +21 -32
- package/build/es/visualizations/config/adapters/dhis_highcharts/legend.js +1 -4
- package/build/es/visualizations/config/adapters/dhis_highcharts/legendSet.js +5 -6
- package/build/es/visualizations/config/adapters/dhis_highcharts/pane/index.js +0 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/plotOptions.js +1 -9
- package/build/es/visualizations/config/adapters/dhis_highcharts/series/gauge.js +0 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/series/index.js +13 -32
- package/build/es/visualizations/config/adapters/dhis_highcharts/series/scatter.js +9 -6
- package/build/es/visualizations/config/adapters/dhis_highcharts/subtitle/gauge.js +2 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/subtitle/index.js +3 -10
- package/build/es/visualizations/config/adapters/dhis_highcharts/title/index.js +1 -9
- package/build/es/visualizations/config/adapters/dhis_highcharts/title/scatter.js +1 -2
- package/build/es/visualizations/config/adapters/dhis_highcharts/title/yearOverYear.js +0 -3
- package/build/es/visualizations/config/adapters/dhis_highcharts/type.js +0 -7
- package/build/es/visualizations/config/adapters/dhis_highcharts/xAxis/index.js +1 -11
- package/build/es/visualizations/config/adapters/dhis_highcharts/xAxis/radar.js +0 -3
- package/build/es/visualizations/config/adapters/dhis_highcharts/xAxis/scatter.js +0 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/xAxis/twoCategory.js +4 -3
- package/build/es/visualizations/config/adapters/dhis_highcharts/xAxis/yearOnYear.js +0 -4
- package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +3 -14
- package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/index.js +8 -23
- package/build/es/visualizations/config/generators/dhis/index.js +0 -4
- package/build/es/visualizations/config/generators/dhis/singleValue.js +42 -67
- package/build/es/visualizations/config/generators/highcharts/index.js +11 -15
- package/build/es/visualizations/config/index.js +9 -15
- package/build/es/visualizations/config/validators/index.js +0 -2
- package/build/es/visualizations/index.js +0 -6
- package/build/es/visualizations/store/adapters/dhis_dhis/index.js +3 -9
- package/build/es/visualizations/store/adapters/dhis_highcharts/index.js +8 -17
- package/build/es/visualizations/store/adapters/dhis_highcharts/pie.js +0 -1
- package/build/es/visualizations/store/adapters/dhis_highcharts/twoCategory.js +5 -4
- package/build/es/visualizations/store/adapters/dhis_highcharts/yearOnYear.js +3 -3
- package/build/es/visualizations/store/index.js +2 -8
- package/build/es/visualizations/store/validators/dhis/index.js +6 -17
- package/build/es/visualizations/store/validators/index.js +0 -2
- package/build/es/visualizations/util/axisId.js +1 -1
- package/build/es/visualizations/util/colors/gradientColorGenerator.js +3 -8
- package/build/es/visualizations/util/getFilterText.js +4 -7
- package/package.json +6 -7
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3
4
|
import times from 'lodash/times';
|
|
4
5
|
import { DIMENSION_TYPE_DATA, DIMENSION_TYPE_DATA_ELEMENT_GROUP_SET, DIMENSION_TYPE_ORGANISATION_UNIT, DIMENSION_TYPE_PERIOD } from '../dataTypes.js';
|
|
5
6
|
import { DIMENSION_ID_ORGUNIT } from '../predefinedDimensions.js';
|
|
@@ -23,9 +24,7 @@ const defaultVisualizationProps = {
|
|
|
23
24
|
fontSize: FONT_SIZE_OPTION_NORMAL,
|
|
24
25
|
displayDensity: DISPLAY_DENSITY_OPTION_NORMAL
|
|
25
26
|
};
|
|
26
|
-
|
|
27
27
|
const isDxDimension = dimensionItem => [DIMENSION_TYPE_DATA, DIMENSION_TYPE_DATA_ELEMENT_GROUP_SET].includes(dimensionItem.dimensionType);
|
|
28
|
-
|
|
29
28
|
const countFromDisaggregates = list => {
|
|
30
29
|
let count = 1;
|
|
31
30
|
list.forEach(x => {
|
|
@@ -33,7 +32,6 @@ const countFromDisaggregates = list => {
|
|
|
33
32
|
});
|
|
34
33
|
return count;
|
|
35
34
|
};
|
|
36
|
-
|
|
37
35
|
const addSize = list => {
|
|
38
36
|
const reversedList = list.slice().reverse();
|
|
39
37
|
reversedList.forEach((level, idx) => {
|
|
@@ -42,22 +40,18 @@ const addSize = list => {
|
|
|
42
40
|
level.size = lastLevel ? lastLevel.count * lastLevel.size : 1;
|
|
43
41
|
});
|
|
44
42
|
};
|
|
45
|
-
|
|
46
43
|
const listByDimension = list => list.reduce((all, item) => {
|
|
47
44
|
all[item.dimension] = item;
|
|
48
45
|
return all;
|
|
49
46
|
}, {});
|
|
50
|
-
|
|
51
47
|
const sortByHierarchy = items => {
|
|
52
48
|
items.sort((a, b) => {
|
|
53
49
|
if (!a.hierarchy || !b.hierarchy) {
|
|
54
50
|
return 0;
|
|
55
51
|
}
|
|
56
|
-
|
|
57
52
|
return a.hierarchy.join('/').localeCompare(b.hierarchy.join('/'));
|
|
58
53
|
});
|
|
59
54
|
};
|
|
60
|
-
|
|
61
55
|
const buildDimensionLookup = (visualization, metadata, headers) => {
|
|
62
56
|
const rows = visualization.rows.map(row => ({
|
|
63
57
|
dimension: row.dimension,
|
|
@@ -79,7 +73,8 @@ const buildDimensionLookup = (visualization, metadata, headers) => {
|
|
|
79
73
|
}));
|
|
80
74
|
addSize(rows);
|
|
81
75
|
addSize(columns);
|
|
82
|
-
const allByDimension = {
|
|
76
|
+
const allByDimension = {
|
|
77
|
+
...listByDimension(rows),
|
|
83
78
|
...listByDimension(columns)
|
|
84
79
|
};
|
|
85
80
|
const headerDimensions = headers.map(header => allByDimension[header.name]);
|
|
@@ -90,11 +85,9 @@ const buildDimensionLookup = (visualization, metadata, headers) => {
|
|
|
90
85
|
return out;
|
|
91
86
|
}, {});
|
|
92
87
|
const ouDimension = allByDimension[DIMENSION_ID_ORGUNIT];
|
|
93
|
-
|
|
94
88
|
if (visualization.showHierarchy && metadata.ouNameHierarchy && ouDimension) {
|
|
95
89
|
ouDimension.items.forEach(ou => {
|
|
96
90
|
const hierarchy = metadata.ouNameHierarchy[ou.uid];
|
|
97
|
-
|
|
98
91
|
if (hierarchy) {
|
|
99
92
|
ou.hierarchy = hierarchy.split('/').filter(x => x.length);
|
|
100
93
|
}
|
|
@@ -102,7 +95,6 @@ const buildDimensionLookup = (visualization, metadata, headers) => {
|
|
|
102
95
|
sortByHierarchy(ouDimension.items);
|
|
103
96
|
ouDimension.itemIds = ouDimension.items.map(item => item.uid);
|
|
104
97
|
}
|
|
105
|
-
|
|
106
98
|
return {
|
|
107
99
|
rows,
|
|
108
100
|
columns,
|
|
@@ -113,52 +105,40 @@ const buildDimensionLookup = (visualization, metadata, headers) => {
|
|
|
113
105
|
dataHeaders
|
|
114
106
|
};
|
|
115
107
|
};
|
|
116
|
-
|
|
117
108
|
const lookup = (dataRow, dimensionLookup, _ref) => {
|
|
118
109
|
let {
|
|
119
110
|
doColumnSubtotals,
|
|
120
111
|
doRowSubtotals
|
|
121
112
|
} = _ref;
|
|
122
113
|
let row = 0;
|
|
123
|
-
|
|
124
114
|
for (const headerIndex of dimensionLookup.rowHeaders) {
|
|
125
115
|
const idx = dimensionLookup.headerDimensions[headerIndex].itemIds.indexOf(dataRow[headerIndex]);
|
|
126
|
-
|
|
127
116
|
if (idx === -1) {
|
|
128
117
|
return undefined;
|
|
129
118
|
}
|
|
130
|
-
|
|
131
119
|
const size = dimensionLookup.headerDimensions[headerIndex].size;
|
|
132
120
|
row += idx * size;
|
|
133
121
|
}
|
|
134
|
-
|
|
135
122
|
if (doColumnSubtotals) {
|
|
136
123
|
row += Math.floor(row / dimensionLookup.rows[0].size);
|
|
137
124
|
}
|
|
138
|
-
|
|
139
125
|
let column = 0;
|
|
140
|
-
|
|
141
126
|
for (const headerIndex of dimensionLookup.columnHeaders) {
|
|
142
127
|
const idx = dimensionLookup.headerDimensions[headerIndex].itemIds.indexOf(dataRow[headerIndex]);
|
|
143
|
-
|
|
144
128
|
if (idx === -1) {
|
|
145
129
|
return undefined;
|
|
146
130
|
}
|
|
147
|
-
|
|
148
131
|
const size = dimensionLookup.headerDimensions[headerIndex].size;
|
|
149
132
|
column += idx * size;
|
|
150
133
|
}
|
|
151
|
-
|
|
152
134
|
if (doRowSubtotals) {
|
|
153
135
|
column += Math.floor(column / dimensionLookup.columns[0].size);
|
|
154
136
|
}
|
|
155
|
-
|
|
156
137
|
return {
|
|
157
138
|
column,
|
|
158
139
|
row
|
|
159
140
|
};
|
|
160
141
|
};
|
|
161
|
-
|
|
162
142
|
const applyTotalAggregationType = (_ref2, overrideTotalAggregationType) => {
|
|
163
143
|
let {
|
|
164
144
|
totalAggregationType,
|
|
@@ -168,48 +148,31 @@ const applyTotalAggregationType = (_ref2, overrideTotalAggregationType) => {
|
|
|
168
148
|
multiplier,
|
|
169
149
|
divisor
|
|
170
150
|
} = _ref2;
|
|
171
|
-
|
|
172
151
|
switch (overrideTotalAggregationType || totalAggregationType) {
|
|
173
152
|
case AGGREGATE_TYPE_NA:
|
|
174
153
|
return 'N/A';
|
|
175
|
-
|
|
176
154
|
case AGGREGATE_TYPE_AVERAGE:
|
|
177
155
|
return (numerator || value) * multiplier / (denominator * divisor || 1);
|
|
178
|
-
|
|
179
156
|
case AGGREGATE_TYPE_SUM:
|
|
180
157
|
default:
|
|
181
158
|
return value;
|
|
182
159
|
}
|
|
183
160
|
};
|
|
184
|
-
|
|
185
161
|
export class PivotTableEngine {
|
|
186
162
|
constructor(visualization, data, legendSets) {
|
|
187
163
|
_defineProperty(this, "visualization", void 0);
|
|
188
|
-
|
|
189
164
|
_defineProperty(this, "rawData", void 0);
|
|
190
|
-
|
|
191
165
|
_defineProperty(this, "options", void 0);
|
|
192
|
-
|
|
193
166
|
_defineProperty(this, "legendSets", void 0);
|
|
194
|
-
|
|
195
167
|
_defineProperty(this, "dimensionLookup", void 0);
|
|
196
|
-
|
|
197
168
|
_defineProperty(this, "adaptiveClippingController", void 0);
|
|
198
|
-
|
|
199
169
|
_defineProperty(this, "columnDepth", 0);
|
|
200
|
-
|
|
201
170
|
_defineProperty(this, "rowDepth", 0);
|
|
202
|
-
|
|
203
171
|
_defineProperty(this, "height", 0);
|
|
204
|
-
|
|
205
172
|
_defineProperty(this, "width", 0);
|
|
206
|
-
|
|
207
173
|
_defineProperty(this, "data", []);
|
|
208
|
-
|
|
209
174
|
_defineProperty(this, "rowMap", []);
|
|
210
|
-
|
|
211
175
|
_defineProperty(this, "columnMap", []);
|
|
212
|
-
|
|
213
176
|
this.visualization = Object.assign({}, defaultVisualizationProps, visualization);
|
|
214
177
|
this.legendSets = (legendSets || []).reduce((sets, set) => {
|
|
215
178
|
sets[set.id] = set;
|
|
@@ -217,7 +180,8 @@ export class PivotTableEngine {
|
|
|
217
180
|
}, {});
|
|
218
181
|
this.rawData = data;
|
|
219
182
|
this.dimensionLookup = buildDimensionLookup(this.visualization, this.rawData.metaData, this.rawData.headers);
|
|
220
|
-
this.options = {
|
|
183
|
+
this.options = {
|
|
184
|
+
...defaultOptions,
|
|
221
185
|
showColumnTotals: visualization.colTotals,
|
|
222
186
|
showRowTotals: visualization.rowTotals,
|
|
223
187
|
showColumnSubtotals: visualization.colSubTotals,
|
|
@@ -238,10 +202,8 @@ export class PivotTableEngine {
|
|
|
238
202
|
this.rowDepth = this.dimensionLookup.rows.length || (this.visualization.showDimensionLabels ? 1 : 0);
|
|
239
203
|
this.buildMatrix();
|
|
240
204
|
}
|
|
241
|
-
|
|
242
205
|
getRaw(_ref3) {
|
|
243
206
|
var _headers$find, _headers$find2;
|
|
244
|
-
|
|
245
207
|
let {
|
|
246
208
|
row,
|
|
247
209
|
column
|
|
@@ -257,7 +219,6 @@ export class PivotTableEngine {
|
|
|
257
219
|
const headers = [...this.getRawRowHeader(row), ...this.getRawColumnHeader(column)];
|
|
258
220
|
const peId = (_headers$find = headers.find(header => (header === null || header === void 0 ? void 0 : header.dimensionItemType) === DIMENSION_TYPE_PERIOD)) === null || _headers$find === void 0 ? void 0 : _headers$find.uid;
|
|
259
221
|
const ouId = (_headers$find2 = headers.find(header => (header === null || header === void 0 ? void 0 : header.dimensionItemType) === DIMENSION_TYPE_ORGANISATION_UNIT)) === null || _headers$find2 === void 0 ? void 0 : _headers$find2.uid;
|
|
260
|
-
|
|
261
222
|
if (!this.data[row] || !this.data[row][column]) {
|
|
262
223
|
return {
|
|
263
224
|
cellType,
|
|
@@ -266,29 +227,23 @@ export class PivotTableEngine {
|
|
|
266
227
|
peId
|
|
267
228
|
};
|
|
268
229
|
}
|
|
269
|
-
|
|
270
230
|
const dataRow = this.data[row][column];
|
|
271
231
|
let rawValue = cellType === CELL_TYPE_VALUE ? dataRow[this.dimensionLookup.dataHeaders.value] : dataRow.value;
|
|
272
232
|
let renderedValue = rawValue;
|
|
273
233
|
const valueType = (dxDimension === null || dxDimension === void 0 ? void 0 : dxDimension.valueType) || VALUE_TYPE_TEXT;
|
|
274
|
-
|
|
275
234
|
if (valueType === VALUE_TYPE_NUMBER) {
|
|
276
235
|
rawValue = parseValue(rawValue);
|
|
277
|
-
|
|
278
236
|
switch (this.visualization.numberType) {
|
|
279
237
|
case NUMBER_TYPE_ROW_PERCENTAGE:
|
|
280
238
|
renderedValue = rawValue / this.percentageTotals[row].value;
|
|
281
239
|
break;
|
|
282
|
-
|
|
283
240
|
case NUMBER_TYPE_COLUMN_PERCENTAGE:
|
|
284
241
|
renderedValue = rawValue / this.percentageTotals[column].value;
|
|
285
242
|
break;
|
|
286
|
-
|
|
287
243
|
default:
|
|
288
244
|
break;
|
|
289
245
|
}
|
|
290
246
|
}
|
|
291
|
-
|
|
292
247
|
renderedValue = renderValue(renderedValue, valueType, this.visualization);
|
|
293
248
|
return {
|
|
294
249
|
cellType,
|
|
@@ -301,25 +256,21 @@ export class PivotTableEngine {
|
|
|
301
256
|
peId
|
|
302
257
|
};
|
|
303
258
|
}
|
|
304
|
-
|
|
305
259
|
get(_ref4) {
|
|
306
260
|
let {
|
|
307
261
|
row,
|
|
308
262
|
column
|
|
309
263
|
} = _ref4;
|
|
310
264
|
const mappedRow = this.rowMap[row],
|
|
311
|
-
|
|
312
|
-
|
|
265
|
+
mappedColumn = this.columnMap[column];
|
|
313
266
|
if (!mappedRow && mappedRow !== 0 || !mappedColumn && mappedColumn !== 0) {
|
|
314
267
|
return undefined;
|
|
315
268
|
}
|
|
316
|
-
|
|
317
269
|
return this.getRaw({
|
|
318
270
|
row: mappedRow,
|
|
319
271
|
column: mappedColumn
|
|
320
272
|
});
|
|
321
273
|
}
|
|
322
|
-
|
|
323
274
|
getRawCellType(_ref5) {
|
|
324
275
|
let {
|
|
325
276
|
row,
|
|
@@ -327,21 +278,16 @@ export class PivotTableEngine {
|
|
|
327
278
|
} = _ref5;
|
|
328
279
|
const isRowTotal = this.doRowTotals && column === this.dataWidth - 1;
|
|
329
280
|
const isColumnTotal = this.doColumnTotals && row === this.dataHeight - 1;
|
|
330
|
-
|
|
331
281
|
if (isRowTotal || isColumnTotal) {
|
|
332
282
|
return CELL_TYPE_TOTAL;
|
|
333
283
|
}
|
|
334
|
-
|
|
335
284
|
const isRowSubtotal = this.doRowSubtotals && (column + 1) % (this.dimensionLookup.columns[0].size + 1) === 0;
|
|
336
285
|
const isColumnSubtotal = this.doColumnSubtotals && (row + 1) % (this.dimensionLookup.rows[0].size + 1) === 0;
|
|
337
|
-
|
|
338
286
|
if (isRowSubtotal || isColumnSubtotal) {
|
|
339
287
|
return CELL_TYPE_SUBTOTAL;
|
|
340
288
|
}
|
|
341
|
-
|
|
342
289
|
return CELL_TYPE_VALUE;
|
|
343
290
|
}
|
|
344
|
-
|
|
345
291
|
getCellType(_ref6) {
|
|
346
292
|
let {
|
|
347
293
|
row,
|
|
@@ -354,36 +300,28 @@ export class PivotTableEngine {
|
|
|
354
300
|
column
|
|
355
301
|
});
|
|
356
302
|
}
|
|
357
|
-
|
|
358
303
|
getDimensionLabel(rowLevel, columnLevel) {
|
|
359
304
|
const lastRowLevel = this.rowDepth - 1;
|
|
360
305
|
const lastColumnLevel = this.columnDepth - 1;
|
|
361
|
-
|
|
362
306
|
if (rowLevel !== lastRowLevel && columnLevel !== lastColumnLevel) {
|
|
363
307
|
return null;
|
|
364
308
|
}
|
|
365
|
-
|
|
366
309
|
if (rowLevel === lastRowLevel && this.dimensionLookup.rows[lastRowLevel] && columnLevel === lastColumnLevel && this.dimensionLookup.columns[lastColumnLevel]) {
|
|
367
|
-
return
|
|
310
|
+
return `${this.dimensionLookup.rows[lastRowLevel].meta.name} / ${this.dimensionLookup.columns[lastColumnLevel].meta.name}`;
|
|
368
311
|
}
|
|
369
|
-
|
|
370
312
|
if (lastRowLevel === -1) {
|
|
371
313
|
return this.dimensionLookup.columns[columnLevel].meta.name;
|
|
372
314
|
}
|
|
373
|
-
|
|
374
315
|
if (lastColumnLevel === -1) {
|
|
375
316
|
return this.dimensionLookup.rows[rowLevel].meta.name;
|
|
376
317
|
}
|
|
377
|
-
|
|
378
318
|
if (rowLevel === lastRowLevel && this.dimensionLookup.columns[columnLevel]) {
|
|
379
319
|
return this.dimensionLookup.columns[columnLevel].meta.name;
|
|
380
320
|
}
|
|
381
|
-
|
|
382
321
|
if (columnLevel === lastColumnLevel && this.dimensionLookup.rows[rowLevel]) {
|
|
383
322
|
return this.dimensionLookup.rows[rowLevel].meta.name;
|
|
384
323
|
}
|
|
385
324
|
}
|
|
386
|
-
|
|
387
325
|
getCellDxDimension(_ref7) {
|
|
388
326
|
let {
|
|
389
327
|
row,
|
|
@@ -394,23 +332,18 @@ export class PivotTableEngine {
|
|
|
394
332
|
column: this.columnMap[column]
|
|
395
333
|
});
|
|
396
334
|
}
|
|
397
|
-
|
|
398
335
|
getRawCellDxDimension(_ref8) {
|
|
399
336
|
let {
|
|
400
337
|
row,
|
|
401
338
|
column
|
|
402
339
|
} = _ref8;
|
|
403
|
-
|
|
404
340
|
if (!this.data[row]) {
|
|
405
341
|
return undefined;
|
|
406
342
|
}
|
|
407
|
-
|
|
408
343
|
const cellValue = this.data[row][column];
|
|
409
|
-
|
|
410
344
|
if (!cellValue) {
|
|
411
345
|
return undefined;
|
|
412
346
|
}
|
|
413
|
-
|
|
414
347
|
if (!Array.isArray(cellValue)) {
|
|
415
348
|
// This is a total cell
|
|
416
349
|
return {
|
|
@@ -419,11 +352,9 @@ export class PivotTableEngine {
|
|
|
419
352
|
legendSet: undefined
|
|
420
353
|
};
|
|
421
354
|
}
|
|
422
|
-
|
|
423
355
|
const rowHeaders = this.getRawRowHeader(row);
|
|
424
356
|
const columnHeaders = this.getRawColumnHeader(column);
|
|
425
357
|
const dxRowIndex = this.dimensionLookup.rows.findIndex(dim => dim.isDxDimension);
|
|
426
|
-
|
|
427
358
|
if (rowHeaders.length && dxRowIndex !== -1) {
|
|
428
359
|
return {
|
|
429
360
|
valueType: rowHeaders[dxRowIndex].valueType,
|
|
@@ -431,90 +362,74 @@ export class PivotTableEngine {
|
|
|
431
362
|
legendSet: rowHeaders[dxRowIndex].legendSet
|
|
432
363
|
};
|
|
433
364
|
}
|
|
434
|
-
|
|
435
365
|
const dxColumnIndex = this.dimensionLookup.columns.findIndex(dim => dim.isDxDimension);
|
|
436
|
-
|
|
437
366
|
if (columnHeaders.length && dxColumnIndex !== -1) {
|
|
438
367
|
return {
|
|
439
368
|
valueType: columnHeaders[dxColumnIndex].valueType,
|
|
440
369
|
totalAggregationType: columnHeaders[dxColumnIndex].totalAggregationType,
|
|
441
370
|
legendSet: columnHeaders[dxColumnIndex].legendSet
|
|
442
371
|
};
|
|
443
|
-
}
|
|
444
|
-
// TODO : This assumes the server ignores text types, we should confirm this is the case
|
|
445
|
-
|
|
372
|
+
}
|
|
446
373
|
|
|
374
|
+
// Data is in Filter
|
|
375
|
+
// TODO : This assumes the server ignores text types, we should confirm this is the case
|
|
447
376
|
return {
|
|
448
377
|
valueType: VALUE_TYPE_NUMBER,
|
|
449
378
|
totalAggregationType: AGGREGATE_TYPE_SUM
|
|
450
379
|
};
|
|
451
380
|
}
|
|
452
|
-
|
|
453
381
|
rowIsEmpty(row) {
|
|
454
382
|
return !this.data[row] || this.data[row].length === 0;
|
|
455
383
|
}
|
|
456
|
-
|
|
457
384
|
columnIsEmpty(column) {
|
|
458
385
|
return !this.adaptiveClippingController.columns.sizes[column];
|
|
459
386
|
}
|
|
460
|
-
|
|
461
387
|
getRawColumnHeader(column) {
|
|
462
388
|
if (this.doRowTotals && column === this.dataWidth - 1) {
|
|
463
389
|
return times(this.columnDepth - 1, () => undefined).concat([{
|
|
464
390
|
name: 'Total'
|
|
465
391
|
}]);
|
|
466
392
|
}
|
|
467
|
-
|
|
468
393
|
if (this.doRowSubtotals) {
|
|
469
394
|
if ((column + 1) % (this.dimensionLookup.columns[0].size + 1) === 0) {
|
|
470
395
|
return times(this.columnDepth - 1, () => undefined).concat([{
|
|
471
396
|
name: 'Subtotal'
|
|
472
397
|
}]);
|
|
473
398
|
}
|
|
474
|
-
|
|
475
399
|
column -= Math.floor(column / (this.dimensionLookup.columns[0].size + 1));
|
|
476
400
|
}
|
|
477
|
-
|
|
478
401
|
return this.dimensionLookup.columns.map(dimension => {
|
|
479
402
|
const itemIndex = Math.floor(column / dimension.size) % dimension.count;
|
|
480
403
|
return dimension.items[itemIndex];
|
|
481
404
|
});
|
|
482
405
|
}
|
|
483
|
-
|
|
484
406
|
getColumnHeader(column) {
|
|
485
407
|
return this.getRawColumnHeader(this.columnMap[column]);
|
|
486
408
|
}
|
|
487
|
-
|
|
488
409
|
getRawRowHeader(row) {
|
|
489
410
|
if (this.doColumnTotals && row === this.dataHeight - 1) {
|
|
490
411
|
return times(this.rowDepth - 1, () => undefined).concat([{
|
|
491
412
|
name: 'Total'
|
|
492
413
|
}]);
|
|
493
414
|
}
|
|
494
|
-
|
|
495
415
|
if (this.doColumnSubtotals) {
|
|
496
416
|
if ((row + 1) % (this.dimensionLookup.rows[0].size + 1) === 0) {
|
|
497
417
|
return times(this.rowDepth - 1, () => undefined).concat([{
|
|
498
418
|
name: 'Subtotal'
|
|
499
419
|
}]);
|
|
500
420
|
}
|
|
501
|
-
|
|
502
421
|
row -= Math.floor(row / (this.dimensionLookup.rows[0].size + 1));
|
|
503
422
|
}
|
|
504
|
-
|
|
505
423
|
return this.dimensionLookup.rows.map(dimension => {
|
|
506
424
|
const itemIndex = Math.floor(row / dimension.size) % dimension.count;
|
|
507
425
|
return dimension.items[itemIndex];
|
|
508
426
|
});
|
|
509
427
|
}
|
|
510
|
-
|
|
511
428
|
getRowHeader(row) {
|
|
512
429
|
return this.getRawRowHeader(this.rowMap[row]);
|
|
513
430
|
}
|
|
514
|
-
|
|
515
431
|
getDependantTotalCells(_ref9) {
|
|
516
432
|
var _this$dimensionLookup, _this$dimensionLookup2;
|
|
517
|
-
|
|
518
433
|
let {
|
|
519
434
|
row,
|
|
520
435
|
column
|
|
@@ -572,7 +487,6 @@ export class PivotTableEngine {
|
|
|
572
487
|
combinedTotal
|
|
573
488
|
};
|
|
574
489
|
}
|
|
575
|
-
|
|
576
490
|
addCellValueToTotals(pos, dataRow) {
|
|
577
491
|
const totals = this.getDependantTotalCells(pos);
|
|
578
492
|
const dxDimension = this.getRawCellDxDimension(pos);
|
|
@@ -580,7 +494,6 @@ export class PivotTableEngine {
|
|
|
580
494
|
if (!totalItem) {
|
|
581
495
|
return;
|
|
582
496
|
}
|
|
583
|
-
|
|
584
497
|
this.data[totalItem.row] = this.data[totalItem.row] || [];
|
|
585
498
|
this.data[totalItem.row][totalItem.column] = this.data[totalItem.row][totalItem.column] || {
|
|
586
499
|
count: 0,
|
|
@@ -589,36 +502,29 @@ export class PivotTableEngine {
|
|
|
589
502
|
const totalCell = this.data[totalItem.row][totalItem.column];
|
|
590
503
|
const currentAggType = dxDimension === null || dxDimension === void 0 ? void 0 : dxDimension.totalAggregationType;
|
|
591
504
|
const previousAggType = totalCell.totalAggregationType || currentAggType;
|
|
592
|
-
|
|
593
505
|
if (previousAggType && currentAggType !== previousAggType) {
|
|
594
506
|
totalCell.totalAggregationType = AGGREGATE_TYPE_NA;
|
|
595
507
|
} else {
|
|
596
508
|
totalCell.totalAggregationType = currentAggType;
|
|
597
509
|
}
|
|
598
|
-
|
|
599
510
|
const currentValueType = dxDimension === null || dxDimension === void 0 ? void 0 : dxDimension.valueType;
|
|
600
511
|
const previousValueType = totalCell.valueType;
|
|
601
|
-
|
|
602
512
|
if (previousValueType && currentValueType !== previousValueType) {
|
|
603
513
|
totalCell.valueType = AGGREGATE_TYPE_NA;
|
|
604
514
|
} else {
|
|
605
515
|
totalCell.valueType = currentValueType;
|
|
606
516
|
}
|
|
607
|
-
|
|
608
517
|
if ((dxDimension === null || dxDimension === void 0 ? void 0 : dxDimension.valueType) === VALUE_TYPE_NUMBER) {
|
|
609
518
|
dataFields.forEach(field => {
|
|
610
519
|
const headerIndex = this.dimensionLookup.dataHeaders[field];
|
|
611
520
|
const value = parseValue(dataRow[headerIndex]);
|
|
612
|
-
|
|
613
521
|
if (value && !isNaN(value)) {
|
|
614
522
|
totalCell[field] = (totalCell[field] || 0) + value;
|
|
615
523
|
}
|
|
616
524
|
});
|
|
617
525
|
}
|
|
618
|
-
|
|
619
526
|
totalCell.count += 1;
|
|
620
527
|
});
|
|
621
|
-
|
|
622
528
|
if (this.visualization.numberType === NUMBER_TYPE_ROW_PERCENTAGE) {
|
|
623
529
|
if (!this.percentageTotals[pos.row]) {
|
|
624
530
|
this.percentageTotals[pos.row] = {
|
|
@@ -626,17 +532,14 @@ export class PivotTableEngine {
|
|
|
626
532
|
totalCount: this.rawDataWidth
|
|
627
533
|
};
|
|
628
534
|
}
|
|
629
|
-
|
|
630
535
|
const percentageTotal = this.percentageTotals[pos.row];
|
|
631
536
|
dataFields.forEach(field => {
|
|
632
537
|
const headerIndex = this.dimensionLookup.dataHeaders[field];
|
|
633
538
|
const value = parseValue(dataRow[headerIndex]);
|
|
634
|
-
|
|
635
539
|
if (value && !isNaN(value)) {
|
|
636
540
|
percentageTotal[field] = (percentageTotal[field] || 0) + value;
|
|
637
541
|
}
|
|
638
542
|
});
|
|
639
|
-
|
|
640
543
|
if (totals.columnSubtotal) {
|
|
641
544
|
if (!this.percentageTotals[totals.columnSubtotal.row]) {
|
|
642
545
|
this.percentageTotals[totals.columnSubtotal.row] = {
|
|
@@ -644,18 +547,15 @@ export class PivotTableEngine {
|
|
|
644
547
|
totalCount: this.rawDataWidth
|
|
645
548
|
};
|
|
646
549
|
}
|
|
647
|
-
|
|
648
550
|
const percentageTotal = this.percentageTotals[totals.columnSubtotal.row];
|
|
649
551
|
dataFields.forEach(field => {
|
|
650
552
|
const headerIndex = this.dimensionLookup.dataHeaders[field];
|
|
651
553
|
const value = parseValue(dataRow[headerIndex]);
|
|
652
|
-
|
|
653
554
|
if (value && !isNaN(value)) {
|
|
654
555
|
percentageTotal[field] = (percentageTotal[field] || 0) + value;
|
|
655
556
|
}
|
|
656
557
|
});
|
|
657
558
|
}
|
|
658
|
-
|
|
659
559
|
if (totals.columnTotal) {
|
|
660
560
|
if (!this.percentageTotals[totals.columnTotal.row]) {
|
|
661
561
|
this.percentageTotals[totals.columnTotal.row] = {
|
|
@@ -663,19 +563,16 @@ export class PivotTableEngine {
|
|
|
663
563
|
totalCount: this.rawDataWidth
|
|
664
564
|
};
|
|
665
565
|
}
|
|
666
|
-
|
|
667
566
|
const percentageTotal = this.percentageTotals[totals.columnTotal.row];
|
|
668
567
|
dataFields.forEach(field => {
|
|
669
568
|
const headerIndex = this.dimensionLookup.dataHeaders[field];
|
|
670
569
|
const value = parseValue(dataRow[headerIndex]);
|
|
671
|
-
|
|
672
570
|
if (value && !isNaN(value)) {
|
|
673
571
|
percentageTotal[field] = (percentageTotal[field] || 0) + value;
|
|
674
572
|
}
|
|
675
573
|
});
|
|
676
574
|
}
|
|
677
575
|
}
|
|
678
|
-
|
|
679
576
|
if (this.visualization.numberType === NUMBER_TYPE_COLUMN_PERCENTAGE) {
|
|
680
577
|
if (!this.percentageTotals[pos.column]) {
|
|
681
578
|
this.percentageTotals[pos.column] = {
|
|
@@ -683,17 +580,14 @@ export class PivotTableEngine {
|
|
|
683
580
|
totalCount: this.rawDataHeight
|
|
684
581
|
};
|
|
685
582
|
}
|
|
686
|
-
|
|
687
583
|
const percentageTotal = this.percentageTotals[pos.column];
|
|
688
584
|
dataFields.forEach(field => {
|
|
689
585
|
const headerIndex = this.dimensionLookup.dataHeaders[field];
|
|
690
586
|
const value = parseValue(dataRow[headerIndex]);
|
|
691
|
-
|
|
692
587
|
if (value && !isNaN(value)) {
|
|
693
588
|
percentageTotal[field] = (percentageTotal[field] || 0) + value;
|
|
694
589
|
}
|
|
695
590
|
});
|
|
696
|
-
|
|
697
591
|
if (totals.rowSubtotal) {
|
|
698
592
|
if (!this.percentageTotals[totals.rowSubtotal.column]) {
|
|
699
593
|
this.percentageTotals[totals.rowSubtotal.column] = {
|
|
@@ -701,18 +595,15 @@ export class PivotTableEngine {
|
|
|
701
595
|
totalCount: this.rawDataHeight
|
|
702
596
|
};
|
|
703
597
|
}
|
|
704
|
-
|
|
705
598
|
const percentageTotal = this.percentageTotals[totals.rowSubtotal.column];
|
|
706
599
|
dataFields.forEach(field => {
|
|
707
600
|
const headerIndex = this.dimensionLookup.dataHeaders[field];
|
|
708
601
|
const value = parseValue(dataRow[headerIndex]);
|
|
709
|
-
|
|
710
602
|
if (value && !isNaN(value)) {
|
|
711
603
|
percentageTotal[field] = (percentageTotal[field] || 0) + value;
|
|
712
604
|
}
|
|
713
605
|
});
|
|
714
606
|
}
|
|
715
|
-
|
|
716
607
|
if (totals.rowTotal) {
|
|
717
608
|
if (!this.percentageTotals[totals.rowTotal.column]) {
|
|
718
609
|
this.percentageTotals[totals.rowTotal.column] = {
|
|
@@ -720,12 +611,10 @@ export class PivotTableEngine {
|
|
|
720
611
|
totalCount: this.rawDataHeight
|
|
721
612
|
};
|
|
722
613
|
}
|
|
723
|
-
|
|
724
614
|
const percentageTotal = this.percentageTotals[totals.rowTotal.column];
|
|
725
615
|
dataFields.forEach(field => {
|
|
726
616
|
const headerIndex = this.dimensionLookup.dataHeaders[field];
|
|
727
617
|
const value = parseValue(dataRow[headerIndex]);
|
|
728
|
-
|
|
729
618
|
if (value && !isNaN(value)) {
|
|
730
619
|
percentageTotal[field] = (percentageTotal[field] || 0) + value;
|
|
731
620
|
}
|
|
@@ -733,19 +622,15 @@ export class PivotTableEngine {
|
|
|
733
622
|
}
|
|
734
623
|
}
|
|
735
624
|
}
|
|
736
|
-
|
|
737
625
|
finalizeTotal(_ref10) {
|
|
738
626
|
let {
|
|
739
627
|
row,
|
|
740
628
|
column
|
|
741
629
|
} = _ref10;
|
|
742
|
-
|
|
743
630
|
if (!this.data[row]) {
|
|
744
631
|
return;
|
|
745
632
|
}
|
|
746
|
-
|
|
747
633
|
const totalCell = this.data[row][column];
|
|
748
|
-
|
|
749
634
|
if (totalCell && totalCell.count) {
|
|
750
635
|
totalCell.value = applyTotalAggregationType(totalCell, this.visualization.numberType !== NUMBER_TYPE_VALUE && AGGREGATE_TYPE_SUM);
|
|
751
636
|
this.adaptiveClippingController.add({
|
|
@@ -754,13 +639,10 @@ export class PivotTableEngine {
|
|
|
754
639
|
}, renderValue(totalCell.value, totalCell.valueType, this.visualization));
|
|
755
640
|
}
|
|
756
641
|
}
|
|
757
|
-
|
|
758
642
|
finalizeTotals() {
|
|
759
643
|
var _this$dimensionLookup3, _this$dimensionLookup4;
|
|
760
|
-
|
|
761
644
|
const columnSubtotalSize = ((_this$dimensionLookup3 = this.dimensionLookup.rows[0]) === null || _this$dimensionLookup3 === void 0 ? void 0 : _this$dimensionLookup3.size) + 1;
|
|
762
645
|
const rowSubtotalSize = ((_this$dimensionLookup4 = this.dimensionLookup.columns[0]) === null || _this$dimensionLookup4 === void 0 ? void 0 : _this$dimensionLookup4.size) + 1;
|
|
763
|
-
|
|
764
646
|
if (this.doRowSubtotals && rowSubtotalSize) {
|
|
765
647
|
times(this.dimensionLookup.columns[0].count, n => (n + 1) * rowSubtotalSize - 1).forEach(column => {
|
|
766
648
|
times(this.dataHeight - (this.doColumnTotals ? 1 : 0), n => n).forEach(row => {
|
|
@@ -774,7 +656,6 @@ export class PivotTableEngine {
|
|
|
774
656
|
});
|
|
775
657
|
});
|
|
776
658
|
}
|
|
777
|
-
|
|
778
659
|
if (this.doColumnSubtotals && columnSubtotalSize) {
|
|
779
660
|
times(this.dimensionLookup.rows[0].count, n => (n + 1) * columnSubtotalSize - 1).forEach(row => {
|
|
780
661
|
times(this.dataWidth - (this.doRowTotals ? 1 : 0), n => n).forEach(column => {
|
|
@@ -787,9 +668,9 @@ export class PivotTableEngine {
|
|
|
787
668
|
}
|
|
788
669
|
});
|
|
789
670
|
});
|
|
790
|
-
}
|
|
791
|
-
|
|
671
|
+
}
|
|
792
672
|
|
|
673
|
+
// Combined subtotal cells
|
|
793
674
|
if (this.doRowSubtotals && this.doColumnSubtotals && rowSubtotalSize && columnSubtotalSize) {
|
|
794
675
|
times(this.dimensionLookup.rows[0].count, n => (n + 1) * columnSubtotalSize - 1).forEach(row => {
|
|
795
676
|
times(this.dimensionLookup.columns[0].count, n => (n + 1) * rowSubtotalSize - 1).forEach(column => {
|
|
@@ -800,7 +681,6 @@ export class PivotTableEngine {
|
|
|
800
681
|
});
|
|
801
682
|
});
|
|
802
683
|
}
|
|
803
|
-
|
|
804
684
|
if (this.doRowTotals) {
|
|
805
685
|
const column = this.dataWidth - 1;
|
|
806
686
|
const rowCount = this.doColumnTotals ? this.dataHeight - 1 : this.dataHeight;
|
|
@@ -811,7 +691,6 @@ export class PivotTableEngine {
|
|
|
811
691
|
});
|
|
812
692
|
});
|
|
813
693
|
}
|
|
814
|
-
|
|
815
694
|
if (this.doColumnTotals) {
|
|
816
695
|
const row = this.dataHeight - 1;
|
|
817
696
|
const colCount = this.doRowTotals ? this.dataWidth - 1 : this.dataWidth;
|
|
@@ -822,106 +701,87 @@ export class PivotTableEngine {
|
|
|
822
701
|
});
|
|
823
702
|
});
|
|
824
703
|
}
|
|
825
|
-
|
|
826
704
|
if (this.doRowTotals && this.doColumnTotals) {
|
|
827
705
|
this.finalizeTotal({
|
|
828
706
|
row: this.dataHeight - 1,
|
|
829
707
|
column: this.dataWidth - 1
|
|
830
708
|
});
|
|
831
709
|
}
|
|
832
|
-
|
|
833
710
|
if (this.percentageTotals) {
|
|
834
711
|
this.percentageTotals.forEach(item => {
|
|
835
712
|
item.value = applyTotalAggregationType(item);
|
|
836
713
|
});
|
|
837
714
|
}
|
|
838
715
|
}
|
|
839
|
-
|
|
840
716
|
resetRowMap() {
|
|
841
717
|
this.rowMap = this.options.hideEmptyRows ? times(this.dataHeight, n => n).filter(idx => !!this.data[idx]) : times(this.dataHeight, n => n);
|
|
842
718
|
}
|
|
843
|
-
|
|
844
719
|
resetColumnMap() {
|
|
845
720
|
this.columnMap = this.options.hideEmptyColumns ? times(this.dataWidth, n => n).filter(idx => !this.columnIsEmpty(idx)) : times(this.dataWidth, n => n);
|
|
846
721
|
}
|
|
847
|
-
|
|
848
722
|
get cellPadding() {
|
|
849
723
|
switch (this.visualization.displayDensity) {
|
|
850
724
|
case DISPLAY_DENSITY_OPTION_COMPACT:
|
|
851
725
|
return DISPLAY_DENSITY_PADDING_COMPACT;
|
|
852
|
-
|
|
853
726
|
case DISPLAY_DENSITY_OPTION_COMFORTABLE:
|
|
854
727
|
return DISPLAY_DENSITY_PADDING_COMFORTABLE;
|
|
855
|
-
|
|
856
728
|
case DISPLAY_DENSITY_OPTION_NORMAL:
|
|
857
729
|
default:
|
|
858
730
|
return DISPLAY_DENSITY_PADDING_NORMAL;
|
|
859
731
|
}
|
|
860
732
|
}
|
|
861
|
-
|
|
862
733
|
get fontSize() {
|
|
863
734
|
switch (this.visualization.fontSize) {
|
|
864
735
|
case FONT_SIZE_OPTION_SMALL:
|
|
865
736
|
return FONT_SIZE_SMALL;
|
|
866
|
-
|
|
867
737
|
case FONT_SIZE_OPTION_LARGE:
|
|
868
738
|
return FONT_SIZE_LARGE;
|
|
869
|
-
|
|
870
739
|
case FONT_SIZE_OPTION_NORMAL:
|
|
871
740
|
default:
|
|
872
741
|
return FONT_SIZE_NORMAL;
|
|
873
742
|
}
|
|
874
743
|
}
|
|
875
|
-
|
|
876
744
|
get scrollIconBuffer() {
|
|
877
745
|
switch (this.visualization.fontSize) {
|
|
878
746
|
case FONT_SIZE_OPTION_SMALL:
|
|
879
747
|
return 11;
|
|
880
|
-
|
|
881
748
|
case FONT_SIZE_OPTION_LARGE:
|
|
882
749
|
return 15;
|
|
883
|
-
|
|
884
750
|
case FONT_SIZE_OPTION_NORMAL:
|
|
885
751
|
default:
|
|
886
752
|
return 13;
|
|
887
753
|
}
|
|
888
754
|
}
|
|
889
|
-
|
|
890
755
|
buildMatrix() {
|
|
891
756
|
this.data = [];
|
|
892
757
|
this.adaptiveClippingController.reset();
|
|
893
758
|
this.dataHeight = this.rawDataHeight = countFromDisaggregates(this.dimensionLookup.rows);
|
|
894
|
-
this.dataWidth = this.rawDataWidth = countFromDisaggregates(this.dimensionLookup.columns);
|
|
759
|
+
this.dataWidth = this.rawDataWidth = countFromDisaggregates(this.dimensionLookup.columns);
|
|
895
760
|
|
|
761
|
+
// TODO: Check last row/col dimension for size===1, skip redundant sub-totals
|
|
896
762
|
this.doRowSubtotals = this.options.showRowSubtotals && this.columnDepth > 1;
|
|
897
763
|
this.doColumnSubtotals = this.options.showColumnSubtotals && this.rowDepth > 1;
|
|
898
764
|
this.doRowTotals = this.options.showRowTotals && this.dataWidth > 1;
|
|
899
765
|
this.doColumnTotals = this.options.showColumnTotals && this.dataHeight > 1;
|
|
900
|
-
|
|
901
766
|
if (this.doRowSubtotals) {
|
|
902
767
|
this.dataWidth += this.dimensionLookup.columns[0].count;
|
|
903
768
|
}
|
|
904
|
-
|
|
905
769
|
if (this.doColumnSubtotals) {
|
|
906
770
|
this.dataHeight += this.dimensionLookup.rows[0].count;
|
|
907
771
|
}
|
|
908
|
-
|
|
909
772
|
if (this.doRowTotals) {
|
|
910
773
|
this.dataWidth += 1;
|
|
911
774
|
}
|
|
912
|
-
|
|
913
775
|
if (this.doColumnTotals) {
|
|
914
776
|
this.dataHeight += 1;
|
|
915
|
-
}
|
|
916
|
-
|
|
777
|
+
}
|
|
917
778
|
|
|
779
|
+
// TODO: Use total cell calculation, don't duplicate here
|
|
918
780
|
if (this.visualization.numberType === NUMBER_TYPE_ROW_PERCENTAGE || this.visualization.numberType === NUMBER_TYPE_COLUMN_PERCENTAGE) {
|
|
919
781
|
this.percentageTotals = [];
|
|
920
782
|
}
|
|
921
|
-
|
|
922
783
|
this.rawData.rows.forEach(dataRow => {
|
|
923
784
|
const pos = lookup(dataRow, this.dimensionLookup, this);
|
|
924
|
-
|
|
925
785
|
if (pos) {
|
|
926
786
|
this.data[pos.row] = this.data[pos.row] || [];
|
|
927
787
|
this.data[pos.row][pos.column] = dataRow;
|
|
@@ -931,7 +791,6 @@ export class PivotTableEngine {
|
|
|
931
791
|
this.finalizeTotals();
|
|
932
792
|
this.rawData.rows.forEach(dataRow => {
|
|
933
793
|
const pos = lookup(dataRow, this.dimensionLookup, this);
|
|
934
|
-
|
|
935
794
|
if (pos) {
|
|
936
795
|
this.adaptiveClippingController.add(pos, this.getRaw(pos).renderedValue);
|
|
937
796
|
}
|
|
@@ -942,50 +801,39 @@ export class PivotTableEngine {
|
|
|
942
801
|
this.width = this.columnMap.length;
|
|
943
802
|
this.adaptiveClippingController.finalize();
|
|
944
803
|
}
|
|
945
|
-
|
|
946
804
|
getColumnType(column) {
|
|
947
805
|
column = this.columnMap[column];
|
|
948
|
-
|
|
949
806
|
if (!column && column !== 0) {
|
|
950
807
|
return undefined;
|
|
951
808
|
}
|
|
952
|
-
|
|
953
809
|
if (this.doRowSubtotals && (column + 1) % (this.dimensionLookup.columns[0].size + 1) === 0) {
|
|
954
810
|
return CELL_TYPE_SUBTOTAL;
|
|
955
811
|
}
|
|
956
|
-
|
|
957
812
|
if (this.doRowTotals && column === this.dataWidth - 1) {
|
|
958
813
|
return CELL_TYPE_TOTAL;
|
|
959
814
|
}
|
|
960
|
-
|
|
961
815
|
return CELL_TYPE_VALUE;
|
|
962
816
|
}
|
|
963
|
-
|
|
964
817
|
isSortable(column) {
|
|
965
818
|
return this.dataHeight > 1 && !this.doColumnSubtotals && this.getColumnType(column) !== undefined;
|
|
966
819
|
}
|
|
967
|
-
|
|
968
820
|
sort(column, order) {
|
|
969
821
|
if (order !== SORT_ORDER_ASCENDING && order !== SORT_ORDER_DESCENDING) {
|
|
970
|
-
console.warn(
|
|
822
|
+
console.warn(`Invalid sort order ${order}`);
|
|
971
823
|
return;
|
|
972
824
|
}
|
|
973
|
-
|
|
974
825
|
if (!this.isSortable(column)) {
|
|
975
|
-
console.warn(
|
|
826
|
+
console.warn(`Invalid sort column ${column}`);
|
|
976
827
|
return;
|
|
977
828
|
}
|
|
978
|
-
|
|
979
829
|
const mappedColumn = this.columnMap[column];
|
|
980
830
|
this.rowMap.sort((rowA, rowB) => {
|
|
981
831
|
if (this.doColumnTotals && rowA === this.dataHeight - 1) {
|
|
982
832
|
return 1;
|
|
983
833
|
}
|
|
984
|
-
|
|
985
834
|
if (this.doColumnTotals && rowB === this.dataHeight - 1) {
|
|
986
835
|
return -1;
|
|
987
836
|
}
|
|
988
|
-
|
|
989
837
|
const valueA = this.getRaw({
|
|
990
838
|
row: rowA,
|
|
991
839
|
column: mappedColumn
|
|
@@ -994,31 +842,24 @@ export class PivotTableEngine {
|
|
|
994
842
|
row: rowB,
|
|
995
843
|
column: mappedColumn
|
|
996
844
|
});
|
|
997
|
-
|
|
998
845
|
if ((!valueA || valueA.empty) && (!valueB || valueB.empty)) {
|
|
999
846
|
return 0;
|
|
1000
847
|
}
|
|
1001
|
-
|
|
1002
848
|
if (!valueA || valueA.empty) {
|
|
1003
849
|
return -1 * order;
|
|
1004
850
|
}
|
|
1005
|
-
|
|
1006
851
|
if (!valueB || valueB.empty) {
|
|
1007
852
|
return 1 * order;
|
|
1008
853
|
}
|
|
1009
|
-
|
|
1010
854
|
if (valueA.valueType === VALUE_TYPE_NUMBER && valueB.valueType === VALUE_TYPE_NUMBER) {
|
|
1011
855
|
return (valueA.rawValue - valueB.rawValue) * order;
|
|
1012
856
|
}
|
|
1013
|
-
|
|
1014
857
|
return valueA.renderedValue.localeCompare(valueB.renderedValue) * order;
|
|
1015
858
|
});
|
|
1016
859
|
this.adaptiveClippingController.resetRowPartitions();
|
|
1017
860
|
}
|
|
1018
|
-
|
|
1019
861
|
clearSort() {
|
|
1020
862
|
this.resetRowMap();
|
|
1021
863
|
this.adaptiveClippingController.resetRowPartitions();
|
|
1022
864
|
}
|
|
1023
|
-
|
|
1024
865
|
}
|