@dhis2/analytics 28.0.3 → 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 +1 -2
- package/build/cjs/__demo__/Filter.stories.js +1 -2
- package/build/cjs/__demo__/FixedPeriodSelect.stories.js +1 -2
- package/build/cjs/__demo__/OrgUnitDimension.stories.js +1 -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 +7 -9
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModalActions.js +18 -27
- 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__/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 +6 -7
- package/build/es/components/TranslationDialog/TranslationModal/TranslationModalActions.js +18 -27
- 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
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"All available items are already selected": "",
|
|
109
109
|
"Calculation": "",
|
|
110
110
|
"Metric type": "",
|
|
111
|
-
"All metrics": "",
|
|
111
|
+
"All metrics": "所有尺度",
|
|
112
112
|
"No items selected": "",
|
|
113
113
|
"No indicators found": "",
|
|
114
114
|
"No data sets found": "",
|
|
@@ -126,19 +126,19 @@
|
|
|
126
126
|
"Add to {{axisName}}": "添加到 {{axisName}}",
|
|
127
127
|
"Not available for {{visualizationType}}": "",
|
|
128
128
|
"Remove Assigned Categories": "",
|
|
129
|
-
"Add Assigned Categories": "",
|
|
129
|
+
"Add Assigned Categories": "添加指定的分类",
|
|
130
130
|
"Remove": "移除",
|
|
131
131
|
"Filter dimensions": "过滤器维度",
|
|
132
132
|
"Main dimensions": "主要维度",
|
|
133
133
|
"Your dimensions": "你的维度",
|
|
134
134
|
"Dimension recommended with selected data": "",
|
|
135
|
-
"All items": "",
|
|
135
|
+
"All items": "所有条目",
|
|
136
136
|
"Automatically include all items": "",
|
|
137
137
|
"Select all {{- dimensionTitle}} items. With this option, new items added in the future will be automatically included.": "",
|
|
138
138
|
"Manually select items...": "",
|
|
139
139
|
"Nothing found in {{- dimensionTitle}}": "",
|
|
140
140
|
"Search": "搜索",
|
|
141
|
-
"Delete {{fileType}}": "",
|
|
141
|
+
"Delete {{fileType}}": "删除{{fileType}}",
|
|
142
142
|
"This {{fileType}} and related interpretations will be deleted. Continue?": "",
|
|
143
143
|
"Delete": "删除",
|
|
144
144
|
"File": "文件",
|
|
@@ -161,6 +161,7 @@
|
|
|
161
161
|
"line list": "",
|
|
162
162
|
"map": "",
|
|
163
163
|
"visualization": "",
|
|
164
|
+
"Untitled {{visualizationType}}, {{date}}": "",
|
|
164
165
|
"Edit": "编辑",
|
|
165
166
|
"Write a reply": "",
|
|
166
167
|
"Post reply": "",
|
|
@@ -179,7 +180,7 @@
|
|
|
179
180
|
"Reply": "回复",
|
|
180
181
|
"{{count}} replies": "",
|
|
181
182
|
"View replies": "",
|
|
182
|
-
"Unlike": "",
|
|
183
|
+
"Unlike": "不喜欢",
|
|
183
184
|
"Like": "Like",
|
|
184
185
|
"See interpretation": "",
|
|
185
186
|
"Open in app": "",
|
|
@@ -187,7 +188,7 @@
|
|
|
187
188
|
"Manage sharing": "",
|
|
188
189
|
"Could not update interpretation": "",
|
|
189
190
|
"Enter interpretation text": "",
|
|
190
|
-
"Not available offline": "",
|
|
191
|
+
"Not available offline": "离线不可用",
|
|
191
192
|
"Anyone": "任何人",
|
|
192
193
|
"Only you": "",
|
|
193
194
|
"Others": "其它",
|
|
@@ -240,8 +241,8 @@
|
|
|
240
241
|
"Select year": "选择年份",
|
|
241
242
|
"Period": "周期",
|
|
242
243
|
"Selected Periods": "",
|
|
243
|
-
"Relative periods": "",
|
|
244
|
-
"Fixed periods": "",
|
|
244
|
+
"Relative periods": "相对期间",
|
|
245
|
+
"Fixed periods": "固定期间",
|
|
245
246
|
"No periods selected": "",
|
|
246
247
|
"Daily": "每日",
|
|
247
248
|
"Weekly": "每周",
|
|
@@ -306,8 +307,8 @@
|
|
|
306
307
|
"Weeks": "周",
|
|
307
308
|
"Bi-weeks": "",
|
|
308
309
|
"Months": "月",
|
|
309
|
-
"Bi-months": "",
|
|
310
|
-
"Quarters": "",
|
|
310
|
+
"Bi-months": "俩月",
|
|
311
|
+
"Quarters": "季节",
|
|
311
312
|
"Six-months": "",
|
|
312
313
|
"Financial Years": "",
|
|
313
314
|
"Years": "年",
|
|
@@ -328,12 +329,12 @@
|
|
|
328
329
|
"Save translations": "",
|
|
329
330
|
"Cannot save while offline": "",
|
|
330
331
|
"Could not load translations": "",
|
|
331
|
-
"Retry": "",
|
|
332
|
+
"Retry": "重试",
|
|
332
333
|
"Too many results. Try refining the search.": "",
|
|
333
334
|
"Search for a user": "",
|
|
334
335
|
"Searching for \"{{- searchText}}\"": "",
|
|
335
336
|
"No results found": "没有结果",
|
|
336
|
-
"Series": "",
|
|
337
|
+
"Series": "系列",
|
|
337
338
|
"Category": "分类",
|
|
338
339
|
"Columns": "",
|
|
339
340
|
"Rows": "",
|
|
@@ -379,7 +380,7 @@
|
|
|
379
380
|
"Large": "较大",
|
|
380
381
|
"Extra Large": "",
|
|
381
382
|
"Left": "左",
|
|
382
|
-
"Center": "",
|
|
383
|
+
"Center": "居中",
|
|
383
384
|
"Right": "右",
|
|
384
385
|
"Start": "开始",
|
|
385
386
|
"Middle": "",
|
|
@@ -446,14 +447,15 @@
|
|
|
446
447
|
"Single value": "",
|
|
447
448
|
"Outlier table": "",
|
|
448
449
|
"All charts": "",
|
|
450
|
+
"Map": "地图",
|
|
449
451
|
"{{seriesName}} (trend)": "",
|
|
450
452
|
"Trend": "",
|
|
451
453
|
"No legend for this series": "",
|
|
452
454
|
"and {{amount}} more...": "",
|
|
453
455
|
"Linear Regression": "",
|
|
454
456
|
"Target": "目标",
|
|
455
|
-
"Base": "",
|
|
456
|
-
"Axis {{axisId}}": "",
|
|
457
|
+
"Base": "基",
|
|
458
|
+
"Axis {{axisId}}": "轴{{axisId}}",
|
|
457
459
|
"{{count}} items": "",
|
|
458
460
|
"Reset zoom": ""
|
|
459
461
|
}
|
|
@@ -25,11 +25,10 @@ const invalidTestExpressions = [{
|
|
|
25
25
|
}];
|
|
26
26
|
const validTestExpressions = ['5+9', '((#{cYeuwXTCPkU}*#{Jtf34kNZhzP}))#{iKGjnOOaPlE}', '#{P3jJH5Tu5VC.S34ULMcHMca}*#{Jtf34kNZhzP}', '(5)+9', '(5+9)', '10/-5'];
|
|
27
27
|
describe('validateExpression', () => {
|
|
28
|
-
invalidTestExpressions.forEach(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} = _ref;
|
|
28
|
+
invalidTestExpressions.forEach(({
|
|
29
|
+
expressions,
|
|
30
|
+
message
|
|
31
|
+
}) => {
|
|
33
32
|
expressions.forEach(exp => {
|
|
34
33
|
test(`Fails: ${message}`, () => {
|
|
35
34
|
expect(validateExpression(exp)).toEqual({
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { isNumeric } from '../utils.js';
|
|
2
|
+
describe('isNumeric', () => {
|
|
3
|
+
it('should return true for a number string', () => {
|
|
4
|
+
expect(isNumeric('01')).toBe(true);
|
|
5
|
+
});
|
|
6
|
+
it('should return true for a regular number', () => {
|
|
7
|
+
expect(isNumeric(10)).toBe(true);
|
|
8
|
+
});
|
|
9
|
+
it('should not regard infinity as a numeric', () => {
|
|
10
|
+
expect(isNumeric(Infinity)).toBe(false);
|
|
11
|
+
expect(isNumeric(-Infinity)).toBe(false);
|
|
12
|
+
});
|
|
13
|
+
it('should return false for NaN', () => {
|
|
14
|
+
expect(isNumeric(NaN)).toBe(false);
|
|
15
|
+
});
|
|
16
|
+
it('should return false for things other than numbers', () => {
|
|
17
|
+
expect(isNumeric(null)).toBe(false);
|
|
18
|
+
expect(isNumeric([1, 2, 3])).toBe(false);
|
|
19
|
+
expect(isNumeric(true)).toBe(false);
|
|
20
|
+
expect(isNumeric(new Date())).toBe(false);
|
|
21
|
+
expect(isNumeric(new Error())).toBe(false);
|
|
22
|
+
expect(isNumeric(undefined)).toBe(false);
|
|
23
|
+
expect(isNumeric(() => {})).toBe(false);
|
|
24
|
+
expect(isNumeric({
|
|
25
|
+
a: 1
|
|
26
|
+
})).toBe(false);
|
|
27
|
+
expect(isNumeric(/x/)).toBe(false);
|
|
28
|
+
expect(isNumeric('a')).toBe(false);
|
|
29
|
+
expect(isNumeric(Symbol())).toBe(false);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -6,12 +6,11 @@ import GenericIcon from '../assets/DimensionItemIcons/GenericIcon.js';
|
|
|
6
6
|
import CalculationIcon from './../assets/DimensionItemIcons/CalculationIcon.js';
|
|
7
7
|
import { REPORTING_RATE } from './dataSets.js';
|
|
8
8
|
import { DIMENSION_TYPE_DATA_ELEMENT, DIMENSION_TYPE_DATA_ELEMENT_OPERAND, DIMENSION_TYPE_DATA_SET, DIMENSION_TYPE_EVENT_DATA_ITEM, DIMENSION_TYPE_EXPRESSION_DIMENSION_ITEM, DIMENSION_TYPE_PROGRAM_ATTRIBUTE, DIMENSION_TYPE_PROGRAM_DATA_ELEMENT, dataTypeMap as dataTypes, DIMENSION_TYPE_INDICATOR, DIMENSION_TYPE_PROGRAM_INDICATOR, DIMENSION_TYPE_PROGRAM_ATTRIBUTE_OPTION, DIMENSION_TYPE_PROGRAM_DATA_ELEMENT_OPTION } from './dataTypes.js';
|
|
9
|
-
export const getDimensionType =
|
|
9
|
+
export const getDimensionType = ({
|
|
10
|
+
type,
|
|
11
|
+
expression
|
|
12
|
+
}) => {
|
|
10
13
|
var _dataTypes$type;
|
|
11
|
-
let {
|
|
12
|
-
type,
|
|
13
|
-
expression
|
|
14
|
-
} = _ref;
|
|
15
14
|
if (type === DIMENSION_TYPE_EXPRESSION_DIMENSION_ITEM && expression) {
|
|
16
15
|
return dataTypes[DIMENSION_TYPE_EXPRESSION_DIMENSION_ITEM].getItemName();
|
|
17
16
|
}
|
|
@@ -37,9 +37,7 @@ export const parseExpression = input => {
|
|
|
37
37
|
const regex = /(#{[a-zA-Z0-9#.]+}|[+\-*/()])|(\d+(\.\d+)?)/g;
|
|
38
38
|
return input.match(regex) || [];
|
|
39
39
|
};
|
|
40
|
-
export const parseExpressionToArray =
|
|
41
|
-
let expression = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
42
|
-
let metadata = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
40
|
+
export const parseExpressionToArray = (expression = '', metadata = []) => {
|
|
43
41
|
return parseExpression(expression).map(value => {
|
|
44
42
|
if (value.startsWith('#{') && value.endsWith('}')) {
|
|
45
43
|
var _metadata$find;
|
|
@@ -65,10 +63,7 @@ export const parseExpressionToArray = function () {
|
|
|
65
63
|
};
|
|
66
64
|
}) || [];
|
|
67
65
|
};
|
|
68
|
-
export const parseArrayToExpression =
|
|
69
|
-
let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
70
|
-
return input.map(item => item.value).join('');
|
|
71
|
-
};
|
|
66
|
+
export const parseArrayToExpression = (input = []) => input.map(item => item.value).join('');
|
|
72
67
|
export const validateExpression = expression => {
|
|
73
68
|
let result;
|
|
74
69
|
const leftParenthesisCount = expression.split('(').length - 1;
|
|
@@ -119,8 +114,7 @@ export const validateExpression = expression => {
|
|
|
119
114
|
}
|
|
120
115
|
return result;
|
|
121
116
|
};
|
|
122
|
-
export const getItemIdsFromExpression =
|
|
123
|
-
let expression = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
117
|
+
export const getItemIdsFromExpression = (expression = '') => {
|
|
124
118
|
const regex = /#{([a-zA-Z0-9#]+.*?)}/g;
|
|
125
119
|
const matches = expression.match(regex);
|
|
126
120
|
return matches ? matches.map(match => match.slice(2, -1)) : [];
|
|
@@ -2,11 +2,10 @@ export const INSTALLATION_STATES = {
|
|
|
2
2
|
READY: 'READY',
|
|
3
3
|
INSTALLING: 'INSTALLING'
|
|
4
4
|
};
|
|
5
|
-
function handleInstallingWorker(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} = _ref;
|
|
5
|
+
function handleInstallingWorker({
|
|
6
|
+
installingWorker,
|
|
7
|
+
onStateChange
|
|
8
|
+
}) {
|
|
10
9
|
installingWorker.onstatechange = () => {
|
|
11
10
|
if (installingWorker.state === 'activated') {
|
|
12
11
|
// ... and update state to 'ready'
|
|
@@ -23,10 +22,9 @@ function handleInstallingWorker(_ref) {
|
|
|
23
22
|
*
|
|
24
23
|
* Returns either READY, INSTALLING, or `null` for not installed/won't install
|
|
25
24
|
*/
|
|
26
|
-
export async function getPWAInstallationStatus(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} = _ref2;
|
|
25
|
+
export async function getPWAInstallationStatus({
|
|
26
|
+
onStateChange
|
|
27
|
+
}) {
|
|
30
28
|
if (!navigator.serviceWorker) {
|
|
31
29
|
// Nothing to do here
|
|
32
30
|
return null;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { DIMENSION_PROP_ID, DIMENSION_PROP_ITEMS, DIMENSION_PROP_FILTER, DIMENSION_PROP_LEGEND_SET, DIMENSION_PROP_PROGRAM, DIMENSION_PROP_PROGRAM_STAGE, DIMENSION_PROP_REPETITION } from './dimension.js';
|
|
2
|
-
export const dimensionCreate =
|
|
3
|
-
let itemIds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
4
|
-
let args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
2
|
+
export const dimensionCreate = (dimensionId, itemIds = [], args = {}) => {
|
|
5
3
|
const dimension = {
|
|
6
4
|
[DIMENSION_PROP_ID.name]: dimensionId,
|
|
7
5
|
...(itemIds.length && {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { DIMENSION, DIMENSION_PROPS } from './dimension.js';
|
|
2
2
|
import { dimensionIsEmpty } from './dimensionIsEmpty.js';
|
|
3
|
-
export const dimensionIsValid =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
3
|
+
export const dimensionIsValid = (dimension, {
|
|
4
|
+
requireItems
|
|
5
|
+
} = {}) => {
|
|
7
6
|
if (!DIMENSION.isValid(dimension)) {
|
|
8
7
|
return false;
|
|
9
8
|
}
|
|
@@ -11,12 +11,11 @@ export const getColorByValueFromLegendSet = (legendSet, value) => {
|
|
|
11
11
|
const legend = getLegendByValueFromLegendSet(legendSet, value);
|
|
12
12
|
return legend && legend.color;
|
|
13
13
|
};
|
|
14
|
-
export const getLegendSetByDisplayStrategy =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} = _ref;
|
|
14
|
+
export const getLegendSetByDisplayStrategy = ({
|
|
15
|
+
displayStrategy,
|
|
16
|
+
legendSets,
|
|
17
|
+
legendSetId
|
|
18
|
+
}) => {
|
|
20
19
|
if (displayStrategy === LEGEND_DISPLAY_STRATEGY_FIXED && legendSets.length) {
|
|
21
20
|
return legendSets[0];
|
|
22
21
|
} else if (displayStrategy === LEGEND_DISPLAY_STRATEGY_BY_DATA_ITEM) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import isNumber from 'd2-utilizr/lib/isNumber';
|
|
2
|
-
import isNumeric from 'd2-utilizr/lib/isNumeric';
|
|
3
2
|
import i18n from '../../locales/index.js';
|
|
3
|
+
import { isNumeric } from '../../modules/utils.js';
|
|
4
4
|
import { getIQRHelper, IQR } from './iqr.js';
|
|
5
5
|
import { getModZScoreHelper, MODIFIED_Z_SCORE } from './modZScore.js';
|
|
6
6
|
import { getNormalizationHelper, Y_RESIDUALS_LINEAR } from './normalization.js';
|
|
@@ -55,8 +55,7 @@ const getMinMaxValue = (outlierHelper, isVertical, isMax) => {
|
|
|
55
55
|
const extremeFactor = isNumber(extremeValue) && isMax ? extremeValue + Math.abs(extremeValue) * 0.1 : extremeValue - Math.abs(extremeValue) * 0.1;
|
|
56
56
|
return [...outlierHelper.thresholds.map(t => getXYStats([t.line[0], t.line[t.line.length - 1]])[prop]), extremeFactor].filter(isNumeric).sort(isMax ? (a, b) => b - a : (a, b) => a - b)[0];
|
|
57
57
|
};
|
|
58
|
-
export const getOutlierHelper =
|
|
59
|
-
let userConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
58
|
+
export const getOutlierHelper = (data, userConfig = {}) => {
|
|
60
59
|
if (data.length < 3) {
|
|
61
60
|
return null;
|
|
62
61
|
}
|
|
@@ -16,8 +16,7 @@ export const getQuartilePosition = (data, quartile) => {
|
|
|
16
16
|
return pos;
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
export const getQuartileValue =
|
|
20
|
-
let quartile = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Q1;
|
|
19
|
+
export const getQuartileValue = (data, quartile = Q1) => {
|
|
21
20
|
if (data.length < 3) {
|
|
22
21
|
return;
|
|
23
22
|
}
|
|
@@ -30,10 +29,9 @@ export const getQuartileValue = function (data) {
|
|
|
30
29
|
var diff = data[base] - data[base - 1];
|
|
31
30
|
return data[base - 1] + diff * rest;
|
|
32
31
|
};
|
|
33
|
-
export const getIQRHelper = (normalizationHelper, config,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} = _ref;
|
|
32
|
+
export const getIQRHelper = (normalizationHelper, config, {
|
|
33
|
+
xyStats
|
|
34
|
+
}) => {
|
|
37
35
|
const sortedNormalized = normalizationHelper.normalized.slice().sort((a, b) => a - b);
|
|
38
36
|
const q1 = getQuartileValue(sortedNormalized, Q1);
|
|
39
37
|
const q3 = getQuartileValue(sortedNormalized, Q3);
|
|
@@ -12,14 +12,8 @@ export const getMedian = values => {
|
|
|
12
12
|
|
|
13
13
|
// Absolute deviation
|
|
14
14
|
|
|
15
|
-
export const getMedianAbsoluteDeviation =
|
|
16
|
-
|
|
17
|
-
return getMedian(values.map(value => Math.abs(value - median)).sort((a, b) => a - b));
|
|
18
|
-
};
|
|
19
|
-
export const getMeanAbsoluteDeviation = function (values) {
|
|
20
|
-
let mean = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getMean(values);
|
|
21
|
-
return getMean(values.map(value => Math.abs(value - mean)));
|
|
22
|
-
};
|
|
15
|
+
export const getMedianAbsoluteDeviation = (values, median = getMedian(values)) => getMedian(values.map(value => Math.abs(value - median)).sort((a, b) => a - b));
|
|
16
|
+
export const getMeanAbsoluteDeviation = (values, mean = getMean(values)) => getMean(values.map(value => Math.abs(value - mean)));
|
|
23
17
|
|
|
24
18
|
// Modified z-scores
|
|
25
19
|
|
|
@@ -30,8 +24,7 @@ export const getModZScoreMAD0 = (value, median, meanAD) => (value - median) / (m
|
|
|
30
24
|
|
|
31
25
|
export const getModZScoreThresholds = (thresholdFactor, medianAD, median) => [median - medianAD * thresholdFactor / MEDIAN_AD_CORRECTION, median + medianAD * thresholdFactor / MEDIAN_AD_CORRECTION];
|
|
32
26
|
export const getModZScoreMAD0Thresholds = (thresholdFactor, meanAD, median) => [median - thresholdFactor * meanAD * MEAN_AD_CORRECTION, median + thresholdFactor * meanAD * MEAN_AD_CORRECTION];
|
|
33
|
-
export const getDataWithZScore =
|
|
34
|
-
let cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
27
|
+
export const getDataWithZScore = (dataWithNormalization, cache = {}) => {
|
|
35
28
|
const normalizedData = cache.normalizedData || dataWithNormalization.map(obj => obj.normalized);
|
|
36
29
|
const median = isNumber(cache.median) ? cache.median : getMedian(normalizedData);
|
|
37
30
|
const medianAD = isNumber(cache.medianAD) ? cache.medianAD : getMedianAbsoluteDeviation();
|
|
@@ -50,10 +43,9 @@ export const getDataWithZScore = function (dataWithNormalization) {
|
|
|
50
43
|
}
|
|
51
44
|
return dataWithZScore;
|
|
52
45
|
};
|
|
53
|
-
export const getModZScoreHelper = (normalizationHelper, config,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
} = _ref;
|
|
46
|
+
export const getModZScoreHelper = (normalizationHelper, config, {
|
|
47
|
+
xyStats
|
|
48
|
+
}) => {
|
|
57
49
|
const sortedNormalized = normalizationHelper.normalized.slice().sort((a, b) => a - b);
|
|
58
50
|
const median = getMedian(sortedNormalized);
|
|
59
51
|
const medianAD = getMedianAbsoluteDeviation(sortedNormalized, median);
|
|
@@ -4,10 +4,9 @@ import { PROP_THRESHOLD_FACTOR } from './index.js';
|
|
|
4
4
|
export const STANDARD_Z_SCORE = 'STANDARD_Z_SCORE';
|
|
5
5
|
export const getStdDev = data => std(data, 'unbiased');
|
|
6
6
|
export const getMean = data => mean(data);
|
|
7
|
-
export const getZScoreHelper = (normalizationHelper, config,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} = _ref;
|
|
7
|
+
export const getZScoreHelper = (normalizationHelper, config, {
|
|
8
|
+
xyStats
|
|
9
|
+
}) => {
|
|
11
10
|
const sortedNormalized = normalizationHelper.normalized.slice().sort((a, b) => a - b);
|
|
12
11
|
const stdDev = getStdDev(sortedNormalized);
|
|
13
12
|
const zScoreThreshold = stdDev * config[PROP_THRESHOLD_FACTOR];
|
|
@@ -11,15 +11,13 @@ export class AdaptiveClippingController {
|
|
|
11
11
|
this.engine = engine;
|
|
12
12
|
this.reset();
|
|
13
13
|
}
|
|
14
|
-
addSize(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
height
|
|
22
|
-
} = _ref2;
|
|
14
|
+
addSize({
|
|
15
|
+
row,
|
|
16
|
+
column
|
|
17
|
+
}, {
|
|
18
|
+
width,
|
|
19
|
+
height
|
|
20
|
+
}) {
|
|
23
21
|
if (column >= 0) {
|
|
24
22
|
const columnSize = this.columns.sizes[column] || {
|
|
25
23
|
pre: 0,
|
|
@@ -43,18 +41,16 @@ export class AdaptiveClippingController {
|
|
|
43
41
|
this.rows.headerSizes[index] = Math.max(this.rows.headerSizes[index] || 0, height);
|
|
44
42
|
}
|
|
45
43
|
}
|
|
46
|
-
add(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
} = _ref3;
|
|
44
|
+
add({
|
|
45
|
+
row,
|
|
46
|
+
column
|
|
47
|
+
}, renderedValue) {
|
|
51
48
|
this.addSize({
|
|
52
49
|
row,
|
|
53
50
|
column
|
|
54
51
|
}, this.measureText(renderedValue));
|
|
55
52
|
}
|
|
56
|
-
measureText(renderedValue) {
|
|
57
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
53
|
+
measureText(renderedValue, options = {}) {
|
|
58
54
|
return measureTextWithWrapping(renderedValue, {
|
|
59
55
|
fontSize: this.engine.fontSize,
|
|
60
56
|
...options
|
|
@@ -108,11 +108,10 @@ const buildDimensionLookup = (visualization, metadata, headers) => {
|
|
|
108
108
|
dataHeaders
|
|
109
109
|
};
|
|
110
110
|
};
|
|
111
|
-
const lookup = (dataRow, dimensionLookup,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
} = _ref;
|
|
111
|
+
const lookup = (dataRow, dimensionLookup, {
|
|
112
|
+
doColumnSubtotals,
|
|
113
|
+
doRowSubtotals
|
|
114
|
+
}) => {
|
|
116
115
|
let row = 0;
|
|
117
116
|
for (const headerIndex of dimensionLookup.rowHeaders) {
|
|
118
117
|
const idx = dimensionLookup.headerDimensions[headerIndex].itemIds.indexOf(dataRow[headerIndex]);
|
|
@@ -142,15 +141,14 @@ const lookup = (dataRow, dimensionLookup, _ref) => {
|
|
|
142
141
|
row
|
|
143
142
|
};
|
|
144
143
|
};
|
|
145
|
-
const applyTotalAggregationType = (
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
} = _ref2;
|
|
144
|
+
const applyTotalAggregationType = ({
|
|
145
|
+
totalAggregationType,
|
|
146
|
+
value,
|
|
147
|
+
numerator,
|
|
148
|
+
denominator,
|
|
149
|
+
multiplier,
|
|
150
|
+
divisor
|
|
151
|
+
}, overrideTotalAggregationType) => {
|
|
154
152
|
switch (overrideTotalAggregationType || totalAggregationType) {
|
|
155
153
|
case AGGREGATE_TYPE_NA:
|
|
156
154
|
return VALUE_NA;
|
|
@@ -209,12 +207,11 @@ export class PivotTableEngine {
|
|
|
209
207
|
this.rowDepth = this.dimensionLookup.rows.length || (this.visualization.showDimensionLabels ? 1 : 0);
|
|
210
208
|
this.buildMatrix();
|
|
211
209
|
}
|
|
212
|
-
getRaw(
|
|
210
|
+
getRaw({
|
|
211
|
+
row,
|
|
212
|
+
column
|
|
213
|
+
}) {
|
|
213
214
|
var _headers$find, _headers$find2;
|
|
214
|
-
let {
|
|
215
|
-
row,
|
|
216
|
-
column
|
|
217
|
-
} = _ref3;
|
|
218
215
|
const cellType = this.getRawCellType({
|
|
219
216
|
row,
|
|
220
217
|
column
|
|
@@ -300,18 +297,16 @@ export class PivotTableEngine {
|
|
|
300
297
|
}
|
|
301
298
|
return rawCell;
|
|
302
299
|
}
|
|
303
|
-
getCumulative(
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
} = _ref4;
|
|
300
|
+
getCumulative({
|
|
301
|
+
row,
|
|
302
|
+
column
|
|
303
|
+
}) {
|
|
308
304
|
return this.accumulators.rows[row][column];
|
|
309
305
|
}
|
|
310
|
-
get(
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
} = _ref5;
|
|
306
|
+
get({
|
|
307
|
+
row,
|
|
308
|
+
column
|
|
309
|
+
}) {
|
|
315
310
|
const mappedRow = this.rowMap[row],
|
|
316
311
|
mappedColumn = this.columnMap[column];
|
|
317
312
|
if (!mappedRow && mappedRow !== 0 || !mappedColumn && mappedColumn !== 0) {
|
|
@@ -322,11 +317,10 @@ export class PivotTableEngine {
|
|
|
322
317
|
column: mappedColumn
|
|
323
318
|
});
|
|
324
319
|
}
|
|
325
|
-
getRawCellType(
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
} = _ref6;
|
|
320
|
+
getRawCellType({
|
|
321
|
+
row,
|
|
322
|
+
column
|
|
323
|
+
}) {
|
|
330
324
|
const isRowTotal = this.doRowTotals && column === this.dataWidth - 1;
|
|
331
325
|
const isColumnTotal = this.doColumnTotals && row === this.dataHeight - 1;
|
|
332
326
|
if (isRowTotal || isColumnTotal) {
|
|
@@ -339,11 +333,10 @@ export class PivotTableEngine {
|
|
|
339
333
|
}
|
|
340
334
|
return CELL_TYPE_VALUE;
|
|
341
335
|
}
|
|
342
|
-
getCellType(
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
} = _ref7;
|
|
336
|
+
getCellType({
|
|
337
|
+
row,
|
|
338
|
+
column
|
|
339
|
+
}) {
|
|
347
340
|
row = this.rowMap[row];
|
|
348
341
|
column = this.columnMap[column];
|
|
349
342
|
return this.getRawCellType({
|
|
@@ -373,21 +366,19 @@ export class PivotTableEngine {
|
|
|
373
366
|
return i18n.t(this.dimensionLookup.rows[rowLevel].meta.name);
|
|
374
367
|
}
|
|
375
368
|
}
|
|
376
|
-
getCellDxDimension(
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
} = _ref8;
|
|
369
|
+
getCellDxDimension({
|
|
370
|
+
row,
|
|
371
|
+
column
|
|
372
|
+
}) {
|
|
381
373
|
return this.getRawCellDxDimension({
|
|
382
374
|
row: this.rowMap[row],
|
|
383
375
|
column: this.columnMap[column]
|
|
384
376
|
});
|
|
385
377
|
}
|
|
386
|
-
getRawCellDxDimension(
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
} = _ref9;
|
|
378
|
+
getRawCellDxDimension({
|
|
379
|
+
row,
|
|
380
|
+
column
|
|
381
|
+
}) {
|
|
391
382
|
if (!this.data[row]) {
|
|
392
383
|
return undefined;
|
|
393
384
|
}
|
|
@@ -484,12 +475,11 @@ export class PivotTableEngine {
|
|
|
484
475
|
getRowHeader(row) {
|
|
485
476
|
return this.getRawRowHeader(this.rowMap[row]);
|
|
486
477
|
}
|
|
487
|
-
getDependantTotalCells(
|
|
478
|
+
getDependantTotalCells({
|
|
479
|
+
row,
|
|
480
|
+
column
|
|
481
|
+
}) {
|
|
488
482
|
var _this$dimensionLookup, _this$dimensionLookup2;
|
|
489
|
-
let {
|
|
490
|
-
row,
|
|
491
|
-
column
|
|
492
|
-
} = _ref10;
|
|
493
483
|
const rowSubtotalSize = ((_this$dimensionLookup = this.dimensionLookup.columns[0]) === null || _this$dimensionLookup === void 0 ? void 0 : _this$dimensionLookup.size) + 1;
|
|
494
484
|
const rowSubtotal = rowSubtotalSize && this.doRowSubtotals && {
|
|
495
485
|
row,
|
|
@@ -687,11 +677,10 @@ export class PivotTableEngine {
|
|
|
687
677
|
// (numberType option default is VALUE)
|
|
688
678
|
return visualization.numberType && visualization.numberType !== NUMBER_TYPE_VALUE && AGGREGATE_TYPE_SUM;
|
|
689
679
|
}
|
|
690
|
-
finalizeTotal(
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
} = _ref11;
|
|
680
|
+
finalizeTotal({
|
|
681
|
+
row,
|
|
682
|
+
column
|
|
683
|
+
}) {
|
|
695
684
|
if (!this.data[row]) {
|
|
696
685
|
return;
|
|
697
686
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import times from 'lodash/times';
|
|
2
|
-
export const clipAxis =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} = _ref;
|
|
2
|
+
export const clipAxis = ({
|
|
3
|
+
position,
|
|
4
|
+
size,
|
|
5
|
+
step,
|
|
6
|
+
totalCount,
|
|
7
|
+
headerCount
|
|
8
|
+
}) => {
|
|
10
9
|
// position: scroll Y position
|
|
11
10
|
// size: height of table container
|
|
12
11
|
// step: height of cell in px
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
export const clipPartitionedAxis =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} = _ref;
|
|
1
|
+
export const clipPartitionedAxis = ({
|
|
2
|
+
partitionSize,
|
|
3
|
+
partitions,
|
|
4
|
+
axisMap,
|
|
5
|
+
widthMap,
|
|
6
|
+
viewportWidth,
|
|
7
|
+
viewportPosition,
|
|
8
|
+
totalWidth
|
|
9
|
+
}) => {
|
|
11
10
|
const partition = Math.floor(viewportPosition / partitionSize);
|
|
12
11
|
if (partitions[partition] === undefined) {
|
|
13
12
|
return {
|