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