@levi-gemcommerce/analytics 3.0.1-dev.3 → 3.0.1-dev.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +38 -15
- package/src/api/graphql/fragments/pathAnalytic.generated.ts +0 -26
- package/src/assets/img/all-sessions.png +0 -0
- package/src/assets/img/analytic-empty.png +0 -0
- package/src/assets/img/first-session.png +0 -0
- package/src/assets/img/page-only.png +0 -0
- package/src/assets/svg/gemx-skeleton.svg +0 -12
- package/src/assets/svg/product.svg +0 -18
- package/src/components/AnalyticMode/AnalyticModeSelector.tsx +0 -50
- package/src/components/AnalyticMode/index.ts +0 -2
- package/src/components/CardPathAnalysis/CardJourneyAnalysis.tsx +0 -33
- package/src/components/CardPathAnalysis/assets/img/analytic-gemx.png +0 -0
- package/src/components/CardPathAnalysis/assets/styles/PathAnalysis.scss +0 -60
- package/src/components/CardPathAnalysis/components/CardPathAnalysis/CardAnalyticEmpty.tsx +0 -45
- package/src/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysis.tsx +0 -53
- package/src/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisContent.tsx +0 -65
- package/src/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisEmpty.tsx +0 -29
- package/src/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisSkeleton.tsx +0 -12
- package/src/components/CardPathAnalysis/components/CardPathAnalysis/CardPathAnalysisWrapper.tsx +0 -43
- package/src/components/CardPathAnalysis/components/CardPathAnalysis/index.ts +0 -1
- package/src/components/CardPathAnalysis/components/PathAnalysisChart.tsx +0 -55
- package/src/components/CardPathAnalysis/components/index.ts +0 -1
- package/src/components/CardPathAnalysis/configs/index.ts +0 -2
- package/src/components/CardPathAnalysis/constants/index.ts +0 -1
- package/src/components/CardPathAnalysis/constants/path-analysis.ts +0 -162
- package/src/components/CardPathAnalysis/contexts/PathAnalysisConfigProvider.tsx +0 -66
- package/src/components/CardPathAnalysis/contexts/PathAnalysisProvider.tsx +0 -130
- package/src/components/CardPathAnalysis/contexts/index.ts +0 -2
- package/src/components/CardPathAnalysis/helpers/index.ts +0 -2
- package/src/components/CardPathAnalysis/helpers/metricHelpers.ts +0 -13
- package/src/components/CardPathAnalysis/helpers/pathAnalysis.ts +0 -96
- package/src/components/CardPathAnalysis/helpers/pathAnalysisChart.ts +0 -128
- package/src/components/CardPathAnalysis/helpers/treeUtils.ts +0 -38
- package/src/components/CardPathAnalysis/hooks/usePathAnalysisChart.tsx +0 -292
- package/src/components/CardPathAnalysis/hooks/usePathAnalysisFunnel.ts +0 -206
- package/src/components/CardPathAnalysis/hooks/usePathAnalyticsMerger.ts +0 -43
- package/src/components/CardPathAnalysis/index.ts +0 -5
- package/src/components/CardPathAnalysis/stores/funnel-chart.ts +0 -30
- package/src/components/CardPathAnalysis/stores/index.ts +0 -3
- package/src/components/CardPathAnalysis/stores/path-analysis-campaign.ts +0 -16
- package/src/components/CardPathAnalysis/stores/path-analysis.ts +0 -11
- package/src/components/CardPathAnalysis/types/index.ts +0 -1
- package/src/components/CardPathAnalysis/types/path-analysis.ts +0 -10
- package/src/components/CurrencySelector/CurrencySelector.tsx +0 -127
- package/src/components/CurrencySelector/index.ts +0 -2
- package/src/components/GModalOrderJourney/GModalOrderJourney.tsx +0 -131
- package/src/components/GModalOrderJourney/components/OrderJourneySkeleton.tsx +0 -93
- package/src/components/GModalOrderJourney/components/index.ts +0 -1
- package/src/components/GModalOrderJourney/context/OrderJourneyContext.tsx +0 -17
- package/src/components/GModalOrderJourney/context/index.ts +0 -1
- package/src/components/GModalOrderJourney/hooks/index.ts +0 -1
- package/src/components/GModalOrderJourney/hooks/useGModalOrderJourney.ts +0 -25
- package/src/components/GModalOrderJourney/index.ts +0 -5
- package/src/components/GModalOrderJourney/types/index.ts +0 -4
- package/src/components/GModalOrderJourney/utils/index.ts +0 -75
- package/src/components/GSelectableMetricChartCard/GSelectableMetricChartCard.tsx +0 -83
- package/src/components/GSelectableMetricChartCard/MetricChartTab.tsx +0 -56
- package/src/components/GSelectableMetricChartCard/index.ts +0 -2
- package/src/components/GTimePicker/GTimePicker.tsx +0 -31
- package/src/components/GTimePicker/components/BaseTimePicker.tsx +0 -249
- package/src/components/GTimePicker/components/CompareTimePicker.tsx +0 -41
- package/src/components/GTimePicker/components/DateTimeFilterAddition.tsx +0 -84
- package/src/components/GTimePicker/components/DateTimeFilterInputs.tsx +0 -124
- package/src/components/GTimePicker/components/DateTimeFilters.tsx +0 -86
- package/src/components/GTimePicker/components/MainTimePicker.tsx +0 -47
- package/src/components/GTimePicker/components/index.ts +0 -2
- package/src/components/GTimePicker/constants/compareDateTimePicker.ts +0 -68
- package/src/components/GTimePicker/constants/datePicker.ts +0 -14
- package/src/components/GTimePicker/constants/index.ts +0 -2
- package/src/components/GTimePicker/constants/mainDataTimePicker.ts +0 -88
- package/src/components/GTimePicker/contexts/DateTimePickerProvider.tsx +0 -125
- package/src/components/GTimePicker/contexts/index.ts +0 -1
- package/src/components/GTimePicker/helpers/date-range-info.ts +0 -84
- package/src/components/GTimePicker/helpers/index.ts +0 -4
- package/src/components/GTimePicker/helpers/parse-date.ts +0 -127
- package/src/components/GTimePicker/helpers/time-picker.ts +0 -123
- package/src/components/GTimePicker/helpers/version.ts +0 -36
- package/src/components/GTimePicker/hooks/index.ts +0 -3
- package/src/components/GTimePicker/hooks/useCompareDateTimePicker.tsx +0 -79
- package/src/components/GTimePicker/hooks/useDateTimeFilter.ts +0 -83
- package/src/components/GTimePicker/hooks/useDateTimePicker.tsx +0 -99
- package/src/components/GTimePicker/hooks/useVersionDateTimeFilters.ts +0 -30
- package/src/components/GTimePicker/index.ts +0 -7
- package/src/components/GTimePicker/types/index.ts +0 -43
- package/src/components/MetricDonutChartCard/MetricDonutChartCard.tsx +0 -121
- package/src/components/MetricDonutChartCard/index.ts +0 -2
- package/src/components/MetricDonutChartCard/utils/donut-chart.ts +0 -75
- package/src/components/MetricDonutChartCard/utils/index.ts +0 -1
- package/src/components/OrderAnalytic/OrderListingLatestTable.tsx +0 -111
- package/src/components/OrderAnalytic/components/OrderListing/OrderListingSkeleton/OrderListingTableSkeleton.tsx +0 -40
- package/src/components/OrderAnalytic/components/OrderListing/OrderListingSkeleton/SkeletonCellContent.tsx +0 -77
- package/src/components/OrderAnalytic/components/OrderListing/OrderListingSkeleton/SkeletonHeader.tsx +0 -35
- package/src/components/OrderAnalytic/components/OrderListing/OrderListingSkeleton/SkeletonRow.tsx +0 -35
- package/src/components/OrderAnalytic/components/OrderListing/OrderListingSkeleton/SkeletonSummaryRow.tsx +0 -36
- package/src/components/OrderAnalytic/components/OrderListing/OrderListingSkeleton/constants.ts +0 -11
- package/src/components/OrderAnalytic/components/OrderListing/OrderListingSkeleton/index.ts +0 -1
- package/src/components/OrderAnalytic/components/OrderListing/OrderListingTable.tsx +0 -159
- package/src/components/OrderAnalytic/components/OrderListing/OrderListingTableEmpty.tsx +0 -29
- package/src/components/OrderAnalytic/components/OrderListing/index.ts +0 -2
- package/src/components/OrderAnalytic/components/index.ts +0 -1
- package/src/components/OrderAnalytic/constants/index.ts +0 -2
- package/src/components/OrderAnalytic/constants/order-columns.ts +0 -51
- package/src/components/OrderAnalytic/constants/order-listing.ts +0 -199
- package/src/components/OrderAnalytic/helpers/index.ts +0 -1
- package/src/components/OrderAnalytic/helpers/order-listing.ts +0 -48
- package/src/components/OrderAnalytic/hooks/index.ts +0 -1
- package/src/components/OrderAnalytic/hooks/useOrderListingData.ts +0 -55
- package/src/components/OrderAnalytic/index.ts +0 -5
- package/src/components/OrderAnalytic/stores/index.ts +0 -2
- package/src/components/OrderAnalytic/stores/order-columns-selector.ts +0 -24
- package/src/components/OrderAnalytic/stores/order-control.ts +0 -15
- package/src/components/OrderAnalytic/types/index.ts +0 -3
- package/src/components/OrderAnalytic/types/order.ts +0 -89
- package/src/components/OrderAnalytic/types/orderListing.ts +0 -4
- package/src/components/OrderAnalytic/types/report.ts +0 -14
- package/src/components/SingleMetricChartCard/SingleMetricChartCard.tsx +0 -56
- package/src/components/SingleMetricChartCard/index.tsx +0 -2
- package/src/components/common/chart/GChartSkeleton.tsx +0 -5
- package/src/components/common/chart/MetricChart.tsx +0 -62
- package/src/components/common/chart/MetricChartEmpty.tsx +0 -35
- package/src/components/common/chart/MetricChartTooltip.tsx +0 -74
- package/src/components/common/chart/MetricDonutChartSkeleton.tsx +0 -14
- package/src/components/common/chart/MetricInfoBlock.tsx +0 -66
- package/src/components/common/chart/MetricInfoSkeleton.tsx +0 -25
- package/src/components/common/chart/MetricValueSummary.tsx +0 -23
- package/src/components/common/chart/index.ts +0 -8
- package/src/components/common/icons/DownIcon8px.tsx +0 -14
- package/src/components/common/icons/UpIcon8px.tsx +0 -14
- package/src/components/common/icons/index.ts +0 -2
- package/src/components/common/percent/MetricPercentage.tsx +0 -42
- package/src/components/common/percent/index.ts +0 -1
- package/src/components/index.ts +0 -9
- package/src/constants/analytic-metric-tooltip.tsx +0 -164
- package/src/constants/breakdown-targets.ts +0 -25
- package/src/constants/campaign.ts +0 -4
- package/src/constants/chart.ts +0 -17
- package/src/constants/currency.ts +0 -3
- package/src/constants/index.ts +0 -6
- package/src/constants/thumbnail.ts +0 -3
- package/src/core/gemxql/api/index.ts +0 -2
- package/src/core/gemxql/api/useCustomGemXQlQuery.ts +0 -35
- package/src/core/gemxql/api/useGemxQlNamedQuery.ts +0 -34
- package/src/core/gemxql/builder/build-gemxql-query.ts +0 -81
- package/src/core/gemxql/builder/clauses/condition-query.ts +0 -74
- package/src/core/gemxql/builder/clauses/from-query.ts +0 -18
- package/src/core/gemxql/builder/clauses/group-query.ts +0 -43
- package/src/core/gemxql/builder/clauses/index.ts +0 -11
- package/src/core/gemxql/builder/clauses/limit-query.ts +0 -15
- package/src/core/gemxql/builder/clauses/mode-query.ts +0 -14
- package/src/core/gemxql/builder/clauses/offset-query.ts +0 -15
- package/src/core/gemxql/builder/clauses/order-by-query.ts +0 -37
- package/src/core/gemxql/builder/clauses/show-query.ts +0 -18
- package/src/core/gemxql/builder/clauses/time-query.ts +0 -67
- package/src/core/gemxql/builder/clauses/time-series-query.ts +0 -15
- package/src/core/gemxql/builder/clauses/timezone-query.ts +0 -17
- package/src/core/gemxql/builder/configs/date-formats.ts +0 -1
- package/src/core/gemxql/builder/configs/index.ts +0 -3
- package/src/core/gemxql/builder/configs/keywords.ts +0 -16
- package/src/core/gemxql/builder/configs/query-defaults.ts +0 -1
- package/src/core/gemxql/builder/filters/build-extra-conditions.ts +0 -69
- package/src/core/gemxql/builder/filters/build-filter-conditions.ts +0 -161
- package/src/core/gemxql/builder/filters/index.ts +0 -2
- package/src/core/gemxql/builder/helpers/date-query-helpers.ts +0 -41
- package/src/core/gemxql/builder/helpers/index.ts +0 -1
- package/src/core/gemxql/builder/helpers/is-valid-query-input.ts +0 -8
- package/src/core/gemxql/builder/index.ts +0 -6
- package/src/core/gemxql/builder/parse-gemxql-query.ts +0 -43
- package/src/core/gemxql/constants/analytic-data.ts +0 -2
- package/src/core/gemxql/constants/column-keys.ts +0 -4
- package/src/core/gemxql/constants/index.ts +0 -4
- package/src/core/gemxql/constants/operators.ts +0 -2
- package/src/core/gemxql/constants/row-reader-mode.ts +0 -9
- package/src/core/gemxql/graphql/fragments/gemxql.generated.ts +0 -80
- package/src/core/gemxql/graphql/fragments/gemxql.gql +0 -18
- package/src/core/gemxql/graphql/index.ts +0 -2
- package/src/core/gemxql/graphql/queries/gemxql.generated.ts +0 -26
- package/src/core/gemxql/graphql/queries/gemxql.gql +0 -5
- package/src/core/gemxql/helpers/columnKeys.ts +0 -8
- package/src/core/gemxql/helpers/extractQueryData.ts +0 -18
- package/src/core/gemxql/helpers/formatAnalyticData.ts +0 -92
- package/src/core/gemxql/helpers/formatAnalyticDate.ts +0 -29
- package/src/core/gemxql/helpers/getTimeDimension.ts +0 -11
- package/src/core/gemxql/helpers/hasMetricData.ts +0 -6
- package/src/core/gemxql/helpers/index.ts +0 -8
- package/src/core/gemxql/helpers/parseJsonFields.ts +0 -36
- package/src/core/gemxql/helpers/readNumeric.ts +0 -25
- package/src/core/gemxql/hooks/index.ts +0 -2
- package/src/core/gemxql/hooks/useAnalyticData.ts +0 -67
- package/src/core/gemxql/hooks/useGemXQlPagination.ts +0 -79
- package/src/core/gemxql/index.ts +0 -8
- package/src/core/gemxql/types/analytic-data.ts +0 -26
- package/src/core/gemxql/types/analytic-source.ts +0 -4
- package/src/core/gemxql/types/extra-condition.ts +0 -40
- package/src/core/gemxql/types/field-filters.ts +0 -18
- package/src/core/gemxql/types/field-operators.ts +0 -8
- package/src/core/gemxql/types/filter-types.ts +0 -33
- package/src/core/gemxql/types/group-with-clause.ts +0 -12
- package/src/core/gemxql/types/index.ts +0 -11
- package/src/core/gemxql/types/order-by.ts +0 -13
- package/src/core/gemxql/types/page-fields.ts +0 -25
- package/src/core/gemxql/types/row-reader-mode.ts +0 -6
- package/src/core/gemxql/types/time-dimension.ts +0 -8
- package/src/global.d.ts +0 -38
- package/src/hooks/index.ts +0 -7
- package/src/hooks/publish/index.ts +0 -2
- package/src/hooks/publish/useStickyDetectById.ts +0 -39
- package/src/hooks/publish/useStickyFilterBoxProps.ts +0 -26
- package/src/hooks/publish/useWindowSize.ts +0 -54
- package/src/hooks/useEnhancedEffect.ts +0 -3
- package/src/hooks/useFetchCurrencyRates.ts +0 -48
- package/src/hooks/useFormatLineChartData.ts +0 -28
- package/src/hooks/usePopoverResizeObserver.ts +0 -43
- package/src/hooks/usePreventBodyScroll.ts +0 -15
- package/src/hooks/useSearchParams.ts +0 -7
- package/src/hooks/useToggle.ts +0 -23
- package/src/index.ts +0 -10
- package/src/modules/analytics/constants/index.ts +0 -124
- package/src/modules/analytics/index.ts +0 -3
- package/src/modules/analytics/types/index.ts +0 -43
- package/src/modules/analytics/utils/formatMetric.ts +0 -42
- package/src/modules/analytics/utils/getPAMetricValue.ts +0 -11
- package/src/modules/analytics/utils/index.ts +0 -3
- package/src/modules/analytics/utils/metric.ts +0 -172
- package/src/providers/ConvertMoneyProvider.tsx +0 -68
- package/src/providers/MetricChartProvider.tsx +0 -50
- package/src/providers/TimezoneProvider.tsx +0 -31
- package/src/providers/index.ts +0 -5
- package/src/shared/charts/components/ComboChart.tsx +0 -108
- package/src/shared/charts/components/GBarChart.tsx +0 -96
- package/src/shared/charts/components/GComboChart.tsx +0 -15
- package/src/shared/charts/components/GDonutChart.tsx +0 -25
- package/src/shared/charts/components/GFunnelChart/GFunnelChart.tsx +0 -34
- package/src/shared/charts/components/GFunnelChart/components/FunnelChartAction.tsx +0 -67
- package/src/shared/charts/components/GFunnelChart/components/FunnelChartActionIcon.tsx +0 -60
- package/src/shared/charts/components/GFunnelChart/components/FunnelChartActionWrapper.tsx +0 -100
- package/src/shared/charts/components/GFunnelChart/components/FunnelSelection/FunnelSelectionContent.tsx +0 -92
- package/src/shared/charts/components/GFunnelChart/components/FunnelSelection/FunnelSelectionHeader.tsx +0 -54
- package/src/shared/charts/components/GFunnelChart/components/FunnelSelection/FunnelSelectionItem.tsx +0 -51
- package/src/shared/charts/components/GFunnelChart/components/FunnelSelection/FunnelSelectionPopover.tsx +0 -95
- package/src/shared/charts/components/GFunnelChart/components/FunnelSelection/index.ts +0 -1
- package/src/shared/charts/components/GFunnelChart/components/FunnelSelection/type.ts +0 -7
- package/src/shared/charts/components/GFunnelChart/components/types.ts +0 -24
- package/src/shared/charts/components/GFunnelChart/index.ts +0 -4
- package/src/shared/charts/components/GFunnelChart/types.ts +0 -11
- package/src/shared/charts/components/GPolarisViz/components/Arc/Arc.module.scss +0 -7
- package/src/shared/charts/components/GPolarisViz/components/Arc/Arc.tsx +0 -135
- package/src/shared/charts/components/GPolarisViz/components/Arc/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/ChartContainer/ChartContainer.module.scss +0 -39
- package/src/shared/charts/components/GPolarisViz/components/ChartContainer/ChartContainer.tsx +0 -150
- package/src/shared/charts/components/GPolarisViz/components/ChartContainer/hooks/useContainerBounds.ts +0 -113
- package/src/shared/charts/components/GPolarisViz/components/ChartContainer/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/ChartElements/ChartDiv.tsx +0 -18
- package/src/shared/charts/components/GPolarisViz/components/ChartElements/ChartElements.module.scss +0 -21
- package/src/shared/charts/components/GPolarisViz/components/ChartElements/ChartSVG.tsx +0 -40
- package/src/shared/charts/components/GPolarisViz/components/ChartElements/index.ts +0 -7
- package/src/shared/charts/components/GPolarisViz/components/ChartErrorBoundary/ChartErrorBoundary.tsx +0 -56
- package/src/shared/charts/components/GPolarisViz/components/ChartErrorBoundary/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/ChartErrorBoundary/utilities/checkForMismatchedData.ts +0 -34
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/ChartSkeleton.module.scss +0 -6
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/ChartSkeleton.tsx +0 -96
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/DonutSkeleton/DonutSkeleton.module.scss +0 -41
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/DonutSkeleton/DonutSkeleton.tsx +0 -193
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/DonutSkeleton/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/ErrorText/ErrorText.tsx +0 -40
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/ErrorText/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/FunnelSkeleton/FunnelSkeleton.tsx +0 -69
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/FunnelSkeleton/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/GridSkeleton/GridSkeleton.tsx +0 -155
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/GridSkeleton/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/Shimmer/Shimmer.module.scss +0 -33
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/Shimmer/Shimmer.tsx +0 -34
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/Shimmer/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/SimpleBarSkeleton/SimpleBarSkeleton.module.scss +0 -15
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/SimpleBarSkeleton/SimpleBarSkeleton.tsx +0 -53
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/SimpleBarSkeleton/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/SimpleNormalizedSkeleton/SimpleNormalizedSkeleton.module.scss +0 -35
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/SimpleNormalizedSkeleton/SimpleNormalizedSkeleton.tsx +0 -75
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/SimpleNormalizedSkeleton/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/SparkSkeleton/SparkSkeleton.tsx +0 -27
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/SparkSkeleton/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/components/index.ts +0 -8
- package/src/shared/charts/components/GPolarisViz/components/ChartSkeleton/index.ts +0 -9
- package/src/shared/charts/components/GPolarisViz/components/ConicGradientWithStops/ConicGradientWithStops.tsx +0 -27
- package/src/shared/charts/components/GPolarisViz/components/ConicGradientWithStops/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/DefaultPreview/DefaultPreview.module.scss +0 -8
- package/src/shared/charts/components/GPolarisViz/components/DefaultPreview/DefaultPreview.tsx +0 -25
- package/src/shared/charts/components/GPolarisViz/components/DefaultPreview/index.ts +0 -2
- package/src/shared/charts/components/GPolarisViz/components/FunnelChart/Chart.tsx +0 -209
- package/src/shared/charts/components/GPolarisViz/components/FunnelChart/FunnelChart.tsx +0 -72
- package/src/shared/charts/components/GPolarisViz/components/FunnelChart/components/FunnelChartXAxisArrows.tsx +0 -52
- package/src/shared/charts/components/GPolarisViz/components/FunnelChart/components/FunnelChartXAxisLabels.tsx +0 -66
- package/src/shared/charts/components/GPolarisViz/components/FunnelChart/components/FunnelSegment.tsx +0 -121
- package/src/shared/charts/components/GPolarisViz/components/FunnelChart/components/Label.module.scss +0 -23
- package/src/shared/charts/components/GPolarisViz/components/FunnelChart/components/Label.tsx +0 -67
- package/src/shared/charts/components/GPolarisViz/components/FunnelChart/components/index.ts +0 -4
- package/src/shared/charts/components/GPolarisViz/components/FunnelChart/index.ts +0 -2
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/Chart.tsx +0 -259
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/FunnelChartNext.tsx +0 -104
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/FunnelChartLabels/FunnelChartLabels.tsx +0 -387
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/FunnelChartLabels/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/FunnelTooltip/FunnelTooltip.scss +0 -8
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/FunnelTooltip/FunnelTooltip.tsx +0 -37
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/FunnelTooltip/index.ts +0 -3
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/ScaleIcon.tsx +0 -20
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/ScaleIconTooltip.tsx +0 -31
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/Tooltip/CustomTooltip.tsx +0 -68
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/Tooltip/Tooltip.scss +0 -52
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/Tooltip/Tooltip.tsx +0 -149
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/Tooltip/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/TooltipOverlay.tsx +0 -117
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/TooltipWithPortal.tsx +0 -12
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/index.ts +0 -8
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/constants.ts +0 -28
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/hooks/useTooltipInteraction.ts +0 -59
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/hooks/useTooltipPlacement.ts +0 -113
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/index.ts +0 -6
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/types.ts +0 -13
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/utilities/calculate-dropoff.ts +0 -4
- package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/utilities/useBuildFunnelTrends.ts +0 -108
- package/src/shared/charts/components/GPolarisViz/components/HorizontalGridLines/HorizontalGridLines.tsx +0 -27
- package/src/shared/charts/components/GPolarisViz/components/HorizontalGridLines/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/Labels/SingleTextLine.tsx +0 -64
- package/src/shared/charts/components/GPolarisViz/components/Labels/hooks/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/Labels/hooks/useLabels.tsx +0 -131
- package/src/shared/charts/components/GPolarisViz/components/Labels/index.ts +0 -3
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/endLineTruncate.ts +0 -23
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/endWordTruncate.ts +0 -34
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/estimateTextHeight.ts +0 -31
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/formatAndAddEllipsis.ts +0 -12
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/getDiagonalLabels.ts +0 -70
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/getHorizontalLabels.ts +0 -90
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/getVerticalLabels.ts +0 -58
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/getWidestLabel.ts +0 -15
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/shouldSkipLabel.ts +0 -11
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/tests/endWordTruncate.test.ts +0 -16
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/tests/estimateTextHeight.test.ts +0 -19
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/tests/formatAndAddEllipsis.test.ts +0 -9
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/tests/truncateLastLine.test.ts +0 -22
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/tests/truncateSingleLine.test.ts +0 -15
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/truncateLabels.ts +0 -75
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/truncateLastLine.ts +0 -61
- package/src/shared/charts/components/GPolarisViz/components/Labels/utilities/truncateSingleLine.ts +0 -39
- package/src/shared/charts/components/GPolarisViz/components/LinePreview/LinePreview.module.scss +0 -8
- package/src/shared/charts/components/GPolarisViz/components/LinePreview/LinePreview.tsx +0 -105
- package/src/shared/charts/components/GPolarisViz/components/LinePreview/constants.ts +0 -3
- package/src/shared/charts/components/GPolarisViz/components/LinePreview/index.ts +0 -2
- package/src/shared/charts/components/GPolarisViz/components/SwallowErrors/SwallowErrors.tsx +0 -32
- package/src/shared/charts/components/GPolarisViz/components/SwallowErrors/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/TextLine/TextLine.tsx +0 -88
- package/src/shared/charts/components/GPolarisViz/components/TextLine/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/TooltipContent.tsx +0 -109
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipContentContainer/TooltipContentContainer.module.scss +0 -10
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipContentContainer/TooltipContentContainer.tsx +0 -67
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipContentContainer/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipRow/TooltipRow.module.scss +0 -26
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipRow/TooltipRow.tsx +0 -57
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipRow/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipSeries/TooltipSeries.module.scss +0 -4
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipSeries/TooltipSeries.tsx +0 -26
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipSeries/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipSeriesName/TooltipSeriesName.module.scss +0 -4
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipSeriesName/TooltipSeriesName.tsx +0 -20
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipSeriesName/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipTitle/TooltipTitle.module.scss +0 -7
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipTitle/TooltipTitle.tsx +0 -15
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/TooltipTitle/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/components/index.ts +0 -5
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/constants.ts +0 -2
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/hooks/useGetLongestLabelFromData.ts +0 -56
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/index.ts +0 -4
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/utilities/get-tooltip-template-content-column-count.ts +0 -10
- package/src/shared/charts/components/GPolarisViz/components/TooltipContent/utilities/tests/get-tooltip-template-content-column-count.test.ts +0 -48
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/TooltipWrapper.tsx +0 -338
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/components/TooltipAnimatedContainer.module.scss +0 -6
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/components/TooltipAnimatedContainer.tsx +0 -139
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/constants.ts +0 -18
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/index.ts +0 -5
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/types.ts +0 -62
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/utilities/eventPoint.ts +0 -84
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/utilities/getAlteredHorizontalBarPosition.ts +0 -110
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/utilities/getAlteredLineChartPosition.ts +0 -115
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/utilities/getAlteredVerticalBarPosition.ts +0 -105
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/utilities/getDonutChartTooltipPosition.ts +0 -64
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/utilities/getHorizontalBarChartTooltipPosition.ts +0 -79
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/utilities/getLineChartTooltipPosition.ts +0 -68
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/utilities/getVerticalBarChartTooltipPosition.ts +0 -123
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/utilities/shouldBlockTooltipEvents.ts +0 -6
- package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/utilities.ts +0 -162
- package/src/shared/charts/components/GPolarisViz/components/TrendIndicator/TrendIndicator.tsx +0 -72
- package/src/shared/charts/components/GPolarisViz/components/TrendIndicator/components/Arrows/ArrowDown.tsx +0 -12
- package/src/shared/charts/components/GPolarisViz/components/TrendIndicator/components/Arrows/ArrowUp.tsx +0 -12
- package/src/shared/charts/components/GPolarisViz/components/TrendIndicator/components/Arrows/index.ts +0 -2
- package/src/shared/charts/components/GPolarisViz/components/TrendIndicator/components/Svg/Svg.scss +0 -7
- package/src/shared/charts/components/GPolarisViz/components/TrendIndicator/components/Svg/Svg.tsx +0 -27
- package/src/shared/charts/components/GPolarisViz/components/TrendIndicator/components/Svg/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/TrendIndicator/components/index.ts +0 -2
- package/src/shared/charts/components/GPolarisViz/components/TrendIndicator/constants.ts +0 -12
- package/src/shared/charts/components/GPolarisViz/components/TrendIndicator/index.ts +0 -6
- package/src/shared/charts/components/GPolarisViz/components/TrendIndicator/utilities/estimateTrendIndicatorWidth.ts +0 -9
- package/src/shared/charts/components/GPolarisViz/components/VerticalBarChart/utilities/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/VerticalBarChart/utilities/sortBarChartData.ts +0 -20
- package/src/shared/charts/components/GPolarisViz/components/VerticalGridLines/VerticalGridLines.tsx +0 -32
- package/src/shared/charts/components/GPolarisViz/components/VerticalGridLines/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/components/index.ts +0 -6
- package/src/shared/charts/components/GPolarisViz/constants.ts +0 -72
- package/src/shared/charts/components/GPolarisViz/data/character-width-offsets.json +0 -65
- package/src/shared/charts/components/GPolarisViz/data/character-widths.json +0 -1
- package/src/shared/charts/components/GPolarisViz/hooks/index.ts +0 -5
- package/src/shared/charts/components/GPolarisViz/hooks/useBarSpringConfig.ts +0 -21
- package/src/shared/charts/components/GPolarisViz/hooks/useBrowserCheck.ts +0 -13
- package/src/shared/charts/components/GPolarisViz/hooks/useCallbackRef.tsx +0 -39
- package/src/shared/charts/components/GPolarisViz/hooks/useDataForHorizontalChart.ts +0 -69
- package/src/shared/charts/components/GPolarisViz/hooks/useDebouncedCallback.ts +0 -197
- package/src/shared/charts/components/GPolarisViz/hooks/useFormattedLabels.ts +0 -31
- package/src/shared/charts/components/GPolarisViz/hooks/useFunnelBarScaling.ts +0 -53
- package/src/shared/charts/components/GPolarisViz/hooks/useHorizontalBarSizes.ts +0 -70
- package/src/shared/charts/components/GPolarisViz/hooks/useHorizontalStackedValues.ts +0 -34
- package/src/shared/charts/components/GPolarisViz/hooks/useHorizontalTicksAndScale.ts +0 -67
- package/src/shared/charts/components/GPolarisViz/hooks/useHorizontalXScale.ts +0 -48
- package/src/shared/charts/components/GPolarisViz/hooks/useIndexForLabels.ts +0 -16
- package/src/shared/charts/components/GPolarisViz/hooks/usePrefersReducedMotion.ts +0 -6
- package/src/shared/charts/components/GPolarisViz/hooks/usePrintResizing.ts +0 -94
- package/src/shared/charts/components/GPolarisViz/hooks/useReducedLabelIndexes.ts +0 -21
- package/src/shared/charts/components/GPolarisViz/hooks/useResizeObserver.ts +0 -39
- package/src/shared/charts/components/GPolarisViz/hooks/useRootContainer.ts +0 -20
- package/src/shared/charts/components/GPolarisViz/hooks/useWatchColorVisionEvents.tsx +0 -35
- package/src/shared/charts/components/GPolarisViz/index.ts +0 -10
- package/src/shared/charts/components/GPolarisViz/shared/Bar/Bar.tsx +0 -89
- package/src/shared/charts/components/GPolarisViz/shared/Bar/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/shared/FunnelChartConnector/FunnelChartConnector.tsx +0 -46
- package/src/shared/charts/components/GPolarisViz/shared/FunnelChartConnector/FunnelChartConnectorGradient.tsx +0 -21
- package/src/shared/charts/components/GPolarisViz/shared/FunnelChartConnector/constants.ts +0 -11
- package/src/shared/charts/components/GPolarisViz/shared/FunnelChartConnector/index.ts +0 -3
- package/src/shared/charts/components/GPolarisViz/shared/FunnelChartSegment/FunnelChartSegment.tsx +0 -100
- package/src/shared/charts/components/GPolarisViz/shared/FunnelChartSegment/components/AnimatedSegment.tsx +0 -50
- package/src/shared/charts/components/GPolarisViz/shared/FunnelChartSegment/components/InteractiveOverlay.tsx +0 -34
- package/src/shared/charts/components/GPolarisViz/shared/FunnelChartSegment/components/ScaledSegment.tsx +0 -218
- package/src/shared/charts/components/GPolarisViz/shared/FunnelChartSegment/constants.ts +0 -4
- package/src/shared/charts/components/GPolarisViz/shared/FunnelChartSegment/index.ts +0 -2
- package/src/shared/charts/components/GPolarisViz/shared/SeriesIcon/SeriesIcon.tsx +0 -22
- package/src/shared/charts/components/GPolarisViz/shared/SeriesIcon/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/shared/ZeroValueLine/ZeroValueLine.tsx +0 -45
- package/src/shared/charts/components/GPolarisViz/shared/ZeroValueLine/index.ts +0 -1
- package/src/shared/charts/components/GPolarisViz/shared/index.ts +0 -3
- package/src/shared/charts/components/GPolarisViz/styles/_common.scss +0 -15
- package/src/shared/charts/components/GPolarisViz/styles/shared/_accessibility.scss +0 -41
- package/src/shared/charts/components/GPolarisViz/styles/shared/_chart-container.scss +0 -8
- package/src/shared/charts/components/GPolarisViz/styles/shared/_variables.scss +0 -322
- package/src/shared/charts/components/GPolarisViz/types.ts +0 -261
- package/src/shared/charts/components/GPolarisViz/utilities/base.ts +0 -13
- package/src/shared/charts/components/GPolarisViz/utilities/classnames.ts +0 -3
- package/src/shared/charts/components/GPolarisViz/utilities/createCssConicGradient.ts +0 -12
- package/src/shared/charts/components/GPolarisViz/utilities/createCssGradient.ts +0 -7
- package/src/shared/charts/components/GPolarisViz/utilities/estimateStringWidthWithOffset.ts +0 -15
- package/src/shared/charts/components/GPolarisViz/utilities/getAxisOptions.ts +0 -26
- package/src/shared/charts/components/GPolarisViz/utilities/getCSSBackgroundFromColor.ts +0 -8
- package/src/shared/charts/components/GPolarisViz/utilities/getChartId.ts +0 -3
- package/src/shared/charts/components/GPolarisViz/utilities/getFontSize.ts +0 -7
- package/src/shared/charts/components/GPolarisViz/utilities/getStackedMinMax.ts +0 -43
- package/src/shared/charts/components/GPolarisViz/utilities/getStackedValues.ts +0 -35
- package/src/shared/charts/components/GPolarisViz/utilities/getStackedValuesFromDataSeries.tsx +0 -30
- package/src/shared/charts/components/GPolarisViz/utilities/getTrendIndicatorData.ts +0 -22
- package/src/shared/charts/components/GPolarisViz/utilities/hasHiddenComparisonSeries.ts +0 -26
- package/src/shared/charts/components/GPolarisViz/utilities/index.ts +0 -6
- package/src/shared/charts/components/GSimpleBarChart.tsx +0 -32
- package/src/shared/charts/components/index.ts +0 -7
- package/src/shared/charts/constants/chart.ts +0 -14
- package/src/shared/charts/constants/index.ts +0 -1
- package/src/shared/charts/contexts/GChartProvider.tsx +0 -48
- package/src/shared/charts/contexts/index.ts +0 -1
- package/src/shared/charts/index.ts +0 -4
- package/src/shared/charts/types/chart.ts +0 -36
- package/src/shared/charts/types/index.ts +0 -1
- package/src/shared/components/GActivatorPopover/GActivatorPopover.tsx +0 -107
- package/src/shared/components/GActivatorPopover/index.ts +0 -1
- package/src/shared/components/GBlockCenter/GBlockCenter.scss +0 -19
- package/src/shared/components/GBlockCenter/GBlockCenter.tsx +0 -72
- package/src/shared/components/GBlockCenter/index.ts +0 -1
- package/src/shared/components/GBox/GBox.scss +0 -25
- package/src/shared/components/GBox/GBox.tsx +0 -15
- package/src/shared/components/GBox/index.ts +0 -1
- package/src/shared/components/GBoxCard/GBoxCard.tsx +0 -27
- package/src/shared/components/GBoxCard/index.ts +0 -1
- package/src/shared/components/GButton/GButton.scss +0 -41
- package/src/shared/components/GButton/GButton.tsx +0 -73
- package/src/shared/components/GButton/index.ts +0 -1
- package/src/shared/components/GCheckbox/GCheckbox.tsx +0 -176
- package/src/shared/components/GCheckbox/index.ts +0 -1
- package/src/shared/components/GChoice/ChoiceHelpText.tsx +0 -25
- package/src/shared/components/GChoice/GChoice.scss +0 -14
- package/src/shared/components/GChoice/GChoice.tsx +0 -165
- package/src/shared/components/GChoice/index.ts +0 -2
- package/src/shared/components/GClickable/GClickable.tsx +0 -43
- package/src/shared/components/GClickable/index.ts +0 -1
- package/src/shared/components/GDiv/GDiv.tsx +0 -27
- package/src/shared/components/GDiv/index.ts +0 -1
- package/src/shared/components/GDotInline/GDotInline.tsx +0 -20
- package/src/shared/components/GDotInline/index.ts +0 -1
- package/src/shared/components/GFeatureLocked/GFeatureLocked.tsx +0 -85
- package/src/shared/components/GFeatureLocked/assets/images/empty-analytics.png +0 -0
- package/src/shared/components/GFeatureLocked/assets/images/empty-campaign-group-template-illustration.png +0 -0
- package/src/shared/components/GFeatureLocked/assets/images/empty-campaign-group-template.png +0 -0
- package/src/shared/components/GFeatureLocked/assets/images/empty-page-listing-illustration.png +0 -0
- package/src/shared/components/GFeatureLocked/assets/images/empty-page-listing.png +0 -0
- package/src/shared/components/GFeatureLocked/constants.ts +0 -33
- package/src/shared/components/GFeatureLocked/index.ts +0 -2
- package/src/shared/components/GFeatureLocked/types.ts +0 -16
- package/src/shared/components/GI18NText/GI18NText.tsx +0 -37
- package/src/shared/components/GI18NText/index.ts +0 -2
- package/src/shared/components/GI18NText/types.ts +0 -7
- package/src/shared/components/GInlineCenter/GInlineCenter.scss +0 -17
- package/src/shared/components/GInlineCenter/GInlineCenter.tsx +0 -39
- package/src/shared/components/GInlineCenter/index.ts +0 -1
- package/src/shared/components/GMockDataTooltip/GMockDataTooltip.tsx +0 -30
- package/src/shared/components/GMockDataTooltip/index.ts +0 -1
- package/src/shared/components/GModal/GModal.tsx +0 -49
- package/src/shared/components/GModal/index.ts +0 -1
- package/src/shared/components/GOptionList/GOptionList.tsx +0 -63
- package/src/shared/components/GOptionList/index.ts +0 -1
- package/src/shared/components/GPagination/GPagination.tsx +0 -44
- package/src/shared/components/GPagination/hooks/useGPagination.ts +0 -42
- package/src/shared/components/GPagination/index.ts +0 -2
- package/src/shared/components/GSelector/GSelector.tsx +0 -198
- package/src/shared/components/GSelector/index.ts +0 -1
- package/src/shared/components/GSkeletonDisplayText/GSkeletonDisplayText.tsx +0 -14
- package/src/shared/components/GSkeletonDisplayText/index.ts +0 -1
- package/src/shared/components/GSpinner/GSpinner.tsx +0 -16
- package/src/shared/components/GSpinner/index.ts +0 -1
- package/src/shared/components/GTextLink/GTextLink.tsx +0 -26
- package/src/shared/components/GTextLink/index.ts +0 -1
- package/src/shared/components/GTextTooltip/GTextTooltip.tsx +0 -18
- package/src/shared/components/GTextTooltip/index.ts +0 -1
- package/src/shared/components/GTextTruncated/GTextTruncated.tsx +0 -80
- package/src/shared/components/GTextTruncated/index.ts +0 -1
- package/src/shared/components/GThumbnail/GThumbnail.scss +0 -5
- package/src/shared/components/GThumbnail/GThumbnail.tsx +0 -69
- package/src/shared/components/GThumbnail/index.ts +0 -1
- package/src/shared/components/GTooltip/GTooltip.tsx +0 -34
- package/src/shared/components/GTooltip/components/GTooltipCard.tsx +0 -164
- package/src/shared/components/GTooltip/index.ts +0 -3
- package/src/shared/components/GTooltipCard/GTooltipCard.tsx +0 -161
- package/src/shared/components/GTooltipCard/index.ts +0 -7
- package/src/shared/components/GVariantBadge/GVariant.tsx +0 -55
- package/src/shared/components/GVariantBadge/GVariantBadge.scss +0 -10
- package/src/shared/components/GVariantBadge/GVariantBadge.tsx +0 -82
- package/src/shared/components/GVariantBadge/index.ts +0 -4
- package/src/shared/components/GVariantBadge/types.ts +0 -20
- package/src/shared/components/GViewBySelector/GViewBySelector.tsx +0 -114
- package/src/shared/components/GViewBySelector/index.ts +0 -1
- package/src/shared/components/index.ts +0 -26
- package/src/shared/index.ts +0 -1
- package/src/shared/journey/common/JourneyContainer/components/JourneyContainer.tsx +0 -140
- package/src/shared/journey/common/JourneyContainer/components/JourneyTimeline.tsx +0 -18
- package/src/shared/journey/common/JourneyContainer/components/index.ts +0 -2
- package/src/shared/journey/common/JourneyContainer/index.ts +0 -1
- package/src/shared/journey/common/index.ts +0 -1
- package/src/shared/journey/index.ts +0 -2
- package/src/shared/journey/ui/JourneyEvents/components/AcceptedPostPurchaseOffer/AcceptedPostPurchaseOffer.tsx +0 -24
- package/src/shared/journey/ui/JourneyEvents/components/AcceptedPostPurchaseOffer/index.ts +0 -1
- package/src/shared/journey/ui/JourneyEvents/components/CheckoutCompleted/CheckoutCompleted.tsx +0 -64
- package/src/shared/journey/ui/JourneyEvents/components/CheckoutCompleted/index.ts +0 -1
- package/src/shared/journey/ui/JourneyEvents/components/CheckoutItems.tsx +0 -27
- package/src/shared/journey/ui/JourneyEvents/components/CheckoutStarted/CheckoutStarted.tsx +0 -25
- package/src/shared/journey/ui/JourneyEvents/components/CheckoutStarted/CheckoutStartedDetail.tsx +0 -79
- package/src/shared/journey/ui/JourneyEvents/components/CheckoutStarted/index.ts +0 -2
- package/src/shared/journey/ui/JourneyEvents/components/PageViewed/PageViewed.tsx +0 -116
- package/src/shared/journey/ui/JourneyEvents/components/PageViewed/index.ts +0 -1
- package/src/shared/journey/ui/JourneyEvents/components/ProductAddedToCart/ProductAddedToCart.tsx +0 -24
- package/src/shared/journey/ui/JourneyEvents/components/ProductAddedToCart/index.ts +0 -1
- package/src/shared/journey/ui/JourneyEvents/components/ProductQuantity/ProductQuantity.tsx +0 -33
- package/src/shared/journey/ui/JourneyEvents/components/ProductQuantity/index.ts +0 -1
- package/src/shared/journey/ui/JourneyEvents/components/ProductRemovedFromCart/ProductRemovedFromCart.tsx +0 -24
- package/src/shared/journey/ui/JourneyEvents/components/ProductRemovedFromCart/index.ts +0 -1
- package/src/shared/journey/ui/JourneyEvents/components/index.ts +0 -6
- package/src/shared/journey/ui/JourneyEvents/constants/event.ts +0 -38
- package/src/shared/journey/ui/JourneyEvents/constants/index.ts +0 -1
- package/src/shared/journey/ui/JourneyEvents/index.ts +0 -2
- package/src/shared/journey/ui/JourneyEvents/types.ts +0 -2
- package/src/shared/journey/ui/JourneyGroup/JourneyGroup.tsx +0 -41
- package/src/shared/journey/ui/JourneyGroup/index.ts +0 -1
- package/src/shared/journey/ui/JourneyItem/components/EventMarkerIcon.tsx +0 -28
- package/src/shared/journey/ui/JourneyItem/components/JourneyDetail.tsx +0 -24
- package/src/shared/journey/ui/JourneyItem/components/JourneyItem.tsx +0 -27
- package/src/shared/journey/ui/JourneyItem/components/JourneyTime.tsx +0 -33
- package/src/shared/journey/ui/JourneyItem/components/QuantityWrapper.tsx +0 -17
- package/src/shared/journey/ui/JourneyItem/components/index.ts +0 -3
- package/src/shared/journey/ui/JourneyItem/index.ts +0 -2
- package/src/shared/journey/ui/JourneyItem/types/events.ts +0 -33
- package/src/shared/journey/ui/JourneyItem/types/index.ts +0 -1
- package/src/shared/journey/ui/JourneyTitle/components/GemxIdBadge.tsx +0 -38
- package/src/shared/journey/ui/JourneyTitle/components/JourneyDateBadge.tsx +0 -18
- package/src/shared/journey/ui/JourneyTitle/components/JourneyIdBadge.tsx +0 -65
- package/src/shared/journey/ui/JourneyTitle/components/JourneyLoadMore.tsx +0 -43
- package/src/shared/journey/ui/JourneyTitle/components/JourneyTitle.tsx +0 -42
- package/src/shared/journey/ui/JourneyTitle/components/index.ts +0 -2
- package/src/shared/journey/ui/JourneyTitle/constants/idBadge.ts +0 -1
- package/src/shared/journey/ui/JourneyTitle/constants/index.ts +0 -1
- package/src/shared/journey/ui/JourneyTitle/index.ts +0 -1
- package/src/shared/journey/ui/index.ts +0 -3
- package/src/shared/journey/ui/type.ts +0 -2
- package/src/shared/reports/common/Visualization/constants/columns.ts +0 -6
- package/src/shared/reports/common/Visualization/constants/index.ts +0 -2
- package/src/shared/reports/common/Visualization/constants/version.ts +0 -8
- package/src/shared/reports/common/Visualization/index.ts +0 -2
- package/src/shared/reports/common/Visualization/types/chart.ts +0 -5
- package/src/shared/reports/common/Visualization/types/index.ts +0 -3
- package/src/shared/reports/common/Visualization/types/report-metric.ts +0 -21
- package/src/shared/reports/common/Visualization/types/report.ts +0 -42
- package/src/shared/reports/common/Visualization/utils/index.ts +0 -2
- package/src/shared/reports/common/Visualization/utils/version.ts +0 -9
- package/src/shared/reports/common/Visualization/utils/visualization.ts +0 -58
- package/src/shared/reports/common/index.ts +0 -1
- package/src/shared/reports/ui/ReportTable/ReportTable.tsx +0 -194
- package/src/shared/reports/ui/ReportTable/ReportTableSkeleton.tsx +0 -73
- package/src/shared/reports/ui/ReportTable/assets/styles/ReportTable.scss +0 -288
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/CampaignsCell/CampaignsCell.tsx +0 -102
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/CampaignsCell/CampaignsCellVersion.tsx +0 -11
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/CampaignsCell/index.ts +0 -1
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/Cell.tsx +0 -93
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/CellRenderers.tsx +0 -72
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/DateCell.tsx +0 -9
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/DefaultCell.tsx +0 -32
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/GemxIdCell.tsx +0 -18
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/ItemsCell/CheckoutStartedDetail.tsx +0 -79
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/ItemsCell/ItemsCell.tsx +0 -56
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/ItemsCell/index.ts +0 -1
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/NoneCell.tsx +0 -11
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/OrderCell/LoadingData.tsx +0 -10
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/OrderCell/NoData.tsx +0 -13
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/OrderCell/OrderCell.tsx +0 -78
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/OrderCell/OrderCellBase.tsx +0 -55
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/OrderCell/OrderCellContainer.tsx +0 -43
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/OrderCell/OrderItem.tsx +0 -79
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/OrderCell/index.ts +0 -2
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/OrderIdCell.tsx +0 -70
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/PreviousCell.tsx +0 -17
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/TotalCell.tsx +0 -14
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/VersionCell.tsx +0 -31
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/WrapperCell.tsx +0 -31
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/index.ts +0 -1
- package/src/shared/reports/ui/ReportTable/components/Body/Cell/type.ts +0 -18
- package/src/shared/reports/ui/ReportTable/components/Body/Row.tsx +0 -85
- package/src/shared/reports/ui/ReportTable/components/Body/index.ts +0 -2
- package/src/shared/reports/ui/ReportTable/components/Footer/Pagination.tsx +0 -76
- package/src/shared/reports/ui/ReportTable/components/Footer/ScrollBar.tsx +0 -19
- package/src/shared/reports/ui/ReportTable/components/Footer/WrapperFooter.tsx +0 -39
- package/src/shared/reports/ui/ReportTable/components/Footer/index.ts +0 -1
- package/src/shared/reports/ui/ReportTable/components/Header/Header.tsx +0 -68
- package/src/shared/reports/ui/ReportTable/components/Header/SortableHeader.tsx +0 -49
- package/src/shared/reports/ui/ReportTable/components/Header/SortableHeaderWithTooltip.tsx +0 -60
- package/src/shared/reports/ui/ReportTable/components/Header/SummaryCell.tsx +0 -26
- package/src/shared/reports/ui/ReportTable/components/Header/SummaryRow.tsx +0 -69
- package/src/shared/reports/ui/ReportTable/components/Header/WrapperHeader.tsx +0 -54
- package/src/shared/reports/ui/ReportTable/components/Header/index.ts +0 -1
- package/src/shared/reports/ui/ReportTable/components/index.ts +0 -2
- package/src/shared/reports/ui/ReportTable/constants/index.ts +0 -2
- package/src/shared/reports/ui/ReportTable/constants/order.ts +0 -30
- package/src/shared/reports/ui/ReportTable/constants/table.ts +0 -17
- package/src/shared/reports/ui/ReportTable/context/ReportTableActionsContext.tsx +0 -28
- package/src/shared/reports/ui/ReportTable/helpers/format.ts +0 -29
- package/src/shared/reports/ui/ReportTable/helpers/index.ts +0 -2
- package/src/shared/reports/ui/ReportTable/helpers/report.ts +0 -7
- package/src/shared/reports/ui/ReportTable/hooks/index.ts +0 -3
- package/src/shared/reports/ui/ReportTable/hooks/useReportTable.ts +0 -172
- package/src/shared/reports/ui/ReportTable/hooks/useReportTableCell.tsx +0 -28
- package/src/shared/reports/ui/ReportTable/hooks/useSyncedScroll.ts +0 -81
- package/src/shared/reports/ui/ReportTable/index.ts +0 -4
- package/src/shared/reports/ui/ReportTable/types/dimension.ts +0 -8
- package/src/shared/reports/ui/ReportTable/types/index.ts +0 -43
- package/src/shared/reports/ui/ReportTable/types/order.ts +0 -15
- package/src/shared/reports/ui/ReportTable/types/report-columns.ts +0 -11
- package/src/shared/reports/ui/ReportTable/utils/format.ts +0 -100
- package/src/shared/reports/ui/ReportTable/utils/index.ts +0 -2
- package/src/shared/reports/ui/ReportTable/utils/order.ts +0 -8
- package/src/shared/reports/ui/ReportTable/utils/table.ts +0 -19
- package/src/shared/reports/ui/ReportTable/utils/visualization.ts +0 -56
- package/src/shared/reports/ui/index.ts +0 -0
- package/src/stores/currencyRatesStore.ts +0 -13
- package/src/stores/index.ts +0 -2
- package/src/styles/index.scss +0 -9
- package/src/types/analytic-mode.ts +0 -5
- package/src/types/breakdown-items.ts +0 -21
- package/src/types/campaign.ts +0 -13
- package/src/types/chart.ts +0 -42
- package/src/types/currency.ts +0 -329
- package/src/types/index.ts +0 -8
- package/src/types/metric.ts +0 -81
- package/src/types/pricing.ts +0 -38
- package/src/types/report-columns.ts +0 -1
- package/src/types/template.ts +0 -19
- package/src/utils/analytics.ts +0 -75
- package/src/utils/array.ts +0 -13
- package/src/utils/cls.ts +0 -18
- package/src/utils/currency.ts +0 -42
- package/src/utils/date-time.ts +0 -7
- package/src/utils/dayjs.ts +0 -52
- package/src/utils/deep-copy.ts +0 -4
- package/src/utils/index.ts +0 -12
- package/src/utils/is-browser.ts +0 -3
- package/src/utils/number.ts +0 -19
- package/src/utils/percentage.ts +0 -40
- package/src/utils/sort.ts +0 -87
- package/src/utils/string.ts +0 -20
- package/src/utils/template-type.ts +0 -30
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import type { IFunnelChartColors } from '@/shared/charts/components/GFunnelChart/types';
|
|
2
|
-
import type { Color, DataPoint, LabelFormatter } from '@shopify/polaris-viz-core';
|
|
3
|
-
import type { FunnelChartMetaData, MetaDataTrendIndicator } from '../../types';
|
|
4
|
-
|
|
5
|
-
import { DEFAULT_THEME_NAME, useTheme } from '@shopify/polaris-viz-core';
|
|
6
|
-
import { Fragment } from 'react';
|
|
7
|
-
import { FUNNEL_CHART_CONNECTOR_GRADIENT } from '../../../../shared/FunnelChartConnector';
|
|
8
|
-
import { FUNNEL_CHART_SEGMENT_FILL } from '../../../../shared/FunnelChartSegment';
|
|
9
|
-
import { SeriesIcon } from '../../../../shared/SeriesIcon';
|
|
10
|
-
import { getTrendIndicatorData } from '../../../../utilities/getTrendIndicatorData';
|
|
11
|
-
import { TooltipContentContainer, TooltipTitle } from '../../../TooltipContent';
|
|
12
|
-
import { TrendIndicator } from '../../../TrendIndicator';
|
|
13
|
-
import { TOOLTIP_WIDTH } from '../../constants';
|
|
14
|
-
import { calculateDropOff } from '../../utilities/calculate-dropoff';
|
|
15
|
-
|
|
16
|
-
export interface TooltipContentProps {
|
|
17
|
-
activeIndex: number;
|
|
18
|
-
dataSeries: DataPoint[];
|
|
19
|
-
trends: FunnelChartMetaData['trends'];
|
|
20
|
-
tooltipLabels: {
|
|
21
|
-
reached: string;
|
|
22
|
-
dropped: string;
|
|
23
|
-
};
|
|
24
|
-
funnelColors?: IFunnelChartColors;
|
|
25
|
-
labelFormatter: LabelFormatter;
|
|
26
|
-
percentageFormatter: (value: number) => string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
interface Data {
|
|
30
|
-
key: string;
|
|
31
|
-
value: string;
|
|
32
|
-
color: Color;
|
|
33
|
-
percent: number | null;
|
|
34
|
-
trendKey: string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function Tooltip({
|
|
38
|
-
activeIndex,
|
|
39
|
-
dataSeries,
|
|
40
|
-
trends,
|
|
41
|
-
tooltipLabels,
|
|
42
|
-
funnelColors,
|
|
43
|
-
labelFormatter,
|
|
44
|
-
percentageFormatter,
|
|
45
|
-
}: TooltipContentProps) {
|
|
46
|
-
const selectedTheme = useTheme(DEFAULT_THEME_NAME);
|
|
47
|
-
|
|
48
|
-
const point = dataSeries[activeIndex];
|
|
49
|
-
const previousPoint = dataSeries[activeIndex - 1];
|
|
50
|
-
const isFirst = activeIndex === 0;
|
|
51
|
-
|
|
52
|
-
const currentValue = point?.value ?? null;
|
|
53
|
-
const previousValue = previousPoint?.value ?? null;
|
|
54
|
-
const hasValidValues = currentValue !== null && previousValue !== null;
|
|
55
|
-
|
|
56
|
-
const getDropOffPercent = () => {
|
|
57
|
-
if (isFirst || !hasValidValues || previousValue === 0) return null;
|
|
58
|
-
|
|
59
|
-
return Math.abs(calculateDropOff(previousValue, currentValue));
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const getReachedPercent = (percDropOff: number | null) => {
|
|
63
|
-
if (isFirst) return 100;
|
|
64
|
-
if (!hasValidValues) return null;
|
|
65
|
-
return 100 - percDropOff!;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const percDropOffage = getDropOffPercent();
|
|
69
|
-
const reachedPercent = getReachedPercent(percDropOffage);
|
|
70
|
-
|
|
71
|
-
const data: Data[] = [
|
|
72
|
-
{
|
|
73
|
-
key: tooltipLabels.reached,
|
|
74
|
-
value: currentValue === null ? '-' : (labelFormatter(currentValue) as string),
|
|
75
|
-
color: funnelColors?.segment.fill ?? FUNNEL_CHART_SEGMENT_FILL,
|
|
76
|
-
percent: reachedPercent,
|
|
77
|
-
trendKey: 'reached',
|
|
78
|
-
},
|
|
79
|
-
];
|
|
80
|
-
|
|
81
|
-
if (!isFirst && hasValidValues) {
|
|
82
|
-
let value = '0';
|
|
83
|
-
if (previousValue > 0 && previousValue >= currentValue) {
|
|
84
|
-
value = labelFormatter(previousValue - currentValue) as string;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
data.push({
|
|
88
|
-
key: tooltipLabels.dropped,
|
|
89
|
-
value,
|
|
90
|
-
percent: percDropOffage,
|
|
91
|
-
color: funnelColors?.connector ?? FUNNEL_CHART_CONNECTOR_GRADIENT,
|
|
92
|
-
trendKey: 'dropped',
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return (
|
|
97
|
-
<TooltipContentContainer
|
|
98
|
-
maxWidth={TOOLTIP_WIDTH}
|
|
99
|
-
minWidth={TOOLTIP_WIDTH}
|
|
100
|
-
theme={DEFAULT_THEME_NAME}
|
|
101
|
-
color={selectedTheme.tooltip.backgroundColor}
|
|
102
|
-
>
|
|
103
|
-
{() => (
|
|
104
|
-
<Fragment>
|
|
105
|
-
<TooltipTitle
|
|
106
|
-
theme={DEFAULT_THEME_NAME}
|
|
107
|
-
color={selectedTheme.tooltip.textColor}
|
|
108
|
-
aria-label={`Step: ${point!.key}`}
|
|
109
|
-
>
|
|
110
|
-
{point!.key}
|
|
111
|
-
</TooltipTitle>
|
|
112
|
-
<div className="GFunnelChartNextTooltip-rows">
|
|
113
|
-
{data.map(({ key, value, color, percent, trendKey }, index) => {
|
|
114
|
-
const formattedPercent = percent === null ? '-' : percentageFormatter(percent);
|
|
115
|
-
const ariaLabel = `${key}: ${value}, ${formattedPercent}`;
|
|
116
|
-
|
|
117
|
-
const { trendIndicatorProps } = getTrendIndicatorData(
|
|
118
|
-
(trends as MetaDataTrendIndicator[])?.[activeIndex],
|
|
119
|
-
);
|
|
120
|
-
const trendByKey = (trendIndicatorProps as any)[trendKey];
|
|
121
|
-
|
|
122
|
-
return (
|
|
123
|
-
<div className="GFunnelChartNextTooltip-row" key={`row-${index}-${key}`} aria-label={ariaLabel}>
|
|
124
|
-
<div className="GFunnelChartNextTooltip-keys">
|
|
125
|
-
<SeriesIcon color={color!} />
|
|
126
|
-
<span>{key}</span>
|
|
127
|
-
</div>
|
|
128
|
-
<div className="GFunnelChartNextTooltip-values">
|
|
129
|
-
<span>
|
|
130
|
-
<strong>{value}</strong>
|
|
131
|
-
</span>
|
|
132
|
-
<span>
|
|
133
|
-
<strong>{formattedPercent}</strong>
|
|
134
|
-
</span>
|
|
135
|
-
{trendIndicatorProps && (
|
|
136
|
-
<div className="GFunnelChartNextTooltip-trendIndicator">
|
|
137
|
-
<TrendIndicator {...trendByKey} />
|
|
138
|
-
</div>
|
|
139
|
-
)}
|
|
140
|
-
</div>
|
|
141
|
-
</div>
|
|
142
|
-
);
|
|
143
|
-
})}
|
|
144
|
-
</div>
|
|
145
|
-
</Fragment>
|
|
146
|
-
)}
|
|
147
|
-
</TooltipContentContainer>
|
|
148
|
-
);
|
|
149
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Tooltip } from './Tooltip';
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import type { IFunnelChartColors } from '../../../../GFunnelChart/types';
|
|
2
|
-
import type { TooltipPlacement } from './FunnelTooltip/FunnelTooltip';
|
|
3
|
-
import type { LabelFormatter } from '@shopify/polaris-viz-core';
|
|
4
|
-
import type { GDataPoint } from '@/shared/charts/types';
|
|
5
|
-
import type { ScaleBand } from 'd3-scale';
|
|
6
|
-
|
|
7
|
-
import { TOOLTIP_WIDTH, TOOLTIP_GAP_FROM_BAR, TOOLTIP_HEIGHT, SHORT_TOOLTIP_HEIGHT } from '../constants';
|
|
8
|
-
import { FunnelTooltip } from './FunnelTooltip/FunnelTooltip';
|
|
9
|
-
import { CustomTooltip } from './Tooltip/CustomTooltip';
|
|
10
|
-
import { Tooltip } from './Tooltip/Tooltip';
|
|
11
|
-
|
|
12
|
-
interface TooltipOverlayProps {
|
|
13
|
-
tooltipIndex: number;
|
|
14
|
-
dataSeries: GDataPoint[];
|
|
15
|
-
trends: ReturnType<any> | undefined;
|
|
16
|
-
tooltipLabels: { reached: string; dropped: string };
|
|
17
|
-
funnelColors?: IFunnelChartColors;
|
|
18
|
-
labelFormatter: LabelFormatter;
|
|
19
|
-
percentageFormatter: (value: number) => string;
|
|
20
|
-
getBarHeight: (value: number) => number;
|
|
21
|
-
getXPosition: (dataPoint: GDataPoint) => number;
|
|
22
|
-
getYPosition: (dataPoint: GDataPoint, height: number) => { y: number; placement: TooltipPlacement };
|
|
23
|
-
chartX: number;
|
|
24
|
-
barWidth: number;
|
|
25
|
-
xScale: ScaleBand<string>;
|
|
26
|
-
onTooltipMouseEnter: () => void;
|
|
27
|
-
onTooltipMouseLeave: () => void;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function TooltipOverlay({
|
|
31
|
-
tooltipIndex,
|
|
32
|
-
dataSeries,
|
|
33
|
-
trends,
|
|
34
|
-
tooltipLabels,
|
|
35
|
-
funnelColors,
|
|
36
|
-
labelFormatter,
|
|
37
|
-
percentageFormatter,
|
|
38
|
-
getBarHeight,
|
|
39
|
-
getXPosition,
|
|
40
|
-
getYPosition,
|
|
41
|
-
chartX,
|
|
42
|
-
barWidth,
|
|
43
|
-
xScale,
|
|
44
|
-
onTooltipMouseEnter,
|
|
45
|
-
onTooltipMouseLeave,
|
|
46
|
-
}: TooltipOverlayProps) {
|
|
47
|
-
const activeDataSeries = dataSeries[tooltipIndex];
|
|
48
|
-
if (!activeDataSeries) return null;
|
|
49
|
-
|
|
50
|
-
const xPosition = getXPosition(activeDataSeries);
|
|
51
|
-
const chartTooltip = activeDataSeries.chartTooltip;
|
|
52
|
-
const tooltipHeight = chartTooltip ? TOOLTIP_HEIGHT : SHORT_TOOLTIP_HEIGHT;
|
|
53
|
-
const { y: yPosition, placement } = getYPosition(activeDataSeries, tooltipHeight);
|
|
54
|
-
const chartTooltipPrimaryAction = activeDataSeries.chartTooltipPrimaryAction;
|
|
55
|
-
|
|
56
|
-
// Hover bridge: covers area between tooltip and bar so mouse can travel between them
|
|
57
|
-
const activeBarHeight = getBarHeight(activeDataSeries.value ?? 0);
|
|
58
|
-
const bridgeHeight = TOOLTIP_GAP_FROM_BAR + activeBarHeight;
|
|
59
|
-
|
|
60
|
-
// Compute union of tooltip and section edges (relative to tooltip left)
|
|
61
|
-
const currentX = xScale(activeDataSeries.key.toString()) ?? 0;
|
|
62
|
-
const sectionLeftRel = chartX + currentX - xPosition;
|
|
63
|
-
const sectionRightRel = sectionLeftRel + barWidth;
|
|
64
|
-
const bridgeLeft = Math.min(0, sectionLeftRel);
|
|
65
|
-
const bridgeRight = Math.max(TOOLTIP_WIDTH, sectionRightRel);
|
|
66
|
-
const bridgeWidth = bridgeRight - bridgeLeft;
|
|
67
|
-
|
|
68
|
-
const isBelow = placement === 'below';
|
|
69
|
-
|
|
70
|
-
return (
|
|
71
|
-
<FunnelTooltip key={`${tooltipIndex}-${placement}`} x={xPosition} y={yPosition} placement={placement}>
|
|
72
|
-
<div
|
|
73
|
-
role="presentation"
|
|
74
|
-
style={{
|
|
75
|
-
position: 'relative',
|
|
76
|
-
overflow: 'visible',
|
|
77
|
-
pointerEvents: 'auto',
|
|
78
|
-
...(isBelow ? { paddingTop: TOOLTIP_GAP_FROM_BAR } : { paddingBottom: TOOLTIP_GAP_FROM_BAR }),
|
|
79
|
-
}}
|
|
80
|
-
onMouseEnter={onTooltipMouseEnter}
|
|
81
|
-
onMouseLeave={onTooltipMouseLeave}
|
|
82
|
-
>
|
|
83
|
-
{chartTooltip ? (
|
|
84
|
-
<CustomTooltip data={chartTooltip} primaryAction={chartTooltipPrimaryAction} item={activeDataSeries} />
|
|
85
|
-
) : (
|
|
86
|
-
<Tooltip
|
|
87
|
-
activeIndex={tooltipIndex}
|
|
88
|
-
dataSeries={dataSeries}
|
|
89
|
-
trends={trends}
|
|
90
|
-
tooltipLabels={tooltipLabels}
|
|
91
|
-
funnelColors={funnelColors}
|
|
92
|
-
labelFormatter={labelFormatter}
|
|
93
|
-
percentageFormatter={percentageFormatter}
|
|
94
|
-
/>
|
|
95
|
-
)}
|
|
96
|
-
{/* Invisible trapezoidal hover bridge between tooltip and bar */}
|
|
97
|
-
<div
|
|
98
|
-
style={{
|
|
99
|
-
position: 'absolute',
|
|
100
|
-
...(isBelow
|
|
101
|
-
? {
|
|
102
|
-
top: -bridgeHeight,
|
|
103
|
-
clipPath: `polygon(${sectionLeftRel - bridgeLeft}px 0, ${sectionRightRel - bridgeLeft}px 0, ${TOOLTIP_WIDTH - bridgeLeft}px 100%, ${-bridgeLeft}px 100%)`,
|
|
104
|
-
}
|
|
105
|
-
: {
|
|
106
|
-
bottom: -bridgeHeight,
|
|
107
|
-
clipPath: `polygon(${-bridgeLeft}px 0, ${TOOLTIP_WIDTH - bridgeLeft}px 0, ${sectionRightRel - bridgeLeft}px 100%, ${sectionLeftRel - bridgeLeft}px 100%)`,
|
|
108
|
-
}),
|
|
109
|
-
left: bridgeLeft,
|
|
110
|
-
width: bridgeWidth,
|
|
111
|
-
height: bridgeHeight,
|
|
112
|
-
}}
|
|
113
|
-
/>
|
|
114
|
-
</div>
|
|
115
|
-
</FunnelTooltip>
|
|
116
|
-
);
|
|
117
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
import { useRootContainer } from '../../../hooks/useRootContainer';
|
|
4
|
-
import { TOOLTIP_ID } from '../../../constants';
|
|
5
|
-
import { createPortal } from 'react-dom';
|
|
6
|
-
|
|
7
|
-
export function TooltipWithPortal({ children }: { children: ReactNode }) {
|
|
8
|
-
const container = useRootContainer(TOOLTIP_ID);
|
|
9
|
-
|
|
10
|
-
if (!container) return null;
|
|
11
|
-
return createPortal(children, container);
|
|
12
|
-
}
|
package/src/shared/charts/components/GPolarisViz/components/FunnelChartNext/components/index.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export type { TooltipPlacement } from './FunnelTooltip';
|
|
2
|
-
|
|
3
|
-
export { FunnelChartLabels } from './FunnelChartLabels';
|
|
4
|
-
export { FunnelTooltip } from './FunnelTooltip';
|
|
5
|
-
export { TooltipWithPortal } from './TooltipWithPortal';
|
|
6
|
-
export { ScaleIcon } from './ScaleIcon';
|
|
7
|
-
export { ScaleIconTooltip } from './ScaleIconTooltip';
|
|
8
|
-
export { Tooltip } from './Tooltip';
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export const FUNNEL_CONNECTOR_Y_OFFSET = 30;
|
|
2
|
-
export const TOOLTIP_WIDTH = 286;
|
|
3
|
-
export const SEGMENT_WIDTH_RATIO = 0.75;
|
|
4
|
-
export const TOOLTIP_HORIZONTAL_OFFSET = 10;
|
|
5
|
-
export const LINE_OFFSET = 3;
|
|
6
|
-
export const LINE_WIDTH = 1;
|
|
7
|
-
export const TOOLTIP_HEIGHT = 225;
|
|
8
|
-
export const TOOLTIP_BOTTOM_OFFSET = 5;
|
|
9
|
-
export const TOOLTIP_RIGHT_POSITION_THRESHOLD = 65;
|
|
10
|
-
export const SHORT_TOOLTIP_HEIGHT = 139;
|
|
11
|
-
export const GAP = 1;
|
|
12
|
-
|
|
13
|
-
export const PERCENTAGE_COLOR = 'rgba(48, 48, 48, 1)';
|
|
14
|
-
export const LINE_GRADIENT = [
|
|
15
|
-
{
|
|
16
|
-
color: 'rgba(227, 227, 227, 1)',
|
|
17
|
-
offset: 0,
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
color: 'rgba(227, 227, 227, 0)',
|
|
21
|
-
offset: 100,
|
|
22
|
-
},
|
|
23
|
-
];
|
|
24
|
-
|
|
25
|
-
export const TOOLTIP_GAP_FROM_BAR = 4;
|
|
26
|
-
|
|
27
|
-
export const LABELS_HEIGHT = 80;
|
|
28
|
-
export const PERCENTAGE_SUMMARY_HEIGHT = 30;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { useCallback, useRef, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Manages tooltip show/hide state with delayed hiding to support
|
|
5
|
-
* mouse travel between bar and tooltip (hover bridge pattern).
|
|
6
|
-
*/
|
|
7
|
-
export function useTooltipInteraction() {
|
|
8
|
-
const [tooltipIndex, setTooltipIndex] = useState<number | null>(null);
|
|
9
|
-
const isTooltipHoveredRef = useRef(false);
|
|
10
|
-
const hideTimerRef = useRef<number | null>(null);
|
|
11
|
-
|
|
12
|
-
const clearHideTimer = useCallback(() => {
|
|
13
|
-
if (hideTimerRef.current) {
|
|
14
|
-
window.clearTimeout(hideTimerRef.current);
|
|
15
|
-
hideTimerRef.current = null;
|
|
16
|
-
}
|
|
17
|
-
}, []);
|
|
18
|
-
|
|
19
|
-
const showTooltipAt = useCallback(
|
|
20
|
-
(index: number) => {
|
|
21
|
-
clearHideTimer();
|
|
22
|
-
setTooltipIndex(index);
|
|
23
|
-
},
|
|
24
|
-
[clearHideTimer],
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
const scheduleTooltipHide = useCallback(() => {
|
|
28
|
-
clearHideTimer();
|
|
29
|
-
hideTimerRef.current = window.setTimeout(() => {
|
|
30
|
-
if (!isTooltipHoveredRef.current) setTooltipIndex(null);
|
|
31
|
-
}, 0);
|
|
32
|
-
}, [clearHideTimer]);
|
|
33
|
-
|
|
34
|
-
const handleTooltipMouseEnter = useCallback(() => {
|
|
35
|
-
isTooltipHoveredRef.current = true;
|
|
36
|
-
}, []);
|
|
37
|
-
|
|
38
|
-
const handleTooltipMouseLeave = useCallback(() => {
|
|
39
|
-
isTooltipHoveredRef.current = false;
|
|
40
|
-
scheduleTooltipHide();
|
|
41
|
-
}, [scheduleTooltipHide]);
|
|
42
|
-
|
|
43
|
-
const handleChartBlur = useCallback((event: React.FocusEvent) => {
|
|
44
|
-
const currentTarget = event.currentTarget;
|
|
45
|
-
const relatedTarget = event.relatedTarget as Node;
|
|
46
|
-
if (!currentTarget.contains(relatedTarget)) {
|
|
47
|
-
setTooltipIndex(null);
|
|
48
|
-
}
|
|
49
|
-
}, []);
|
|
50
|
-
|
|
51
|
-
return {
|
|
52
|
-
tooltipIndex,
|
|
53
|
-
showTooltipAt,
|
|
54
|
-
scheduleTooltipHide,
|
|
55
|
-
handleTooltipMouseEnter,
|
|
56
|
-
handleTooltipMouseLeave,
|
|
57
|
-
handleChartBlur,
|
|
58
|
-
};
|
|
59
|
-
}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import type { GDataPoint } from '@/shared/charts/types';
|
|
2
|
-
import type { TooltipPlacement } from '../components';
|
|
3
|
-
import type { ScaleBand } from 'd3-scale';
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
TOOLTIP_HORIZONTAL_OFFSET,
|
|
7
|
-
TOOLTIP_WIDTH,
|
|
8
|
-
TOOLTIP_GAP_FROM_BAR,
|
|
9
|
-
TOOLTIP_HEIGHT,
|
|
10
|
-
SHORT_TOOLTIP_HEIGHT,
|
|
11
|
-
} from '../constants';
|
|
12
|
-
import { SCROLLBAR_WIDTH } from '../../TooltipWrapper';
|
|
13
|
-
import { useEffect, useRef, useState } from 'react';
|
|
14
|
-
import { clamp } from '@shopify/polaris-viz-core';
|
|
15
|
-
|
|
16
|
-
interface UseTooltipPlacementParams {
|
|
17
|
-
tooltipIndex: number | null;
|
|
18
|
-
dataSeries: GDataPoint[];
|
|
19
|
-
getBarHeight: (value: number) => number;
|
|
20
|
-
chartX: number;
|
|
21
|
-
chartY: number;
|
|
22
|
-
drawableHeight: number;
|
|
23
|
-
barHeightAdjustment: number;
|
|
24
|
-
barWidth: number;
|
|
25
|
-
xScale: ScaleBand<string>;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Computes tooltip x/y position and placement (above/below bar).
|
|
30
|
-
* Listens to scroll events via rAF and only triggers re-render
|
|
31
|
-
* when placement actually flips — not on every scroll frame.
|
|
32
|
-
*/
|
|
33
|
-
export function useTooltipPlacement({
|
|
34
|
-
tooltipIndex,
|
|
35
|
-
dataSeries,
|
|
36
|
-
getBarHeight,
|
|
37
|
-
chartX,
|
|
38
|
-
chartY,
|
|
39
|
-
drawableHeight,
|
|
40
|
-
barHeightAdjustment,
|
|
41
|
-
barWidth,
|
|
42
|
-
xScale,
|
|
43
|
-
}: UseTooltipPlacementParams) {
|
|
44
|
-
const rafRef = useRef<number | null>(null);
|
|
45
|
-
const lastPlacementRef = useRef<TooltipPlacement | null>(null);
|
|
46
|
-
const [, setPlacementTick] = useState(0);
|
|
47
|
-
|
|
48
|
-
useEffect(() => {
|
|
49
|
-
if (tooltipIndex == null) {
|
|
50
|
-
lastPlacementRef.current = null;
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const onScroll = () => {
|
|
55
|
-
if (rafRef.current != null) return;
|
|
56
|
-
rafRef.current = requestAnimationFrame(() => {
|
|
57
|
-
rafRef.current = null;
|
|
58
|
-
const activeData = dataSeries[tooltipIndex];
|
|
59
|
-
if (!activeData) return;
|
|
60
|
-
|
|
61
|
-
const barHeight = getBarHeight(activeData.value ?? 0);
|
|
62
|
-
const barTopY = chartY + (drawableHeight - barHeightAdjustment) - barHeight;
|
|
63
|
-
const tooltipHeight = activeData.chartTooltip ? TOOLTIP_HEIGHT : SHORT_TOOLTIP_HEIGHT;
|
|
64
|
-
|
|
65
|
-
const hasSpaceAbove = barTopY - window.scrollY - tooltipHeight - TOOLTIP_GAP_FROM_BAR >= 0;
|
|
66
|
-
const newPlacement: TooltipPlacement = hasSpaceAbove ? 'above' : 'below';
|
|
67
|
-
|
|
68
|
-
if (newPlacement !== lastPlacementRef.current) {
|
|
69
|
-
lastPlacementRef.current = newPlacement;
|
|
70
|
-
setPlacementTick((t) => t + 1);
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
window.addEventListener('scroll', onScroll, { passive: true });
|
|
76
|
-
return () => {
|
|
77
|
-
window.removeEventListener('scroll', onScroll);
|
|
78
|
-
if (rafRef.current != null) {
|
|
79
|
-
cancelAnimationFrame(rafRef.current);
|
|
80
|
-
rafRef.current = null;
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
}, [tooltipIndex, dataSeries, getBarHeight, chartY, drawableHeight, barHeightAdjustment]);
|
|
84
|
-
|
|
85
|
-
const getXPosition = (activeDataSeries: GDataPoint) => {
|
|
86
|
-
const currentX = xScale(activeDataSeries.key.toString()) ?? 0;
|
|
87
|
-
const xPosition = chartX + currentX + (barWidth - TOOLTIP_WIDTH) / 2;
|
|
88
|
-
|
|
89
|
-
return clamp({
|
|
90
|
-
amount: xPosition,
|
|
91
|
-
min: TOOLTIP_HORIZONTAL_OFFSET,
|
|
92
|
-
max: window.innerWidth - TOOLTIP_WIDTH - TOOLTIP_HORIZONTAL_OFFSET - SCROLLBAR_WIDTH,
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
const getYPosition = (
|
|
97
|
-
activeDataSeries: GDataPoint,
|
|
98
|
-
tooltipHeight: number,
|
|
99
|
-
): { y: number; placement: TooltipPlacement } => {
|
|
100
|
-
const barHeight = getBarHeight(activeDataSeries.value ?? 0);
|
|
101
|
-
const barTopY = chartY + (drawableHeight - barHeightAdjustment) - barHeight;
|
|
102
|
-
const barBottomY = chartY + (drawableHeight - barHeightAdjustment);
|
|
103
|
-
|
|
104
|
-
const hasSpaceAbove = barTopY - window.scrollY - tooltipHeight - TOOLTIP_GAP_FROM_BAR >= 0;
|
|
105
|
-
|
|
106
|
-
if (hasSpaceAbove) {
|
|
107
|
-
return { y: barTopY, placement: 'above' };
|
|
108
|
-
}
|
|
109
|
-
return { y: barBottomY, placement: 'below' };
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
return { getXPosition, getYPosition };
|
|
113
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { DataSeries } from '@shopify/polaris-viz-core';
|
|
2
|
-
|
|
3
|
-
import type { TrendIndicatorProps } from '../TrendIndicator';
|
|
4
|
-
|
|
5
|
-
export type MetaDataTrendIndicator = Omit<TrendIndicatorProps, 'theme'>;
|
|
6
|
-
|
|
7
|
-
export interface FunnelChartMetaData {
|
|
8
|
-
trends?: MetaDataTrendIndicator;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export type FunnelChartDataSeries = DataSeries & {
|
|
12
|
-
metadata?: FunnelChartMetaData;
|
|
13
|
-
};
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import type { MetaDataTrendIndicator, FunnelChartMetaData } from '../types';
|
|
2
|
-
import type { GDataSeries } from '@/shared/charts/types';
|
|
3
|
-
import type { FunnelChartNextProps } from '../FunnelChartNext';
|
|
4
|
-
|
|
5
|
-
import { useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
export interface UseBuildFunnelTrendsProps {
|
|
8
|
-
data: GDataSeries[];
|
|
9
|
-
percentageFormatter: FunnelChartNextProps['percentageFormatter'];
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function useBuildFunnelTrends({ data, percentageFormatter }: UseBuildFunnelTrendsProps) {
|
|
13
|
-
return useMemo(() => {
|
|
14
|
-
const primarySeries = data.find((series) => !series.isComparison);
|
|
15
|
-
const comparisonSeries = data.find((series) => series.isComparison);
|
|
16
|
-
|
|
17
|
-
if (!primarySeries || !comparisonSeries || !primarySeries.metadata?.trends) {
|
|
18
|
-
return undefined;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const trends: FunnelChartMetaData['trends'] = {};
|
|
22
|
-
|
|
23
|
-
primarySeries.data.forEach((_, index) => {
|
|
24
|
-
const reachedTrend = primarySeries.metadata?.trends[index];
|
|
25
|
-
|
|
26
|
-
if (!reachedTrend) return;
|
|
27
|
-
|
|
28
|
-
const droppedPercentageChange = calculateDroppedPercentageChange({
|
|
29
|
-
previousStepValue: primarySeries.data[index - 1]?.value,
|
|
30
|
-
currentStepValue: primarySeries.data[index]?.value,
|
|
31
|
-
comparisonPreviousStepValue: comparisonSeries.data[index - 1]?.value,
|
|
32
|
-
comparisonCurrentStepValue: comparisonSeries.data[index]?.value,
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
const droppedTrend =
|
|
36
|
-
index === 0 || comparisonSeries.isEmptyData
|
|
37
|
-
? undefined
|
|
38
|
-
: formatDroppedTrend(droppedPercentageChange, percentageFormatter);
|
|
39
|
-
|
|
40
|
-
(trends as any)[index] = {
|
|
41
|
-
reached: reachedTrend,
|
|
42
|
-
...(droppedTrend && { dropped: droppedTrend }),
|
|
43
|
-
};
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
return { trends };
|
|
47
|
-
}, [data, percentageFormatter]);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
interface DropOffCalculationParams {
|
|
51
|
-
previousStepValue: number | null | undefined;
|
|
52
|
-
currentStepValue: number | null | undefined;
|
|
53
|
-
comparisonPreviousStepValue: number | null | undefined;
|
|
54
|
-
comparisonCurrentStepValue: number | null | undefined;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function calculateDroppedPercentageChange({
|
|
58
|
-
previousStepValue,
|
|
59
|
-
currentStepValue,
|
|
60
|
-
comparisonPreviousStepValue,
|
|
61
|
-
comparisonCurrentStepValue,
|
|
62
|
-
}: DropOffCalculationParams): number | null {
|
|
63
|
-
const hasEmptyValues =
|
|
64
|
-
previousStepValue == null ||
|
|
65
|
-
currentStepValue == null ||
|
|
66
|
-
comparisonPreviousStepValue == null ||
|
|
67
|
-
comparisonCurrentStepValue == null;
|
|
68
|
-
|
|
69
|
-
if (hasEmptyValues) return null;
|
|
70
|
-
|
|
71
|
-
const currentDropped = previousStepValue! - currentStepValue!;
|
|
72
|
-
const comparisonDropped = comparisonPreviousStepValue! - comparisonCurrentStepValue!;
|
|
73
|
-
|
|
74
|
-
if (comparisonDropped === 0) return null;
|
|
75
|
-
|
|
76
|
-
return ((currentDropped - comparisonDropped) / Math.abs(comparisonDropped)) * 100;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function formatDroppedTrend(
|
|
80
|
-
percentageChange: number | null,
|
|
81
|
-
percentageFormatter: FunnelChartNextProps['percentageFormatter'],
|
|
82
|
-
): MetaDataTrendIndicator {
|
|
83
|
-
if (percentageChange == null) {
|
|
84
|
-
return {
|
|
85
|
-
value: null,
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const absolutePercentageChange = Math.abs(percentageChange);
|
|
90
|
-
const defaultFormattedPercentage = `${absolutePercentageChange}%`;
|
|
91
|
-
const formattedPercentage = percentageFormatter
|
|
92
|
-
? percentageFormatter(absolutePercentageChange)
|
|
93
|
-
: defaultFormattedPercentage;
|
|
94
|
-
|
|
95
|
-
if (percentageChange === 0) {
|
|
96
|
-
return {
|
|
97
|
-
value: formattedPercentage,
|
|
98
|
-
trend: 'neutral',
|
|
99
|
-
direction: 'upward',
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return {
|
|
104
|
-
value: formattedPercentage,
|
|
105
|
-
trend: percentageChange < 0 ? 'positive' : 'negative',
|
|
106
|
-
direction: percentageChange < 0 ? 'downward' : 'upward',
|
|
107
|
-
};
|
|
108
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { YAxisTick } from '../../types';
|
|
2
|
-
|
|
3
|
-
import { useTheme } from '@shopify/polaris-viz-core';
|
|
4
|
-
import { memo, Fragment } from 'react';
|
|
5
|
-
|
|
6
|
-
export interface Props {
|
|
7
|
-
ticks: YAxisTick[];
|
|
8
|
-
transform: { x: number; y: number };
|
|
9
|
-
width: number;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const HorizontalGridLines = memo(function HorizontalGridLines({ ticks, transform, width }: Props) {
|
|
13
|
-
const selectedTheme = useTheme();
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<Fragment>
|
|
17
|
-
{ticks.map(({ yOffset }, index) => (
|
|
18
|
-
<line
|
|
19
|
-
key={index}
|
|
20
|
-
x2={width}
|
|
21
|
-
stroke={selectedTheme.grid.color}
|
|
22
|
-
transform={`translate(${transform.x},${transform.y + yOffset})`}
|
|
23
|
-
/>
|
|
24
|
-
))}
|
|
25
|
-
</Fragment>
|
|
26
|
-
);
|
|
27
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { HorizontalGridLines } from './HorizontalGridLines';
|