@levi-gemcommerce/analytics 3.0.1-dev.3 → 3.0.1-dev.5
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/dist/esm/components/OrderAnalytic/types/order.d.ts +1 -1
- 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,139 +0,0 @@
|
|
|
1
|
-
import type { BoundingRect, Dimensions } from '@shopify/polaris-viz-core';
|
|
2
|
-
import type { TooltipPositionOffset } from '../types';
|
|
3
|
-
import type { Margin } from '../../../types';
|
|
4
|
-
import type { ReactNode } from 'react';
|
|
5
|
-
|
|
6
|
-
import { getAlteredHorizontalBarPosition } from '../utilities/getAlteredHorizontalBarPosition';
|
|
7
|
-
import { getAlteredVerticalBarPosition } from '../utilities/getAlteredVerticalBarPosition';
|
|
8
|
-
import { getAlteredLineChartPosition } from '../utilities/getAlteredLineChartPosition';
|
|
9
|
-
import { useChartContext, InternalChartType } from '@shopify/polaris-viz-core';
|
|
10
|
-
import { useResizeObserver } from '../../../hooks/useResizeObserver';
|
|
11
|
-
import { useEffect, useRef, useState, useMemo } from 'react';
|
|
12
|
-
import { DEFAULT_TOOLTIP_POSITION } from '../constants';
|
|
13
|
-
|
|
14
|
-
import styles from './TooltipAnimatedContainer.module.scss';
|
|
15
|
-
|
|
16
|
-
export interface TooltipAnimatedContainerProps {
|
|
17
|
-
children: ReactNode;
|
|
18
|
-
margin: Margin;
|
|
19
|
-
currentX: number;
|
|
20
|
-
currentY: number;
|
|
21
|
-
chartBounds: BoundingRect;
|
|
22
|
-
chartType: InternalChartType;
|
|
23
|
-
position?: TooltipPositionOffset;
|
|
24
|
-
id?: string;
|
|
25
|
-
bandwidth?: number;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function TooltipAnimatedContainer({
|
|
29
|
-
bandwidth = 0,
|
|
30
|
-
chartBounds,
|
|
31
|
-
chartType,
|
|
32
|
-
children,
|
|
33
|
-
currentX,
|
|
34
|
-
currentY,
|
|
35
|
-
id = '',
|
|
36
|
-
margin,
|
|
37
|
-
position = DEFAULT_TOOLTIP_POSITION,
|
|
38
|
-
}: TooltipAnimatedContainerProps) {
|
|
39
|
-
const { isPerformanceImpacted, scrollContainer, containerBounds, isTouchDevice } = useChartContext();
|
|
40
|
-
|
|
41
|
-
const [tooltipDimensions, setTooltipDimensions] = useState<Dimensions | null>(null);
|
|
42
|
-
const firstRender = useRef(true);
|
|
43
|
-
|
|
44
|
-
const { setRef, entry } = useResizeObserver();
|
|
45
|
-
|
|
46
|
-
const getAlteredPositionFunction = useMemo(() => {
|
|
47
|
-
switch (chartType) {
|
|
48
|
-
case InternalChartType.Line:
|
|
49
|
-
case InternalChartType.Donut:
|
|
50
|
-
return getAlteredLineChartPosition;
|
|
51
|
-
case InternalChartType.HorizontalBar:
|
|
52
|
-
return getAlteredHorizontalBarPosition;
|
|
53
|
-
case InternalChartType.Bar:
|
|
54
|
-
default:
|
|
55
|
-
return getAlteredVerticalBarPosition;
|
|
56
|
-
}
|
|
57
|
-
}, [chartType]);
|
|
58
|
-
|
|
59
|
-
const { x, y, opacity, immediate } = useMemo(() => {
|
|
60
|
-
if (tooltipDimensions == null) {
|
|
61
|
-
return { x: 0, y: 0, opacity: 0 };
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const { x, y } = getAlteredPositionFunction({
|
|
65
|
-
currentX,
|
|
66
|
-
currentY,
|
|
67
|
-
position,
|
|
68
|
-
tooltipDimensions,
|
|
69
|
-
chartBounds,
|
|
70
|
-
margin,
|
|
71
|
-
bandwidth,
|
|
72
|
-
isPerformanceImpacted,
|
|
73
|
-
isTouchDevice,
|
|
74
|
-
containerBounds,
|
|
75
|
-
scrollContainer,
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
const shouldRenderImmediate = firstRender.current;
|
|
79
|
-
firstRender.current = false;
|
|
80
|
-
|
|
81
|
-
return {
|
|
82
|
-
x,
|
|
83
|
-
y,
|
|
84
|
-
opacity: 1,
|
|
85
|
-
immediate: isPerformanceImpacted || shouldRenderImmediate,
|
|
86
|
-
};
|
|
87
|
-
}, [
|
|
88
|
-
bandwidth,
|
|
89
|
-
chartBounds,
|
|
90
|
-
currentX,
|
|
91
|
-
currentY,
|
|
92
|
-
getAlteredPositionFunction,
|
|
93
|
-
margin,
|
|
94
|
-
position,
|
|
95
|
-
isPerformanceImpacted,
|
|
96
|
-
tooltipDimensions,
|
|
97
|
-
containerBounds,
|
|
98
|
-
scrollContainer,
|
|
99
|
-
isTouchDevice,
|
|
100
|
-
]);
|
|
101
|
-
|
|
102
|
-
useEffect(() => {
|
|
103
|
-
if (entry == null) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
setTooltipDimensions((previous: Dimensions | null) => {
|
|
108
|
-
const { width, height } = entry.target.getBoundingClientRect();
|
|
109
|
-
|
|
110
|
-
if (previous?.width === width && previous?.height === height) {
|
|
111
|
-
return previous;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
return {
|
|
115
|
-
width,
|
|
116
|
-
height,
|
|
117
|
-
};
|
|
118
|
-
});
|
|
119
|
-
}, [entry]);
|
|
120
|
-
|
|
121
|
-
return (
|
|
122
|
-
<div
|
|
123
|
-
id={id}
|
|
124
|
-
className={styles.Container}
|
|
125
|
-
data-tooltip
|
|
126
|
-
style={{
|
|
127
|
-
top: 0,
|
|
128
|
-
left: 0,
|
|
129
|
-
opacity,
|
|
130
|
-
transform: `translate3d(${Math.round(x)}px, ${Math.round(y)}px, 0px)`,
|
|
131
|
-
transition: immediate ? 'none' : 'opacity 300ms ease, transform 150ms',
|
|
132
|
-
}}
|
|
133
|
-
ref={setRef}
|
|
134
|
-
aria-hidden="true"
|
|
135
|
-
>
|
|
136
|
-
{children}
|
|
137
|
-
</div>
|
|
138
|
-
);
|
|
139
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { TooltipHorizontalOffset, TooltipVerticalOffset } from './types';
|
|
2
|
-
import type { TooltipPosition } from './types';
|
|
3
|
-
|
|
4
|
-
export const DEFAULT_TOOLTIP_POSITION = {
|
|
5
|
-
horizontal: TooltipHorizontalOffset.Center,
|
|
6
|
-
vertical: TooltipVerticalOffset.Above,
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const TOOLTIP_POSITION_DEFAULT_RETURN: TooltipPosition = {
|
|
10
|
-
x: 0,
|
|
11
|
-
y: 0,
|
|
12
|
-
position: DEFAULT_TOOLTIP_POSITION,
|
|
13
|
-
activeIndex: null,
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
// The space between the cursor and the tooltip
|
|
17
|
-
export const TOOLTIP_MARGIN = 20;
|
|
18
|
-
export const SCROLLBAR_WIDTH = 20;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { TooltipWrapper } from './TooltipWrapper';
|
|
2
|
-
export { TooltipAnimatedContainer } from './components/TooltipAnimatedContainer';
|
|
3
|
-
export { TOOLTIP_MARGIN, TOOLTIP_POSITION_DEFAULT_RETURN, SCROLLBAR_WIDTH } from './constants';
|
|
4
|
-
export type { TooltipPosition, TooltipPositionParams } from './types';
|
|
5
|
-
export { eventPointNative } from './utilities/eventPoint';
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { BoundingRect, ChartType, DataSeries, Dimensions } from '@shopify/polaris-viz-core';
|
|
2
|
-
import type { ScaleBand, ScaleLinear } from 'd3-scale';
|
|
3
|
-
|
|
4
|
-
import type { Margin } from '../../types';
|
|
5
|
-
|
|
6
|
-
export enum TooltipHorizontalOffset {
|
|
7
|
-
Left,
|
|
8
|
-
Right,
|
|
9
|
-
Center,
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export enum TooltipVerticalOffset {
|
|
13
|
-
Above,
|
|
14
|
-
Below,
|
|
15
|
-
Inline,
|
|
16
|
-
Center,
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface TooltipPositionOffset {
|
|
20
|
-
horizontal: TooltipHorizontalOffset;
|
|
21
|
-
vertical: TooltipVerticalOffset;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface TooltipPosition {
|
|
25
|
-
x: number;
|
|
26
|
-
y: number;
|
|
27
|
-
activeIndex: number | null;
|
|
28
|
-
position?: TooltipPositionOffset;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface TooltipPositionParams {
|
|
32
|
-
chartBounds: Required<BoundingRect>;
|
|
33
|
-
data: DataSeries[];
|
|
34
|
-
eventType: 'mouse' | 'focus';
|
|
35
|
-
longestSeriesIndex: number;
|
|
36
|
-
xScale: ScaleBand<string> | ScaleLinear<number, number>;
|
|
37
|
-
event?: MouseEvent | TouchEvent | FocusEvent;
|
|
38
|
-
index?: number;
|
|
39
|
-
type?: ChartType;
|
|
40
|
-
yScale?: ScaleLinear<number, number>;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface AlteredPositionProps {
|
|
44
|
-
bandwidth: number;
|
|
45
|
-
chartBounds: BoundingRect;
|
|
46
|
-
currentX: number;
|
|
47
|
-
currentY: number;
|
|
48
|
-
containerBounds: BoundingRect;
|
|
49
|
-
isPerformanceImpacted: boolean;
|
|
50
|
-
isTouchDevice: boolean;
|
|
51
|
-
margin: Margin;
|
|
52
|
-
position: TooltipPositionOffset;
|
|
53
|
-
tooltipDimensions: Dimensions;
|
|
54
|
-
scrollContainer?: Element | null;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface AlteredPositionReturn {
|
|
58
|
-
x: number;
|
|
59
|
-
y: number;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export type AlteredPosition = (props: AlteredPositionProps) => AlteredPositionReturn;
|
package/src/shared/charts/components/GPolarisViz/components/TooltipWrapper/utilities/eventPoint.ts
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import type { Position } from '@shopify/polaris-viz-core';
|
|
2
|
-
import type React from 'react';
|
|
3
|
-
|
|
4
|
-
export function eventPoint(event: React.MouseEvent<SVGSVGElement> | React.TouchEvent<SVGSVGElement>) {
|
|
5
|
-
const svgNode = event.currentTarget;
|
|
6
|
-
|
|
7
|
-
if (svgNode == null) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const screenCTM = svgNode.getScreenCTM();
|
|
12
|
-
|
|
13
|
-
if (screenCTM == null) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const point = svgNode.createSVGPoint();
|
|
18
|
-
if (isMouseEvent(event)) {
|
|
19
|
-
point.x = event.clientX;
|
|
20
|
-
point.y = event.clientY;
|
|
21
|
-
} else if (isTouchEvent(event)) {
|
|
22
|
-
const touch = event.changedTouches[0];
|
|
23
|
-
point.x = touch!.clientX;
|
|
24
|
-
point.y = touch!.clientY;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const transformedSVGPoint = point.matrixTransform(screenCTM.inverse());
|
|
28
|
-
|
|
29
|
-
return {
|
|
30
|
-
clientX: point.x,
|
|
31
|
-
clientY: point.y,
|
|
32
|
-
svgX: transformedSVGPoint.x,
|
|
33
|
-
svgY: transformedSVGPoint.y,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function eventPointNative(event: MouseEvent | TouchEvent) {
|
|
38
|
-
const svgNode = getSVGNodeFromTarget(event);
|
|
39
|
-
|
|
40
|
-
if (svgNode == null) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const screenCTM = svgNode.getScreenCTM();
|
|
45
|
-
|
|
46
|
-
if (screenCTM == null) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const point = svgNode.createSVGPoint();
|
|
51
|
-
const { x, y } = getXYFromEventType(event);
|
|
52
|
-
|
|
53
|
-
point.x = x;
|
|
54
|
-
point.y = y;
|
|
55
|
-
|
|
56
|
-
const transformedSVGPoint = point.matrixTransform(screenCTM.inverse());
|
|
57
|
-
|
|
58
|
-
return {
|
|
59
|
-
svgX: transformedSVGPoint.x,
|
|
60
|
-
svgY: transformedSVGPoint.y,
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
function getSVGNodeFromTarget(event: MouseEvent | TouchEvent) {
|
|
64
|
-
if (event.currentTarget == null) {
|
|
65
|
-
return (event.target as SVGElement)?.closest('svg');
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return event.currentTarget as SVGSVGElement;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export function getXYFromEventType(event: MouseEvent | TouchEvent): Position {
|
|
73
|
-
return 'touches' in event
|
|
74
|
-
? { x: event.touches[0]!.pageX, y: event.touches[0]!.pageY }
|
|
75
|
-
: { x: event.pageX, y: event.pageY };
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export function isMouseEvent(event: React.SyntheticEvent): event is React.MouseEvent {
|
|
79
|
-
return event.nativeEvent instanceof MouseEvent;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export function isTouchEvent(event: React.SyntheticEvent): event is React.TouchEvent {
|
|
83
|
-
return typeof TouchEvent !== 'undefined' && event.nativeEvent instanceof TouchEvent;
|
|
84
|
-
}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import type { BoundingRect, Dimensions } from '@shopify/polaris-viz-core';
|
|
2
|
-
import { HORIZONTAL_GROUP_LABEL_HEIGHT } from '@shopify/polaris-viz-core';
|
|
3
|
-
|
|
4
|
-
import type { AlteredPositionProps, AlteredPositionReturn } from '../types';
|
|
5
|
-
import { TOOLTIP_MARGIN } from '../constants';
|
|
6
|
-
|
|
7
|
-
export function getAlteredHorizontalBarPosition(props: AlteredPositionProps): AlteredPositionReturn {
|
|
8
|
-
if (props.currentX < 0) {
|
|
9
|
-
return getNegativeOffset(props);
|
|
10
|
-
}
|
|
11
|
-
return getPositiveOffset(props);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function getNegativeOffset(props: AlteredPositionProps): AlteredPositionReturn {
|
|
15
|
-
const { bandwidth, currentX, currentY, tooltipDimensions } = props;
|
|
16
|
-
|
|
17
|
-
const flippedX = currentX * -1;
|
|
18
|
-
const yOffset = (bandwidth - tooltipDimensions.height) / 2;
|
|
19
|
-
|
|
20
|
-
const y = currentY - tooltipDimensions.height;
|
|
21
|
-
if (flippedX - tooltipDimensions.width < 0) {
|
|
22
|
-
return { x: flippedX, y: y < 0 ? 0 : y };
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return {
|
|
26
|
-
x: flippedX - tooltipDimensions.width - TOOLTIP_MARGIN,
|
|
27
|
-
y: currentY + HORIZONTAL_GROUP_LABEL_HEIGHT + yOffset,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function getPositiveOffset(props: AlteredPositionProps): AlteredPositionReturn {
|
|
32
|
-
const { bandwidth, currentX, currentY, tooltipDimensions, chartBounds } = props;
|
|
33
|
-
|
|
34
|
-
const isOutside = isOutsideBounds({
|
|
35
|
-
x: currentX,
|
|
36
|
-
y: currentY,
|
|
37
|
-
tooltipDimensions,
|
|
38
|
-
chartBounds,
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
if (isOutside.top && isOutside.right) {
|
|
42
|
-
return {
|
|
43
|
-
x: chartBounds.width - tooltipDimensions.width,
|
|
44
|
-
y: 0,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
if (isOutside.top && !isOutside.right) {
|
|
49
|
-
return {
|
|
50
|
-
x: currentX + TOOLTIP_MARGIN,
|
|
51
|
-
y: 0,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (!isOutside.right && !isOutside.bottom) {
|
|
56
|
-
const yOffset = (bandwidth - tooltipDimensions.height) / 2;
|
|
57
|
-
return {
|
|
58
|
-
x: currentX + TOOLTIP_MARGIN,
|
|
59
|
-
y: currentY + HORIZONTAL_GROUP_LABEL_HEIGHT + yOffset,
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (isOutside.right) {
|
|
64
|
-
const x = currentX - tooltipDimensions.width;
|
|
65
|
-
const y = currentY - tooltipDimensions.height + HORIZONTAL_GROUP_LABEL_HEIGHT - TOOLTIP_MARGIN;
|
|
66
|
-
|
|
67
|
-
if (y < 0) {
|
|
68
|
-
return {
|
|
69
|
-
x,
|
|
70
|
-
y: bandwidth + HORIZONTAL_GROUP_LABEL_HEIGHT + TOOLTIP_MARGIN,
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return {
|
|
75
|
-
x,
|
|
76
|
-
y,
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (isOutside.bottom) {
|
|
81
|
-
return {
|
|
82
|
-
x: currentX + TOOLTIP_MARGIN,
|
|
83
|
-
y: chartBounds.height - tooltipDimensions.height - HORIZONTAL_GROUP_LABEL_HEIGHT,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
return { x: currentX, y: currentY };
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function isOutsideBounds({
|
|
91
|
-
x,
|
|
92
|
-
y,
|
|
93
|
-
tooltipDimensions,
|
|
94
|
-
chartBounds,
|
|
95
|
-
}: {
|
|
96
|
-
x: number;
|
|
97
|
-
y: number;
|
|
98
|
-
tooltipDimensions: Dimensions;
|
|
99
|
-
chartBounds: BoundingRect;
|
|
100
|
-
}) {
|
|
101
|
-
const right = x + TOOLTIP_MARGIN + tooltipDimensions.width;
|
|
102
|
-
const bottom = y + tooltipDimensions.height;
|
|
103
|
-
|
|
104
|
-
return {
|
|
105
|
-
left: x <= 0,
|
|
106
|
-
right: right > chartBounds.width,
|
|
107
|
-
bottom: bottom > chartBounds.height,
|
|
108
|
-
top: y <= 0,
|
|
109
|
-
};
|
|
110
|
-
}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { clamp } from '@shopify/polaris-viz-core';
|
|
2
|
-
|
|
3
|
-
import type { AlteredPositionProps } from '../types';
|
|
4
|
-
|
|
5
|
-
// The space between the cursor and the tooltip
|
|
6
|
-
export const TOOLTIP_MARGIN = 20;
|
|
7
|
-
export const SCROLLBAR_WIDTH = 20;
|
|
8
|
-
|
|
9
|
-
export interface AlteredPositionReturn {
|
|
10
|
-
x: number;
|
|
11
|
-
y: number;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export type AlteredPosition = (props: AlteredPositionProps) => AlteredPositionReturn;
|
|
15
|
-
|
|
16
|
-
export function getAlteredLineChartPosition(props: AlteredPositionProps): AlteredPositionReturn {
|
|
17
|
-
const { currentX, currentY, containerBounds, scrollContainer } = props;
|
|
18
|
-
|
|
19
|
-
let x = currentX;
|
|
20
|
-
let y = currentY;
|
|
21
|
-
|
|
22
|
-
//
|
|
23
|
-
// Y POSITIONING
|
|
24
|
-
//
|
|
25
|
-
|
|
26
|
-
if (props.isPerformanceImpacted || props.isTouchDevice) {
|
|
27
|
-
y = containerBounds.y - ((scrollContainer as HTMLElement)?.scrollTop ?? 0);
|
|
28
|
-
|
|
29
|
-
if (props.isTouchDevice) {
|
|
30
|
-
y -= props.tooltipDimensions.height;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
//
|
|
35
|
-
// X POSITIONING
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
const right = getRightPosition(x, props);
|
|
39
|
-
|
|
40
|
-
x = right.value;
|
|
41
|
-
|
|
42
|
-
if (right.wasOutsideBounds) {
|
|
43
|
-
const left = getLeftPosition(x, props);
|
|
44
|
-
|
|
45
|
-
x = left.value;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return {
|
|
49
|
-
x: clamp({
|
|
50
|
-
amount: x,
|
|
51
|
-
min: TOOLTIP_MARGIN,
|
|
52
|
-
max: window.innerWidth - props.tooltipDimensions.width - TOOLTIP_MARGIN - SCROLLBAR_WIDTH,
|
|
53
|
-
}),
|
|
54
|
-
y: clamp({
|
|
55
|
-
amount: y,
|
|
56
|
-
min: window.scrollY + TOOLTIP_MARGIN,
|
|
57
|
-
max: window.scrollY + window.innerHeight - props.tooltipDimensions.height - TOOLTIP_MARGIN,
|
|
58
|
-
}),
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
interface IsOutsideBoundsData {
|
|
63
|
-
current: number;
|
|
64
|
-
alteredPosition: AlteredPositionProps;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function isOutsideBounds(data: IsOutsideBoundsData) {
|
|
68
|
-
const { current, alteredPosition } = data;
|
|
69
|
-
|
|
70
|
-
const min = TOOLTIP_MARGIN;
|
|
71
|
-
const max = window.innerWidth - TOOLTIP_MARGIN - SCROLLBAR_WIDTH;
|
|
72
|
-
|
|
73
|
-
const isLeft = current < min;
|
|
74
|
-
const isRight = current + alteredPosition.tooltipDimensions.width > max;
|
|
75
|
-
|
|
76
|
-
return { left: isLeft, right: isRight };
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
type getFunction = (value: number, props: AlteredPositionProps) => { value: number; wasOutsideBounds: boolean };
|
|
80
|
-
|
|
81
|
-
function getLeftPosition(...args: Parameters<getFunction>): ReturnType<getFunction> {
|
|
82
|
-
const [value] = args;
|
|
83
|
-
|
|
84
|
-
return { value: value - TOOLTIP_MARGIN, wasOutsideBounds: false };
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function getRightPosition(...args: Parameters<getFunction>): ReturnType<getFunction> {
|
|
88
|
-
const [value, props] = args;
|
|
89
|
-
|
|
90
|
-
let x = value;
|
|
91
|
-
|
|
92
|
-
if (props.isTouchDevice) {
|
|
93
|
-
x += props.chartBounds.x + props.containerBounds.x;
|
|
94
|
-
x -= props.tooltipDimensions.width / 2;
|
|
95
|
-
} else {
|
|
96
|
-
x += props.bandwidth;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const wasOutsideBounds = isOutsideBounds({
|
|
100
|
-
current: x,
|
|
101
|
-
alteredPosition: props,
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
if (wasOutsideBounds.right) {
|
|
105
|
-
if (props.isTouchDevice) {
|
|
106
|
-
x = props.containerBounds.x + props.containerBounds.width - props.tooltipDimensions.width;
|
|
107
|
-
} else {
|
|
108
|
-
x -= props.tooltipDimensions.width + props.bandwidth + TOOLTIP_MARGIN;
|
|
109
|
-
}
|
|
110
|
-
} else {
|
|
111
|
-
x += TOOLTIP_MARGIN;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
return { value: x, wasOutsideBounds: wasOutsideBounds.right };
|
|
115
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { clamp } from '@shopify/polaris-viz-core';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
getAbovePosition,
|
|
5
|
-
getBelowPosition,
|
|
6
|
-
getCenterPosition,
|
|
7
|
-
getInlinePosition,
|
|
8
|
-
getLeftPosition,
|
|
9
|
-
getRightPosition,
|
|
10
|
-
getVerticalCenterPosition,
|
|
11
|
-
} from '../utilities';
|
|
12
|
-
import type { AlteredPositionProps, AlteredPositionReturn } from '../types';
|
|
13
|
-
import { TooltipHorizontalOffset, TooltipVerticalOffset } from '../types';
|
|
14
|
-
import { TOOLTIP_MARGIN, SCROLLBAR_WIDTH } from '../constants';
|
|
15
|
-
|
|
16
|
-
// Keep the tooltip within the bounds of the chart.
|
|
17
|
-
// Based on "position" the tooltip will be placed
|
|
18
|
-
// around the chart item so the item should never
|
|
19
|
-
// be obscured by the tooltip.
|
|
20
|
-
export function getAlteredVerticalBarPosition(props: AlteredPositionProps): AlteredPositionReturn {
|
|
21
|
-
const { currentX, currentY, position, scrollContainer } = props;
|
|
22
|
-
|
|
23
|
-
const newPosition = { ...position };
|
|
24
|
-
|
|
25
|
-
let x = currentX;
|
|
26
|
-
let y = currentY - (scrollContainer?.scrollTop ?? 0);
|
|
27
|
-
|
|
28
|
-
//
|
|
29
|
-
// Y POSITIONING
|
|
30
|
-
//
|
|
31
|
-
if (props.isPerformanceImpacted || props.isTouchDevice) {
|
|
32
|
-
y = clamp({
|
|
33
|
-
amount: props.containerBounds.y - props.tooltipDimensions.height - (scrollContainer?.scrollTop ?? 0),
|
|
34
|
-
min: 0,
|
|
35
|
-
max: window.scrollY + window.innerHeight - props.tooltipDimensions.height - TOOLTIP_MARGIN,
|
|
36
|
-
});
|
|
37
|
-
} else {
|
|
38
|
-
if (newPosition.vertical === TooltipVerticalOffset.Inline) {
|
|
39
|
-
newPosition.horizontal = TooltipHorizontalOffset.Left;
|
|
40
|
-
|
|
41
|
-
const inline = getInlinePosition(y, props);
|
|
42
|
-
y = inline.value;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (newPosition.vertical === TooltipVerticalOffset.Center) {
|
|
46
|
-
const verticalCenter = getVerticalCenterPosition(y, props);
|
|
47
|
-
y = verticalCenter.value;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (newPosition.vertical === TooltipVerticalOffset.Above) {
|
|
51
|
-
const above = getAbovePosition(y, props);
|
|
52
|
-
y = above.value;
|
|
53
|
-
|
|
54
|
-
if (above.wasOutsideBounds) {
|
|
55
|
-
newPosition.horizontal = TooltipHorizontalOffset.Left;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (newPosition.vertical === TooltipVerticalOffset.Below) {
|
|
60
|
-
const below = getBelowPosition(y, props);
|
|
61
|
-
y = below.value;
|
|
62
|
-
|
|
63
|
-
if (below.wasOutsideBounds) {
|
|
64
|
-
newPosition.horizontal = TooltipHorizontalOffset.Left;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
//
|
|
70
|
-
// X POSITIONING
|
|
71
|
-
//
|
|
72
|
-
|
|
73
|
-
if (newPosition.horizontal === TooltipHorizontalOffset.Left) {
|
|
74
|
-
const left = getLeftPosition(x, props);
|
|
75
|
-
|
|
76
|
-
if (left.wasOutsideBounds) {
|
|
77
|
-
newPosition.horizontal = TooltipHorizontalOffset.Right;
|
|
78
|
-
} else {
|
|
79
|
-
x = left.value;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (newPosition.horizontal === TooltipHorizontalOffset.Right) {
|
|
84
|
-
const right = getRightPosition(x, props);
|
|
85
|
-
x = right.value;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (newPosition.horizontal === TooltipHorizontalOffset.Center) {
|
|
89
|
-
const center = getCenterPosition(x, props);
|
|
90
|
-
x = center.value;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return {
|
|
94
|
-
x: clamp({
|
|
95
|
-
amount: x,
|
|
96
|
-
min: TOOLTIP_MARGIN,
|
|
97
|
-
max: window.innerWidth - props.tooltipDimensions.width - TOOLTIP_MARGIN - SCROLLBAR_WIDTH,
|
|
98
|
-
}),
|
|
99
|
-
y: clamp({
|
|
100
|
-
amount: y,
|
|
101
|
-
min: window.scrollY + TOOLTIP_MARGIN,
|
|
102
|
-
max: window.scrollY + window.innerHeight - props.tooltipDimensions.height - TOOLTIP_MARGIN,
|
|
103
|
-
}),
|
|
104
|
-
};
|
|
105
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { BoundingRect } from '@shopify/polaris-viz-core';
|
|
2
|
-
|
|
3
|
-
import { TOOLTIP_POSITION_DEFAULT_RETURN } from '../constants';
|
|
4
|
-
import type { TooltipPositionParams } from '../types';
|
|
5
|
-
|
|
6
|
-
import { eventPointNative, getXYFromEventType } from './eventPoint';
|
|
7
|
-
|
|
8
|
-
interface Props extends Pick<TooltipPositionParams, 'event' | 'eventType' | 'index'> {
|
|
9
|
-
containerBounds: BoundingRect;
|
|
10
|
-
parentElement: SVGSVGElement | null;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function getDonutChartTooltipPosition({ containerBounds, event, eventType, index, parentElement }: Props) {
|
|
14
|
-
if (index == null) {
|
|
15
|
-
return TOOLTIP_POSITION_DEFAULT_RETURN;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (eventType === 'mouse' && (event instanceof MouseEvent || event instanceof TouchEvent)) {
|
|
19
|
-
if (index == null || event == null) {
|
|
20
|
-
return TOOLTIP_POSITION_DEFAULT_RETURN;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const point = eventPointNative(event!);
|
|
24
|
-
|
|
25
|
-
if (point == null) {
|
|
26
|
-
return TOOLTIP_POSITION_DEFAULT_RETURN;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const { x, y } = getXYFromEventType(event);
|
|
30
|
-
|
|
31
|
-
return {
|
|
32
|
-
x,
|
|
33
|
-
y,
|
|
34
|
-
activeIndex: index,
|
|
35
|
-
};
|
|
36
|
-
} else {
|
|
37
|
-
if (event?.target == null || parentElement == null) {
|
|
38
|
-
return TOOLTIP_POSITION_DEFAULT_RETURN;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const parentWidth = parentElement.clientWidth;
|
|
42
|
-
|
|
43
|
-
const startAngle = (event.target as SVGElement).getAttribute('data-start-angle');
|
|
44
|
-
const endAngle = (event.target as SVGElement).getAttribute('data-end-angle');
|
|
45
|
-
|
|
46
|
-
const leftOffset = containerBounds.width - parentWidth;
|
|
47
|
-
|
|
48
|
-
const radius = Math.min(containerBounds.width - leftOffset, containerBounds.height) / 2;
|
|
49
|
-
|
|
50
|
-
const centerX = containerBounds.x + leftOffset + radius;
|
|
51
|
-
const centerY = containerBounds.y + containerBounds.height / 2;
|
|
52
|
-
|
|
53
|
-
const midAngle = (Number(startAngle) + Number(endAngle)) / 2;
|
|
54
|
-
|
|
55
|
-
const x = centerX + radius * Math.cos(midAngle - Math.PI / 2);
|
|
56
|
-
const y = centerY + radius * Math.sin(midAngle - Math.PI / 2);
|
|
57
|
-
|
|
58
|
-
return {
|
|
59
|
-
x,
|
|
60
|
-
y,
|
|
61
|
-
activeIndex: index,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
}
|