@dhis2/analytics 28.0.2 → 28.0.4
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__/DataDimension.stories.js +3 -4
- package/build/cjs/__demo__/Filter.stories.js +1 -2
- package/build/cjs/__demo__/FixedPeriodSelect.stories.js +1 -2
- package/build/cjs/__demo__/OpenFileDialog.stories.js +2 -2
- package/build/cjs/__demo__/OrgUnitDimension.stories.js +3 -4
- package/build/cjs/__demo__/PeriodDimension.stories.js +2 -2
- package/build/cjs/__demo__/PivotTable.stories.js +166 -224
- package/build/cjs/__demo__/ScatterPlotPdfExport.stories.js +1 -2
- package/build/cjs/__demo__/SingleValue.stories.js +1 -2
- package/build/cjs/__demo__/Toolbar.stories.js +1 -2
- package/build/cjs/api/__tests__/dimensions.spec.js +1 -2
- package/build/cjs/api/analytics/Analytics.js +8 -9
- package/build/cjs/api/analytics/AnalyticsBase.js +58 -77
- package/build/cjs/api/analytics/AnalyticsRequest.js +1 -2
- package/build/cjs/api/analytics/AnalyticsRequestBase.js +18 -21
- package/build/cjs/api/analytics/AnalyticsRequestPropertiesMixin.js +19 -38
- package/build/cjs/api/analytics/AnalyticsResponseHeader.js +5 -7
- package/build/cjs/api/analytics/__tests__/AnalyticsBase.spec.js +9 -12
- package/build/cjs/api/analytics/__tests__/AnalyticsRequest.spec.js +8 -2
- package/build/cjs/api/analytics/utils.js +11 -17
- package/build/cjs/api/dimensions.js +119 -148
- package/build/cjs/api/expression.js +39 -60
- package/build/cjs/api/organisationUnits.js +23 -35
- package/build/cjs/components/AboutAOUnit/AboutAOUnit.js +12 -20
- package/build/cjs/components/CachedDataQueryProvider.js +7 -9
- package/build/cjs/components/DashboardPluginWrapper/DashboardPluginWrapper.js +18 -22
- package/build/cjs/components/DataDimension/Calculation/CalculationModal.js +44 -61
- package/build/cjs/components/DataDimension/Calculation/DataElementOption.js +5 -6
- package/build/cjs/components/DataDimension/Calculation/DataElementSelector.js +29 -38
- package/build/cjs/components/DataDimension/Calculation/DndContext.js +29 -37
- package/build/cjs/components/DataDimension/Calculation/DraggingItem.js +5 -6
- package/build/cjs/components/DataDimension/Calculation/DropZone.js +4 -5
- package/build/cjs/components/DataDimension/Calculation/FormulaField.js +29 -32
- package/build/cjs/components/DataDimension/Calculation/FormulaItem.js +14 -16
- package/build/cjs/components/DataDimension/Calculation/MathOperatorSelector.js +23 -29
- package/build/cjs/components/DataDimension/Calculation/Operator.js +6 -7
- package/build/cjs/components/DataDimension/DataDimension.js +20 -32
- package/build/cjs/components/DataDimension/Info/CalculationInfo.js +14 -22
- package/build/cjs/components/DataDimension/Info/DataElementInfo.js +23 -36
- package/build/cjs/components/DataDimension/Info/DataElementOperandInfo.js +30 -44
- package/build/cjs/components/DataDimension/Info/DataSetInfo.js +26 -39
- package/build/cjs/components/DataDimension/Info/EventDataItemInfo.js +21 -34
- package/build/cjs/components/DataDimension/Info/IndicatorInfo.js +21 -32
- package/build/cjs/components/DataDimension/Info/InfoPopover.js +6 -7
- package/build/cjs/components/DataDimension/Info/InfoTable.js +39 -52
- package/build/cjs/components/DataDimension/Info/OptionInfo.js +13 -20
- package/build/cjs/components/DataDimension/Info/ProgramIndicatorInfo.js +46 -58
- package/build/cjs/components/DataDimension/ItemOptionsSelector/ItemOptionsSelector.js +22 -32
- package/build/cjs/components/DataDimension/ItemSelector/DataTypeSelector.js +6 -7
- package/build/cjs/components/DataDimension/ItemSelector/DetailSelector.js +5 -6
- package/build/cjs/components/DataDimension/ItemSelector/GroupSelector.js +10 -12
- package/build/cjs/components/DataDimension/ItemSelector/ItemSelector.js +86 -104
- package/build/cjs/components/DataDimension/ItemSelector/MetricSelector.js +5 -6
- package/build/cjs/components/DataDimension/SourceEmptyPlaceholder.js +10 -13
- package/build/cjs/components/DataDimension/TransferOption.js +35 -39
- package/build/cjs/components/DimensionMenu.js +13 -14
- package/build/cjs/components/DimensionsPanel/DimensionsPanel.js +8 -9
- package/build/cjs/components/DimensionsPanel/List/DimensionItem.js +12 -13
- package/build/cjs/components/DimensionsPanel/List/DimensionList.js +9 -10
- package/build/cjs/components/DimensionsPanel/List/OptionsButton.js +8 -11
- package/build/cjs/components/DimensionsPanel/List/RecommendedIcon.js +10 -13
- package/build/cjs/components/DynamicDimension/DynamicDimension.js +9 -13
- package/build/cjs/components/DynamicDimension/ItemSelector.js +25 -38
- package/build/cjs/components/FileMenu/DeleteDialog.js +11 -16
- package/build/cjs/components/FileMenu/FileMenu.js +19 -30
- package/build/cjs/components/FileMenu/GetLinkDialog.js +7 -7
- package/build/cjs/components/FileMenu/RenameDialog.js +13 -21
- package/build/cjs/components/FileMenu/SaveAsDialog.js +13 -21
- package/build/cjs/components/FileMenu/__tests__/FileMenu.spec.js +6 -2
- package/build/cjs/components/FileMenu/__tests__/GetLinkDialog.spec.js +7 -8
- package/build/cjs/components/FileMenu/utils.js +10 -12
- package/build/cjs/components/Filter/Filter.js +21 -27
- package/build/cjs/components/Interpretations/InterpretationModal/Comment.js +8 -10
- package/build/cjs/components/Interpretations/InterpretationModal/CommentAddForm.js +10 -15
- package/build/cjs/components/Interpretations/InterpretationModal/CommentDeleteButton.js +10 -15
- package/build/cjs/components/Interpretations/InterpretationModal/CommentUpdateForm.js +12 -17
- package/build/cjs/components/Interpretations/InterpretationModal/InterpretationModal.js +19 -25
- package/build/cjs/components/Interpretations/InterpretationModal/InterpretationThread.js +12 -14
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationForm.js +12 -17
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationList.js +10 -11
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js +23 -33
- package/build/cjs/components/Interpretations/common/Interpretation/Interpretation.js +13 -15
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js +7 -11
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationSharingLink.js +5 -7
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js +15 -23
- package/build/cjs/components/Interpretations/common/Interpretation/useLike.js +5 -6
- package/build/cjs/components/Interpretations/common/Message/Message.js +6 -7
- package/build/cjs/components/Interpretations/common/Message/MessageButtonStrip.js +8 -11
- package/build/cjs/components/Interpretations/common/Message/MessageEditorContainer.js +18 -21
- package/build/cjs/components/Interpretations/common/Message/MessageIconButton.js +34 -40
- package/build/cjs/components/Interpretations/common/Message/MessageInput.js +1 -2
- package/build/cjs/components/Interpretations/common/Message/MessageStatsBar.js +8 -11
- package/build/cjs/components/LegendKey/LegendKey.js +3 -4
- package/build/cjs/components/OfflineTooltip.js +18 -26
- package/build/cjs/components/OpenFileDialog/CreatedByFilter.js +20 -26
- package/build/cjs/components/OpenFileDialog/CustomSelectOption.js +23 -26
- package/build/cjs/components/OpenFileDialog/DateField.js +3 -4
- package/build/cjs/components/OpenFileDialog/FileList.js +19 -22
- package/build/cjs/components/OpenFileDialog/NameFilter.js +15 -21
- package/build/cjs/components/OpenFileDialog/OpenFileDialog.js +36 -45
- package/build/cjs/components/OpenFileDialog/PaginationControls.js +22 -28
- package/build/cjs/components/OpenFileDialog/VisTypeFilter.js +28 -37
- package/build/cjs/components/Options/VisualizationOptions.js +35 -46
- package/build/cjs/components/OrgUnitDimension/OrgUnitDimension.js +38 -60
- package/build/cjs/components/PeriodDimension/FixedPeriodFilter.js +16 -25
- package/build/cjs/components/PeriodDimension/FixedPeriodSelect.js +15 -21
- package/build/cjs/components/PeriodDimension/PeriodDimension.js +9 -12
- package/build/cjs/components/PeriodDimension/PeriodTransfer.js +49 -63
- package/build/cjs/components/PeriodDimension/RelativePeriodFilter.js +24 -30
- package/build/cjs/components/PeriodDimension/__tests__/__snapshots__/FixedPeriodSingleSelect.spec.js.snap +0 -1
- package/build/cjs/components/PeriodDimension/__tests__/__snapshots__/PeriodDimension.spec.js.snap +0 -1
- package/build/cjs/components/PeriodDimension/utils/fixedPeriods.js +6 -7
- package/build/cjs/components/PeriodDimension/utils/index.js +1 -5
- package/build/cjs/components/PivotTable/PivotTable.js +8 -10
- package/build/cjs/components/PivotTable/PivotTableBody.js +20 -29
- package/build/cjs/components/PivotTable/PivotTableCell.js +8 -12
- package/build/cjs/components/PivotTable/PivotTableClippedAxis.js +14 -17
- package/build/cjs/components/PivotTable/PivotTableColumnHeaderCell.js +7 -8
- package/build/cjs/components/PivotTable/PivotTableColumnHeaders.js +22 -29
- package/build/cjs/components/PivotTable/PivotTableContainer.js +5 -6
- package/build/cjs/components/PivotTable/PivotTableDimensionLabelCell.js +4 -5
- package/build/cjs/components/PivotTable/PivotTableEmptyCell.js +3 -4
- package/build/cjs/components/PivotTable/PivotTableEmptyRow.js +4 -5
- package/build/cjs/components/PivotTable/PivotTableEngineContext.js +5 -7
- package/build/cjs/components/PivotTable/PivotTableHead.js +13 -16
- package/build/cjs/components/PivotTable/PivotTableHeaderCell.js +8 -9
- package/build/cjs/components/PivotTable/PivotTableRow.js +20 -27
- package/build/cjs/components/PivotTable/PivotTableRowHeaderCell.js +5 -6
- package/build/cjs/components/PivotTable/PivotTableSortIcon.js +4 -5
- package/build/cjs/components/PivotTable/PivotTableTitleRow.js +19 -24
- package/build/cjs/components/PivotTable/PivotTableTitleRows.js +4 -5
- package/build/cjs/components/PivotTable/PivotTableValueCell.js +6 -8
- package/build/cjs/components/RichText/Editor/Editor.js +70 -85
- package/build/cjs/components/RichText/Parser/Parser.js +5 -10
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuBar.js +20 -24
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuDropdown.js +8 -13
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuList.js +9 -17
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuListItem.js +11 -16
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuBar.spec.js +4 -5
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuList.spec.js +13 -11
- package/build/cjs/components/Toolbar/InterpretationsAndDetailsToggler.js +15 -21
- package/build/cjs/components/Toolbar/Toolbar.js +10 -16
- package/build/cjs/components/Toolbar/ToolbarSidebar.js +12 -18
- package/build/cjs/components/Toolbar/UpdateButton.js +18 -24
- package/build/cjs/components/TransferOption.js +14 -15
- package/build/cjs/components/TranslationDialog/TranslationModal/LocalesSelect.js +19 -27
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationForm.js +17 -25
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModal.js +8 -10
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModalActions.js +18 -27
- package/build/cjs/components/TranslationDialog/TranslationModal/__tests__/TranslationModal.spec.js +52 -0
- package/build/cjs/components/TranslationDialog/TranslationModal/useTranslationsResults.js +3 -4
- package/build/cjs/components/UserMention/UserList.js +6 -7
- package/build/cjs/components/UserMention/UserMentionWrapper.js +13 -20
- package/build/cjs/components/UserMention/useUserSearchResults.js +12 -16
- package/build/cjs/components/VisTypeIcon.js +5 -6
- package/build/cjs/index.js +38 -39
- package/build/cjs/locales/ar_IQ/translations.json +20 -11
- package/build/cjs/locales/cs/translations.json +2 -0
- package/build/cjs/locales/en/translations.json +1 -0
- package/build/cjs/locales/es/translations.json +2 -0
- package/build/cjs/locales/fr/translations.json +2 -0
- package/build/cjs/locales/id/translations.json +20 -11
- package/build/cjs/locales/index.js +62 -62
- package/build/cjs/locales/lo/translations.json +2 -0
- package/build/cjs/locales/nb/translations.json +2 -0
- package/build/cjs/locales/prs/translations.json +2 -0
- package/build/cjs/locales/ps/translations.json +2 -0
- package/build/cjs/locales/pt/translations.json +2 -0
- package/build/cjs/locales/pt_BR/translations.json +2 -0
- package/build/cjs/locales/ru/translations.json +2 -0
- package/build/cjs/locales/si/translations.json +20 -11
- package/build/cjs/locales/sv/translations.json +20 -11
- package/build/cjs/locales/tet/translations.json +20 -11
- package/build/cjs/locales/tg/translations.json +2 -0
- package/build/cjs/locales/uk/translations.json +2 -0
- package/build/cjs/locales/ur/translations.json +2 -0
- package/build/cjs/locales/uz_UZ_Cyrl/translations.json +2 -0
- package/build/cjs/locales/uz_UZ_Latn/translations.json +4 -2
- package/build/cjs/locales/vi/translations.json +2 -0
- package/build/cjs/locales/zh/translations.json +2 -0
- package/build/cjs/locales/zh_CN/translations.json +17 -15
- package/build/cjs/modules/__tests__/expressions.spec.js +4 -5
- package/build/cjs/modules/__tests__/isNumeric.spec.js +33 -0
- package/build/cjs/modules/dimensionListItem.js +4 -5
- package/build/cjs/modules/expressions.js +3 -9
- package/build/cjs/modules/getPWAInstallationStatus.js +7 -9
- package/build/cjs/modules/layout/dimensionCreate.js +1 -3
- package/build/cjs/modules/layout/dimensionIsValid.js +3 -4
- package/build/cjs/modules/legends.js +5 -6
- package/build/cjs/modules/outliers/index.js +5 -6
- package/build/cjs/modules/outliers/iqr.js +4 -6
- package/build/cjs/modules/outliers/modZScore.js +6 -14
- package/build/cjs/modules/outliers/zScore.js +3 -4
- package/build/cjs/modules/pivotTable/AdaptiveClippingController.js +12 -16
- package/build/cjs/modules/pivotTable/PivotTableEngine.js +48 -59
- package/build/cjs/modules/pivotTable/clipAxis.js +7 -8
- package/build/cjs/modules/pivotTable/clipPartitionedAxis.js +9 -10
- package/build/cjs/modules/pivotTable/getHeaderForDisplay.js +8 -9
- package/build/cjs/modules/pivotTable/measureText.js +7 -9
- package/build/cjs/modules/pivotTable/useParentSize.js +1 -2
- package/build/cjs/modules/pivotTable/useScrollPosition.js +1 -2
- package/build/cjs/modules/pivotTable/useTableClipping.js +6 -7
- package/build/cjs/modules/relativeItems/index.js +1 -4
- package/build/cjs/modules/renderValue.js +1 -2
- package/build/cjs/modules/utils.js +11 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +3 -8
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/axis.js +7 -10
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/customAxes.js +2 -5
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/customSVGOptions/index.js +7 -8
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/getSingleValueBackgroundColor.js +1 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/index.js +6 -7
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getFormatter.js +2 -3
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getSteps.js +2 -3
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +3 -4
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/index.js +8 -10
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/legend.js +6 -7
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/legendSet.js +22 -26
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/plotOptions.js +8 -9
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/series/index.js +18 -20
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/series/pie.js +1 -4
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/subtitle/index.js +1 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +1 -3
- package/build/cjs/visualizations/config/index.js +11 -12
- package/build/cjs/visualizations/config/validators/dhis/index.js +3 -4
- package/build/cjs/visualizations/index.js +1 -4
- package/build/cjs/visualizations/store/adapters/dhis_highcharts/index.js +7 -8
- package/build/cjs/visualizations/store/index.js +15 -17
- package/build/cjs/visualizations/store/validators/dhis/index.js +5 -6
- package/build/cjs/visualizations/util/getFilterText.js +3 -6
- package/build/cjs/visualizations/util/shouldUseContrastColor.js +1 -2
- package/build/es/__demo__/DataDimension.stories.js +2 -2
- package/build/es/__demo__/OpenFileDialog.stories.js +2 -2
- package/build/es/__demo__/OrgUnitDimension.stories.js +2 -2
- package/build/es/__demo__/PeriodDimension.stories.js +2 -2
- package/build/es/__demo__/PivotTable.stories.js +165 -222
- package/build/es/api/__tests__/dimensions.spec.js +1 -2
- package/build/es/api/analytics/Analytics.js +8 -9
- package/build/es/api/analytics/AnalyticsBase.js +58 -77
- package/build/es/api/analytics/AnalyticsRequest.js +1 -2
- package/build/es/api/analytics/AnalyticsRequestBase.js +18 -21
- package/build/es/api/analytics/AnalyticsRequestPropertiesMixin.js +19 -38
- package/build/es/api/analytics/AnalyticsResponseHeader.js +5 -7
- package/build/es/api/analytics/__tests__/AnalyticsBase.spec.js +8 -10
- package/build/es/api/analytics/__tests__/AnalyticsRequest.spec.js +8 -2
- package/build/es/api/analytics/utils.js +11 -17
- package/build/es/api/dimensions.js +119 -148
- package/build/es/api/expression.js +39 -60
- package/build/es/api/organisationUnits.js +23 -35
- package/build/es/components/AboutAOUnit/AboutAOUnit.js +11 -18
- package/build/es/components/CachedDataQueryProvider.js +6 -7
- package/build/es/components/DashboardPluginWrapper/DashboardPluginWrapper.js +17 -20
- package/build/es/components/DataDimension/Calculation/CalculationModal.js +43 -59
- package/build/es/components/DataDimension/Calculation/DataElementOption.js +5 -6
- package/build/es/components/DataDimension/Calculation/DataElementSelector.js +28 -36
- package/build/es/components/DataDimension/Calculation/DndContext.js +28 -35
- package/build/es/components/DataDimension/Calculation/DraggingItem.js +5 -6
- package/build/es/components/DataDimension/Calculation/DropZone.js +4 -5
- package/build/es/components/DataDimension/Calculation/FormulaField.js +29 -32
- package/build/es/components/DataDimension/Calculation/FormulaItem.js +13 -14
- package/build/es/components/DataDimension/Calculation/MathOperatorSelector.js +23 -29
- package/build/es/components/DataDimension/Calculation/Operator.js +6 -7
- package/build/es/components/DataDimension/DataDimension.js +19 -30
- package/build/es/components/DataDimension/Info/CalculationInfo.js +13 -20
- package/build/es/components/DataDimension/Info/DataElementInfo.js +23 -36
- package/build/es/components/DataDimension/Info/DataElementOperandInfo.js +29 -42
- package/build/es/components/DataDimension/Info/DataSetInfo.js +26 -39
- package/build/es/components/DataDimension/Info/EventDataItemInfo.js +21 -34
- package/build/es/components/DataDimension/Info/IndicatorInfo.js +20 -30
- package/build/es/components/DataDimension/Info/InfoPopover.js +6 -7
- package/build/es/components/DataDimension/Info/InfoTable.js +39 -52
- package/build/es/components/DataDimension/Info/OptionInfo.js +13 -20
- package/build/es/components/DataDimension/Info/ProgramIndicatorInfo.js +45 -56
- package/build/es/components/DataDimension/ItemOptionsSelector/ItemOptionsSelector.js +21 -30
- package/build/es/components/DataDimension/ItemSelector/DataTypeSelector.js +6 -7
- package/build/es/components/DataDimension/ItemSelector/DetailSelector.js +5 -6
- package/build/es/components/DataDimension/ItemSelector/GroupSelector.js +9 -10
- package/build/es/components/DataDimension/ItemSelector/ItemSelector.js +85 -102
- package/build/es/components/DataDimension/ItemSelector/MetricSelector.js +5 -6
- package/build/es/components/DataDimension/SourceEmptyPlaceholder.js +10 -13
- package/build/es/components/DataDimension/TransferOption.js +35 -39
- package/build/es/components/DimensionMenu.js +13 -14
- package/build/es/components/DimensionsPanel/DimensionsPanel.js +7 -7
- package/build/es/components/DimensionsPanel/List/DimensionItem.js +11 -11
- package/build/es/components/DimensionsPanel/List/DimensionList.js +8 -8
- package/build/es/components/DimensionsPanel/List/OptionsButton.js +8 -11
- package/build/es/components/DimensionsPanel/List/RecommendedIcon.js +10 -13
- package/build/es/components/DynamicDimension/DynamicDimension.js +9 -13
- package/build/es/components/DynamicDimension/ItemSelector.js +24 -36
- package/build/es/components/FileMenu/DeleteDialog.js +10 -14
- package/build/es/components/FileMenu/FileMenu.js +18 -28
- package/build/es/components/FileMenu/GetLinkDialog.js +7 -7
- package/build/es/components/FileMenu/RenameDialog.js +12 -19
- package/build/es/components/FileMenu/SaveAsDialog.js +12 -19
- package/build/es/components/FileMenu/__tests__/FileMenu.spec.js +6 -2
- package/build/es/components/FileMenu/__tests__/GetLinkDialog.spec.js +7 -8
- package/build/es/components/FileMenu/utils.js +10 -12
- package/build/es/components/Filter/Filter.js +21 -27
- package/build/es/components/Interpretations/InterpretationModal/Comment.js +7 -8
- package/build/es/components/Interpretations/InterpretationModal/CommentAddForm.js +9 -13
- package/build/es/components/Interpretations/InterpretationModal/CommentDeleteButton.js +9 -13
- package/build/es/components/Interpretations/InterpretationModal/CommentUpdateForm.js +11 -15
- package/build/es/components/Interpretations/InterpretationModal/InterpretationModal.js +18 -23
- package/build/es/components/Interpretations/InterpretationModal/InterpretationThread.js +11 -12
- package/build/es/components/Interpretations/InterpretationsUnit/InterpretationForm.js +11 -15
- package/build/es/components/Interpretations/InterpretationsUnit/InterpretationList.js +10 -11
- package/build/es/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js +22 -31
- package/build/es/components/Interpretations/common/Interpretation/Interpretation.js +12 -13
- package/build/es/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js +7 -11
- package/build/es/components/Interpretations/common/Interpretation/InterpretationSharingLink.js +4 -5
- package/build/es/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js +14 -21
- package/build/es/components/Interpretations/common/Interpretation/useLike.js +5 -6
- package/build/es/components/Interpretations/common/Message/Message.js +6 -7
- package/build/es/components/Interpretations/common/Message/MessageButtonStrip.js +8 -11
- package/build/es/components/Interpretations/common/Message/MessageEditorContainer.js +18 -21
- package/build/es/components/Interpretations/common/Message/MessageIconButton.js +34 -40
- package/build/es/components/Interpretations/common/Message/MessageStatsBar.js +8 -11
- package/build/es/components/LegendKey/LegendKey.js +3 -4
- package/build/es/components/OfflineTooltip.js +18 -26
- package/build/es/components/OpenFileDialog/CreatedByFilter.js +20 -26
- package/build/es/components/OpenFileDialog/CustomSelectOption.js +23 -26
- package/build/es/components/OpenFileDialog/DateField.js +3 -4
- package/build/es/components/OpenFileDialog/FileList.js +19 -22
- package/build/es/components/OpenFileDialog/NameFilter.js +15 -21
- package/build/es/components/OpenFileDialog/OpenFileDialog.js +35 -43
- package/build/es/components/OpenFileDialog/PaginationControls.js +22 -28
- package/build/es/components/OpenFileDialog/VisTypeFilter.js +28 -37
- package/build/es/components/Options/VisualizationOptions.js +34 -44
- package/build/es/components/OrgUnitDimension/OrgUnitDimension.js +37 -58
- package/build/es/components/PeriodDimension/FixedPeriodFilter.js +16 -25
- package/build/es/components/PeriodDimension/FixedPeriodSelect.js +14 -19
- package/build/es/components/PeriodDimension/PeriodDimension.js +9 -12
- package/build/es/components/PeriodDimension/PeriodTransfer.js +48 -61
- package/build/es/components/PeriodDimension/RelativePeriodFilter.js +24 -30
- package/build/es/components/PeriodDimension/__tests__/__snapshots__/FixedPeriodSingleSelect.spec.js.snap +0 -1
- package/build/es/components/PeriodDimension/__tests__/__snapshots__/PeriodDimension.spec.js.snap +0 -1
- package/build/es/components/PeriodDimension/utils/fixedPeriods.js +6 -7
- package/build/es/components/PeriodDimension/utils/index.js +1 -5
- package/build/es/components/PivotTable/PivotTable.js +7 -8
- package/build/es/components/PivotTable/PivotTableBody.js +20 -29
- package/build/es/components/PivotTable/PivotTableCell.js +8 -12
- package/build/es/components/PivotTable/PivotTableClippedAxis.js +14 -17
- package/build/es/components/PivotTable/PivotTableColumnHeaderCell.js +7 -8
- package/build/es/components/PivotTable/PivotTableColumnHeaders.js +22 -29
- package/build/es/components/PivotTable/PivotTableContainer.js +5 -6
- package/build/es/components/PivotTable/PivotTableDimensionLabelCell.js +4 -5
- package/build/es/components/PivotTable/PivotTableEmptyCell.js +3 -4
- package/build/es/components/PivotTable/PivotTableEmptyRow.js +4 -5
- package/build/es/components/PivotTable/PivotTableEngineContext.js +4 -5
- package/build/es/components/PivotTable/PivotTableHead.js +13 -16
- package/build/es/components/PivotTable/PivotTableHeaderCell.js +8 -9
- package/build/es/components/PivotTable/PivotTableRow.js +20 -27
- package/build/es/components/PivotTable/PivotTableRowHeaderCell.js +5 -6
- package/build/es/components/PivotTable/PivotTableSortIcon.js +4 -5
- package/build/es/components/PivotTable/PivotTableTitleRow.js +18 -22
- package/build/es/components/PivotTable/PivotTableTitleRows.js +4 -5
- package/build/es/components/PivotTable/PivotTableValueCell.js +5 -6
- package/build/es/components/RichText/Editor/Editor.js +69 -83
- package/build/es/components/RichText/Parser/Parser.js +4 -8
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuBar.js +20 -23
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuDropdown.js +7 -11
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuList.js +8 -15
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuListItem.js +10 -14
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuBar.spec.js +4 -5
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuList.spec.js +6 -4
- package/build/es/components/Toolbar/InterpretationsAndDetailsToggler.js +15 -21
- package/build/es/components/Toolbar/Toolbar.js +10 -16
- package/build/es/components/Toolbar/ToolbarSidebar.js +12 -18
- package/build/es/components/Toolbar/UpdateButton.js +18 -24
- package/build/es/components/TransferOption.js +14 -15
- package/build/es/components/TranslationDialog/TranslationModal/LocalesSelect.js +19 -27
- package/build/es/components/TranslationDialog/TranslationModal/TranslationForm.js +16 -23
- package/build/es/components/TranslationDialog/TranslationModal/TranslationModal.js +7 -8
- package/build/es/components/TranslationDialog/TranslationModal/TranslationModalActions.js +18 -27
- package/build/es/components/TranslationDialog/TranslationModal/__tests__/TranslationModal.spec.js +49 -0
- package/build/es/components/TranslationDialog/TranslationModal/useTranslationsResults.js +3 -4
- package/build/es/components/UserMention/UserList.js +6 -7
- package/build/es/components/UserMention/UserMentionWrapper.js +12 -18
- package/build/es/components/UserMention/useUserSearchResults.js +12 -16
- package/build/es/components/VisTypeIcon.js +5 -6
- package/build/es/locales/ar_IQ/translations.json +20 -11
- package/build/es/locales/cs/translations.json +2 -0
- package/build/es/locales/en/translations.json +1 -0
- package/build/es/locales/es/translations.json +2 -0
- package/build/es/locales/fr/translations.json +2 -0
- package/build/es/locales/id/translations.json +20 -11
- package/build/es/locales/lo/translations.json +2 -0
- package/build/es/locales/nb/translations.json +2 -0
- package/build/es/locales/prs/translations.json +2 -0
- package/build/es/locales/ps/translations.json +2 -0
- package/build/es/locales/pt/translations.json +2 -0
- package/build/es/locales/pt_BR/translations.json +2 -0
- package/build/es/locales/ru/translations.json +2 -0
- package/build/es/locales/si/translations.json +20 -11
- package/build/es/locales/sv/translations.json +20 -11
- package/build/es/locales/tet/translations.json +20 -11
- package/build/es/locales/tg/translations.json +2 -0
- package/build/es/locales/uk/translations.json +2 -0
- package/build/es/locales/ur/translations.json +2 -0
- package/build/es/locales/uz_UZ_Cyrl/translations.json +2 -0
- package/build/es/locales/uz_UZ_Latn/translations.json +4 -2
- package/build/es/locales/vi/translations.json +2 -0
- package/build/es/locales/zh/translations.json +2 -0
- package/build/es/locales/zh_CN/translations.json +17 -15
- package/build/es/modules/__tests__/expressions.spec.js +4 -5
- package/build/es/modules/__tests__/isNumeric.spec.js +31 -0
- package/build/es/modules/dimensionListItem.js +4 -5
- package/build/es/modules/expressions.js +3 -9
- package/build/es/modules/getPWAInstallationStatus.js +7 -9
- package/build/es/modules/layout/dimensionCreate.js +1 -3
- package/build/es/modules/layout/dimensionIsValid.js +3 -4
- package/build/es/modules/legends.js +5 -6
- package/build/es/modules/outliers/index.js +2 -3
- package/build/es/modules/outliers/iqr.js +4 -6
- package/build/es/modules/outliers/modZScore.js +6 -14
- package/build/es/modules/outliers/zScore.js +3 -4
- package/build/es/modules/pivotTable/AdaptiveClippingController.js +12 -16
- package/build/es/modules/pivotTable/PivotTableEngine.js +48 -59
- package/build/es/modules/pivotTable/clipAxis.js +7 -8
- package/build/es/modules/pivotTable/clipPartitionedAxis.js +9 -10
- package/build/es/modules/pivotTable/getHeaderForDisplay.js +8 -9
- package/build/es/modules/pivotTable/measureText.js +7 -9
- package/build/es/modules/pivotTable/useParentSize.js +1 -2
- package/build/es/modules/pivotTable/useScrollPosition.js +1 -2
- package/build/es/modules/pivotTable/useTableClipping.js +6 -7
- package/build/es/modules/relativeItems/index.js +1 -4
- package/build/es/modules/renderValue.js +1 -2
- package/build/es/modules/utils.js +9 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +3 -8
- package/build/es/visualizations/config/adapters/dhis_highcharts/axis.js +2 -5
- package/build/es/visualizations/config/adapters/dhis_highcharts/customAxes.js +2 -5
- package/build/es/visualizations/config/adapters/dhis_highcharts/customSVGOptions/index.js +7 -8
- package/build/es/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/getSingleValueBackgroundColor.js +1 -2
- package/build/es/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/index.js +6 -7
- package/build/es/visualizations/config/adapters/dhis_highcharts/getFormatter.js +1 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/getSteps.js +1 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +3 -4
- package/build/es/visualizations/config/adapters/dhis_highcharts/index.js +7 -8
- package/build/es/visualizations/config/adapters/dhis_highcharts/legend.js +6 -7
- package/build/es/visualizations/config/adapters/dhis_highcharts/legendSet.js +22 -26
- package/build/es/visualizations/config/adapters/dhis_highcharts/plotOptions.js +8 -9
- package/build/es/visualizations/config/adapters/dhis_highcharts/series/index.js +18 -20
- package/build/es/visualizations/config/adapters/dhis_highcharts/series/pie.js +1 -4
- package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +1 -3
- package/build/es/visualizations/config/index.js +11 -12
- package/build/es/visualizations/config/validators/dhis/index.js +3 -4
- package/build/es/visualizations/index.js +1 -4
- package/build/es/visualizations/store/adapters/dhis_highcharts/index.js +7 -8
- package/build/es/visualizations/store/index.js +15 -17
- package/build/es/visualizations/store/validators/dhis/index.js +5 -6
- package/build/es/visualizations/util/getFilterText.js +3 -6
- package/build/es/visualizations/util/shouldUseContrastColor.js +1 -2
- package/package.json +12 -12
|
@@ -6,15 +6,14 @@ const headerStacksAreEqual = (a, b, limit) => {
|
|
|
6
6
|
}
|
|
7
7
|
return true;
|
|
8
8
|
};
|
|
9
|
-
export const getHeaderForDisplay =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} = _ref;
|
|
9
|
+
export const getHeaderForDisplay = ({
|
|
10
|
+
start,
|
|
11
|
+
count,
|
|
12
|
+
index,
|
|
13
|
+
dimensionLevel,
|
|
14
|
+
getHeader,
|
|
15
|
+
showHierarchy
|
|
16
|
+
}) => {
|
|
18
17
|
const header = getHeader(index);
|
|
19
18
|
const showHeader = index === start || !headerStacksAreEqual(header, getHeader(index - 1), dimensionLevel);
|
|
20
19
|
if (!showHeader) {
|
|
@@ -8,19 +8,17 @@ const getContext = fontSize => {
|
|
|
8
8
|
ctx.font = `${fontSize}px Roboto, Arial, sans-serif`;
|
|
9
9
|
return ctx;
|
|
10
10
|
};
|
|
11
|
-
const measureText =
|
|
12
|
-
let fontSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 11;
|
|
11
|
+
const measureText = (text, fontSize = 11) => {
|
|
13
12
|
const ctx = getContext(fontSize);
|
|
14
13
|
const textMetrics = ctx.measureText(text);
|
|
15
14
|
return textMetrics.width;
|
|
16
15
|
};
|
|
17
|
-
export const measureTextWithWrapping = (text,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = _ref;
|
|
16
|
+
export const measureTextWithWrapping = (text, {
|
|
17
|
+
fontSize = 11,
|
|
18
|
+
maxWidth = CLIPPED_CELL_MAX_SIZE,
|
|
19
|
+
justifyBuffer = WRAPPED_TEXT_JUSTIFY_BUFFER,
|
|
20
|
+
lineHeight = WRAPPED_TEXT_LINE_HEIGHT
|
|
21
|
+
}) => {
|
|
24
22
|
if (!text) {
|
|
25
23
|
return {
|
|
26
24
|
width: 0,
|
|
@@ -4,8 +4,7 @@ const initialState = {
|
|
|
4
4
|
width: 0,
|
|
5
5
|
height: 0
|
|
6
6
|
};
|
|
7
|
-
export const useParentSize =
|
|
8
|
-
let initialSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : initialState;
|
|
7
|
+
export const useParentSize = (elementRef, renderCounter, initialSize = initialState) => {
|
|
9
8
|
const [size, setSize] = useState({
|
|
10
9
|
width: initialSize.width || 0,
|
|
11
10
|
height: initialSize.height || 0
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import debounce from 'lodash/debounce';
|
|
2
2
|
import { useState, useCallback, useEffect } from 'react';
|
|
3
|
-
export const useScrollPosition =
|
|
4
|
-
let debounceWait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
|
|
3
|
+
export const useScrollPosition = (containerRef, debounceWait = 10) => {
|
|
5
4
|
const [scrollPosition, setScrollPosition] = useState({
|
|
6
5
|
x: 0,
|
|
7
6
|
y: 0
|
|
@@ -2,13 +2,12 @@ import { useMemo } from 'react';
|
|
|
2
2
|
import { clipPartitionedAxis } from './clipPartitionedAxis.js';
|
|
3
3
|
import { CLIPPED_AXIS_PARTITION_SIZE_PX } from './pivotTableConstants.js';
|
|
4
4
|
import { useScrollPosition } from './useScrollPosition.js';
|
|
5
|
-
export const useTableClipping =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} = _ref;
|
|
5
|
+
export const useTableClipping = ({
|
|
6
|
+
containerRef,
|
|
7
|
+
width,
|
|
8
|
+
height,
|
|
9
|
+
engine
|
|
10
|
+
}) => {
|
|
12
11
|
const scrollPosition = useScrollPosition(containerRef);
|
|
13
12
|
const lineHeight = engine.fontSize + engine.cellPadding * 2 + 2;
|
|
14
13
|
const rows = useMemo(() => {
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { getRelativePeriodIds } from '../../components/PeriodDimension/utils/relativePeriods.js';
|
|
2
2
|
import { ouIdHelper, USER_ORG_UNIT, USER_ORG_UNIT_CHILDREN, USER_ORG_UNIT_GRANDCHILDREN } from '../ouIdHelper/index.js';
|
|
3
3
|
import { DIMENSION_ID_ASSIGNED_CATEGORIES, DIMENSION_ID_ORGUNIT, DIMENSION_ID_PERIOD } from '../predefinedDimensions.js';
|
|
4
|
-
export const hasRelativeItems =
|
|
5
|
-
let itemIds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
6
|
-
return dimension === DIMENSION_ID_ASSIGNED_CATEGORIES || dimension === DIMENSION_ID_ORGUNIT && Array.isArray(itemIds) && itemIds.some(id => ouIdHelper.hasLevelPrefix(id) || ouIdHelper.hasGroupPrefix(id) || [USER_ORG_UNIT, USER_ORG_UNIT_CHILDREN, USER_ORG_UNIT_GRANDCHILDREN].includes(id)) || dimension === DIMENSION_ID_PERIOD && Array.isArray(itemIds) && itemIds.some(id => getRelativePeriodIds().includes(id));
|
|
7
|
-
};
|
|
4
|
+
export const hasRelativeItems = (dimension, itemIds = []) => dimension === DIMENSION_ID_ASSIGNED_CATEGORIES || dimension === DIMENSION_ID_ORGUNIT && Array.isArray(itemIds) && itemIds.some(id => ouIdHelper.hasLevelPrefix(id) || ouIdHelper.hasGroupPrefix(id) || [USER_ORG_UNIT, USER_ORG_UNIT_CHILDREN, USER_ORG_UNIT_GRANDCHILDREN].includes(id)) || dimension === DIMENSION_ID_PERIOD && Array.isArray(itemIds) && itemIds.some(id => getRelativePeriodIds().includes(id));
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { NUMBER_TYPE_ROW_PERCENTAGE, NUMBER_TYPE_COLUMN_PERCENTAGE } from './pivotTable/pivotTableConstants.js';
|
|
2
2
|
import { isNumericValueType, isBooleanValueType } from './valueTypes.js';
|
|
3
3
|
const trimTrailingZeros = stringValue => stringValue.replace(/\.?0+$/, '');
|
|
4
|
-
export const separateDigitGroups =
|
|
5
|
-
let decimalSeparator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '.';
|
|
4
|
+
export const separateDigitGroups = (stringValue, decimalSeparator = '.') => {
|
|
6
5
|
const isNegative = stringValue[0] === '-';
|
|
7
6
|
const [integer, remainder] = stringValue.replace(/^-/, '').split('.');
|
|
8
7
|
const groups = [];
|
|
@@ -20,4 +20,12 @@ export const useDidUpdateEffect = (fn, inputs) => {
|
|
|
20
20
|
didMountRef.current = true;
|
|
21
21
|
}
|
|
22
22
|
}, inputs);
|
|
23
|
-
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Check if a value is numeric
|
|
27
|
+
*
|
|
28
|
+
* @param param Value to be checked
|
|
29
|
+
* @returns {boolean} Returns true when the `param` is a numeric value
|
|
30
|
+
*/
|
|
31
|
+
export const isNumeric = param => typeof param !== 'symbol' && !isNaN(parseFloat(param)) && isFinite(param);
|
|
@@ -188,8 +188,7 @@ function gaussianElimination(a, o) {
|
|
|
188
188
|
// N * Σ(X^2) - Σ(X)^2
|
|
189
189
|
//
|
|
190
190
|
// correlation = N * Σ(XY) - Σ(X) * Σ (Y) / √ ( N * Σ(X^2) - Σ(X) ) * ( N * Σ(Y^2) - Σ(Y)^2 ) ) )
|
|
191
|
-
export function linear(data) {
|
|
192
|
-
let decimalPlaces = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
191
|
+
export function linear(data, decimalPlaces = 2) {
|
|
193
192
|
const sum = [0, 0, 0, 0, 0],
|
|
194
193
|
results = [];
|
|
195
194
|
let N = data.length;
|
|
@@ -238,10 +237,7 @@ export function linear(data) {
|
|
|
238
237
|
}
|
|
239
238
|
|
|
240
239
|
// Code extracted from https://github.com/Tom-Alexander/regression-js/
|
|
241
|
-
function polynomial(data) {
|
|
242
|
-
let order = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
243
|
-
let extrapolate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
244
|
-
let decimalPlaces = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2;
|
|
240
|
+
function polynomial(data, order = 2, extrapolate = 0, decimalPlaces = 2) {
|
|
245
241
|
const lhs = [],
|
|
246
242
|
rhs = [],
|
|
247
243
|
results = [],
|
|
@@ -322,8 +318,7 @@ function polynomial(data) {
|
|
|
322
318
|
// Based on
|
|
323
319
|
// - http://commons.apache.org/proper/commons-math/download_math.cgi LoesInterpolator.java
|
|
324
320
|
// - https://gist.github.com/avibryant/1151823
|
|
325
|
-
function loess(data) {
|
|
326
|
-
let bandwidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.25;
|
|
321
|
+
function loess(data, bandwidth = 0.25) {
|
|
327
322
|
const xval = data.map(pair => {
|
|
328
323
|
return pair[0];
|
|
329
324
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import isNumeric from 'd2-utilizr/lib/isNumeric';
|
|
2
1
|
import isString from 'd2-utilizr/lib/isString';
|
|
3
2
|
import objectClean from 'd2-utilizr/lib/objectClean';
|
|
4
3
|
import { FONT_STYLE_AXIS_LABELS, FONT_STYLE_REGRESSION_LINE_LABEL, FONT_STYLE_OPTION_TEXT_COLOR, FONT_STYLE_OPTION_FONT_SIZE, FONT_STYLE_OPTION_BOLD, FONT_STYLE_OPTION_ITALIC, FONT_STYLE_OPTION_TEXT_ALIGN, TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, TEXT_ALIGN_RIGHT, mergeFontStyleWithDefault } from '../../../../modules/fontStyle.js';
|
|
4
|
+
import { isNumeric } from '../../../../modules/utils.js';
|
|
5
5
|
import { isVerticalType } from '../../../../modules/visTypes.js';
|
|
6
6
|
import getFormatter from './getFormatter.js';
|
|
7
7
|
import { getTextAlignOption } from './getTextAlignOption.js';
|
|
@@ -68,11 +68,8 @@ export const getMaxValue = (maxValue, dataValues, outlierLineMax) => {
|
|
|
68
68
|
}
|
|
69
69
|
return dataValues !== null && dataValues !== void 0 && dataValues.every(value => value < DEFAULT_MIN_VALUE) ? DEFAULT_MIN_VALUE : undefined;
|
|
70
70
|
};
|
|
71
|
-
export const getRegressionLine =
|
|
71
|
+
export const getRegressionLine = (regressionLine = {}, visType, isVertical) => {
|
|
72
72
|
var _regressionLine$title, _regressionLine$title2;
|
|
73
|
-
let regressionLine = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
74
|
-
let visType = arguments.length > 1 ? arguments[1] : undefined;
|
|
75
|
-
let isVertical = arguments.length > 2 ? arguments[2] : undefined;
|
|
76
73
|
const fontStyle = mergeFontStyleWithDefault((_regressionLine$title = regressionLine.title) === null || _regressionLine$title === void 0 ? void 0 : _regressionLine$title.fontStyle, FONT_STYLE_REGRESSION_LINE_LABEL);
|
|
77
74
|
const plotLineStyle = getPlotLineStyle(fontStyle);
|
|
78
75
|
const plotLineLabelStyle = getPlotLineLabelStyle(fontStyle);
|
|
@@ -12,9 +12,7 @@ export function getIdAxisMap(customAxes) {
|
|
|
12
12
|
return map;
|
|
13
13
|
}, {});
|
|
14
14
|
}
|
|
15
|
-
export function getFullIdAxisMap() {
|
|
16
|
-
let customAxes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
17
|
-
let series = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
15
|
+
export function getFullIdAxisMap(customAxes = [], series = []) {
|
|
18
16
|
const idAxisMap = getIdAxisMap(customAxes.filter(axisItem => series.find(seriesItem => seriesItem.id === axisItem.dimensionItem)));
|
|
19
17
|
|
|
20
18
|
// adds first axis ids to seriesAxisMap
|
|
@@ -33,8 +31,7 @@ export function getFullIdAxisMap() {
|
|
|
33
31
|
// }
|
|
34
32
|
export function getAxisIdsMap(customAxes, series) {
|
|
35
33
|
const fullIdAxisMap = getFullIdAxisMap(customAxes, series);
|
|
36
|
-
return Object.entries(fullIdAxisMap).reduce((map,
|
|
37
|
-
let [id, axis] = _ref;
|
|
34
|
+
return Object.entries(fullIdAxisMap).reduce((map, [id, axis]) => {
|
|
38
35
|
if (!(axis in map)) {
|
|
39
36
|
map[axis] = [];
|
|
40
37
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { VIS_TYPE_SINGLE_VALUE } from '../../../../../modules/visTypes.js';
|
|
2
2
|
import getSingleValueCustomSVGOptions from './singleValue/index.js';
|
|
3
|
-
export default function getCustomSVGOptions(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} = _ref;
|
|
3
|
+
export default function getCustomSVGOptions({
|
|
4
|
+
extraConfig,
|
|
5
|
+
layout,
|
|
6
|
+
extraOptions,
|
|
7
|
+
metaData,
|
|
8
|
+
series
|
|
9
|
+
}) {
|
|
11
10
|
const baseOptions = {
|
|
12
11
|
visualizationType: layout.type
|
|
13
12
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { LEGEND_DISPLAY_STYLE_FILL } from '../../../../../../modules/legends.js';
|
|
2
2
|
import { getSingleValueLegendColor } from './getSingleValueLegendColor.js';
|
|
3
|
-
export function getSingleValueBackgroundColor(legendOptions, legendSets, value) {
|
|
4
|
-
let defaultColor = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'transparent';
|
|
3
|
+
export function getSingleValueBackgroundColor(legendOptions, legendSets, value, defaultColor = 'transparent') {
|
|
5
4
|
const legendColor = getSingleValueLegendColor(legendOptions, legendSets, value);
|
|
6
5
|
return legendColor && legendOptions.style === LEGEND_DISPLAY_STYLE_FILL ? legendColor : defaultColor;
|
|
7
6
|
}
|
|
@@ -2,13 +2,12 @@ import { colors } from '@dhis2/ui';
|
|
|
2
2
|
import { getSingleValueFormattedValue } from './getSingleValueFormattedValue.js';
|
|
3
3
|
import { getSingleValueSubtext } from './getSingleValueSubtext.js';
|
|
4
4
|
import { getSingleValueTextColor } from './getSingleValueTextColor.js';
|
|
5
|
-
export default function getSingleValueCustomSVGOptions(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} = _ref;
|
|
5
|
+
export default function getSingleValueCustomSVGOptions({
|
|
6
|
+
layout,
|
|
7
|
+
extraOptions,
|
|
8
|
+
metaData,
|
|
9
|
+
series
|
|
10
|
+
}) {
|
|
12
11
|
const {
|
|
13
12
|
dashboard,
|
|
14
13
|
icon
|
|
@@ -14,10 +14,9 @@ function getEmptySeriesIndexes(series) {
|
|
|
14
14
|
let seriesValues;
|
|
15
15
|
series[0].data.forEach((value, index) => {
|
|
16
16
|
seriesValues = [];
|
|
17
|
-
series.forEach(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} = _ref;
|
|
17
|
+
series.forEach(({
|
|
18
|
+
data
|
|
19
|
+
}) => {
|
|
21
20
|
// handle undefined values due to empty (or shorter) serie data
|
|
22
21
|
// preserve 0 as valid value
|
|
23
22
|
seriesValues.push(data[index] === undefined ? null : data[index]);
|
|
@@ -33,15 +33,14 @@ const getTransformedExtraOptions = extraOptions => ({
|
|
|
33
33
|
...extraOptions,
|
|
34
34
|
multiAxisTheme: extraOptions.multiAxisTheme || defaultMultiAxisTheme1
|
|
35
35
|
});
|
|
36
|
-
export default function (
|
|
36
|
+
export default function ({
|
|
37
|
+
store,
|
|
38
|
+
layout,
|
|
39
|
+
el,
|
|
40
|
+
extraConfig,
|
|
41
|
+
extraOptions
|
|
42
|
+
}) {
|
|
37
43
|
var _layout$legend, _layout$seriesKey, _layout$seriesKey2, _layout$seriesKey2$la, _config$xAxis;
|
|
38
|
-
let {
|
|
39
|
-
store,
|
|
40
|
-
layout,
|
|
41
|
-
el,
|
|
42
|
-
extraConfig,
|
|
43
|
-
extraOptions
|
|
44
|
-
} = _ref;
|
|
45
44
|
const _layout = getTransformedLayout(layout);
|
|
46
45
|
const _extraOptions = getTransformedExtraOptions(extraOptions);
|
|
47
46
|
const stacked = isStacked(_layout.type);
|
|
@@ -27,13 +27,12 @@ function getLegend(fontStyle, dashboard, visType) {
|
|
|
27
27
|
align: getTextAlignOption(fontStyle[FONT_STYLE_OPTION_TEXT_ALIGN], FONT_STYLE_LEGEND, isVerticalType(visType))
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
-
export default function (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} = _ref;
|
|
30
|
+
export default function ({
|
|
31
|
+
isHidden,
|
|
32
|
+
fontStyle,
|
|
33
|
+
visType,
|
|
34
|
+
dashboard
|
|
35
|
+
}) {
|
|
37
36
|
const mergedFontStyle = mergeFontStyleWithDefault(fontStyle, FONT_STYLE_LEGEND);
|
|
38
37
|
return isHidden || visType === VIS_TYPE_SCATTER ? {
|
|
39
38
|
enabled: false
|
|
@@ -1,33 +1,29 @@
|
|
|
1
|
-
import isNumeric from 'd2-utilizr/lib/isNumeric';
|
|
2
1
|
import i18n from '../../../../locales/index.js';
|
|
3
2
|
import { getLegendByValueFromLegendSet } from '../../../../modules/legends.js';
|
|
3
|
+
import { isNumeric } from '../../../../modules/utils.js';
|
|
4
4
|
const OUT_OF_BOUNDS_COLOR = '#CCCCCC';
|
|
5
5
|
const getLegend = (value, legendSet) => value && legendSet ? getLegendByValueFromLegendSet(legendSet, value) : {};
|
|
6
|
-
export const applyLegendSet =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
?
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
?
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})
|
|
28
|
-
} : {
|
|
29
|
-
...seriesObj
|
|
30
|
-
};
|
|
6
|
+
export const applyLegendSet = (seriesObj = {}, legendSet) => !seriesObj.type ? {
|
|
7
|
+
...seriesObj,
|
|
8
|
+
data: seriesObj.data.map(value => {
|
|
9
|
+
var _getLegend, _getLegend2, _getLegend3, _getLegend4;
|
|
10
|
+
return isNumeric(value) // Single category pass data as [value1, value2]
|
|
11
|
+
? {
|
|
12
|
+
y: value,
|
|
13
|
+
color: ((_getLegend = getLegend(value, legendSet)) === null || _getLegend === void 0 ? void 0 : _getLegend.color) || OUT_OF_BOUNDS_COLOR,
|
|
14
|
+
legend: ((_getLegend2 = getLegend(value, legendSet)) === null || _getLegend2 === void 0 ? void 0 : _getLegend2.name) || '-',
|
|
15
|
+
legendSet: legendSet.name
|
|
16
|
+
} : Array.isArray(value) // Dual category pass data as [[position1, value1], [position2, value2]]
|
|
17
|
+
? {
|
|
18
|
+
x: value[0],
|
|
19
|
+
y: value[1],
|
|
20
|
+
color: ((_getLegend3 = getLegend(value[1], legendSet)) === null || _getLegend3 === void 0 ? void 0 : _getLegend3.color) || OUT_OF_BOUNDS_COLOR,
|
|
21
|
+
legend: ((_getLegend4 = getLegend(value[1], legendSet)) === null || _getLegend4 === void 0 ? void 0 : _getLegend4.name) || '-',
|
|
22
|
+
legendSet: legendSet.name
|
|
23
|
+
} : value;
|
|
24
|
+
})
|
|
25
|
+
} : {
|
|
26
|
+
...seriesObj
|
|
31
27
|
};
|
|
32
28
|
export const getLegendSetTooltip = () => ({
|
|
33
29
|
pointFormatter: function () {
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import i18n from '../../../../locales/index.js';
|
|
2
2
|
import { VIS_TYPE_COLUMN, VIS_TYPE_SCATTER, VIS_TYPE_STACKED_COLUMN, VIS_TYPE_BAR, VIS_TYPE_STACKED_BAR } from '../../../../modules/visTypes.js';
|
|
3
3
|
const MAX_LABELS = 10;
|
|
4
|
-
export default
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} = _ref;
|
|
4
|
+
export default ({
|
|
5
|
+
visType,
|
|
6
|
+
xAxisName,
|
|
7
|
+
yAxisName,
|
|
8
|
+
showLabels,
|
|
9
|
+
tooltipData,
|
|
10
|
+
onClick
|
|
11
|
+
}) => {
|
|
13
12
|
const series = {
|
|
14
13
|
dataLabels: {
|
|
15
14
|
enabled: showLabels,
|
|
@@ -65,16 +65,15 @@ function getIdColorMap(series, layout, extraOptions) {
|
|
|
65
65
|
}, {});
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
function getDefault(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
} = _ref;
|
|
68
|
+
function getDefault({
|
|
69
|
+
series,
|
|
70
|
+
metaData,
|
|
71
|
+
layout,
|
|
72
|
+
isStacked,
|
|
73
|
+
extraOptions,
|
|
74
|
+
legendSets,
|
|
75
|
+
displayStrategy
|
|
76
|
+
}) {
|
|
78
77
|
const fullIdAxisMap = getFullIdAxisMap(layout.series, series);
|
|
79
78
|
const idColorMap = getIdColorMap(series, layout, extraOptions);
|
|
80
79
|
const indexColorPatternMap = getIndexColorPatternMap(series, layout, extraOptions);
|
|
@@ -152,17 +151,16 @@ function getDefault(_ref) {
|
|
|
152
151
|
}
|
|
153
152
|
return series;
|
|
154
153
|
}
|
|
155
|
-
export default function (
|
|
154
|
+
export default function ({
|
|
155
|
+
series,
|
|
156
|
+
metaData,
|
|
157
|
+
layout,
|
|
158
|
+
isStacked,
|
|
159
|
+
extraOptions,
|
|
160
|
+
legendSets,
|
|
161
|
+
displayStrategy
|
|
162
|
+
}) {
|
|
156
163
|
var _series;
|
|
157
|
-
let {
|
|
158
|
-
series,
|
|
159
|
-
metaData,
|
|
160
|
-
layout,
|
|
161
|
-
isStacked,
|
|
162
|
-
extraOptions,
|
|
163
|
-
legendSets,
|
|
164
|
-
displayStrategy
|
|
165
|
-
} = _ref2;
|
|
166
164
|
switch (layout.type) {
|
|
167
165
|
case VIS_TYPE_SINGLE_VALUE:
|
|
168
166
|
series = [];
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { separateDigitGroups } from '../../../../../modules/renderValue.js';
|
|
2
|
-
export const formatDataLabel =
|
|
3
|
-
let name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
4
|
-
let y = arguments.length > 1 ? arguments[1] : undefined;
|
|
5
|
-
let percentage = arguments.length > 2 ? arguments[2] : undefined;
|
|
2
|
+
export const formatDataLabel = (name = '', y, percentage) => {
|
|
6
3
|
const value = separateDigitGroups(y.toString()).join(' ');
|
|
7
4
|
return '<span style="font-weight:normal">' + name + '</span><br/>' + value + '<span style="font-weight:normal"> (' + parseFloat(percentage.toFixed(1)) + '%)</span>';
|
|
8
5
|
};
|
|
@@ -23,10 +23,8 @@ const getLabelOffsetFromTextAlign = textAlign => {
|
|
|
23
23
|
return 0;
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
function getPlotLine() {
|
|
26
|
+
function getPlotLine(regressionLine = {}, defaultLabel) {
|
|
27
27
|
var _regressionLine$title, _regressionLine$title2;
|
|
28
|
-
let regressionLine = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
29
|
-
let defaultLabel = arguments.length > 1 ? arguments[1] : undefined;
|
|
30
28
|
const value = regressionLine.value;
|
|
31
29
|
if (!isNumber(value)) {
|
|
32
30
|
return null;
|
|
@@ -3,18 +3,17 @@ import { theme1 } from '../util/colors/index.js';
|
|
|
3
3
|
import adapters from './adapters/index.js';
|
|
4
4
|
import generators from './generators/index.js';
|
|
5
5
|
import validators from './validators/index.js';
|
|
6
|
-
export default function (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} = _ref;
|
|
6
|
+
export default function ({
|
|
7
|
+
store,
|
|
8
|
+
layout,
|
|
9
|
+
el,
|
|
10
|
+
inputFormat = 'dhis',
|
|
11
|
+
outputFormat = 'highcharts',
|
|
12
|
+
extraLayout,
|
|
13
|
+
extraOptions,
|
|
14
|
+
onError,
|
|
15
|
+
onWarning
|
|
16
|
+
}) {
|
|
18
17
|
const _validator = validators[inputFormat] || validators.noValidation;
|
|
19
18
|
const _adapter = adapters[inputFormat + '_' + outputFormat];
|
|
20
19
|
const _generator = generators[outputFormat];
|
|
@@ -7,10 +7,7 @@ const defaultError = error => {
|
|
|
7
7
|
const defaultWarning = warning => {
|
|
8
8
|
console.log(warning);
|
|
9
9
|
};
|
|
10
|
-
function createVisualization(data, layout, el, extraOptions) {
|
|
11
|
-
let error = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : defaultError;
|
|
12
|
-
let warning = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : defaultWarning;
|
|
13
|
-
let outputFormat = arguments.length > 6 ? arguments[6] : undefined;
|
|
10
|
+
function createVisualization(data, layout, el, extraOptions, error = defaultError, warning = defaultWarning, outputFormat) {
|
|
14
11
|
const _data = isArray(data) ? data : [data];
|
|
15
12
|
const store = new Store({
|
|
16
13
|
data: _data,
|
|
@@ -77,14 +77,13 @@ function getSeriesFunction(type, categoryIds) {
|
|
|
77
77
|
return getDefault;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
export default function (
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
} = _ref;
|
|
80
|
+
export default function ({
|
|
81
|
+
type,
|
|
82
|
+
data,
|
|
83
|
+
seriesId,
|
|
84
|
+
categoryIds,
|
|
85
|
+
extraOptions
|
|
86
|
+
}) {
|
|
88
87
|
categoryIds = categoryIds || [];
|
|
89
88
|
const seriesFunction = getSeriesFunction(type, categoryIds);
|
|
90
89
|
return data.reduce((acc, res) => {
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import adapters from './adapters/index.js';
|
|
2
2
|
import validators from './validators/index.js';
|
|
3
|
-
export default function (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} = _ref;
|
|
3
|
+
export default function ({
|
|
4
|
+
data,
|
|
5
|
+
inputFormat = 'dhis',
|
|
6
|
+
outputFormat = 'highcharts',
|
|
7
|
+
seriesId: initialSeriesId,
|
|
8
|
+
categoryId: initialCategoryId,
|
|
9
|
+
error,
|
|
10
|
+
warning
|
|
11
|
+
}) {
|
|
13
12
|
const _validator = validators[inputFormat] || validators.noValidation;
|
|
14
13
|
const _adapter = adapters[inputFormat + '_' + outputFormat];
|
|
15
14
|
if (_validator === validators.noValidation) {
|
|
@@ -19,13 +18,12 @@ export default function (_ref) {
|
|
|
19
18
|
error(`Data tranformation from "${inputFormat}" to "${outputFormat}" is not supported`);
|
|
20
19
|
}
|
|
21
20
|
this.data = data;
|
|
22
|
-
this.generateData =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} = _ref2;
|
|
21
|
+
this.generateData = ({
|
|
22
|
+
type,
|
|
23
|
+
seriesId = initialSeriesId,
|
|
24
|
+
categoryIds = [initialCategoryId],
|
|
25
|
+
extraOptions = {}
|
|
26
|
+
}) => {
|
|
29
27
|
return _adapter({
|
|
30
28
|
type,
|
|
31
29
|
data: data.map(d => _validator({
|
|
@@ -29,12 +29,11 @@ function validateRow(row, headersLength, error) {
|
|
|
29
29
|
}
|
|
30
30
|
row.forEach(rowValue => validateRowValue(rowValue, error));
|
|
31
31
|
}
|
|
32
|
-
export default function (
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} = _ref;
|
|
32
|
+
export default function ({
|
|
33
|
+
data,
|
|
34
|
+
error,
|
|
35
|
+
warning
|
|
36
|
+
}) {
|
|
38
37
|
if (!isObject(data)) {
|
|
39
38
|
error(getMessage('Data is not an object'));
|
|
40
39
|
}
|