@dhis2/analytics 23.8.4 → 23.8.7
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/CHANGELOG.md +23 -0
- package/build/cjs/__demo__/FileMenu.stories.js +4 -2
- package/build/cjs/__demo__/Filter.stories.js +2 -2
- package/build/cjs/__demo__/FixedPeriodSelect.stories.js +2 -2
- package/build/cjs/__demo__/OpenFileDialog.stories.js +4 -2
- package/build/cjs/__demo__/OrgUnitDimension.stories.js +2 -2
- package/build/cjs/__demo__/PivotTable.stories.js +206 -153
- package/build/cjs/api/__tests__/dimensions.spec.js +2 -1
- package/build/cjs/api/analytics/Analytics.js +8 -7
- package/build/cjs/api/analytics/AnalyticsBase.js +58 -43
- package/build/cjs/api/analytics/AnalyticsRequest.js +2 -1
- package/build/cjs/api/analytics/AnalyticsRequestBase.js +22 -17
- package/build/cjs/api/analytics/AnalyticsRequestPropertiesMixin.js +38 -19
- package/build/cjs/api/analytics/AnalyticsResponseHeader.js +7 -5
- package/build/cjs/api/analytics/__tests__/AnalyticsRequest.spec.js +2 -1
- package/build/cjs/api/dimensions.js +150 -120
- package/build/cjs/api/organisationUnits.js +36 -24
- package/build/cjs/components/AboutAOUnit/AboutAOUnit.js +22 -13
- package/build/cjs/components/AboutAOUnit/styles/AboutAOUnit.style.js +2 -2
- package/build/cjs/components/CachedDataQueryProvider.js +8 -7
- package/build/cjs/components/DataDimension/DataDimension.js +8 -6
- package/build/cjs/components/DataDimension/DataTypeSelector.js +6 -5
- package/build/cjs/components/DataDimension/DetailSelector.js +6 -5
- package/build/cjs/components/DataDimension/GroupSelector.js +12 -11
- package/build/cjs/components/DataDimension/ItemSelector.js +87 -73
- package/build/cjs/components/DataDimension/MetricSelector.js +6 -5
- package/build/cjs/components/DimensionMenu.js +14 -13
- package/build/cjs/components/DimensionsPanel/DimensionsPanel.js +4 -4
- package/build/cjs/components/DimensionsPanel/List/DimensionItem.js +4 -4
- package/build/cjs/components/DimensionsPanel/List/DimensionLabel.js +4 -4
- package/build/cjs/components/DimensionsPanel/List/DimensionList.js +4 -4
- package/build/cjs/components/DimensionsPanel/List/OptionsButton.js +10 -7
- package/build/cjs/components/DimensionsPanel/List/RecommendedIcon.js +14 -11
- package/build/cjs/components/DynamicDimension/DynamicDimension.js +9 -8
- package/build/cjs/components/DynamicDimension/ItemSelector.js +58 -44
- package/build/cjs/components/FileMenu/DeleteDialog.js +16 -12
- package/build/cjs/components/FileMenu/FileMenu.js +19 -18
- package/build/cjs/components/FileMenu/GetLinkDialog.js +6 -5
- package/build/cjs/components/FileMenu/RenameDialog.js +38 -25
- package/build/cjs/components/FileMenu/SaveAsDialog.js +21 -14
- package/build/cjs/components/FileMenu/utils.js +1 -1
- package/build/cjs/components/Filter/Filter.js +22 -19
- package/build/cjs/components/LegendKey/LegendKey.js +4 -3
- package/build/cjs/components/OpenFileDialog/CreatedByFilter.js +26 -20
- package/build/cjs/components/OpenFileDialog/CustomSelectOption.js +26 -23
- package/build/cjs/components/OpenFileDialog/DateField.js +4 -3
- package/build/cjs/components/OpenFileDialog/FileList.js +22 -19
- package/build/cjs/components/OpenFileDialog/NameFilter.js +21 -15
- package/build/cjs/components/OpenFileDialog/OpenFileDialog.js +43 -35
- package/build/cjs/components/OpenFileDialog/PaginationControls.js +28 -22
- package/build/cjs/components/OpenFileDialog/VisTypeFilter.js +37 -28
- package/build/cjs/components/OpenFileDialog/utils.js +1 -1
- package/build/cjs/components/Options/VisualizationOptions.js +46 -36
- package/build/cjs/components/Options/styles/VisualizationOptions.style.js +1 -1
- package/build/cjs/components/OrgUnitDimension/OrgUnitDimension.js +50 -34
- package/build/cjs/components/PeriodDimension/FixedPeriodFilter.js +22 -15
- package/build/cjs/components/PeriodDimension/FixedPeriodSelect.js +19 -14
- package/build/cjs/components/PeriodDimension/PeriodDimension.js +8 -6
- package/build/cjs/components/PeriodDimension/PeriodTransfer.js +24 -19
- package/build/cjs/components/PeriodDimension/RelativePeriodFilter.js +30 -24
- package/build/cjs/components/PeriodDimension/utils/fixedPeriods.js +1 -1
- package/build/cjs/components/PeriodDimension/utils/index.js +6 -2
- package/build/cjs/components/PeriodDimension/utils/relativePeriods.js +1 -1
- package/build/cjs/components/PivotTable/PivotTable.js +10 -9
- package/build/cjs/components/PivotTable/PivotTableBody.js +29 -20
- package/build/cjs/components/PivotTable/PivotTableCell.js +9 -8
- package/build/cjs/components/PivotTable/PivotTableClippedAxis.js +17 -14
- package/build/cjs/components/PivotTable/PivotTableColumnHeaderCell.js +8 -7
- package/build/cjs/components/PivotTable/PivotTableColumnHeaders.js +29 -22
- package/build/cjs/components/PivotTable/PivotTableContainer.js +6 -5
- package/build/cjs/components/PivotTable/PivotTableDimensionLabelCell.js +5 -4
- package/build/cjs/components/PivotTable/PivotTableEmptyCell.js +3 -2
- package/build/cjs/components/PivotTable/PivotTableEmptyRow.js +5 -4
- package/build/cjs/components/PivotTable/PivotTableEngineContext.js +7 -6
- package/build/cjs/components/PivotTable/PivotTableHead.js +16 -13
- package/build/cjs/components/PivotTable/PivotTableHeaderCell.js +9 -8
- package/build/cjs/components/PivotTable/PivotTableRow.js +27 -20
- package/build/cjs/components/PivotTable/PivotTableRowHeaderCell.js +6 -5
- package/build/cjs/components/PivotTable/PivotTableSortIcon.js +5 -4
- package/build/cjs/components/PivotTable/PivotTableTitleRow.js +9 -8
- package/build/cjs/components/PivotTable/PivotTableTitleRows.js +5 -4
- package/build/cjs/components/PivotTable/PivotTableValueCell.js +8 -7
- package/build/cjs/components/PivotTable/styles/PivotTable.style.js +1 -1
- package/build/cjs/components/TransferOption.js +15 -13
- package/build/cjs/components/TranslationDialog/TranslationModal/LocalesSelect.js +28 -19
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationForm.js +25 -18
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModal.js +9 -8
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModalActions.js +17 -14
- package/build/cjs/components/TranslationDialog/TranslationModal/useTranslationsResults.js +4 -3
- package/build/cjs/components/VisTypeIcon.js +6 -5
- package/build/cjs/index.js +464 -464
- package/build/cjs/locales/ar/translations.json +1 -1
- package/build/cjs/locales/ar_EG/translations.json +1 -1
- package/build/cjs/locales/ar_IQ/translations.json +1 -1
- package/build/cjs/locales/ckb/translations.json +1 -1
- package/build/cjs/locales/cs/translations.json +1 -1
- package/build/cjs/locales/da/translations.json +1 -1
- package/build/cjs/locales/en/translations.json +1 -1
- package/build/cjs/locales/es/translations.json +1 -1
- package/build/cjs/locales/fr/translations.json +1 -1
- package/build/cjs/locales/id/translations.json +1 -1
- package/build/cjs/locales/km/translations.json +1 -1
- package/build/cjs/locales/lo/translations.json +1 -1
- package/build/cjs/locales/my/translations.json +1 -1
- package/build/cjs/locales/nb/translations.json +1 -1
- package/build/cjs/locales/nl/translations.json +30 -30
- package/build/cjs/locales/prs/translations.json +1 -1
- package/build/cjs/locales/ps/translations.json +1 -1
- package/build/cjs/locales/pt/translations.json +1 -1
- package/build/cjs/locales/pt_BR/translations.json +1 -1
- package/build/cjs/locales/ru/translations.json +1 -1
- package/build/cjs/locales/sv/translations.json +1 -1
- package/build/cjs/locales/tet/translations.json +1 -1
- package/build/cjs/locales/tg/translations.json +1 -1
- package/build/cjs/locales/uk/translations.json +1 -1
- package/build/cjs/locales/ur/translations.json +1 -1
- package/build/cjs/locales/uz/translations.json +1 -1
- package/build/cjs/locales/uz_Latn/translations.json +1 -1
- package/build/cjs/locales/vi/translations.json +1 -1
- package/build/cjs/locales/zh/translations.json +1 -1
- package/build/cjs/locales/zh_CN/translations.json +1 -1
- package/build/cjs/modules/axis.js +1 -1
- package/build/cjs/modules/dataSets.js +1 -1
- package/build/cjs/modules/dataTypes.js +2 -2
- package/build/cjs/modules/dimensionSelectorHelper.js +1 -1
- package/build/cjs/modules/fontStyle.js +1 -1
- package/build/cjs/modules/layout/axis.js +1 -1
- package/build/cjs/modules/layout/dimension.js +1 -1
- package/build/cjs/modules/layout/dimensionCreate.js +3 -1
- package/build/cjs/modules/layout/dimensionIsValid.js +5 -3
- package/build/cjs/modules/layout/item.js +1 -1
- package/build/cjs/modules/layout/testResources.js +1 -1
- package/build/cjs/modules/layoutTypes.js +1 -1
- package/build/cjs/modules/layoutUiRules/index.js +20 -20
- package/build/cjs/modules/layoutUiRules/rules.js +1 -1
- package/build/cjs/modules/layoutUiRules/rulesHelper.js +2 -1
- package/build/cjs/modules/layoutUiRules/rulesUtils.js +1 -1
- package/build/cjs/modules/legends.js +1 -1
- package/build/cjs/modules/outliers/index.js +4 -2
- package/build/cjs/modules/outliers/iqr.js +8 -5
- package/build/cjs/modules/outliers/modZScore.js +15 -7
- package/build/cjs/modules/outliers/zScore.js +5 -4
- package/build/cjs/modules/pivotTable/AdaptiveClippingController.js +17 -12
- package/build/cjs/modules/pivotTable/PivotTableEngine.js +57 -44
- package/build/cjs/modules/pivotTable/clipAxis.js +8 -7
- package/build/cjs/modules/pivotTable/clipPartitionedAxis.js +10 -9
- package/build/cjs/modules/pivotTable/getHeaderForDisplay.js +9 -8
- package/build/cjs/modules/pivotTable/measureText.js +10 -7
- package/build/cjs/modules/pivotTable/pivotTableConstants.js +1 -1
- package/build/cjs/modules/pivotTable/useParentSize.js +2 -1
- package/build/cjs/modules/pivotTable/useScrollPosition.js +2 -1
- package/build/cjs/modules/pivotTable/useTableClipping.js +7 -6
- package/build/cjs/modules/predefinedDimensions.js +2 -2
- package/build/cjs/modules/relativeItems/index.js +4 -1
- package/build/cjs/modules/valueTypes.js +1 -1
- package/build/cjs/modules/visTypes.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_dhis/index.js +7 -6
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +9 -4
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/axis.js +5 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/customAxes.js +9 -5
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +4 -3
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/index.js +11 -9
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/legend.js +32 -28
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/legendSet.js +24 -20
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/plotOptions.js +9 -8
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/xAxis/index.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +3 -1
- package/build/cjs/visualizations/config/generators/dhis/singleValue.js +28 -24
- package/build/cjs/visualizations/config/generators/highcharts/index.js +5 -1
- package/build/cjs/visualizations/config/index.js +13 -11
- package/build/cjs/visualizations/config/validators/dhis/index.js +4 -3
- package/build/cjs/visualizations/index.js +6 -2
- package/build/cjs/visualizations/store/adapters/dhis_dhis/index.js +7 -6
- package/build/cjs/visualizations/store/adapters/dhis_highcharts/index.js +8 -7
- package/build/cjs/visualizations/store/index.js +18 -15
- package/build/cjs/visualizations/store/validators/dhis/index.js +7 -5
- package/build/cjs/visualizations/util/colors/colorSets.js +1 -1
- package/build/cjs/visualizations/util/colors/themes.js +1 -1
- package/build/cjs/visualizations/util/getFilterText.js +9 -6
- package/build/es/__demo__/FileMenu.stories.js +4 -2
- package/build/es/__demo__/OpenFileDialog.stories.js +4 -2
- package/build/es/__demo__/PivotTable.stories.js +204 -151
- package/build/es/api/__tests__/dimensions.spec.js +2 -1
- package/build/es/api/analytics/Analytics.js +8 -7
- package/build/es/api/analytics/AnalyticsBase.js +58 -43
- package/build/es/api/analytics/AnalyticsRequest.js +2 -1
- package/build/es/api/analytics/AnalyticsRequestBase.js +22 -17
- package/build/es/api/analytics/AnalyticsRequestPropertiesMixin.js +38 -19
- package/build/es/api/analytics/AnalyticsResponseHeader.js +7 -5
- package/build/es/api/analytics/__tests__/AnalyticsRequest.spec.js +2 -1
- package/build/es/api/dimensions.js +149 -119
- package/build/es/api/organisationUnits.js +35 -23
- package/build/es/components/AboutAOUnit/AboutAOUnit.js +20 -11
- package/build/es/components/AboutAOUnit/styles/AboutAOUnit.style.js +2 -2
- package/build/es/components/CachedDataQueryProvider.js +6 -5
- package/build/es/components/DataDimension/DataDimension.js +8 -6
- package/build/es/components/DataDimension/DataTypeSelector.js +6 -5
- package/build/es/components/DataDimension/DetailSelector.js +6 -5
- package/build/es/components/DataDimension/GroupSelector.js +10 -9
- package/build/es/components/DataDimension/ItemSelector.js +85 -71
- package/build/es/components/DataDimension/MetricSelector.js +6 -5
- package/build/es/components/DimensionMenu.js +14 -13
- package/build/es/components/DimensionsPanel/DimensionsPanel.js +2 -2
- package/build/es/components/DimensionsPanel/List/DimensionItem.js +2 -2
- package/build/es/components/DimensionsPanel/List/DimensionLabel.js +2 -2
- package/build/es/components/DimensionsPanel/List/DimensionList.js +2 -2
- package/build/es/components/DimensionsPanel/List/OptionsButton.js +10 -7
- package/build/es/components/DimensionsPanel/List/RecommendedIcon.js +14 -11
- package/build/es/components/DynamicDimension/DynamicDimension.js +9 -8
- package/build/es/components/DynamicDimension/ItemSelector.js +56 -42
- package/build/es/components/FileMenu/DeleteDialog.js +14 -10
- package/build/es/components/FileMenu/FileMenu.js +17 -16
- package/build/es/components/FileMenu/GetLinkDialog.js +6 -5
- package/build/es/components/FileMenu/RenameDialog.js +36 -23
- package/build/es/components/FileMenu/SaveAsDialog.js +19 -12
- package/build/es/components/Filter/Filter.js +22 -19
- package/build/es/components/LegendKey/LegendKey.js +4 -3
- package/build/es/components/OpenFileDialog/CreatedByFilter.js +26 -20
- package/build/es/components/OpenFileDialog/CustomSelectOption.js +26 -23
- package/build/es/components/OpenFileDialog/DateField.js +4 -3
- package/build/es/components/OpenFileDialog/FileList.js +22 -19
- package/build/es/components/OpenFileDialog/NameFilter.js +21 -15
- package/build/es/components/OpenFileDialog/OpenFileDialog.js +41 -33
- package/build/es/components/OpenFileDialog/PaginationControls.js +28 -22
- package/build/es/components/OpenFileDialog/VisTypeFilter.js +37 -28
- package/build/es/components/Options/VisualizationOptions.js +43 -33
- package/build/es/components/OrgUnitDimension/OrgUnitDimension.js +48 -32
- package/build/es/components/PeriodDimension/FixedPeriodFilter.js +22 -15
- package/build/es/components/PeriodDimension/FixedPeriodSelect.js +17 -12
- package/build/es/components/PeriodDimension/PeriodDimension.js +8 -6
- package/build/es/components/PeriodDimension/PeriodTransfer.js +22 -17
- package/build/es/components/PeriodDimension/RelativePeriodFilter.js +30 -24
- package/build/es/components/PeriodDimension/utils/index.js +5 -1
- package/build/es/components/PivotTable/PivotTable.js +8 -7
- package/build/es/components/PivotTable/PivotTableBody.js +29 -20
- package/build/es/components/PivotTable/PivotTableCell.js +9 -8
- package/build/es/components/PivotTable/PivotTableClippedAxis.js +17 -14
- package/build/es/components/PivotTable/PivotTableColumnHeaderCell.js +8 -7
- package/build/es/components/PivotTable/PivotTableColumnHeaders.js +29 -22
- package/build/es/components/PivotTable/PivotTableContainer.js +6 -5
- package/build/es/components/PivotTable/PivotTableDimensionLabelCell.js +5 -4
- package/build/es/components/PivotTable/PivotTableEmptyCell.js +3 -2
- package/build/es/components/PivotTable/PivotTableEmptyRow.js +5 -4
- package/build/es/components/PivotTable/PivotTableEngineContext.js +5 -4
- package/build/es/components/PivotTable/PivotTableHead.js +16 -13
- package/build/es/components/PivotTable/PivotTableHeaderCell.js +9 -8
- package/build/es/components/PivotTable/PivotTableRow.js +27 -20
- package/build/es/components/PivotTable/PivotTableRowHeaderCell.js +6 -5
- package/build/es/components/PivotTable/PivotTableSortIcon.js +5 -4
- package/build/es/components/PivotTable/PivotTableTitleRow.js +7 -6
- package/build/es/components/PivotTable/PivotTableTitleRows.js +5 -4
- package/build/es/components/PivotTable/PivotTableValueCell.js +6 -5
- package/build/es/components/TransferOption.js +15 -13
- package/build/es/components/TranslationDialog/TranslationModal/LocalesSelect.js +28 -19
- package/build/es/components/TranslationDialog/TranslationModal/TranslationForm.js +23 -16
- package/build/es/components/TranslationDialog/TranslationModal/TranslationModal.js +7 -6
- package/build/es/components/TranslationDialog/TranslationModal/TranslationModalActions.js +17 -14
- package/build/es/components/TranslationDialog/TranslationModal/useTranslationsResults.js +4 -3
- package/build/es/components/VisTypeIcon.js +6 -5
- package/build/es/locales/ar/translations.json +1 -1
- package/build/es/locales/ar_EG/translations.json +1 -1
- package/build/es/locales/ar_IQ/translations.json +1 -1
- package/build/es/locales/ckb/translations.json +1 -1
- package/build/es/locales/cs/translations.json +1 -1
- package/build/es/locales/da/translations.json +1 -1
- package/build/es/locales/en/translations.json +1 -1
- package/build/es/locales/es/translations.json +1 -1
- package/build/es/locales/fr/translations.json +1 -1
- package/build/es/locales/id/translations.json +1 -1
- package/build/es/locales/km/translations.json +1 -1
- package/build/es/locales/lo/translations.json +1 -1
- package/build/es/locales/my/translations.json +1 -1
- package/build/es/locales/nb/translations.json +1 -1
- package/build/es/locales/nl/translations.json +30 -30
- package/build/es/locales/prs/translations.json +1 -1
- package/build/es/locales/ps/translations.json +1 -1
- package/build/es/locales/pt/translations.json +1 -1
- package/build/es/locales/pt_BR/translations.json +1 -1
- package/build/es/locales/ru/translations.json +1 -1
- package/build/es/locales/sv/translations.json +1 -1
- package/build/es/locales/tet/translations.json +1 -1
- package/build/es/locales/tg/translations.json +1 -1
- package/build/es/locales/uk/translations.json +1 -1
- package/build/es/locales/ur/translations.json +1 -1
- package/build/es/locales/uz/translations.json +1 -1
- package/build/es/locales/uz_Latn/translations.json +1 -1
- package/build/es/locales/vi/translations.json +1 -1
- package/build/es/locales/zh/translations.json +1 -1
- package/build/es/locales/zh_CN/translations.json +1 -1
- package/build/es/modules/layout/dimensionCreate.js +3 -1
- package/build/es/modules/layout/dimensionIsValid.js +5 -3
- package/build/es/modules/outliers/index.js +3 -1
- package/build/es/modules/outliers/iqr.js +7 -4
- package/build/es/modules/outliers/modZScore.js +14 -6
- package/build/es/modules/outliers/zScore.js +4 -3
- package/build/es/modules/pivotTable/AdaptiveClippingController.js +17 -12
- package/build/es/modules/pivotTable/PivotTableEngine.js +57 -44
- package/build/es/modules/pivotTable/clipAxis.js +8 -7
- package/build/es/modules/pivotTable/clipPartitionedAxis.js +10 -9
- package/build/es/modules/pivotTable/getHeaderForDisplay.js +9 -8
- package/build/es/modules/pivotTable/measureText.js +10 -7
- package/build/es/modules/pivotTable/useParentSize.js +2 -1
- package/build/es/modules/pivotTable/useScrollPosition.js +2 -1
- package/build/es/modules/pivotTable/useTableClipping.js +7 -6
- package/build/es/modules/predefinedDimensions.js +1 -1
- package/build/es/modules/relativeItems/index.js +4 -1
- package/build/es/visualizations/config/adapters/dhis_dhis/index.js +6 -5
- package/build/es/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +8 -3
- package/build/es/visualizations/config/adapters/dhis_highcharts/axis.js +4 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/customAxes.js +6 -2
- package/build/es/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +4 -3
- package/build/es/visualizations/config/adapters/dhis_highcharts/index.js +9 -7
- package/build/es/visualizations/config/adapters/dhis_highcharts/legend.js +32 -28
- package/build/es/visualizations/config/adapters/dhis_highcharts/legendSet.js +23 -19
- package/build/es/visualizations/config/adapters/dhis_highcharts/plotOptions.js +9 -8
- package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +3 -1
- package/build/es/visualizations/config/generators/dhis/singleValue.js +28 -24
- package/build/es/visualizations/config/generators/highcharts/index.js +5 -1
- package/build/es/visualizations/config/index.js +13 -11
- package/build/es/visualizations/config/validators/dhis/index.js +4 -3
- package/build/es/visualizations/index.js +5 -1
- package/build/es/visualizations/store/adapters/dhis_dhis/index.js +7 -6
- package/build/es/visualizations/store/adapters/dhis_highcharts/index.js +8 -7
- package/build/es/visualizations/store/index.js +18 -15
- package/build/es/visualizations/store/validators/dhis/index.js +7 -5
- package/build/es/visualizations/util/getFilterText.js +9 -6
- package/package.json +11 -11
|
@@ -114,10 +114,11 @@ const buildDimensionLookup = (visualization, metadata, headers) => {
|
|
|
114
114
|
};
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
-
const lookup = (dataRow, dimensionLookup, {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
117
|
+
const lookup = (dataRow, dimensionLookup, _ref) => {
|
|
118
|
+
let {
|
|
119
|
+
doColumnSubtotals,
|
|
120
|
+
doRowSubtotals
|
|
121
|
+
} = _ref;
|
|
121
122
|
let row = 0;
|
|
122
123
|
|
|
123
124
|
for (const headerIndex of dimensionLookup.rowHeaders) {
|
|
@@ -158,14 +159,16 @@ const lookup = (dataRow, dimensionLookup, {
|
|
|
158
159
|
};
|
|
159
160
|
};
|
|
160
161
|
|
|
161
|
-
const applyTotalAggregationType = ({
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
162
|
+
const applyTotalAggregationType = (_ref2, overrideTotalAggregationType) => {
|
|
163
|
+
let {
|
|
164
|
+
totalAggregationType,
|
|
165
|
+
value,
|
|
166
|
+
numerator,
|
|
167
|
+
denominator,
|
|
168
|
+
multiplier,
|
|
169
|
+
divisor
|
|
170
|
+
} = _ref2;
|
|
171
|
+
|
|
169
172
|
switch (overrideTotalAggregationType || totalAggregationType) {
|
|
170
173
|
case AGGREGATE_TYPE_NA:
|
|
171
174
|
return 'N/A';
|
|
@@ -236,12 +239,13 @@ export class PivotTableEngine {
|
|
|
236
239
|
this.buildMatrix();
|
|
237
240
|
}
|
|
238
241
|
|
|
239
|
-
getRaw({
|
|
240
|
-
row,
|
|
241
|
-
column
|
|
242
|
-
}) {
|
|
242
|
+
getRaw(_ref3) {
|
|
243
243
|
var _headers$find, _headers$find2;
|
|
244
244
|
|
|
245
|
+
let {
|
|
246
|
+
row,
|
|
247
|
+
column
|
|
248
|
+
} = _ref3;
|
|
245
249
|
const cellType = this.getRawCellType({
|
|
246
250
|
row,
|
|
247
251
|
column
|
|
@@ -298,10 +302,11 @@ export class PivotTableEngine {
|
|
|
298
302
|
};
|
|
299
303
|
}
|
|
300
304
|
|
|
301
|
-
get({
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
+
get(_ref4) {
|
|
306
|
+
let {
|
|
307
|
+
row,
|
|
308
|
+
column
|
|
309
|
+
} = _ref4;
|
|
305
310
|
const mappedRow = this.rowMap[row],
|
|
306
311
|
mappedColumn = this.columnMap[column];
|
|
307
312
|
|
|
@@ -315,10 +320,11 @@ export class PivotTableEngine {
|
|
|
315
320
|
});
|
|
316
321
|
}
|
|
317
322
|
|
|
318
|
-
getRawCellType({
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
323
|
+
getRawCellType(_ref5) {
|
|
324
|
+
let {
|
|
325
|
+
row,
|
|
326
|
+
column
|
|
327
|
+
} = _ref5;
|
|
322
328
|
const isRowTotal = this.doRowTotals && column === this.dataWidth - 1;
|
|
323
329
|
const isColumnTotal = this.doColumnTotals && row === this.dataHeight - 1;
|
|
324
330
|
|
|
@@ -336,10 +342,11 @@ export class PivotTableEngine {
|
|
|
336
342
|
return CELL_TYPE_VALUE;
|
|
337
343
|
}
|
|
338
344
|
|
|
339
|
-
getCellType({
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
345
|
+
getCellType(_ref6) {
|
|
346
|
+
let {
|
|
347
|
+
row,
|
|
348
|
+
column
|
|
349
|
+
} = _ref6;
|
|
343
350
|
row = this.rowMap[row];
|
|
344
351
|
column = this.columnMap[column];
|
|
345
352
|
return this.getRawCellType({
|
|
@@ -377,20 +384,23 @@ export class PivotTableEngine {
|
|
|
377
384
|
}
|
|
378
385
|
}
|
|
379
386
|
|
|
380
|
-
getCellDxDimension({
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
387
|
+
getCellDxDimension(_ref7) {
|
|
388
|
+
let {
|
|
389
|
+
row,
|
|
390
|
+
column
|
|
391
|
+
} = _ref7;
|
|
384
392
|
return this.getRawCellDxDimension({
|
|
385
393
|
row: this.rowMap[row],
|
|
386
394
|
column: this.columnMap[column]
|
|
387
395
|
});
|
|
388
396
|
}
|
|
389
397
|
|
|
390
|
-
getRawCellDxDimension({
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
398
|
+
getRawCellDxDimension(_ref8) {
|
|
399
|
+
let {
|
|
400
|
+
row,
|
|
401
|
+
column
|
|
402
|
+
} = _ref8;
|
|
403
|
+
|
|
394
404
|
if (!this.data[row]) {
|
|
395
405
|
return undefined;
|
|
396
406
|
}
|
|
@@ -502,12 +512,13 @@ export class PivotTableEngine {
|
|
|
502
512
|
return this.getRawRowHeader(this.rowMap[row]);
|
|
503
513
|
}
|
|
504
514
|
|
|
505
|
-
getDependantTotalCells({
|
|
506
|
-
row,
|
|
507
|
-
column
|
|
508
|
-
}) {
|
|
515
|
+
getDependantTotalCells(_ref9) {
|
|
509
516
|
var _this$dimensionLookup, _this$dimensionLookup2;
|
|
510
517
|
|
|
518
|
+
let {
|
|
519
|
+
row,
|
|
520
|
+
column
|
|
521
|
+
} = _ref9;
|
|
511
522
|
const rowSubtotalSize = ((_this$dimensionLookup = this.dimensionLookup.columns[0]) === null || _this$dimensionLookup === void 0 ? void 0 : _this$dimensionLookup.size) + 1;
|
|
512
523
|
const rowSubtotal = rowSubtotalSize && this.doRowSubtotals && {
|
|
513
524
|
row,
|
|
@@ -723,10 +734,12 @@ export class PivotTableEngine {
|
|
|
723
734
|
}
|
|
724
735
|
}
|
|
725
736
|
|
|
726
|
-
finalizeTotal({
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
737
|
+
finalizeTotal(_ref10) {
|
|
738
|
+
let {
|
|
739
|
+
row,
|
|
740
|
+
column
|
|
741
|
+
} = _ref10;
|
|
742
|
+
|
|
730
743
|
if (!this.data[row]) {
|
|
731
744
|
return;
|
|
732
745
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import times from 'lodash/times';
|
|
2
|
-
export const clipAxis =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
export const clipAxis = _ref => {
|
|
3
|
+
let {
|
|
4
|
+
position,
|
|
5
|
+
size,
|
|
6
|
+
step,
|
|
7
|
+
totalCount,
|
|
8
|
+
headerCount
|
|
9
|
+
} = _ref;
|
|
9
10
|
// position: scroll Y position
|
|
10
11
|
// size: height of table container
|
|
11
12
|
// step: height of cell in px
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
export const clipPartitionedAxis =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
export const clipPartitionedAxis = _ref => {
|
|
2
|
+
let {
|
|
3
|
+
partitionSize,
|
|
4
|
+
partitions,
|
|
5
|
+
axisMap,
|
|
6
|
+
widthMap,
|
|
7
|
+
viewportWidth,
|
|
8
|
+
viewportPosition,
|
|
9
|
+
totalWidth
|
|
10
|
+
} = _ref;
|
|
10
11
|
const partition = Math.floor(viewportPosition / partitionSize);
|
|
11
12
|
|
|
12
13
|
if (partitions[partition] === undefined) {
|
|
@@ -8,14 +8,15 @@ const headerStacksAreEqual = (a, b, limit) => {
|
|
|
8
8
|
return true;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
export const getHeaderForDisplay =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
export const getHeaderForDisplay = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
start,
|
|
14
|
+
count,
|
|
15
|
+
index,
|
|
16
|
+
dimensionLevel,
|
|
17
|
+
getHeader,
|
|
18
|
+
showHierarchy
|
|
19
|
+
} = _ref;
|
|
19
20
|
const header = getHeader(index);
|
|
20
21
|
const showHeader = index === start || !headerStacksAreEqual(header, getHeader(index - 1), dimensionLevel);
|
|
21
22
|
|
|
@@ -11,18 +11,21 @@ const getContext = fontSize => {
|
|
|
11
11
|
return ctx;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
const measureText = (text
|
|
14
|
+
const measureText = function (text) {
|
|
15
|
+
let fontSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 11;
|
|
15
16
|
const ctx = getContext(fontSize);
|
|
16
17
|
const textMetrics = ctx.measureText(text);
|
|
17
18
|
return textMetrics.width;
|
|
18
19
|
};
|
|
19
20
|
|
|
20
|
-
export const measureTextWithWrapping = (text, {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
export const measureTextWithWrapping = (text, _ref) => {
|
|
22
|
+
let {
|
|
23
|
+
fontSize = 11,
|
|
24
|
+
maxWidth = CLIPPED_CELL_MAX_SIZE,
|
|
25
|
+
justifyBuffer = WRAPPED_TEXT_JUSTIFY_BUFFER,
|
|
26
|
+
lineHeight = WRAPPED_TEXT_LINE_HEIGHT
|
|
27
|
+
} = _ref;
|
|
28
|
+
|
|
26
29
|
if (!text) {
|
|
27
30
|
return {
|
|
28
31
|
width: 0,
|
|
@@ -4,7 +4,8 @@ const initialState = {
|
|
|
4
4
|
width: 0,
|
|
5
5
|
height: 0
|
|
6
6
|
};
|
|
7
|
-
export const useParentSize = (elementRef, renderCounter
|
|
7
|
+
export const useParentSize = function (elementRef, renderCounter) {
|
|
8
|
+
let initialSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : initialState;
|
|
8
9
|
const [size, setSize] = useState({
|
|
9
10
|
width: initialSize.width || 0,
|
|
10
11
|
height: initialSize.height || 0
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import debounce from 'lodash/debounce';
|
|
2
2
|
import { useState, useCallback, useEffect } from 'react';
|
|
3
|
-
export const useScrollPosition = (containerRef
|
|
3
|
+
export const useScrollPosition = function (containerRef) {
|
|
4
|
+
let debounceWait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
|
|
4
5
|
const [scrollPosition, setScrollPosition] = useState({
|
|
5
6
|
x: 0,
|
|
6
7
|
y: 0
|
|
@@ -2,12 +2,13 @@ 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
|
-
|
|
5
|
+
export const useTableClipping = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
containerRef,
|
|
8
|
+
width,
|
|
9
|
+
height,
|
|
10
|
+
engine
|
|
11
|
+
} = _ref;
|
|
11
12
|
const scrollPosition = useScrollPosition(containerRef);
|
|
12
13
|
const lineHeight = engine.fontSize + engine.cellPadding * 2 + 2;
|
|
13
14
|
const rows = useMemo(() => {
|
|
@@ -1,4 +1,7 @@
|
|
|
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 =
|
|
4
|
+
export const hasRelativeItems = function (dimension) {
|
|
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
|
+
};
|
|
@@ -2,11 +2,12 @@ import getSubtitle from './subtitle/index.js';
|
|
|
2
2
|
import getTitle from './title/index.js';
|
|
3
3
|
import getValue from './value/index.js';
|
|
4
4
|
export const INDICATOR_FACTOR_100 = 100;
|
|
5
|
-
export default function ({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
export default function (_ref) {
|
|
6
|
+
let {
|
|
7
|
+
store,
|
|
8
|
+
layout,
|
|
9
|
+
extraOptions
|
|
10
|
+
} = _ref;
|
|
10
11
|
const data = store.generateData({
|
|
11
12
|
type: layout.type,
|
|
12
13
|
seriesId: layout.columns && layout.columns.length ? layout.columns[0].dimension : null,
|
|
@@ -212,7 +212,8 @@ function gaussianElimination(a, o) {
|
|
|
212
212
|
// correlation = N * Σ(XY) - Σ(X) * Σ (Y) / √ ( N * Σ(X^2) - Σ(X) ) * ( N * Σ(Y^2) - Σ(Y)^2 ) ) )
|
|
213
213
|
|
|
214
214
|
|
|
215
|
-
export function linear(data
|
|
215
|
+
export function linear(data) {
|
|
216
|
+
let decimalPlaces = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
216
217
|
const sum = [0, 0, 0, 0, 0],
|
|
217
218
|
results = [];
|
|
218
219
|
let N = data.length;
|
|
@@ -271,7 +272,10 @@ export function linear(data, decimalPlaces = 2) {
|
|
|
271
272
|
};
|
|
272
273
|
} // Code extracted from https://github.com/Tom-Alexander/regression-js/
|
|
273
274
|
|
|
274
|
-
function polynomial(data
|
|
275
|
+
function polynomial(data) {
|
|
276
|
+
let order = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
277
|
+
let extrapolate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
278
|
+
let decimalPlaces = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2;
|
|
275
279
|
const lhs = [],
|
|
276
280
|
rhs = [],
|
|
277
281
|
results = [],
|
|
@@ -369,7 +373,8 @@ function polynomial(data, order = 2, extrapolate = 0, decimalPlaces = 2) {
|
|
|
369
373
|
// - https://gist.github.com/avibryant/1151823
|
|
370
374
|
|
|
371
375
|
|
|
372
|
-
function loess(data
|
|
376
|
+
function loess(data) {
|
|
377
|
+
let bandwidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.25;
|
|
373
378
|
const xval = data.map(pair => {
|
|
374
379
|
return pair[0];
|
|
375
380
|
});
|
|
@@ -79,9 +79,12 @@ export const getMaxValue = (maxValue, dataValues, outlierLineMax) => {
|
|
|
79
79
|
|
|
80
80
|
return dataValues !== null && dataValues !== void 0 && dataValues.every(value => value < DEFAULT_MIN_VALUE) ? DEFAULT_MIN_VALUE : undefined;
|
|
81
81
|
};
|
|
82
|
-
export const getRegressionLine = (
|
|
82
|
+
export const getRegressionLine = function () {
|
|
83
83
|
var _regressionLine$title, _regressionLine$title2;
|
|
84
84
|
|
|
85
|
+
let regressionLine = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
86
|
+
let visType = arguments.length > 1 ? arguments[1] : undefined;
|
|
87
|
+
let isVertical = arguments.length > 2 ? arguments[2] : undefined;
|
|
85
88
|
const fontStyle = mergeFontStyleWithDefault((_regressionLine$title = regressionLine.title) === null || _regressionLine$title === void 0 ? void 0 : _regressionLine$title.fontStyle, FONT_STYLE_REGRESSION_LINE_LABEL);
|
|
86
89
|
const plotLineStyle = getPlotLineStyle(fontStyle);
|
|
87
90
|
const plotLineLabelStyle = getPlotLineLabelStyle(fontStyle);
|
|
@@ -11,7 +11,9 @@ export function getIdAxisMap(customAxes) {
|
|
|
11
11
|
return map;
|
|
12
12
|
}, {});
|
|
13
13
|
}
|
|
14
|
-
export function getFullIdAxisMap(
|
|
14
|
+
export function getFullIdAxisMap() {
|
|
15
|
+
let customAxes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
16
|
+
let series = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
15
17
|
const idAxisMap = getIdAxisMap(customAxes.filter(axisItem => series.find(seriesItem => seriesItem.id === axisItem.dimensionItem))); // adds first axis ids to seriesAxisMap
|
|
16
18
|
|
|
17
19
|
series.forEach(s => {
|
|
@@ -28,7 +30,9 @@ export function getFullIdAxisMap(customAxes = [], series = []) {
|
|
|
28
30
|
|
|
29
31
|
export function getAxisIdsMap(customAxes, series) {
|
|
30
32
|
const fullIdAxisMap = getFullIdAxisMap(customAxes, series);
|
|
31
|
-
return Object.entries(fullIdAxisMap).reduce((map,
|
|
33
|
+
return Object.entries(fullIdAxisMap).reduce((map, _ref) => {
|
|
34
|
+
let [id, axis] = _ref;
|
|
35
|
+
|
|
32
36
|
if (!(axis in map)) {
|
|
33
37
|
map[axis] = [];
|
|
34
38
|
}
|
|
@@ -16,9 +16,10 @@ function getEmptySeriesIndexes(series) {
|
|
|
16
16
|
let seriesValues;
|
|
17
17
|
series[0].data.forEach((value, index) => {
|
|
18
18
|
seriesValues = [];
|
|
19
|
-
series.forEach(
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
series.forEach(_ref => {
|
|
20
|
+
let {
|
|
21
|
+
data
|
|
22
|
+
} = _ref;
|
|
22
23
|
// handle undefined values due to empty (or shorter) serie data
|
|
23
24
|
// preserve 0 as valid value
|
|
24
25
|
seriesValues.push(data[index] === undefined ? null : data[index]);
|
|
@@ -30,15 +30,17 @@ const getTransformedExtraOptions = extraOptions => ({ ...extraOptions,
|
|
|
30
30
|
multiAxisTheme: extraOptions.multiAxisTheme || defaultMultiAxisTheme1
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
export default function ({
|
|
34
|
-
store,
|
|
35
|
-
layout,
|
|
36
|
-
el,
|
|
37
|
-
extraConfig,
|
|
38
|
-
extraOptions
|
|
39
|
-
}) {
|
|
33
|
+
export default function (_ref) {
|
|
40
34
|
var _layout$seriesKey, _layout$seriesKey2, _layout$seriesKey2$la, _layout$legend, _config$xAxis;
|
|
41
35
|
|
|
36
|
+
let {
|
|
37
|
+
store,
|
|
38
|
+
layout,
|
|
39
|
+
el,
|
|
40
|
+
extraConfig,
|
|
41
|
+
extraOptions
|
|
42
|
+
} = _ref;
|
|
43
|
+
|
|
42
44
|
const _layout = getTransformedLayout(layout);
|
|
43
45
|
|
|
44
46
|
const _extraOptions = getTransformedExtraOptions(extraOptions);
|
|
@@ -33,11 +33,13 @@ function getLegend(fontStyle, dashboard, visType) {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
const getLegendSetByDisplayStrategy =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
const getLegendSetByDisplayStrategy = _ref => {
|
|
37
|
+
let {
|
|
38
|
+
displayStrategy,
|
|
39
|
+
legendSets,
|
|
40
|
+
legendSetId
|
|
41
|
+
} = _ref;
|
|
42
|
+
|
|
41
43
|
if (displayStrategy === LEGEND_DISPLAY_STRATEGY_FIXED && legendSets.length) {
|
|
42
44
|
return legendSets[0];
|
|
43
45
|
} else if (displayStrategy === LEGEND_DISPLAY_STRATEGY_BY_DATA_ITEM) {
|
|
@@ -47,19 +49,20 @@ const getLegendSetByDisplayStrategy = ({
|
|
|
47
49
|
}
|
|
48
50
|
};
|
|
49
51
|
|
|
50
|
-
const formatLabel =
|
|
51
|
-
seriesId,
|
|
52
|
-
seriesColor,
|
|
53
|
-
seriesName,
|
|
54
|
-
seriesType,
|
|
55
|
-
metaData,
|
|
56
|
-
displayStrategy,
|
|
57
|
-
legendSets,
|
|
58
|
-
fontStyle,
|
|
59
|
-
visType
|
|
60
|
-
}) => {
|
|
52
|
+
const formatLabel = _ref2 => {
|
|
61
53
|
var _metaData$seriesId, _legendSet$legends;
|
|
62
54
|
|
|
55
|
+
let {
|
|
56
|
+
seriesId,
|
|
57
|
+
seriesColor,
|
|
58
|
+
seriesName,
|
|
59
|
+
seriesType,
|
|
60
|
+
metaData,
|
|
61
|
+
displayStrategy,
|
|
62
|
+
legendSets,
|
|
63
|
+
fontStyle,
|
|
64
|
+
visType
|
|
65
|
+
} = _ref2;
|
|
63
66
|
const legendSet = getLegendSetByDisplayStrategy({
|
|
64
67
|
displayStrategy,
|
|
65
68
|
legendSets,
|
|
@@ -75,15 +78,15 @@ const formatLabel = ({
|
|
|
75
78
|
result.push("<span style=\"margin-left: 8px\" class=\"data-test-series-key-item-name\">".concat(seriesName, "</span>"));
|
|
76
79
|
} else if (legendSet !== null && legendSet !== void 0 && (_legendSet$legends = legendSet.legends) !== null && _legendSet$legends !== void 0 && _legendSet$legends.length && isLegendSetType(visType) && seriesType !== getType(VIS_TYPE_LINE).type) {
|
|
77
80
|
// item with legend set
|
|
78
|
-
legendSet.legends.sort((a, b) => a.startValue - b.startValue).forEach((legend, index) => result.push("<svg
|
|
81
|
+
legendSet.legends.sort((a, b) => a.startValue - b.startValue).forEach((legend, index) => result.push("<svg width=\"".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "\" height=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "\" style=\"margin-right:-5px; z-index: ").concat(legendSet.legends.length - index, "\" class=\"data-test-series-key-item-bullet\">\n <circle cx=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" cy=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" r=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" fill=\"").concat(legend.color, "\"></circle>\n </svg>")));
|
|
79
82
|
result.push("<span style=\"margin-left: 8px\" class=\"data-test-series-key-item-name\">".concat(seriesName, "</span>"));
|
|
80
83
|
} else {
|
|
81
84
|
// regular item (not a trendline, no applied legend set)
|
|
82
85
|
if ((seriesColor === null || seriesColor === void 0 ? void 0 : seriesColor.patternIndex) !== undefined) {
|
|
83
86
|
const pattern = colorSets[COLOR_SET_PATTERNS].patterns[seriesColor.patternIndex];
|
|
84
|
-
result.push("<svg
|
|
87
|
+
result.push("<svg style=\"height: ".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px; width: ").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px; display: inline-block; margin-right:5px\" class=\"data-test-series-key-item-bullet\">\n <defs>\n <pattern id=\"pattern").concat(seriesColor.patternIndex, "\" patternUnits=\"userSpaceOnUse\" width=\"").concat(pattern.width, "\" height=\"").concat(pattern.height, "\">\n <path stroke=\"").concat(pattern.color, "\" d=\"").concat(pattern.path, "\"/>\n </pattern>\n </defs>\n <circle cx=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" cy=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" r=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" fill=\"url(#pattern").concat(seriesColor.patternIndex, ")\"/>\n </svg>"));
|
|
85
88
|
} else {
|
|
86
|
-
result.push("<svg
|
|
89
|
+
result.push("<svg width=\"".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "\" height=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "\" style=\"margin-right:5px\" class=\"data-test-series-key-item-bullet\">\n <circle cx=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" cy=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" r=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" fill=\"").concat(seriesColor, "\"></circle>\n </svg>"));
|
|
87
90
|
}
|
|
88
91
|
|
|
89
92
|
result.push("<span class=\"data-test-series-key-item-name\">".concat(seriesName, "</span>"));
|
|
@@ -93,15 +96,16 @@ const formatLabel = ({
|
|
|
93
96
|
return result.join('');
|
|
94
97
|
};
|
|
95
98
|
|
|
96
|
-
export default function ({
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
99
|
+
export default function (_ref3) {
|
|
100
|
+
let {
|
|
101
|
+
isHidden,
|
|
102
|
+
fontStyle,
|
|
103
|
+
visType,
|
|
104
|
+
dashboard,
|
|
105
|
+
legendSets = [],
|
|
106
|
+
metaData,
|
|
107
|
+
displayStrategy
|
|
108
|
+
} = _ref3;
|
|
105
109
|
const mergedFontStyle = mergeFontStyleWithDefault(fontStyle, FONT_STYLE_LEGEND);
|
|
106
110
|
return isHidden || visType === VIS_TYPE_SCATTER ? {
|
|
107
111
|
enabled: false
|
|
@@ -5,26 +5,30 @@ const OUT_OF_BOUNDS_COLOR = '#CCCCCC';
|
|
|
5
5
|
|
|
6
6
|
const getLegend = (value, legendSet) => value && legendSet ? getLegendByValueFromLegendSet(legendSet, value) : {};
|
|
7
7
|
|
|
8
|
-
export const applyLegendSet = (
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
export const applyLegendSet = function () {
|
|
9
|
+
let seriesObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
10
|
+
let legendSet = arguments.length > 1 ? arguments[1] : undefined;
|
|
11
|
+
return !seriesObj.type ? { ...seriesObj,
|
|
12
|
+
data: seriesObj.data.map(value => {
|
|
13
|
+
var _getLegend, _getLegend2, _getLegend3, _getLegend4;
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
} : { ...seriesObj
|
|
15
|
+
return isNumeric(value) // Single category pass data as [value1, value2]
|
|
16
|
+
? {
|
|
17
|
+
y: value,
|
|
18
|
+
color: ((_getLegend = getLegend(value, legendSet)) === null || _getLegend === void 0 ? void 0 : _getLegend.color) || OUT_OF_BOUNDS_COLOR,
|
|
19
|
+
legend: ((_getLegend2 = getLegend(value, legendSet)) === null || _getLegend2 === void 0 ? void 0 : _getLegend2.name) || '-',
|
|
20
|
+
legendSet: legendSet.name
|
|
21
|
+
} : Array.isArray(value) // Dual category pass data as [[position1, value1], [position2, value2]]
|
|
22
|
+
? {
|
|
23
|
+
x: value[0],
|
|
24
|
+
y: value[1],
|
|
25
|
+
color: ((_getLegend3 = getLegend(value[1], legendSet)) === null || _getLegend3 === void 0 ? void 0 : _getLegend3.color) || OUT_OF_BOUNDS_COLOR,
|
|
26
|
+
legend: ((_getLegend4 = getLegend(value[1], legendSet)) === null || _getLegend4 === void 0 ? void 0 : _getLegend4.name) || '-',
|
|
27
|
+
legendSet: legendSet.name
|
|
28
|
+
} : value;
|
|
29
|
+
})
|
|
30
|
+
} : { ...seriesObj
|
|
31
|
+
};
|
|
28
32
|
};
|
|
29
33
|
export const getLegendSetTooltip = () => ({
|
|
30
34
|
pointFormatter: function () {
|
|
@@ -1,14 +1,15 @@
|
|
|
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
|
-
|
|
4
|
+
export default (_ref => {
|
|
5
|
+
let {
|
|
6
|
+
visType,
|
|
7
|
+
xAxisName,
|
|
8
|
+
yAxisName,
|
|
9
|
+
showLabels,
|
|
10
|
+
tooltipData,
|
|
11
|
+
onClick
|
|
12
|
+
} = _ref;
|
|
12
13
|
const series = {
|
|
13
14
|
dataLabels: {
|
|
14
15
|
enabled: showLabels,
|
|
@@ -27,9 +27,11 @@ const getLabelOffsetFromTextAlign = textAlign => {
|
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
function getPlotLine(
|
|
30
|
+
function getPlotLine() {
|
|
31
31
|
var _regressionLine$title, _regressionLine$title2;
|
|
32
32
|
|
|
33
|
+
let regressionLine = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
34
|
+
let defaultLabel = arguments.length > 1 ? arguments[1] : undefined;
|
|
33
35
|
const value = regressionLine.value;
|
|
34
36
|
|
|
35
37
|
if (!isNumber(value)) {
|