@dhis2/analytics 26.0.7 → 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/locales/km/translations.json +4 -3
- 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/locales/km/translations.json +4 -3
- 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
|
@@ -4,43 +4,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = _default;
|
|
7
|
-
|
|
8
7
|
var _arrayClean = _interopRequireDefault(require("d2-utilizr/lib/arrayClean"));
|
|
9
|
-
|
|
10
8
|
var _objectClean = _interopRequireDefault(require("d2-utilizr/lib/objectClean"));
|
|
11
|
-
|
|
12
9
|
var _index = _interopRequireDefault(require("../../../../../locales/index.js"));
|
|
13
|
-
|
|
14
10
|
var _fontStyle = require("../../../../../modules/fontStyle.js");
|
|
15
|
-
|
|
16
11
|
var _visTypes = require("../../../../../modules/visTypes.js");
|
|
17
|
-
|
|
18
12
|
var _axes = require("../../../../util/axes.js");
|
|
19
|
-
|
|
20
13
|
var _axisId = require("../../../../util/axisId.js");
|
|
21
|
-
|
|
22
14
|
var _axis = require("../axis.js");
|
|
23
|
-
|
|
24
15
|
var _customAxes = require("../customAxes.js");
|
|
25
|
-
|
|
26
16
|
var _getAxisTitle = _interopRequireDefault(require("../getAxisTitle.js"));
|
|
27
|
-
|
|
28
17
|
var _getSteps = _interopRequireDefault(require("../getSteps.js"));
|
|
29
|
-
|
|
30
18
|
var _gauge = _interopRequireDefault(require("./gauge.js"));
|
|
31
|
-
|
|
32
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
|
-
|
|
34
20
|
const AXIS_TYPE_RANGE = 'RANGE';
|
|
35
|
-
|
|
36
21
|
function getDefault(layout, series, extraOptions) {
|
|
37
22
|
var _extraOptions$outlier;
|
|
38
|
-
|
|
39
23
|
const axes = [];
|
|
40
24
|
const dataValues = series === null || series === void 0 ? void 0 : series.map(item => item.data).flat();
|
|
41
25
|
const layoutAxes = [];
|
|
42
26
|
let useMultiAxisMode = false;
|
|
43
|
-
|
|
44
27
|
if ((0, _visTypes.isDualAxisType)(layout.type)) {
|
|
45
28
|
const axisIdsMap = (0, _customAxes.getAxisIdsMap)(layout.series, series);
|
|
46
29
|
const axisIds = [...new Set(Object.keys(axisIdsMap))].sort((a, b) => a - b);
|
|
@@ -49,44 +32,37 @@ function getDefault(layout, series, extraOptions) {
|
|
|
49
32
|
} else {
|
|
50
33
|
layoutAxes.push((0, _axes.getAxis)(layout.axes, AXIS_TYPE_RANGE, 0));
|
|
51
34
|
}
|
|
52
|
-
|
|
53
35
|
let extremeObj;
|
|
54
|
-
|
|
55
36
|
if (layout.type === _visTypes.VIS_TYPE_SCATTER && (_extraOptions$outlier = extraOptions.outlierHelper) !== null && _extraOptions$outlier !== void 0 && _extraOptions$outlier.extremeLines) {
|
|
56
37
|
extremeObj = extraOptions.outlierHelper.extremeLines[1];
|
|
57
38
|
}
|
|
58
|
-
|
|
59
39
|
layoutAxes.forEach(axis => {
|
|
60
40
|
var _axis$title2, _axis$title3, _extraOptions$outlier2, _extraOptions$outlier3, _axis$title4;
|
|
61
|
-
|
|
62
|
-
|
|
41
|
+
const targetLine = {
|
|
42
|
+
...axis.targetLine
|
|
63
43
|
};
|
|
64
|
-
const baseLine = {
|
|
44
|
+
const baseLine = {
|
|
45
|
+
...axis.baseLine
|
|
65
46
|
};
|
|
66
|
-
|
|
67
47
|
if (useMultiAxisMode) {
|
|
68
48
|
const regressionLines = [targetLine, baseLine];
|
|
69
49
|
regressionLines.forEach(rl => {
|
|
70
50
|
var _rl$title;
|
|
71
|
-
|
|
72
51
|
if ((_rl$title = rl.title) !== null && _rl$title !== void 0 && _rl$title.text) {
|
|
73
52
|
var _axis$title;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
text:
|
|
53
|
+
rl.title = {
|
|
54
|
+
...rl.title,
|
|
55
|
+
text: `${rl.title.text} - ${((_axis$title = axis.title) === null || _axis$title === void 0 ? void 0 : _axis$title.text) || _index.default.t('Axis {{axisId}}', {
|
|
77
56
|
axisId: axis.index + 1
|
|
78
|
-
})
|
|
57
|
+
})}`
|
|
79
58
|
};
|
|
80
59
|
}
|
|
81
60
|
});
|
|
82
61
|
}
|
|
83
|
-
|
|
84
62
|
let titleText = (_axis$title2 = axis.title) === null || _axis$title2 === void 0 ? void 0 : _axis$title2.text;
|
|
85
|
-
|
|
86
63
|
if (((_axis$title3 = axis.title) === null || _axis$title3 === void 0 ? void 0 : _axis$title3.textMode) === 'AUTO') {
|
|
87
64
|
if (layout.type === _visTypes.VIS_TYPE_SCATTER || series.length === 1) {
|
|
88
65
|
var _series$;
|
|
89
|
-
|
|
90
66
|
if ((_series$ = series[0]) !== null && _series$ !== void 0 && _series$.name) {
|
|
91
67
|
titleText = series[0].name;
|
|
92
68
|
}
|
|
@@ -102,7 +78,6 @@ function getDefault(layout, series, extraOptions) {
|
|
|
102
78
|
});
|
|
103
79
|
}
|
|
104
80
|
}
|
|
105
|
-
|
|
106
81
|
axes.push((0, _objectClean.default)({
|
|
107
82
|
min: (0, _axis.getMinValue)(axis.minValue, dataValues, (_extraOptions$outlier2 = extraOptions.outlierHelper) === null || _extraOptions$outlier2 === void 0 ? void 0 : _extraOptions$outlier2.yAxisMin),
|
|
108
83
|
max: (0, _axis.getMaxValue)(axis.maxValue, dataValues, (_extraOptions$outlier3 = extraOptions.outlierHelper) === null || _extraOptions$outlier3 === void 0 ? void 0 : _extraOptions$outlier3.yAxisMax),
|
|
@@ -131,18 +106,14 @@ function getDefault(layout, series, extraOptions) {
|
|
|
131
106
|
});
|
|
132
107
|
return axes;
|
|
133
108
|
}
|
|
134
|
-
|
|
135
109
|
function _default(layout, series, extraOptions) {
|
|
136
110
|
let yAxis;
|
|
137
|
-
|
|
138
111
|
switch (layout.type) {
|
|
139
112
|
case _visTypes.VIS_TYPE_GAUGE:
|
|
140
113
|
yAxis = (0, _gauge.default)(layout, series, extraOptions.legendSets[0]);
|
|
141
114
|
break;
|
|
142
|
-
|
|
143
115
|
default:
|
|
144
116
|
yAxis = getDefault(layout, series, extraOptions);
|
|
145
117
|
}
|
|
146
|
-
|
|
147
118
|
return yAxis;
|
|
148
119
|
}
|
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _index = _interopRequireDefault(require("./dhis_dhis/index.js"));
|
|
9
|
-
|
|
10
8
|
var _index2 = _interopRequireDefault(require("./dhis_highcharts/index.js"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
var _default = {
|
|
15
11
|
dhis_highcharts: _index2.default,
|
|
16
12
|
dhis_dhis: _index.default
|
|
@@ -4,31 +4,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = _default;
|
|
7
|
-
|
|
8
7
|
var _visTypes = require("../../../../modules/visTypes.js");
|
|
9
|
-
|
|
10
8
|
var _singleValue = _interopRequireDefault(require("./singleValue.js"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
function _default(config, parentEl, extraOptions) {
|
|
15
11
|
if (config) {
|
|
16
12
|
const node = typeof parentEl === 'object' ? parentEl : typeof parentEl === 'string' ? document.querySelector(parentEl) : null;
|
|
17
|
-
|
|
18
13
|
if (node) {
|
|
19
14
|
if (node.lastChild) {
|
|
20
15
|
node.removeChild(node.lastChild);
|
|
21
16
|
}
|
|
22
|
-
|
|
23
17
|
let content;
|
|
24
|
-
|
|
25
18
|
switch (config.type) {
|
|
26
19
|
case _visTypes.VIS_TYPE_SINGLE_VALUE:
|
|
27
20
|
default:
|
|
28
21
|
content = (0, _singleValue.default)(config, node, extraOptions);
|
|
29
22
|
break;
|
|
30
23
|
}
|
|
31
|
-
|
|
32
24
|
node.appendChild(content);
|
|
33
25
|
return node.innerHTML;
|
|
34
26
|
}
|
|
@@ -4,68 +4,67 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = _default;
|
|
7
|
-
|
|
8
7
|
var _ui = require("@dhis2/ui");
|
|
9
|
-
|
|
10
8
|
var _fontStyle = require("../../../../modules/fontStyle.js");
|
|
11
|
-
|
|
12
9
|
var _legends = require("../../../../modules/legends.js");
|
|
10
|
+
const svgNS = 'http://www.w3.org/2000/svg';
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
// multiply text width with this factor
|
|
15
13
|
// to get very close to actual text width
|
|
16
14
|
// nb: dependent on viewbox etc
|
|
15
|
+
const ACTUAL_TEXT_WIDTH_FACTOR = 0.9;
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
// multiply value text size with this factor
|
|
19
18
|
// to get very close to the actual number height
|
|
20
19
|
// as numbers don't go below the baseline like e.g. "j" and "g"
|
|
20
|
+
const ACTUAL_NUMBER_HEIGHT_FACTOR = 0.67;
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
// do not allow text width to exceed this threshold
|
|
23
23
|
// a threshold >1 does not really make sense but text width vs viewbox is complicated
|
|
24
|
+
const TEXT_WIDTH_CONTAINER_WIDTH_FACTOR = 1.3;
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
// do not allow text size to exceed this
|
|
27
27
|
const TEXT_SIZE_CONTAINER_HEIGHT_FACTOR = 0.6;
|
|
28
|
-
const TEXT_SIZE_MAX_THRESHOLD = 400;
|
|
29
|
-
// to get an appropriate letter spacing
|
|
28
|
+
const TEXT_SIZE_MAX_THRESHOLD = 400;
|
|
30
29
|
|
|
30
|
+
// multiply text size with this factor
|
|
31
|
+
// to get an appropriate letter spacing
|
|
31
32
|
const LETTER_SPACING_TEXT_SIZE_FACTOR = 1 / 35 * -1;
|
|
32
33
|
const LETTER_SPACING_MIN_THRESHOLD = -6;
|
|
33
|
-
const LETTER_SPACING_MAX_THRESHOLD = -1;
|
|
34
|
+
const LETTER_SPACING_MAX_THRESHOLD = -1;
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
// fixed top margin above title/subtitle
|
|
37
|
+
const TOP_MARGIN_FIXED = 16;
|
|
37
38
|
|
|
39
|
+
// multiply text size with this factor
|
|
40
|
+
// to get an appropriate sub text size
|
|
38
41
|
const SUB_TEXT_SIZE_FACTOR = 0.5;
|
|
39
42
|
const SUB_TEXT_SIZE_MIN_THRESHOLD = 26;
|
|
40
|
-
const SUB_TEXT_SIZE_MAX_THRESHOLD = 40;
|
|
43
|
+
const SUB_TEXT_SIZE_MAX_THRESHOLD = 40;
|
|
44
|
+
|
|
45
|
+
// multiply text size with this factor
|
|
41
46
|
// to get an appropriate icon padding
|
|
47
|
+
const ICON_PADDING_FACTOR = 0.3;
|
|
42
48
|
|
|
43
|
-
|
|
49
|
+
// Compute text width before rendering
|
|
44
50
|
// Not exactly precise but close enough
|
|
45
|
-
|
|
46
51
|
const getTextWidth = (text, font) => {
|
|
47
52
|
const canvas = document.createElement('canvas');
|
|
48
53
|
const context = canvas.getContext('2d');
|
|
49
54
|
context.font = font;
|
|
50
55
|
return Math.round(context.measureText(text).width * ACTUAL_TEXT_WIDTH_FACTOR);
|
|
51
56
|
};
|
|
52
|
-
|
|
53
57
|
const getTextHeightForNumbers = textSize => textSize * ACTUAL_NUMBER_HEIGHT_FACTOR;
|
|
54
|
-
|
|
55
58
|
const getIconPadding = textSize => Math.round(textSize * ICON_PADDING_FACTOR);
|
|
56
|
-
|
|
57
59
|
const getTextSize = (formattedValue, containerWidth, containerHeight, showIcon) => {
|
|
58
60
|
let size = Math.min(Math.round(containerHeight * TEXT_SIZE_CONTAINER_HEIGHT_FACTOR), TEXT_SIZE_MAX_THRESHOLD);
|
|
59
61
|
const widthThreshold = Math.round(containerWidth * TEXT_WIDTH_CONTAINER_WIDTH_FACTOR);
|
|
60
|
-
const textWidth = getTextWidth(formattedValue,
|
|
61
|
-
|
|
62
|
+
const textWidth = getTextWidth(formattedValue, `${size}px Roboto`) + (showIcon ? getIconPadding(size) : 0);
|
|
62
63
|
if (textWidth > widthThreshold) {
|
|
63
64
|
size = Math.round(size * (widthThreshold / textWidth));
|
|
64
65
|
}
|
|
65
|
-
|
|
66
66
|
return size;
|
|
67
67
|
};
|
|
68
|
-
|
|
69
68
|
const generateValueSVG = _ref => {
|
|
70
69
|
let {
|
|
71
70
|
formattedValue,
|
|
@@ -80,25 +79,24 @@ const generateValueSVG = _ref => {
|
|
|
80
79
|
} = _ref;
|
|
81
80
|
const showIcon = icon && formattedValue !== noData.text;
|
|
82
81
|
const textSize = getTextSize(formattedValue, containerWidth, containerHeight, showIcon);
|
|
83
|
-
const textWidth = getTextWidth(formattedValue,
|
|
82
|
+
const textWidth = getTextWidth(formattedValue, `${textSize}px Roboto`);
|
|
84
83
|
const iconSize = textSize;
|
|
85
84
|
const subTextSize = textSize * SUB_TEXT_SIZE_FACTOR > SUB_TEXT_SIZE_MAX_THRESHOLD ? SUB_TEXT_SIZE_MAX_THRESHOLD : textSize * SUB_TEXT_SIZE_FACTOR < SUB_TEXT_SIZE_MIN_THRESHOLD ? SUB_TEXT_SIZE_MIN_THRESHOLD : textSize * SUB_TEXT_SIZE_FACTOR;
|
|
86
85
|
const svgValue = document.createElementNS(svgNS, 'svg');
|
|
87
|
-
svgValue.setAttribute('viewBox',
|
|
86
|
+
svgValue.setAttribute('viewBox', `0 0 ${containerWidth} ${containerHeight}`);
|
|
88
87
|
svgValue.setAttribute('width', '50%');
|
|
89
88
|
svgValue.setAttribute('height', '50%');
|
|
90
89
|
svgValue.setAttribute('x', '50%');
|
|
91
90
|
svgValue.setAttribute('y', '50%');
|
|
92
91
|
svgValue.setAttribute('style', 'overflow: visible');
|
|
93
92
|
let fillColor = _ui.colors.grey900;
|
|
94
|
-
|
|
95
93
|
if (valueColor) {
|
|
96
94
|
fillColor = valueColor;
|
|
97
95
|
} else if (formattedValue === noData.text) {
|
|
98
96
|
fillColor = _ui.colors.grey600;
|
|
99
|
-
}
|
|
100
|
-
|
|
97
|
+
}
|
|
101
98
|
|
|
99
|
+
// show icon if configured in maintenance app
|
|
102
100
|
if (showIcon) {
|
|
103
101
|
// embed icon to allow changing color
|
|
104
102
|
// (elements with fill need to use "currentColor" for this to work)
|
|
@@ -107,28 +105,26 @@ const generateValueSVG = _ref => {
|
|
|
107
105
|
iconSvgNode.setAttribute('width', iconSize);
|
|
108
106
|
iconSvgNode.setAttribute('height', iconSize);
|
|
109
107
|
iconSvgNode.setAttribute('y', (iconSize / 2 - topMargin / 2) * -1);
|
|
110
|
-
iconSvgNode.setAttribute('x',
|
|
111
|
-
iconSvgNode.setAttribute('style',
|
|
108
|
+
iconSvgNode.setAttribute('x', `-${(iconSize + getIconPadding(textSize) + textWidth) / 2}`);
|
|
109
|
+
iconSvgNode.setAttribute('style', `color: ${fillColor}`);
|
|
112
110
|
iconSvgNode.setAttribute('data-test', 'visualization-icon');
|
|
113
111
|
const parser = new DOMParser();
|
|
114
112
|
const svgIconDocument = parser.parseFromString(icon, 'image/svg+xml');
|
|
115
113
|
Array.from(svgIconDocument.documentElement.children).forEach(node => iconSvgNode.appendChild(node));
|
|
116
114
|
svgValue.appendChild(iconSvgNode);
|
|
117
115
|
}
|
|
118
|
-
|
|
119
116
|
const letterSpacing = Math.round(textSize * LETTER_SPACING_TEXT_SIZE_FACTOR);
|
|
120
117
|
const textNode = document.createElementNS(svgNS, 'text');
|
|
121
118
|
textNode.setAttribute('font-size', textSize);
|
|
122
119
|
textNode.setAttribute('font-weight', '300');
|
|
123
120
|
textNode.setAttribute('letter-spacing', letterSpacing < LETTER_SPACING_MIN_THRESHOLD ? LETTER_SPACING_MIN_THRESHOLD : letterSpacing > LETTER_SPACING_MAX_THRESHOLD ? LETTER_SPACING_MAX_THRESHOLD : letterSpacing);
|
|
124
121
|
textNode.setAttribute('text-anchor', 'middle');
|
|
125
|
-
textNode.setAttribute('x', showIcon ?
|
|
122
|
+
textNode.setAttribute('x', showIcon ? `${(iconSize + getIconPadding(textSize)) / 2}` : 0);
|
|
126
123
|
textNode.setAttribute('y', topMargin / 2 + getTextHeightForNumbers(textSize) / 2);
|
|
127
124
|
textNode.setAttribute('fill', fillColor);
|
|
128
125
|
textNode.setAttribute('data-test', 'visualization-primary-value');
|
|
129
126
|
textNode.appendChild(document.createTextNode(formattedValue));
|
|
130
127
|
svgValue.appendChild(textNode);
|
|
131
|
-
|
|
132
128
|
if (subText) {
|
|
133
129
|
const subTextNode = document.createElementNS(svgNS, 'text');
|
|
134
130
|
subTextNode.setAttribute('text-anchor', 'middle');
|
|
@@ -139,10 +135,8 @@ const generateValueSVG = _ref => {
|
|
|
139
135
|
subTextNode.appendChild(document.createTextNode(subText));
|
|
140
136
|
svgValue.appendChild(subTextNode);
|
|
141
137
|
}
|
|
142
|
-
|
|
143
138
|
return svgValue;
|
|
144
139
|
};
|
|
145
|
-
|
|
146
140
|
const generateDashboardItem = (config, _ref2) => {
|
|
147
141
|
let {
|
|
148
142
|
svgContainer,
|
|
@@ -165,55 +159,45 @@ const generateDashboardItem = (config, _ref2) => {
|
|
|
165
159
|
containerHeight: height
|
|
166
160
|
}));
|
|
167
161
|
const container = document.createElement('div');
|
|
168
|
-
container.setAttribute('style',
|
|
169
|
-
const titleStyle =
|
|
162
|
+
container.setAttribute('style', `display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; padding-top: 8px; ${backgroundColor ? `background-color:${backgroundColor};` : ''}`);
|
|
163
|
+
const titleStyle = `padding: 0 8px; text-align: center; font-size: 12px; color: ${titleColor || '#666'};`;
|
|
170
164
|
const title = document.createElement('span');
|
|
171
165
|
title.setAttribute('style', titleStyle);
|
|
172
|
-
|
|
173
166
|
if (config.title) {
|
|
174
167
|
title.appendChild(document.createTextNode(config.title));
|
|
175
168
|
container.appendChild(title);
|
|
176
169
|
}
|
|
177
|
-
|
|
178
170
|
if (config.subtitle) {
|
|
179
171
|
const subtitle = document.createElement('span');
|
|
180
172
|
subtitle.setAttribute('style', titleStyle + ' margin-top: 4px;');
|
|
181
173
|
subtitle.appendChild(document.createTextNode(config.subtitle));
|
|
182
174
|
container.appendChild(subtitle);
|
|
183
175
|
}
|
|
184
|
-
|
|
185
176
|
container.appendChild(svgContainer);
|
|
186
177
|
return container;
|
|
187
178
|
};
|
|
188
|
-
|
|
189
179
|
const getTextAnchorFromTextAlign = textAlign => {
|
|
190
180
|
switch (textAlign) {
|
|
191
181
|
default:
|
|
192
182
|
case _fontStyle.TEXT_ALIGN_LEFT:
|
|
193
183
|
return 'start';
|
|
194
|
-
|
|
195
184
|
case _fontStyle.TEXT_ALIGN_CENTER:
|
|
196
185
|
return 'middle';
|
|
197
|
-
|
|
198
186
|
case _fontStyle.TEXT_ALIGN_RIGHT:
|
|
199
187
|
return 'end';
|
|
200
188
|
}
|
|
201
189
|
};
|
|
202
|
-
|
|
203
190
|
const getXFromTextAlign = textAlign => {
|
|
204
191
|
switch (textAlign) {
|
|
205
192
|
default:
|
|
206
193
|
case _fontStyle.TEXT_ALIGN_LEFT:
|
|
207
194
|
return '1%';
|
|
208
|
-
|
|
209
195
|
case _fontStyle.TEXT_ALIGN_CENTER:
|
|
210
196
|
return '50%';
|
|
211
|
-
|
|
212
197
|
case _fontStyle.TEXT_ALIGN_RIGHT:
|
|
213
198
|
return '99%';
|
|
214
199
|
}
|
|
215
200
|
};
|
|
216
|
-
|
|
217
201
|
const generateDVItem = (config, _ref3) => {
|
|
218
202
|
let {
|
|
219
203
|
svgContainer,
|
|
@@ -226,18 +210,17 @@ const generateDVItem = (config, _ref3) => {
|
|
|
226
210
|
fontStyle,
|
|
227
211
|
icon
|
|
228
212
|
} = _ref3;
|
|
229
|
-
|
|
230
213
|
if (backgroundColor) {
|
|
231
|
-
svgContainer.setAttribute('style',
|
|
214
|
+
svgContainer.setAttribute('style', `background-color: ${backgroundColor};`);
|
|
232
215
|
const background = document.createElementNS(svgNS, 'rect');
|
|
233
216
|
background.setAttribute('width', '100%');
|
|
234
217
|
background.setAttribute('height', '100%');
|
|
235
218
|
background.setAttribute('fill', backgroundColor);
|
|
236
219
|
svgContainer.appendChild(background);
|
|
237
220
|
}
|
|
221
|
+
const svgWrapper = document.createElementNS(svgNS, 'svg');
|
|
238
222
|
|
|
239
|
-
|
|
240
|
-
|
|
223
|
+
// title
|
|
241
224
|
const title = document.createElementNS(svgNS, 'text');
|
|
242
225
|
const titleFontStyle = (0, _fontStyle.mergeFontStyleWithDefault)(fontStyle && fontStyle[_fontStyle.FONT_STYLE_VISUALIZATION_TITLE], _fontStyle.FONT_STYLE_VISUALIZATION_TITLE);
|
|
243
226
|
const titleYPosition = TOP_MARGIN_FIXED + parseInt(titleFontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE]) + 'px';
|
|
@@ -245,7 +228,7 @@ const generateDVItem = (config, _ref3) => {
|
|
|
245
228
|
x: getXFromTextAlign(titleFontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_ALIGN]),
|
|
246
229
|
y: titleYPosition,
|
|
247
230
|
'text-anchor': getTextAnchorFromTextAlign(titleFontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_ALIGN]),
|
|
248
|
-
'font-size':
|
|
231
|
+
'font-size': `${titleFontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE]}px`,
|
|
249
232
|
'font-weight': titleFontStyle[_fontStyle.FONT_STYLE_OPTION_BOLD] ? _fontStyle.FONT_STYLE_OPTION_BOLD : 'normal',
|
|
250
233
|
'font-style': titleFontStyle[_fontStyle.FONT_STYLE_OPTION_ITALIC] ? _fontStyle.FONT_STYLE_OPTION_ITALIC : 'normal',
|
|
251
234
|
'data-test': 'visualization-title',
|
|
@@ -255,21 +238,20 @@ const generateDVItem = (config, _ref3) => {
|
|
|
255
238
|
let [key, value] = _ref4;
|
|
256
239
|
return title.setAttribute(key, value);
|
|
257
240
|
});
|
|
258
|
-
|
|
259
241
|
if (config.title) {
|
|
260
242
|
title.appendChild(document.createTextNode(config.title));
|
|
261
243
|
svgWrapper.appendChild(title);
|
|
262
|
-
}
|
|
263
|
-
|
|
244
|
+
}
|
|
264
245
|
|
|
246
|
+
// subtitle
|
|
265
247
|
const subtitle = document.createElementNS(svgNS, 'text');
|
|
266
248
|
const subtitleFontStyle = (0, _fontStyle.mergeFontStyleWithDefault)(fontStyle && fontStyle[_fontStyle.FONT_STYLE_VISUALIZATION_SUBTITLE], _fontStyle.FONT_STYLE_VISUALIZATION_SUBTITLE);
|
|
267
249
|
const subtitleAttributes = {
|
|
268
250
|
x: getXFromTextAlign(subtitleFontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_ALIGN]),
|
|
269
251
|
y: titleYPosition,
|
|
270
|
-
dy:
|
|
252
|
+
dy: `${subtitleFontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE] + 10}`,
|
|
271
253
|
'text-anchor': getTextAnchorFromTextAlign(subtitleFontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_ALIGN]),
|
|
272
|
-
'font-size':
|
|
254
|
+
'font-size': `${subtitleFontStyle[_fontStyle.FONT_STYLE_OPTION_FONT_SIZE]}px`,
|
|
273
255
|
'font-weight': subtitleFontStyle[_fontStyle.FONT_STYLE_OPTION_BOLD] ? _fontStyle.FONT_STYLE_OPTION_BOLD : 'normal',
|
|
274
256
|
'font-style': subtitleFontStyle[_fontStyle.FONT_STYLE_OPTION_ITALIC] ? _fontStyle.FONT_STYLE_OPTION_ITALIC : 'normal',
|
|
275
257
|
fill: titleColor && subtitleFontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_COLOR] === _fontStyle.defaultFontStyle[_fontStyle.FONT_STYLE_VISUALIZATION_SUBTITLE][_fontStyle.FONT_STYLE_OPTION_TEXT_COLOR] ? titleColor : subtitleFontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_COLOR],
|
|
@@ -279,12 +261,10 @@ const generateDVItem = (config, _ref3) => {
|
|
|
279
261
|
let [key, value] = _ref5;
|
|
280
262
|
return subtitle.setAttribute(key, value);
|
|
281
263
|
});
|
|
282
|
-
|
|
283
264
|
if (config.subtitle) {
|
|
284
265
|
subtitle.appendChild(document.createTextNode(config.subtitle));
|
|
285
266
|
svgWrapper.appendChild(subtitle);
|
|
286
267
|
}
|
|
287
|
-
|
|
288
268
|
svgContainer.appendChild(svgWrapper);
|
|
289
269
|
svgContainer.appendChild(generateValueSVG({
|
|
290
270
|
formattedValue: config.formattedValue,
|
|
@@ -299,29 +279,23 @@ const generateDVItem = (config, _ref3) => {
|
|
|
299
279
|
}));
|
|
300
280
|
return svgContainer;
|
|
301
281
|
};
|
|
302
|
-
|
|
303
282
|
const shouldUseContrastColor = function () {
|
|
304
283
|
let inputColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
305
284
|
// based on https://stackoverflow.com/questions/3942878/how-to-decide-font-color-in-white-or-black-depending-on-background-color
|
|
306
285
|
var color = inputColor.charAt(0) === '#' ? inputColor.substring(1, 7) : inputColor;
|
|
307
286
|
var r = parseInt(color.substring(0, 2), 16); // hexToR
|
|
308
|
-
|
|
309
287
|
var g = parseInt(color.substring(2, 4), 16); // hexToG
|
|
310
|
-
|
|
311
288
|
var b = parseInt(color.substring(4, 6), 16); // hexToB
|
|
312
|
-
|
|
313
289
|
var uicolors = [r / 255, g / 255, b / 255];
|
|
314
290
|
var c = uicolors.map(col => {
|
|
315
291
|
if (col <= 0.03928) {
|
|
316
292
|
return col / 12.92;
|
|
317
293
|
}
|
|
318
|
-
|
|
319
294
|
return Math.pow((col + 0.055) / 1.055, 2.4);
|
|
320
295
|
});
|
|
321
296
|
var L = 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2];
|
|
322
297
|
return L <= 0.179;
|
|
323
298
|
};
|
|
324
|
-
|
|
325
299
|
function _default(config, parentEl, _ref6) {
|
|
326
300
|
let {
|
|
327
301
|
dashboard,
|
|
@@ -334,7 +308,6 @@ function _default(config, parentEl, _ref6) {
|
|
|
334
308
|
const legendSet = legendOptions && legendSets[0];
|
|
335
309
|
const legendColor = legendSet && (0, _legends.getColorByValueFromLegendSet)(legendSet, config.value);
|
|
336
310
|
let valueColor, titleColor, backgroundColor;
|
|
337
|
-
|
|
338
311
|
if (legendColor) {
|
|
339
312
|
if (legendOptions.style === _legends.LEGEND_DISPLAY_STYLE_FILL) {
|
|
340
313
|
backgroundColor = legendColor;
|
|
@@ -343,7 +316,6 @@ function _default(config, parentEl, _ref6) {
|
|
|
343
316
|
valueColor = legendColor;
|
|
344
317
|
}
|
|
345
318
|
}
|
|
346
|
-
|
|
347
319
|
parentEl.style.overflow = 'hidden';
|
|
348
320
|
parentEl.style.display = 'flex';
|
|
349
321
|
parentEl.style.justifyContent = 'center';
|
|
@@ -352,11 +324,10 @@ function _default(config, parentEl, _ref6) {
|
|
|
352
324
|
const height = parentElBBox.height;
|
|
353
325
|
const svgContainer = document.createElementNS(svgNS, 'svg');
|
|
354
326
|
svgContainer.setAttribute('xmlns', svgNS);
|
|
355
|
-
svgContainer.setAttribute('viewBox',
|
|
327
|
+
svgContainer.setAttribute('viewBox', `0 0 ${width} ${height}`);
|
|
356
328
|
svgContainer.setAttribute('width', dashboard ? '100%' : width);
|
|
357
329
|
svgContainer.setAttribute('height', dashboard ? '100%' : height);
|
|
358
330
|
svgContainer.setAttribute('data-test', 'visualization-container');
|
|
359
|
-
|
|
360
331
|
if (dashboard) {
|
|
361
332
|
parentEl.style.borderRadius = '3px';
|
|
362
333
|
return generateDashboardItem(config, {
|
|
@@ -372,7 +343,7 @@ function _default(config, parentEl, _ref6) {
|
|
|
372
343
|
} : {})
|
|
373
344
|
});
|
|
374
345
|
} else {
|
|
375
|
-
parentEl.style.height =
|
|
346
|
+
parentEl.style.height = `100%`;
|
|
376
347
|
return generateDVItem(config, {
|
|
377
348
|
svgContainer,
|
|
378
349
|
width,
|
|
@@ -4,23 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = _default;
|
|
7
|
-
|
|
8
7
|
var _highcharts = _interopRequireDefault(require("highcharts"));
|
|
9
|
-
|
|
10
8
|
var _highchartsMore = _interopRequireDefault(require("highcharts/highcharts-more"));
|
|
11
|
-
|
|
12
9
|
var _boost = _interopRequireDefault(require("highcharts/modules/boost"));
|
|
13
|
-
|
|
14
10
|
var _exporting = _interopRequireDefault(require("highcharts/modules/exporting"));
|
|
15
|
-
|
|
16
11
|
var _noDataToDisplay = _interopRequireDefault(require("highcharts/modules/no-data-to-display"));
|
|
17
|
-
|
|
18
12
|
var _patternFill = _interopRequireDefault(require("highcharts/modules/pattern-fill"));
|
|
19
|
-
|
|
20
13
|
var _solidGauge = _interopRequireDefault(require("highcharts/modules/solid-gauge"));
|
|
21
|
-
|
|
22
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
-
|
|
24
15
|
// apply
|
|
25
16
|
(0, _highchartsMore.default)(_highcharts.default);
|
|
26
17
|
(0, _solidGauge.default)(_highcharts.default);
|
|
@@ -28,20 +19,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
28
19
|
(0, _exporting.default)(_highcharts.default);
|
|
29
20
|
(0, _patternFill.default)(_highcharts.default);
|
|
30
21
|
(0, _boost.default)(_highcharts.default);
|
|
31
|
-
|
|
32
22
|
function drawLegendSymbolWrap() {
|
|
33
23
|
const pick = _highcharts.default.pick;
|
|
34
|
-
|
|
35
24
|
_highcharts.default.wrap(_highcharts.default.seriesTypes.column.prototype, 'drawLegendSymbol', function (proceed, legend, item) {
|
|
36
25
|
var _this$options$legendS, _this$options$legendS2;
|
|
37
|
-
|
|
38
26
|
if ((_this$options$legendS = this.options.legendSet) !== null && _this$options$legendS !== void 0 && (_this$options$legendS2 = _this$options$legendS.legends) !== null && _this$options$legendS2 !== void 0 && _this$options$legendS2.length) {
|
|
39
27
|
const ys = legend.baseline - legend.symbolHeight + 1,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
28
|
+
// y start
|
|
29
|
+
x = legend.symbolWidth / 2 > 8 ? legend.symbolWidth / 2 : 8,
|
|
30
|
+
// x start
|
|
31
|
+
ye = legend.symbolHeight + ys; // y end
|
|
45
32
|
const legends = this.options.legendSet.legends.sort((a, b) => a.startValue - b.startValue);
|
|
46
33
|
this.chart.renderer.path(['M', x, ys, 'A', 1, 1, 0, 0, 0, x, ye, 'V', ys]).attr({
|
|
47
34
|
fill: legends[legends.length >= 5 ? 1 : 0].color
|
|
@@ -51,30 +38,28 @@ function drawLegendSymbolWrap() {
|
|
|
51
38
|
}).add(this.legendGroup);
|
|
52
39
|
} else {
|
|
53
40
|
var options = legend.options,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
41
|
+
symbolHeight = legend.symbolHeight,
|
|
42
|
+
square = options.squareSymbol,
|
|
43
|
+
symbolWidth = square ? symbolHeight : legend.symbolWidth;
|
|
57
44
|
item.legendSymbol = this.chart.renderer.rect(square ? (legend.symbolWidth - symbolHeight) / 2 : 0, legend.baseline - symbolHeight + 1, symbolWidth, symbolHeight, pick(legend.options.symbolRadius, symbolHeight / 2)).addClass('highcharts-point').attr({
|
|
58
45
|
zIndex: 3
|
|
59
46
|
}).add(item.legendGroup);
|
|
60
47
|
}
|
|
61
48
|
});
|
|
62
49
|
}
|
|
63
|
-
|
|
64
50
|
function _default(config, el) {
|
|
65
51
|
if (config) {
|
|
66
|
-
config.chart.renderTo = el || config.chart.renderTo;
|
|
52
|
+
config.chart.renderTo = el || config.chart.renderTo;
|
|
67
53
|
|
|
54
|
+
// silence warning about accessibility
|
|
68
55
|
config.accessibility = {
|
|
69
56
|
enabled: false
|
|
70
57
|
};
|
|
71
|
-
|
|
72
58
|
if (config.lang) {
|
|
73
59
|
_highcharts.default.setOptions({
|
|
74
60
|
lang: config.lang
|
|
75
61
|
});
|
|
76
62
|
}
|
|
77
|
-
|
|
78
63
|
drawLegendSymbolWrap();
|
|
79
64
|
return new _highcharts.default.Chart(config);
|
|
80
65
|
}
|
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _index = _interopRequireDefault(require("./dhis/index.js"));
|
|
9
|
-
|
|
10
8
|
var _index2 = _interopRequireDefault(require("./highcharts/index.js"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
var _default = {
|
|
15
11
|
highcharts: _index2.default,
|
|
16
12
|
dhis: _index.default
|