@gooddata/sdk-ui-ext 11.68.0-alpha.0 → 11.68.0-alpha.10
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/NOTICE +8338 -63070
- package/esm/insightPicker/InsightPickerCore.d.ts +1 -1
- package/esm/insightPicker/InsightPickerCore.d.ts.map +1 -1
- package/esm/insightPicker/InsightPickerCore.js +8 -6
- package/esm/insightPicker/InsightPickerMenu.d.ts +1 -1
- package/esm/insightPicker/InsightPickerMenu.d.ts.map +1 -1
- package/esm/insightPicker/InsightPickerMenu.js +5 -1
- package/esm/insightPicker/types.d.ts +5 -1
- package/esm/insightPicker/types.d.ts.map +1 -1
- package/esm/insightPicker/useInsightPickerHybridSearch.d.ts.map +1 -1
- package/esm/insightPicker/useInsightPickerHybridSearch.js +2 -0
- package/esm/insightView/InsightRenderer.d.ts.map +1 -1
- package/esm/insightView/InsightRenderer.js +4 -4
- package/esm/internal/components/BaseVisualization.d.ts.map +1 -1
- package/esm/internal/components/BaseVisualization.js +7 -7
- package/esm/internal/components/attributeHierarchies/attributeHierarchyDialog/AttributeHierarchyDialogFooter.js +2 -2
- package/esm/internal/components/attributeHierarchies/attributeHierarchyDialog/AttributeHierarchyDialogProvider.d.ts.map +1 -1
- package/esm/internal/components/attributeHierarchies/attributeHierarchyDialog/AttributeHierarchyDialogProvider.js +4 -4
- package/esm/internal/components/attributeHierarchies/attributeHierarchyDialog/useBackendProvider.d.ts.map +1 -1
- package/esm/internal/components/attributeHierarchies/attributeHierarchyDialog/useBackendProvider.js +2 -2
- package/esm/internal/components/attributeHierarchies/attributeHierarchyDialog/utils.d.ts.map +1 -1
- package/esm/internal/components/attributeHierarchies/attributeHierarchyDialog/utils.js +2 -2
- package/esm/internal/components/configurationControls/CheckboxControl.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/CheckboxControl.js +3 -3
- package/esm/internal/components/configurationControls/ConfigSection.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/ConfigSection.js +3 -3
- package/esm/internal/components/configurationControls/ConfigSubsection.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/ConfigSubsection.js +3 -3
- package/esm/internal/components/configurationControls/ContinuousLineControl.js +3 -3
- package/esm/internal/components/configurationControls/DistintcPointShapesControl.js +3 -3
- package/esm/internal/components/configurationControls/DropdownControl.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/DropdownControl.js +3 -3
- package/esm/internal/components/configurationControls/GeoViewportControl.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/GeoViewportControl.js +14 -14
- package/esm/internal/components/configurationControls/InputControl.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/InputControl.js +4 -4
- package/esm/internal/components/configurationControls/LineShapeControl.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/LineShapeControl.js +3 -2
- package/esm/internal/components/configurationControls/PagingSection.js +5 -5
- package/esm/internal/components/configurationControls/PivotTableTextWrappingControl.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/PivotTableTextWrappingControl.js +3 -3
- package/esm/internal/components/configurationControls/PushpinShapeControl.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/PushpinShapeControl.js +5 -5
- package/esm/internal/components/configurationControls/advanced/AdvancedSection.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/advanced/AdvancedSection.js +3 -3
- package/esm/internal/components/configurationControls/colors/ColorsSection.js +3 -3
- package/esm/internal/components/configurationControls/comparison/indicators/colorsControl/ColorCheckbox.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/comparison/indicators/colorsControl/ColorCheckbox.js +4 -4
- package/esm/internal/components/configurationControls/comparison/indicators/colorsControl/ColorItem.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/comparison/indicators/colorsControl/ColorItem.js +3 -3
- package/esm/internal/components/configurationControls/comparison/indicators/colorsControl/ColorResetButton.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/comparison/indicators/colorsControl/ColorResetButton.js +6 -6
- package/esm/internal/components/configurationControls/comparison/values/numberFormat/NumberFormatControl.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/comparison/values/numberFormat/NumberFormatControl.js +3 -3
- package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingDialog.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingDialog.js +2 -2
- package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingSection.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/conditionalFormatting/ConditionalFormattingSection.js +3 -3
- package/esm/internal/components/configurationControls/customTooltip/CustomTooltipSection.js +3 -3
- package/esm/internal/components/configurationControls/interactions/InteractionsSection.d.ts +1 -2
- package/esm/internal/components/configurationControls/interactions/InteractionsSection.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/interactions/InteractionsSection.js +2 -2
- package/esm/internal/components/configurationControls/total/TotalSection.d.ts.map +1 -1
- package/esm/internal/components/configurationControls/total/TotalSection.js +4 -4
- package/esm/internal/components/configurationPanels/BaseChartConfigurationPanel.js +2 -2
- package/esm/internal/components/configurationPanels/ConfigurationPanelContent.d.ts.map +1 -1
- package/esm/internal/components/configurationPanels/ConfigurationPanelContent.js +1 -2
- package/esm/internal/components/configurationPanels/LineChartBasedConfigurationPanel.js +1 -1
- package/esm/internal/components/configurationPanels/UnsupportedConfigurationPanel.js +2 -2
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/WorkspaceItem/granularPermissionUtils.d.ts.map +1 -1
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/WorkspaceItem/granularPermissionUtils.js +3 -3
- package/esm/internal/components/dialogs/userManagementDialogs/types.d.ts.map +1 -1
- package/esm/internal/components/dialogs/userManagementDialogs/types.js +6 -6
- package/esm/internal/components/insightList/useInsightPagedList.d.ts.map +1 -1
- package/esm/internal/components/insightList/useInsightPagedList.js +3 -3
- package/esm/internal/components/pluggableVisualizations/AbstractPluggableVisualization.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/AbstractPluggableVisualization.js +4 -4
- package/esm/internal/components/pluggableVisualizations/PluggableColumnBarCharts.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/PluggableColumnBarCharts.js +3 -4
- package/esm/internal/components/pluggableVisualizations/areaChart/PluggableAreaChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/areaChart/PluggableAreaChart.js +6 -6
- package/esm/internal/components/pluggableVisualizations/barChart/PluggableBarChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/barChart/PluggableBarChart.js +7 -7
- package/esm/internal/components/pluggableVisualizations/baseChart/PluggableBaseChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/baseChart/PluggableBaseChart.js +9 -8
- package/esm/internal/components/pluggableVisualizations/bubbleChart/PluggableBubbleChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/bubbleChart/PluggableBubbleChart.js +4 -5
- package/esm/internal/components/pluggableVisualizations/bulletChart/PluggableBulletChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/bulletChart/PluggableBulletChart.js +3 -3
- package/esm/internal/components/pluggableVisualizations/columnChart/PluggableColumnChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/columnChart/PluggableColumnChart.js +7 -7
- package/esm/internal/components/pluggableVisualizations/comboChart/PluggableComboChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/comboChart/PluggableComboChart.js +6 -6
- package/esm/internal/components/pluggableVisualizations/comboChart/PluggableComboChartDeprecated.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/comboChart/PluggableComboChartDeprecated.js +5 -4
- package/esm/internal/components/pluggableVisualizations/geoAreaChart/PluggableGeoAreaChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/geoAreaChart/PluggableGeoAreaChart.js +4 -5
- package/esm/internal/components/pluggableVisualizations/geoChart/PluggableGeoPushpinChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/geoChart/PluggableGeoPushpinChart.js +8 -9
- package/esm/internal/components/pluggableVisualizations/geoChartNext/PluggableGeoPushpinChartNext.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/geoChartNext/PluggableGeoPushpinChartNext.js +15 -16
- package/esm/internal/components/pluggableVisualizations/geoCommon/geoPropertySanitization.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/geoCommon/geoPropertySanitization.js +8 -8
- package/esm/internal/components/pluggableVisualizations/headline/PluggableHeadline.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/headline/PluggableHeadline.js +2 -3
- package/esm/internal/components/pluggableVisualizations/headline/headlineBucketHelper.js +3 -3
- package/esm/internal/components/pluggableVisualizations/heatMap/PluggableHeatmap.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/heatMap/PluggableHeatmap.js +8 -7
- package/esm/internal/components/pluggableVisualizations/lineChart/PluggableLineChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/lineChart/PluggableLineChart.js +8 -8
- package/esm/internal/components/pluggableVisualizations/mekko/PluggableMekko.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/mekko/PluggableMekko.js +11 -11
- package/esm/internal/components/pluggableVisualizations/pieChart/PluggablePieChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/pieChart/PluggablePieChart.js +8 -8
- package/esm/internal/components/pluggableVisualizations/pivotTable/PluggablePivotTable.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/pivotTable/PluggablePivotTable.js +5 -5
- package/esm/internal/components/pluggableVisualizations/pivotTable/pivotTableAdditionalFactories.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/pivotTable/pivotTableAdditionalFactories.js +2 -2
- package/esm/internal/components/pluggableVisualizations/pivotTable/pivotTableConfigFromInsight.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/pivotTable/pivotTableConfigFromInsight.js +6 -6
- package/esm/internal/components/pluggableVisualizations/pivotTableNext/PluggablePivotTableNext.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/pivotTableNext/PluggablePivotTableNext.js +4 -5
- package/esm/internal/components/pluggableVisualizations/pivotTableNext/pivotTableNextAdditionalFactories.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/pivotTableNext/pivotTableNextAdditionalFactories.js +2 -2
- package/esm/internal/components/pluggableVisualizations/pivotTableNext/sortHelpers.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/pivotTableNext/sortHelpers.js +2 -2
- package/esm/internal/components/pluggableVisualizations/radarChart/PluggableRadarChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/radarChart/PluggableRadarChart.js +4 -4
- package/esm/internal/components/pluggableVisualizations/repeater/PluggableRepeater.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/repeater/PluggableRepeater.js +6 -7
- package/esm/internal/components/pluggableVisualizations/sankeyChart/PluggableSankeyChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/sankeyChart/PluggableSankeyChart.js +3 -4
- package/esm/internal/components/pluggableVisualizations/scatterPlot/PluggableScatterPlot.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/scatterPlot/PluggableScatterPlot.js +5 -6
- package/esm/internal/components/pluggableVisualizations/treeMap/PluggableTreemap.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/treeMap/PluggableTreemap.js +6 -5
- package/esm/internal/components/pluggableVisualizations/waterfallChart/PluggableWaterfallChart.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/waterfallChart/PluggableWaterfallChart.js +11 -11
- package/esm/internal/components/pluggableVisualizations/xirr/PluggableXirr.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/xirr/PluggableXirr.js +2 -3
- package/esm/internal/interfaces/Visualization.d.ts.map +1 -1
- package/esm/internal/interfaces/Visualization.js +6 -6
- package/esm/internal/translations/en-US.localization-bundle.d.ts +28 -0
- package/esm/internal/translations/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/en-US.localization-bundle.js +29 -1
- package/esm/internal/translations/fr-CA.localization-bundle.js +1 -1
- package/esm/internal/translations/it-IT.localization-bundle.js +2 -2
- package/esm/internal/translations/ru-RU.localization-bundle.js +1 -1
- package/esm/internal/translations/tr-TR.localization-bundle.js +1 -1
- package/esm/internal/translations/zh-Hant.localization-bundle.js +4 -4
- package/esm/internal/utils/bucketConfig.d.ts.map +1 -1
- package/esm/internal/utils/bucketConfig.js +5 -5
- package/esm/internal/utils/bucketHelper.d.ts.map +1 -1
- package/esm/internal/utils/bucketHelper.js +15 -14
- package/esm/internal/utils/bucketRules.d.ts.map +1 -1
- package/esm/internal/utils/bucketRules.js +3 -2
- package/esm/internal/utils/colors.d.ts.map +1 -1
- package/esm/internal/utils/colors.js +11 -11
- package/esm/internal/utils/controlsHelper.d.ts.map +1 -1
- package/esm/internal/utils/controlsHelper.js +7 -7
- package/esm/internal/utils/dimensions.d.ts.map +1 -1
- package/esm/internal/utils/dimensions.js +4 -4
- package/esm/internal/utils/drillablePredicates.d.ts.map +1 -1
- package/esm/internal/utils/drillablePredicates.js +4 -4
- package/esm/internal/utils/embeddingCodeGenerator/getReactEmbeddingCodeGenerator.d.ts.map +1 -1
- package/esm/internal/utils/embeddingCodeGenerator/getReactEmbeddingCodeGenerator.js +11 -10
- package/esm/internal/utils/propertiesHelper.d.ts.map +1 -1
- package/esm/internal/utils/propertiesHelper.js +16 -15
- package/esm/internal/utils/removeUseless.js +3 -3
- package/esm/internal/utils/sort.d.ts.map +1 -1
- package/esm/internal/utils/sort.js +9 -8
- package/esm/internal/utils/translations.d.ts.map +1 -1
- package/esm/internal/utils/translations.js +2 -3
- package/esm/internal/utils/uiConfigHelpers/areaChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/areaChartUiConfigHelper.js +10 -10
- package/esm/internal/utils/uiConfigHelpers/baseChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/baseChartUiConfigHelper.js +19 -19
- package/esm/internal/utils/uiConfigHelpers/bubbleChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/bubbleChartUiConfigHelper.js +8 -8
- package/esm/internal/utils/uiConfigHelpers/bulletChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/bulletChartUiConfigHelper.js +2 -2
- package/esm/internal/utils/uiConfigHelpers/columnBarChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/columnBarChartUiConfigHelper.js +6 -6
- package/esm/internal/utils/uiConfigHelpers/comboChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/comboChartUiConfigHelper.js +8 -8
- package/esm/internal/utils/uiConfigHelpers/comboChartUiConfigHelperDeprecated.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/comboChartUiConfigHelperDeprecated.js +10 -10
- package/esm/internal/utils/uiConfigHelpers/dependencyWheelChartUiConfigHelper.js +6 -6
- package/esm/internal/utils/uiConfigHelpers/donutChartUiConfigHelper.js +5 -5
- package/esm/internal/utils/uiConfigHelpers/funnelChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/funnelChartUiConfigHelper.js +6 -6
- package/esm/internal/utils/uiConfigHelpers/geoAreaChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/geoAreaChartUiConfigHelper.js +3 -3
- package/esm/internal/utils/uiConfigHelpers/geoPushpinChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/geoPushpinChartUiConfigHelper.js +15 -15
- package/esm/internal/utils/uiConfigHelpers/headlineUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/headlineUiConfigHelper.js +10 -10
- package/esm/internal/utils/uiConfigHelpers/heatmapUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/heatmapUiConfigHelper.js +7 -7
- package/esm/internal/utils/uiConfigHelpers/lineChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/lineChartUiConfigHelper.js +13 -13
- package/esm/internal/utils/uiConfigHelpers/mekkoUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/mekkoUiConfigHelper.js +7 -7
- package/esm/internal/utils/uiConfigHelpers/pieChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/pieChartUiConfigHelper.js +12 -12
- package/esm/internal/utils/uiConfigHelpers/pivotTableNextUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/pivotTableNextUiConfigHelper.js +14 -14
- package/esm/internal/utils/uiConfigHelpers/pivotTableUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/pivotTableUiConfigHelper.js +14 -14
- package/esm/internal/utils/uiConfigHelpers/pyramidChartUiConfigHelper.js +5 -5
- package/esm/internal/utils/uiConfigHelpers/radarChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/radarChartUiConfigHelper.js +13 -13
- package/esm/internal/utils/uiConfigHelpers/repeaterUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/repeaterUiConfigHelper.js +14 -14
- package/esm/internal/utils/uiConfigHelpers/sankeyChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/sankeyChartUiConfigHelper.js +10 -10
- package/esm/internal/utils/uiConfigHelpers/scatterPlotUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/scatterPlotUiConfigHelper.js +8 -8
- package/esm/internal/utils/uiConfigHelpers/treemapUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/treemapUiConfigHelper.js +12 -12
- package/esm/internal/utils/uiConfigHelpers/waterfallChartUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/waterfallChartUiConfigHelper.js +11 -11
- package/esm/internal/utils/uiConfigHelpers/xirrUiConfigHelper.d.ts.map +1 -1
- package/esm/internal/utils/uiConfigHelpers/xirrUiConfigHelper.js +5 -5
- package/esm/notificationsPanel/Notification/Notification.d.ts.map +1 -1
- package/esm/notificationsPanel/Notification/Notification.js +4 -4
- package/esm/sdk-ui-ext.d.ts +6 -2
- package/esm/share/ObjectShareDialog.d.ts +1 -1
- package/esm/share/ObjectShareDialog.js +3 -3
- package/esm/share/messages.d.ts +28 -0
- package/esm/share/messages.d.ts.map +1 -1
- package/esm/share/messages.js +14 -0
- package/esm/share/removeAccessConfirm.d.ts +21 -0
- package/esm/share/removeAccessConfirm.d.ts.map +1 -0
- package/esm/share/removeAccessConfirm.js +27 -0
- package/esm/share/useObjectShareDialog.d.ts +14 -11
- package/esm/share/useObjectShareDialog.d.ts.map +1 -1
- package/esm/share/useObjectShareDialog.js +54 -24
- package/package.json +21 -21
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// (C) 2019-2026 GoodData Corporation
|
|
2
|
-
import {
|
|
2
|
+
import { negate, without } from "lodash-es";
|
|
3
3
|
import { areObjRefsEqual, bucketItems, bucketsFind, bucketsMeasures, idRef, insightBuckets, insightVisualizationType, isObjRef, isPoPMeasure, isPreviousPeriodMeasure, isSimpleMeasure, } from "@gooddata/sdk-model";
|
|
4
4
|
import { BucketNames, OverTimeComparisonTypes, VisualizationTypes, } from "@gooddata/sdk-ui";
|
|
5
5
|
import { isAreaChart, isBulletChart, isComboChart, isLineChart } from "@gooddata/sdk-ui-charts";
|
|
6
|
+
import { _cloneDeep, _compact, _isEmpty, _set, _uniqBy } from "@gooddata/util";
|
|
6
7
|
import { subtitles, titles } from "../../locales.js";
|
|
7
8
|
import { ATTRIBUTE, BUCKETS, DATE, METRIC, SHOW_ON_SECONDARY_AXIS } from "../constants/bucket.js";
|
|
8
9
|
import { DATE_DATASET_ATTRIBUTE, } from "../interfaces/Visualization.js";
|
|
@@ -307,15 +308,15 @@ export function getDateFilter(filtersBucket) {
|
|
|
307
308
|
const filters = filterItem.filters ?? [];
|
|
308
309
|
return filters.find(isDateFilter);
|
|
309
310
|
});
|
|
310
|
-
const dateFilters =
|
|
311
|
+
const dateFilters = _compact(dateFiltersInclEmpty);
|
|
311
312
|
return dateFilters.length ? dateFilters[0] : null;
|
|
312
313
|
}
|
|
313
314
|
export function getComparisonTypeFromFilters(filtersBucket) {
|
|
314
|
-
if (
|
|
315
|
+
if (_isEmpty(filtersBucket)) {
|
|
315
316
|
return OverTimeComparisonTypes.NOTHING;
|
|
316
317
|
}
|
|
317
318
|
const dateFilter = getDateFilter(filtersBucket);
|
|
318
|
-
return !
|
|
319
|
+
return !_isEmpty(dateFilter) && dateFilter.overTimeComparisonType
|
|
319
320
|
? dateFilter.overTimeComparisonType
|
|
320
321
|
: OverTimeComparisonTypes.NOTHING;
|
|
321
322
|
}
|
|
@@ -349,7 +350,7 @@ function bucketSupportsSubtitle(visualizationType, bucketLocalIdentifier) {
|
|
|
349
350
|
}
|
|
350
351
|
export function setBucketTitles(referencePoint, visualizationType, intl) {
|
|
351
352
|
const buckets = referencePoint?.buckets;
|
|
352
|
-
const updatedUiConfig =
|
|
353
|
+
const updatedUiConfig = _cloneDeep(referencePoint?.uiConfig);
|
|
353
354
|
if (!updatedUiConfig) {
|
|
354
355
|
return updatedUiConfig;
|
|
355
356
|
}
|
|
@@ -362,11 +363,11 @@ export function setBucketTitles(referencePoint, visualizationType, intl) {
|
|
|
362
363
|
if (bucketSupportsSubtitle(visualizationType, localIdentifier)) {
|
|
363
364
|
const subtitleId = generateBucketSubtitleId(localIdentifier, visualizationType);
|
|
364
365
|
const subtitle = getTranslation(subtitleId, intl);
|
|
365
|
-
|
|
366
|
+
_set(updatedUiConfig, [BUCKETS, localIdentifier, "subtitle"], subtitle);
|
|
366
367
|
}
|
|
367
368
|
const titleId = generateBucketTitleId(localIdentifier, visualizationType);
|
|
368
369
|
const title = getTranslation(titleId, intl);
|
|
369
|
-
|
|
370
|
+
_set(updatedUiConfig, [BUCKETS, localIdentifier, "title"], title);
|
|
370
371
|
});
|
|
371
372
|
return updatedUiConfig;
|
|
372
373
|
}
|
|
@@ -454,7 +455,7 @@ export function getTotalsFromBucket(buckets, bucketName) {
|
|
|
454
455
|
}
|
|
455
456
|
function getUniqueAttributes(buckets) {
|
|
456
457
|
const attributes = getAllItemsByType(buckets, [ATTRIBUTE, DATE]);
|
|
457
|
-
return
|
|
458
|
+
return _uniqBy(attributes, (attribute) => attribute?.attribute);
|
|
458
459
|
}
|
|
459
460
|
export function getMeasuresFromMdObject(insight) {
|
|
460
461
|
if (!insight) {
|
|
@@ -487,7 +488,7 @@ export function getMeasureItems(buckets) {
|
|
|
487
488
|
return acc;
|
|
488
489
|
}, []);
|
|
489
490
|
// if no preferred items are found, return all available items
|
|
490
|
-
if (
|
|
491
|
+
if (_isEmpty(preferredMeasures)) {
|
|
491
492
|
return getAllMeasures(buckets);
|
|
492
493
|
}
|
|
493
494
|
return preferredMeasures;
|
|
@@ -577,7 +578,7 @@ function hasItemsAboveLimit(bucket, itemsLimit) {
|
|
|
577
578
|
}
|
|
578
579
|
function applyItemsLimit(bucket, itemsLimit) {
|
|
579
580
|
if (itemsLimit !== undefined && hasItemsAboveLimit(bucket, itemsLimit)) {
|
|
580
|
-
const newBucket =
|
|
581
|
+
const newBucket = _cloneDeep(bucket);
|
|
581
582
|
newBucket.items = newBucket.items.slice(0, itemsLimit);
|
|
582
583
|
return newBucket;
|
|
583
584
|
}
|
|
@@ -590,7 +591,7 @@ export function applyUiConfig(referencePoint) {
|
|
|
590
591
|
const buckets = referencePoint.buckets;
|
|
591
592
|
const uiConfig = referencePoint.uiConfig?.buckets;
|
|
592
593
|
const newBuckets = buckets.map((bucket) => applyUiConfigOnBucket(bucket, uiConfig?.[bucket.localIdentifier]));
|
|
593
|
-
|
|
594
|
+
_set(referencePoint, "buckets", newBuckets);
|
|
594
595
|
return referencePoint;
|
|
595
596
|
}
|
|
596
597
|
export function hasBucket(buckets, localIdentifier) {
|
|
@@ -609,7 +610,7 @@ export function getFirstMasterWithDerived(measureItems) {
|
|
|
609
610
|
measureItem === chosenMaster);
|
|
610
611
|
}
|
|
611
612
|
export function removeAllArithmeticMeasuresFromDerived(extendedReferencePoint) {
|
|
612
|
-
const originalBuckets =
|
|
613
|
+
const originalBuckets = _cloneDeep(extendedReferencePoint.buckets);
|
|
613
614
|
extendedReferencePoint.buckets.forEach((bucket) => {
|
|
614
615
|
bucket.items = filterOutArithmeticMeasuresFromDerived(bucket.items, originalBuckets);
|
|
615
616
|
});
|
|
@@ -733,7 +734,7 @@ function getMeasureDependencies(measure, allMeasures) {
|
|
|
733
734
|
const dependenciesOfDependency = getMeasureDependencies(directDependency, allMeasures);
|
|
734
735
|
indirectDependencies.push(...dependenciesOfDependency);
|
|
735
736
|
});
|
|
736
|
-
return
|
|
737
|
+
return _uniqBy([...directDependencies, ...indirectDependencies], (dependency) => dependency.localIdentifier);
|
|
737
738
|
}
|
|
738
739
|
function tryToSelectMeasures(measures, alreadySelectedMeasures, limit) {
|
|
739
740
|
const measuresToBePlaced = without(measures, ...alreadySelectedMeasures);
|
|
@@ -848,7 +849,7 @@ export const getMainRowAttribute = (buckets) => {
|
|
|
848
849
|
return attributeItems[0] ?? undefined;
|
|
849
850
|
};
|
|
850
851
|
export const cloneBucketItem = (item) => {
|
|
851
|
-
const clonedItem =
|
|
852
|
+
const clonedItem = _cloneDeep(item);
|
|
852
853
|
clonedItem.localIdentifier = clonedItem.localIdentifier + "_cloned";
|
|
853
854
|
return clonedItem;
|
|
854
855
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bucketRules.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/bucketRules.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bucketRules.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/bucketRules.ts"],"names":[],"mappings":"AAcA,O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(C) 2019-2026 GoodData Corporation
|
|
2
|
-
import {
|
|
2
|
+
import { reduce } from "lodash-es";
|
|
3
3
|
import { BucketNames } from "@gooddata/sdk-ui";
|
|
4
|
+
import { _isEmpty } from "@gooddata/util";
|
|
4
5
|
import { ALL_TIME, ATTRIBUTE, DATE, METRIC } from "../constants/bucket.js";
|
|
5
6
|
import { INCREASE_MAX_TABLE_ATTRIBUTES_ITEMS_LIMIT, INCREASE_MAX_TABLE_MEASURE_ITEMS_LIMIT, MAX_METRICS_COUNT, MAX_TABLE_CATEGORIES_COUNT, } from "../constants/uiConfig.js";
|
|
6
7
|
import { getAllAttributeItems, getAllItemsByType, getAttributeItemsWithoutStacks, getBucketItems, getItemsCount, getMeasureItems, getStackItems, isDateBucketItem, isMeasureValueFilter, isRankingFilter, } from "./bucketHelper.js";
|
|
@@ -130,7 +131,7 @@ export function hasNonAllTimeFilter(filters) {
|
|
|
130
131
|
return filter?.attribute === "attr.datedataset";
|
|
131
132
|
});
|
|
132
133
|
const filterInterval = dateFilter?.filters?.[0]?.interval?.interval ?? [];
|
|
133
|
-
return !
|
|
134
|
+
return !_isEmpty(filterInterval);
|
|
134
135
|
}
|
|
135
136
|
function hasNoRankingFilter(_, filters) {
|
|
136
137
|
const allBucketFilters = filters?.items.flatMap((filterItem) => filterItem.filters);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/colors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/colors.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,MAAM,EACX,KAAK,iBAAiB,EASzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAiC,MAAM,kBAAkB,CAAC;AAC7G,OAAO,EAAc,KAAK,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGjF,OAAO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
|
1
1
|
// (C) 2019-2026 GoodData Corporation
|
|
2
|
-
import { cloneDeep, compact, isEmpty, isEqual, set, uniqBy } from "lodash-es";
|
|
3
2
|
import { isAttributeDescriptor, isColorDescriptor, isColorFromPalette, isMeasureDescriptor, isResultAttributeHeader, isRgbColor, isUriRef, } from "@gooddata/sdk-model";
|
|
4
3
|
import { getMappingHeaderFormattedName } from "@gooddata/sdk-ui";
|
|
5
4
|
import { ColorUtils } from "@gooddata/sdk-ui-charts";
|
|
5
|
+
import { _cloneDeep, _compact, _isEmpty, _isEqual, _set, _uniqBy } from "@gooddata/util";
|
|
6
6
|
/**
|
|
7
7
|
* Name of the colored item as the list displays it, so that searching matches what the user sees: the
|
|
8
8
|
* formatted element value for dates and number-formatted attributes, the raw name otherwise.
|
|
@@ -11,7 +11,7 @@ function getItemName(item) {
|
|
|
11
11
|
return getMappingHeaderFormattedName(item.mappingHeader) || "";
|
|
12
12
|
}
|
|
13
13
|
export function getSearchedItems(inputItems, searchString) {
|
|
14
|
-
if (
|
|
14
|
+
if (_isEmpty(searchString)) {
|
|
15
15
|
return inputItems;
|
|
16
16
|
}
|
|
17
17
|
return inputItems.filter((item) => {
|
|
@@ -94,9 +94,9 @@ function mergeColorMappingToProperties(properties, id, color) {
|
|
|
94
94
|
},
|
|
95
95
|
];
|
|
96
96
|
const previousColorMapping = properties?.controls?.["colorMapping"] ?? [];
|
|
97
|
-
const mergedMapping =
|
|
98
|
-
const newProperties =
|
|
99
|
-
|
|
97
|
+
const mergedMapping = _compact(_uniqBy([...colorMapping, ...previousColorMapping], "id"));
|
|
98
|
+
const newProperties = _cloneDeep(properties);
|
|
99
|
+
_set(newProperties, "controls.colorMapping", mergedMapping);
|
|
100
100
|
return newProperties;
|
|
101
101
|
}
|
|
102
102
|
export function getProperties(properties, item, color) {
|
|
@@ -111,16 +111,16 @@ export function removeColorMappingFromProperties(properties, id) {
|
|
|
111
111
|
// a null color instructs the host application to remove the stored entry;
|
|
112
112
|
// omitting the entry is not enough because hosts merge pushed properties additively
|
|
113
113
|
const updatedMapping = previousColorMapping.map((item) => item.id === id ? { id, color: null } : item);
|
|
114
|
-
const newProperties =
|
|
115
|
-
|
|
114
|
+
const newProperties = _cloneDeep(properties);
|
|
115
|
+
_set(newProperties, "controls.colorMapping", updatedMapping);
|
|
116
116
|
return newProperties;
|
|
117
117
|
}
|
|
118
118
|
export function getLineStyleProperties(properties, id, lineStyle, lineWidth) {
|
|
119
119
|
const newEntry = { id, lineStyle, lineWidth };
|
|
120
120
|
const previousMapping = properties?.controls?.["lineStyleMapping"] ?? [];
|
|
121
|
-
const merged =
|
|
122
|
-
const newProperties =
|
|
123
|
-
|
|
121
|
+
const merged = _compact(_uniqBy([newEntry, ...previousMapping], "id"));
|
|
122
|
+
const newProperties = _cloneDeep(properties);
|
|
123
|
+
_set(newProperties, "controls.lineStyleMapping", merged);
|
|
124
124
|
return newProperties;
|
|
125
125
|
}
|
|
126
126
|
export function getPropertiesWithLineStyleMappingForMeasures(properties, measureLocalIds) {
|
|
@@ -158,7 +158,7 @@ export function getValidProperties(properties, colorAssignments) {
|
|
|
158
158
|
const assignmentValid = colorAssignments?.find((colorAssignment) => {
|
|
159
159
|
if (isMeasureDescriptor(colorAssignment.headerItem)) {
|
|
160
160
|
return (colorAssignment.headerItem.measureHeaderItem.localIdentifier === id &&
|
|
161
|
-
|
|
161
|
+
_isEqual(colorAssignment.color?.value, colorValue));
|
|
162
162
|
}
|
|
163
163
|
else if (isResultAttributeHeader(colorAssignment.headerItem)) {
|
|
164
164
|
return colorAssignment.headerItem.attributeHeaderItem.uri === id;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controlsHelper.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/controlsHelper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"controlsHelper.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/controlsHelper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EACH,KAAK,kBAAkB,EAK1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAI/D,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAKpG,KAAK,qBAAqB,GAAG;IACzB,IAAI,EAAE,SAAS,CAAC;CACnB,CAAC;AAoBF,wBAAgB,2BAA2B,CACvC,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,mBAAmB,EAC1B,KAAK,EAAE,mBAAmB,GAAG,qBAAqB,EAClD,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,mBAAmB,CAAC,KAAK,IAAI,EACtD,YAAY,EAAE,mBAAmB,GAClC,IAAI,CAsDN;AAED,wBAAgB,2BAA2B,CACvC,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,mBAAmB,EAC1B,KAAK,EAAE,mBAAmB,GAAG,qBAAqB,EAClD,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,mBAAmB,CAAC,KAAK,IAAI,EACtD,YAAY,EAAE,mBAAmB,GAClC,IAAI,CAuDN;AAED,wBAAgB,uCAAuC,CAAC,OAAO,EAAE,kBAAkB,GAAG,SAAS,uBAa9F"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// (C) 2019-2026 GoodData Corporation
|
|
2
|
-
import { set } from "lodash-es";
|
|
3
2
|
import { bucketItems, bucketsFind, insightBuckets, insightProperties, } from "@gooddata/sdk-model";
|
|
4
3
|
import { BucketNames } from "@gooddata/sdk-ui";
|
|
4
|
+
import { _set } from "@gooddata/util";
|
|
5
5
|
import { messages } from "../../locales.js";
|
|
6
6
|
import { getMeasureGroupDimensionFromProperties } from "./propertiesHelper.js";
|
|
7
7
|
import { getTranslation } from "./translations.js";
|
|
@@ -31,7 +31,7 @@ export function maxInputValidateAndPushData(data, state, props, setState, defaul
|
|
|
31
31
|
const maxNumberValue = fixEmptyMaxValue(maxValue);
|
|
32
32
|
const maxIsMinus = maxValue === "-";
|
|
33
33
|
const { propertiesMeta, pushData } = props;
|
|
34
|
-
|
|
34
|
+
_set(propertiesMeta, "undoApplied", false);
|
|
35
35
|
// dash, non-numeric or min/max mismatch: set error
|
|
36
36
|
if (isInvalidOrMinMaxError(maxValue, minNumberValue, maxNumberValue)) {
|
|
37
37
|
setState({
|
|
@@ -52,7 +52,7 @@ export function maxInputValidateAndPushData(data, state, props, setState, defaul
|
|
|
52
52
|
// valid, set new value
|
|
53
53
|
const { properties } = props;
|
|
54
54
|
if (properties) {
|
|
55
|
-
|
|
55
|
+
_set(properties, `controls.${basePath}.max`, maxValue);
|
|
56
56
|
}
|
|
57
57
|
// if incorrect value was set previously but now validation passed, set incorrect value as correct value
|
|
58
58
|
if (isNaN(parseFloat(incorrectMinValue))) {
|
|
@@ -62,7 +62,7 @@ export function maxInputValidateAndPushData(data, state, props, setState, defaul
|
|
|
62
62
|
}
|
|
63
63
|
else {
|
|
64
64
|
if (properties) {
|
|
65
|
-
|
|
65
|
+
_set(properties, `controls.${basePath}.min`, incorrectMinValue);
|
|
66
66
|
}
|
|
67
67
|
setState(defaultState);
|
|
68
68
|
}
|
|
@@ -80,7 +80,7 @@ export function minInputValidateAndPushData(data, state, props, setState, defaul
|
|
|
80
80
|
const minNumberValue = fixEmptyMinValue(minValue);
|
|
81
81
|
const minIsDash = minValue === "-";
|
|
82
82
|
const { propertiesMeta, pushData } = props;
|
|
83
|
-
|
|
83
|
+
_set(propertiesMeta, "undoApplied", false);
|
|
84
84
|
// dash, non-numeric or min/max mismatch: set error
|
|
85
85
|
if (isInvalidOrMinMaxError(minValue, minNumberValue, maxNumberValue)) {
|
|
86
86
|
setState({
|
|
@@ -101,7 +101,7 @@ export function minInputValidateAndPushData(data, state, props, setState, defaul
|
|
|
101
101
|
// valid, set new value
|
|
102
102
|
const { properties } = props;
|
|
103
103
|
if (properties) {
|
|
104
|
-
|
|
104
|
+
_set(properties, `controls.${basePath}.min`, minValue);
|
|
105
105
|
}
|
|
106
106
|
// if incorrect value was set previously but now validation passed, set incorrect value as correct value
|
|
107
107
|
if (isNaN(parseFloat(incorrectMaxValue))) {
|
|
@@ -111,7 +111,7 @@ export function minInputValidateAndPushData(data, state, props, setState, defaul
|
|
|
111
111
|
}
|
|
112
112
|
else {
|
|
113
113
|
if (properties) {
|
|
114
|
-
|
|
114
|
+
_set(properties, `controls.${basePath}.max`, incorrectMaxValue);
|
|
115
115
|
}
|
|
116
116
|
setState(defaultState);
|
|
117
117
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensions.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/dimensions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dimensions.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/dimensions.ts"],"names":[],"mappings":"AAEA,OAAO,EAGH,KAAK,UAAU,EACf,KAAK,kBAAkB,EAS1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAe,KAAK,OAAO,EAAsB,MAAM,kBAAkB,CAAC;AA4BjF,wBAAgB,uBAAuB,CACnC,OAAO,EAAE,kBAAkB,EAC3B,yBAAyB,CAAC,EAAE,GAAG,GAChC,UAAU,EAAE,CAMd;AAwCD,wBAAgB,sBAAsB,IAAI,UAAU,EAAE,CAErD;AAmCD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAC9B,OAAO,EAAE,kBAAkB,EAC3B,IAAI,EAAE,OAAO,EACb,yBAAyB,CAAC,EAAE,GAAG,GAChC,UAAU,EAAE,CAiDd;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,kBAAkB,GAAG,UAAU,EAAE,CAKnF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// (C) 2007-2026 GoodData Corporation
|
|
2
|
-
import { compact } from "lodash-es";
|
|
3
2
|
import { MeasureGroupIdentifier, bucketAttributes, insightAttributes, insightBucket, insightBuckets, insightProperties, newDimension, newTwoDimensional, } from "@gooddata/sdk-model";
|
|
4
3
|
import { BucketNames, VisualizationTypes } from "@gooddata/sdk-ui";
|
|
5
4
|
import { getPivotTableDimensions as getPivotTableDimensionsShared, } from "@gooddata/sdk-ui-pivot";
|
|
5
|
+
import { _compact } from "@gooddata/util";
|
|
6
6
|
import { getMeasureGroupDimensionFromProperties } from "./propertiesHelper.js";
|
|
7
7
|
const COLUMNS = "columns";
|
|
8
8
|
const ROWS = "rows";
|
|
@@ -41,8 +41,8 @@ function getAreaDimensions(insight) {
|
|
|
41
41
|
const seriesAttribute = viewByAttributes[0];
|
|
42
42
|
const sliceAttribute = stackByAttributes[0] ?? viewByAttributes[1];
|
|
43
43
|
return sliceAttribute
|
|
44
|
-
? newTwoDimensional([sliceAttribute],
|
|
45
|
-
: newTwoDimensional([MeasureGroupIdentifier],
|
|
44
|
+
? newTwoDimensional([sliceAttribute], _compact([seriesAttribute, MeasureGroupIdentifier]))
|
|
45
|
+
: newTwoDimensional([MeasureGroupIdentifier], _compact([seriesAttribute]));
|
|
46
46
|
}
|
|
47
47
|
function getLineDimensions(insight) {
|
|
48
48
|
const trendAttributes = safeBucketAttributes(insight, BucketNames.TREND);
|
|
@@ -75,7 +75,7 @@ function getBubbleDimensions(insight) {
|
|
|
75
75
|
function getSankeyDimensions(insight) {
|
|
76
76
|
const fromAttributes = safeBucketAttributes(insight, BucketNames.ATTRIBUTE_FROM);
|
|
77
77
|
const toAttributes = safeBucketAttributes(insight, BucketNames.ATTRIBUTE_TO);
|
|
78
|
-
return newTwoDimensional([MeasureGroupIdentifier],
|
|
78
|
+
return newTwoDimensional([MeasureGroupIdentifier], _compact([...fromAttributes, ...toAttributes]));
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
81
|
* Generates dimensions based on buckets and visualization objects.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drillablePredicates.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/drillablePredicates.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"drillablePredicates.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/drillablePredicates.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,0BAA0B,EAGlC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAiB3E;;;;;;;;;;GAUG;AACH,wBAAgB,uCAAuC,CAAC,EACpD,IAAI,EACJ,WAAW,EACX,YAAY,GACf,EAAE,0BAA0B,GAAG,gBAAgB,EAAE,CAsBjD;AAED,eAAO,MAAM,wBAAwB;;CAEpC,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// (C) 2019-2026 GoodData Corporation
|
|
2
|
-
import { uniq, uniqBy } from "lodash-es";
|
|
3
2
|
import { HeaderPredicates } from "@gooddata/sdk-ui";
|
|
3
|
+
import { _uniq, _uniqBy } from "@gooddata/util";
|
|
4
4
|
const toQualifier = (identifier) => typeof identifier === "string" ? { identifier } : identifier;
|
|
5
5
|
/**
|
|
6
6
|
* An untyped entry stays distinct from the same identifier typed, and two types of one identifier stay
|
|
7
7
|
* distinct from each other, because each activates drilling on a different object.
|
|
8
8
|
*/
|
|
9
9
|
const uniqueQualifiers = (identifiers) => Array.isArray(identifiers)
|
|
10
|
-
?
|
|
10
|
+
? _uniqBy(identifiers.map(toQualifier), ({ identifier, type }) => `${type ?? ""}.${identifier}`)
|
|
11
11
|
: [];
|
|
12
12
|
/**
|
|
13
13
|
* Converts post message with drilling specification into header predicates. Given the message with
|
|
@@ -21,9 +21,9 @@ const uniqueQualifiers = (identifiers) => Array.isArray(identifiers)
|
|
|
21
21
|
* @internal
|
|
22
22
|
*/
|
|
23
23
|
export function convertPostMessageToDrillablePredicates({ uris, identifiers, composedFrom, }) {
|
|
24
|
-
const simpleUris = Array.isArray(uris) ?
|
|
24
|
+
const simpleUris = Array.isArray(uris) ? _uniq(uris) : [];
|
|
25
25
|
const simpleIdentifiers = uniqueQualifiers(identifiers);
|
|
26
|
-
const composedFromUris = composedFrom?.uris && Array.isArray(composedFrom.uris) ?
|
|
26
|
+
const composedFromUris = composedFrom?.uris && Array.isArray(composedFrom.uris) ? _uniq(composedFrom.uris) : [];
|
|
27
27
|
const composedFromIdentifiers = uniqueQualifiers(composedFrom?.identifiers);
|
|
28
28
|
// note: not passing factory function to maps to make testing assertions simpler (passing factory fun-as-is
|
|
29
29
|
// will call the factory with 3 args (value, index and all values)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getReactEmbeddingCodeGenerator.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/embeddingCodeGenerator/getReactEmbeddingCodeGenerator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,kBAAkB,EAAsB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"getReactEmbeddingCodeGenerator.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/embeddingCodeGenerator/getReactEmbeddingCodeGenerator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,kBAAkB,EAAsB,MAAM,qBAAqB,CAAC;AAGlF,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAGxF,OAAO,EAEH,KAAK,oCAAoC,EAI5C,MAAM,YAAY,CAAC;AA0JpB;;;;;;;;;GASG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,SAAS,MAAM,EAAE,EAClE,SAAS,EACT,cAAc,EACd,mBAAmB,GACtB,EAAE,oCAAoC,CAAC,MAAM,CAAC,GAAG,CAC9C,OAAO,EAAE,kBAAkB,EAC3B,MAAM,CAAC,EAAE,oBAAoB,KAC5B,MAAM,CA4BV"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// (C) 2022-2026 GoodData Corporation
|
|
2
|
-
import {
|
|
2
|
+
import { sortBy } from "lodash-es";
|
|
3
3
|
import { factoryNotationFor } from "@gooddata/sdk-model";
|
|
4
|
+
import { _compact, _groupBy, _isEmpty, _partition, _uniqBy } from "@gooddata/util";
|
|
4
5
|
import { normalizeInsight } from "./normalizeInsight.js";
|
|
5
6
|
// these are in line with what `factoryNotationFor` supports
|
|
6
7
|
const defaultFactories = [
|
|
@@ -59,12 +60,12 @@ function indent(str, tabs) {
|
|
|
59
60
|
.map((chunk) => `${" ".repeat(tabs * TAB_SIZE)}${chunk}`)
|
|
60
61
|
.join("\n");
|
|
61
62
|
}
|
|
62
|
-
const renderImports = (imports) => Object.entries(
|
|
63
|
+
const renderImports = (imports) => Object.entries(_groupBy(imports, (i) => i.package))
|
|
63
64
|
.map(([pkg, imports]) => {
|
|
64
|
-
const [[defaultImport], namedImports] =
|
|
65
|
-
return
|
|
65
|
+
const [[defaultImport], namedImports] = _partition(imports, (i) => i.importType === "default");
|
|
66
|
+
return _compact([
|
|
66
67
|
"import",
|
|
67
|
-
|
|
68
|
+
_compact([
|
|
68
69
|
defaultImport?.name,
|
|
69
70
|
namedImports.length &&
|
|
70
71
|
`{ ${sortBy(namedImports.map((i) => i.name), (i) => i.toLowerCase()).join(", ")} }`,
|
|
@@ -80,11 +81,11 @@ function walkProps(props, additionalFactories, config) {
|
|
|
80
81
|
const propsToOmit = config?.omitChartProps ?? [];
|
|
81
82
|
const importsUsed = [];
|
|
82
83
|
// we ignore undefined values and functions as there is no bullet-proof way to serialize them
|
|
83
|
-
// Note:
|
|
84
|
-
// Non-empty strings are handled correctly by
|
|
84
|
+
// Note: _isEmpty() returns true for primitive values like numbers/booleans, so we check for them explicitly
|
|
85
|
+
// Non-empty strings are handled correctly by _isEmpty(), but we explicitly check to be safe
|
|
85
86
|
const propPairsIgnoredFunctions = Object.entries(props).filter(([_, meta]) => meta !== undefined &&
|
|
86
87
|
!(typeof meta.value === "function") &&
|
|
87
|
-
(typeof meta.value === "number" || typeof meta.value === "boolean" || !
|
|
88
|
+
(typeof meta.value === "number" || typeof meta.value === "boolean" || !_isEmpty(meta.value)));
|
|
88
89
|
//omit chart configuration when define in config
|
|
89
90
|
const propPairs = propPairsIgnoredFunctions.filter(([key, _]) => !propsToOmit.includes(key));
|
|
90
91
|
// get variable declaration for each prop to render outside of the component
|
|
@@ -112,7 +113,7 @@ function walkProps(props, additionalFactories, config) {
|
|
|
112
113
|
const detectedFactories = detectFactoryImports(propDeclarations, additionalFactories ?? []);
|
|
113
114
|
importsUsed.push(...detectedFactories);
|
|
114
115
|
return {
|
|
115
|
-
importsUsed:
|
|
116
|
+
importsUsed: _uniqBy(importsUsed, (i) => `${i.package}#${i.name}`),
|
|
116
117
|
propDeclarations,
|
|
117
118
|
propUsages,
|
|
118
119
|
};
|
|
@@ -132,7 +133,7 @@ export function getReactEmbeddingCodeGenerator({ component, insightToProps, addi
|
|
|
132
133
|
const normalizedInsight = normalizeInsight(insight);
|
|
133
134
|
const props = insightToProps(normalizedInsight, config?.context);
|
|
134
135
|
const { importsUsed, propDeclarations, propUsages } = walkProps(props, additionalFactories, config);
|
|
135
|
-
const imports =
|
|
136
|
+
const imports = _compact([REACT_IMPORT_INFO, ...importsUsed, component]);
|
|
136
137
|
const height = config?.height ?? DEFAULT_HEIGHT;
|
|
137
138
|
const stringifiedHeight = typeof height === "string" ? `"${height}"` : height.toString();
|
|
138
139
|
const componentBody = `<${component.name}\n${indent(propUsages.join("\n"), 1)}\n/>`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propertiesHelper.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/propertiesHelper.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACd,KAAK,MAAM,EAKd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACH,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACH,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,yCAAyC,EACjD,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"propertiesHelper.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/propertiesHelper.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACd,KAAK,MAAM,EAKd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACH,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACH,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,yCAAyC,EACjD,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAAyB,KAAK,QAAQ,EAA4B,MAAM,2BAA2B,CAAC;AAC3G,OAAO,EACH,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,SAAS,EACd,KAAK,wBAAwB,EAChC,MAAM,gCAAgC,CAAC;AAUxC,wBAAgB,8BAA8B,CAC1C,+BAA+B,EAAE,wBAAwB,CAAC,UAAU,CAAC,EACrE,uBAAuB,EAAE,MAAM,EAAE,GAAG,SAAS,GAC9C,wBAAwB,CAU1B;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,wBAAwB,GAAG,SAAS,GAAG,OAAO,CAEzF;AAED,wBAAgB,oBAAoB,CAChC,cAAc,EAAE,uBAAuB,EACvC,QAAQ,EAAE,QAAQ,GACnB,uBAAuB,CA8BzB;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,wBAAgB,sBAAsB,CAClC,uBAAuB,EAAE,wBAAwB,GAAG,SAAS,EAC7D,uBAAuB,EAAE,MAAM,EAAE,GAAG,SAAS,GAC9C,wBAAwB,CAS1B;AAED,wBAAgB,wCAAwC,CACpD,cAAc,EAAE,uBAAuB,EACvC,uBAAu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BD,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,wBAAwB;;;;;;EAiBhG"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
// (C) 2019-2026 GoodData Corporation
|
|
2
2
|
// eslint-disable-next-line no-restricted-imports
|
|
3
|
-
import {
|
|
3
|
+
import { get, has } from "lodash-es";
|
|
4
4
|
import { bucketsIsEmpty, insightBuckets, insightProperties, insightVisualizationUrl, } from "@gooddata/sdk-model";
|
|
5
5
|
import { BucketNames } from "@gooddata/sdk-ui";
|
|
6
|
+
import { _cloneDeep, _isEmpty, _set } from "@gooddata/util";
|
|
6
7
|
import { AXIS } from "../constants/axis.js";
|
|
7
8
|
import { PROPERTY_CONTROLS } from "../constants/properties.js";
|
|
8
9
|
import { OPTIONAL_STACKING_PROPERTIES } from "../constants/supportedProperties.js";
|
|
9
10
|
import { UICONFIG_AXIS } from "../constants/uiConfig.js";
|
|
10
11
|
import { getAllMeasuresShowOnSecondaryAxis, getItemsCount, getItemsLocalIdentifiers, getMeasureItems, getStackItems, } from "./bucketHelper.js";
|
|
11
12
|
export function getSupportedPropertiesControls(visualizationControlsProperties, supportedPropertiesList) {
|
|
12
|
-
const clonedControls =
|
|
13
|
+
const clonedControls = _cloneDeep(visualizationControlsProperties);
|
|
13
14
|
if (supportedPropertiesList) {
|
|
14
|
-
return supportedPropertiesList.reduce((props, current) => has(clonedControls, current) ?
|
|
15
|
+
return supportedPropertiesList.reduce((props, current) => has(clonedControls, current) ? _set(props, current, get(clonedControls, current)) : props, {});
|
|
15
16
|
}
|
|
16
17
|
return {};
|
|
17
18
|
}
|
|
@@ -22,7 +23,7 @@ export function setSecondaryMeasures(referencePoint, axisName) {
|
|
|
22
23
|
if (!axisName) {
|
|
23
24
|
return referencePoint;
|
|
24
25
|
}
|
|
25
|
-
const newReferencePoint =
|
|
26
|
+
const newReferencePoint = _cloneDeep(referencePoint);
|
|
26
27
|
const path = `${PROPERTY_CONTROLS}.${axisName}`;
|
|
27
28
|
const secondaryAxisProperties = newReferencePoint?.properties?.controls?.[axisName];
|
|
28
29
|
const buckets = newReferencePoint?.buckets ?? [];
|
|
@@ -39,8 +40,8 @@ export function setSecondaryMeasures(referencePoint, axisName) {
|
|
|
39
40
|
0: AXIS.PRIMARY,
|
|
40
41
|
[allMeasures.length]: AXIS.SECONDARY,
|
|
41
42
|
}[secondaryMeasures.length] || AXIS.DUAL;
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
_set(newReferencePoint, path, secondaryAxis);
|
|
44
|
+
_set(newReferencePoint, UICONFIG_AXIS, axis);
|
|
44
45
|
return newReferencePoint;
|
|
45
46
|
}
|
|
46
47
|
export function isEmptyObject(obj) {
|
|
@@ -49,7 +50,7 @@ export function isEmptyObject(obj) {
|
|
|
49
50
|
export function getSupportedProperties(visualizationProperties, supportedPropertiesList) {
|
|
50
51
|
const controls = visualizationProperties?.controls ?? {};
|
|
51
52
|
const supportedControls = getSupportedPropertiesControls(controls, supportedPropertiesList);
|
|
52
|
-
return
|
|
53
|
+
return _isEmpty(supportedControls)
|
|
53
54
|
? {}
|
|
54
55
|
: {
|
|
55
56
|
controls: supportedControls,
|
|
@@ -59,9 +60,9 @@ export function getReferencePointWithSupportedProperties(referencePoint, support
|
|
|
59
60
|
const supportedControlsProperties = referencePoint.properties
|
|
60
61
|
? getSupportedPropertiesControls(referencePoint.properties.controls, supportedPropertiesList)
|
|
61
62
|
: {};
|
|
62
|
-
if (
|
|
63
|
+
if (_isEmpty(supportedControlsProperties)) {
|
|
63
64
|
const sortItems = referencePoint.properties?.sortItems;
|
|
64
|
-
const sortItemsExpand = sortItems && !
|
|
65
|
+
const sortItemsExpand = sortItems && !_isEmpty(sortItems) ? { sortItems } : {};
|
|
65
66
|
return {
|
|
66
67
|
...referencePoint,
|
|
67
68
|
properties: {
|
|
@@ -149,7 +150,7 @@ const AXIS_TYPES = ["xaxis", "yaxis", "secondary_xaxis", "secondary_yaxis"];
|
|
|
149
150
|
export function getHighchartsAxisNameConfiguration(controlProperties) {
|
|
150
151
|
const axisProperties = AXIS_TYPES.reduce((result, axis) => {
|
|
151
152
|
const axisNameConfig = controlProperties?.[axis]?.name;
|
|
152
|
-
if (
|
|
153
|
+
if (_isEmpty(axisNameConfig)) {
|
|
153
154
|
return result;
|
|
154
155
|
}
|
|
155
156
|
if (axisNameConfig.position) {
|
|
@@ -254,20 +255,20 @@ export function getColumnHeadersPositionFromProperties(visualizationProperties)
|
|
|
254
255
|
}
|
|
255
256
|
export function getLegendConfiguration(controlProperties, insight) {
|
|
256
257
|
const legendPosition = getLegendPosition(controlProperties, insight);
|
|
257
|
-
|
|
258
|
+
_set(controlProperties, "legend.position", legendPosition);
|
|
258
259
|
return controlProperties;
|
|
259
260
|
}
|
|
260
261
|
export function getLegendConfigurationDashboardsEnv(controlProperties, options) {
|
|
261
262
|
const legendPosition = getLegendPositionDashboardsEnv(controlProperties, options);
|
|
262
|
-
|
|
263
|
-
|
|
263
|
+
_set(controlProperties, "legend.position", legendPosition);
|
|
264
|
+
_set(controlProperties, "legend.responsive", "autoPositionWithPopup");
|
|
264
265
|
return controlProperties;
|
|
265
266
|
}
|
|
266
267
|
export function getChartSupportedControls(controlProperties, insight) {
|
|
267
|
-
return getDataPointsConfiguration(getHighchartsAxisNameConfiguration(getLegendConfiguration(
|
|
268
|
+
return getDataPointsConfiguration(getHighchartsAxisNameConfiguration(getLegendConfiguration(_cloneDeep(controlProperties ?? {}), insight)));
|
|
268
269
|
}
|
|
269
270
|
export function getChartSupportedControlsDashboardsEnv(controlProperties, options) {
|
|
270
|
-
return getDataPointsConfiguration(getHighchartsAxisNameConfiguration(getLegendConfigurationDashboardsEnv(
|
|
271
|
+
return getDataPointsConfiguration(getHighchartsAxisNameConfiguration(getLegendConfigurationDashboardsEnv(_cloneDeep(controlProperties ?? {}), options)));
|
|
271
272
|
}
|
|
272
273
|
function getLegendPosition(controlProperties, insight) {
|
|
273
274
|
const legendPosition = controlProperties?.["legend"]?.position ?? "auto";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// (C) 2022-2026 GoodData Corporation
|
|
2
|
-
import {
|
|
2
|
+
import { _compact, _isEmpty } from "@gooddata/util";
|
|
3
3
|
function isUseless(obj) {
|
|
4
|
-
return obj === null || obj === undefined || (typeof obj === "object" &&
|
|
4
|
+
return obj === null || obj === undefined || (typeof obj === "object" && _isEmpty(obj));
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* For a given object returns a copy that has all properties that are empty objects or arrays or nil removed.
|
|
@@ -13,7 +13,7 @@ function isUseless(obj) {
|
|
|
13
13
|
export function removeUseless(obj) {
|
|
14
14
|
let res = obj;
|
|
15
15
|
if (Array.isArray(obj)) {
|
|
16
|
-
res =
|
|
16
|
+
res = _compact(obj.map(removeUseless));
|
|
17
17
|
}
|
|
18
18
|
else if (obj !== null && typeof obj === "object") {
|
|
19
19
|
res = Object.fromEntries(Object.entries(obj)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/sort.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,kBAAkB,EAEvB,KAAK,QAAQ,EAEb,KAAK,SAAS,EACd,KAAK,aAAa,EAerB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/sort.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,kBAAkB,EAEvB,KAAK,QAAQ,EAEb,KAAK,SAAS,EACd,KAAK,aAAa,EAerB,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EACH,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAChC,MAAM,gCAAgC,CAAC;AAIxC,wBAAgB,oBAAoB,CAChC,UAAU,EAAE,MAAM,EAClB,SAAS,GAAE,aAAqB,EAChC,WAAW,GAAE,OAAe,GAC7B,SAAS,CAcX;AAqCD,wBAAgB,gCAAgC,CAC5C,MAAM,EAAE,OAAO,GAAG,SAAS,EAC3B,SAAS,EAAE,OAAO,GAAG,SAAS,EAC9B,QAAQ,EAAE,QAAQ,EAAE,GAAG,SAAS,GACjC,SAAS,EAAE,CAYb;AAwCD;;;GAGG;AAEH,wBAAgB,WAAW,CACvB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,kBAAkB,EAC3B,iBAAiB,EAAE,wBAAwB,GAC5C,SAAS,EAAE,CAuBb;AAmBD,wBAAgB,wBAAwB,CAAC,cAAc,EAAE,uBAAuB,GAAG,MAAM,EAAE,CAO1F;AAED,wBAAgB,UAAU,CAAC,cAAc,EAAE,QAAQ,CAAC,uBAAuB,CAAC,GAAG,uBAAuB,CAiBrG;AAoGD;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAC/B,sBAAsB,GAAE,oBAAoB,EAAO,EACnD,YAAY,GAAE,SAAS,EAAO,EAC9B,cAAc,GAAE,oBAAoB,EAAO,EAC3C,WAAW,GAAE,SAAS,EAAO,GAC9B,SAAS,EAAE,CA8Bb;AAED,wBAAgB,gCAAgC,CAC5C,gBAAgB,EAAE,WAAW,EAAE,EAC/B,kBAAkB,EAAE,WAAW,EAAE,EACjC,IAAI,EAAE,SAAS,GAChB,MAAM,GAAG,SAAS,CAUpB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// (C) 2019-2026 GoodData Corporation
|
|
2
|
-
import {
|
|
2
|
+
import { omitBy } from "lodash-es";
|
|
3
3
|
import { areObjRefsEqual, bucketAttributes, insightBucket, insightMeasures, insightSorts, isAttributeAreaSort, isAttributeValueSort, isMeasureSort, newAttributeAreaSort, newAttributeSort, newMeasureSort, newMeasureSortFromLocators, sortDirection, sortMeasureLocators, } from "@gooddata/sdk-model";
|
|
4
4
|
import { BucketNames, VisualizationTypes } from "@gooddata/sdk-ui";
|
|
5
|
+
import { _isEmpty, _isEqual } from "@gooddata/util";
|
|
5
6
|
import { messages } from "../../locales.js";
|
|
6
7
|
import { SORT_DIR_DESC } from "../constants/sort.js";
|
|
7
8
|
import { getTranslation } from "./translations.js";
|
|
@@ -37,18 +38,18 @@ function getDefaultBarChartSort(insight, canSortStackTotalValue = false) {
|
|
|
37
38
|
newAttributeAreaSort(viewBy[1], SORT_DIR_DESC),
|
|
38
39
|
];
|
|
39
40
|
}
|
|
40
|
-
if (!
|
|
41
|
+
if (!_isEmpty(viewBy) && !_isEmpty(stackBy)) {
|
|
41
42
|
return [newAttributeAreaSort(viewBy[0], SORT_DIR_DESC)];
|
|
42
43
|
}
|
|
43
|
-
if (!
|
|
44
|
+
if (!_isEmpty(viewBy) && canSortStackTotalValue) {
|
|
44
45
|
return [newAttributeAreaSort(viewBy[0], SORT_DIR_DESC)];
|
|
45
46
|
}
|
|
46
|
-
return
|
|
47
|
+
return _isEmpty(stackBy) && !_isEmpty(measures) ? [newMeasureSort(measures[0], SORT_DIR_DESC)] : [];
|
|
47
48
|
}
|
|
48
49
|
export function getDefaultTreemapSortFromBuckets(viewBy, segmentBy, measures) {
|
|
49
50
|
const viewAttr = viewBy ? bucketAttributes(viewBy) : [];
|
|
50
51
|
const stackAttr = segmentBy ? bucketAttributes(segmentBy) : [];
|
|
51
|
-
if (!
|
|
52
|
+
if (!_isEmpty(viewAttr) && !_isEmpty(stackAttr)) {
|
|
52
53
|
return [
|
|
53
54
|
newAttributeSort(viewAttr[0], "asc"),
|
|
54
55
|
...(measures ?? []).map((m) => newMeasureSort(m, "desc")),
|
|
@@ -61,7 +62,7 @@ function getDefaultTreemapSort(insight) {
|
|
|
61
62
|
}
|
|
62
63
|
function getDefaultHeatmapSortFromBuckets(viewBy) {
|
|
63
64
|
const viewAttr = viewBy ? bucketAttributes(viewBy) : [];
|
|
64
|
-
if (!
|
|
65
|
+
if (!_isEmpty(viewAttr)) {
|
|
65
66
|
return [newAttributeSort(viewAttr[0], "desc")];
|
|
66
67
|
}
|
|
67
68
|
return [];
|
|
@@ -77,7 +78,7 @@ function getDefaultPieDonutPyramidFunnelSort(insight) {
|
|
|
77
78
|
const measures = insightMeasures(insight);
|
|
78
79
|
const viewBucket = insightBucket(insight, BucketNames.VIEW);
|
|
79
80
|
const viewBy = viewBucket ? bucketAttributes(viewBucket) : [];
|
|
80
|
-
if (!
|
|
81
|
+
if (!_isEmpty(measures) && !_isEmpty(viewBy)) {
|
|
81
82
|
return [newMeasureSort(measures[0], SORT_DIR_DESC)];
|
|
82
83
|
}
|
|
83
84
|
return [];
|
|
@@ -145,7 +146,7 @@ export function removeSort(referencePoint) {
|
|
|
145
146
|
}
|
|
146
147
|
function validateMeasureSortLocators(sortLocators, availableLocators) {
|
|
147
148
|
return (sortLocators.length === availableLocators.length &&
|
|
148
|
-
sortLocators.every((sortLocator, locatorIndex) =>
|
|
149
|
+
sortLocators.every((sortLocator, locatorIndex) => _isEqual(sortLocator, availableLocators[locatorIndex])));
|
|
149
150
|
}
|
|
150
151
|
function isValidMeasureSort(measureSort, availableSort) {
|
|
151
152
|
return (availableSort &&
|