Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(trends): move the insight display types into products/product_analytics (#100116)

Thomas Obermüllerdc204958336d
diff --git a/common/storybook/storybook-timings.json b/common/storybook/storybook-timings.json
index 17761a730e40..33d628a37acc 100644
--- a/common/storybook/storybook-timings.json
+++ b/common/storybook/storybook-timings.json
@@ -1027,15 +1027,15 @@
"chromium": 6.294,
"webkit": 2.51
},
- "frontend/src/scenes/insights/views/BoldNumber/BoldNumber.stories.tsx": {
+ "products/product_analytics/frontend/insights/shared/BoldNumber/BoldNumber.stories.tsx": {
"chromium": 11.991,
"webkit": 2.629
},
- "frontend/src/scenes/insights/views/BoldNumber/Textfit.stories.tsx": {
+ "products/product_analytics/frontend/insights/shared/BoldNumber/Textfit.stories.tsx": {
"chromium": 5.228,
"webkit": 2.11
},
- "frontend/src/scenes/insights/views/BoxPlot/BoxPlot.stories.tsx": {
+ "products/product_analytics/frontend/insights/trends/BoxPlot/BoxPlot.stories.tsx": {
"chromium": 6.229,
"webkit": 2.209
},
@@ -1055,19 +1055,19 @@
"chromium": 13.933,
"webkit": 2.926
},
- "frontend/src/scenes/insights/views/InsightsTable/InsightsTable.stories.tsx": {
+ "products/product_analytics/frontend/insights/shared/InsightsTable/InsightsTable.stories.tsx": {
"chromium": 30.027,
"webkit": 6.248
},
- "frontend/src/scenes/insights/views/Metric/Metric.stories.tsx": {
+ "products/product_analytics/frontend/insights/trends/Metric/Metric.stories.tsx": {
"chromium": 6.969,
"webkit": 2.109
},
- "frontend/src/scenes/insights/views/RegionMap/RegionMap.stories.tsx": {
+ "products/product_analytics/frontend/insights/trends/RegionMap/RegionMap.stories.tsx": {
"chromium": 7.432,
"webkit": 2.225
},
- "frontend/src/scenes/insights/views/WorldMap/WorldMap.stories.tsx": {
+ "products/product_analytics/frontend/insights/trends/WorldMap/WorldMap.stories.tsx": {
"chromium": 7.118,
"webkit": 3.811
},
diff --git a/frontend/src/exporter/ExportedInsight/ExportedInsight.tsx b/frontend/src/exporter/ExportedInsight/ExportedInsight.tsx
index af1676dc0857..394059ab62a8 100644
--- a/frontend/src/exporter/ExportedInsight/ExportedInsight.tsx
+++ b/frontend/src/exporter/ExportedInsight/ExportedInsight.tsx
@@ -14,8 +14,6 @@ import { SINGLE_SERIES_DISPLAY_TYPES } from 'lib/constants'
import { dataThemeLogic } from 'scenes/dataThemeLogic'
import { insightLogic } from 'scenes/insights/insightLogic'
import { DISPLAYS_WITH_IN_CHART_LEGEND } from 'scenes/insights/insightVizDataLogic'
-import { BoxPlotLegend } from 'scenes/insights/views/BoxPlot/BoxPlotLegend'
-import { InsightsTable } from 'scenes/insights/views/InsightsTable/InsightsTable'
import { getQueryBasedInsightModel } from '~/queries/nodes/InsightViz/utils'
import { Query } from '~/queries/Query/Query'
@@ -23,6 +21,9 @@ import { SharingConfigurationSettings } from '~/queries/schema/schema-general'
import { getDisplay, isDataTableNode, isInsightVizNode, isMetricInsightQuery, isTrendsQuery } from '~/queries/utils'
import { ChartDisplayType, DataColorThemeModel, InsightLogicProps, InsightModel } from '~/types'
+import { InsightsTable } from 'products/product_analytics/frontend/insights/shared/InsightsTable/InsightsTable'
+import { BoxPlotLegend } from 'products/product_analytics/frontend/insights/trends/BoxPlot/BoxPlotLegend'
+
export function ExportedInsight({
insight: legacyInsight,
themes,
diff --git a/frontend/src/lib/components/InsightLegend/InsightLegendRow.tsx b/frontend/src/lib/components/InsightLegend/InsightLegendRow.tsx
index 955a30431ea3..06fd8a29e537 100644
--- a/frontend/src/lib/components/InsightLegend/InsightLegendRow.tsx
+++ b/frontend/src/lib/components/InsightLegend/InsightLegendRow.tsx
@@ -10,12 +10,12 @@ import { LemonCheckbox } from 'lib/lemon-ui/LemonCheckbox'
import { formatAggregationAxisValue } from 'scenes/insights/aggregationAxisFormat'
import { insightLogic } from 'scenes/insights/insightLogic'
import { formatBreakdownLabel, getTrendResultCustomizationKey } from 'scenes/insights/utils'
-import { formatCompareLabel } from 'scenes/insights/views/InsightsTable/columns/SeriesColumn'
import { teamLogic } from 'scenes/teamLogic'
import { cohortsModel } from '~/models/cohortsModel'
import { propertyDefinitionsModel } from '~/models/propertyDefinitionsModel'
+import { formatCompareLabel } from 'products/product_analytics/frontend/insights/shared/InsightsTable/columns/SeriesColumn'
import { trendsDataLogic } from 'products/product_analytics/frontend/insights/trends/trendsDataLogic'
import { IndexedTrendResult } from 'products/product_analytics/frontend/insights/trends/types'
diff --git a/frontend/src/queries/nodes/DataVisualization/DataVisualization.tsx b/frontend/src/queries/nodes/DataVisualization/DataVisualization.tsx
index 68468f4d88e3..f0a5e59fc52f 100644
--- a/frontend/src/queries/nodes/DataVisualization/DataVisualization.tsx
+++ b/frontend/src/queries/nodes/DataVisualization/DataVisualization.tsx
@@ -12,7 +12,6 @@ import { useAttachedLogic } from 'lib/logic/scenes/useAttachedLogic'
import { InsightErrorState, StatelessInsightLoadingState } from 'scenes/insights/EmptyStates'
import { insightDataLogic } from 'scenes/insights/insightDataLogic'
import { insightLogic } from 'scenes/insights/insightLogic'
-import { HogQLBoldNumber } from 'scenes/insights/views/BoldNumber/BoldNumber'
import { urls } from 'scenes/urls'
import { insightVizDataCollectionId, insightVizDataNodeKey } from '~/queries/nodes/InsightViz/insightVizKeys'
@@ -29,6 +28,7 @@ import { shouldQueryBeAsync } from '~/queries/utils'
import { ChartDisplayType, ExportContext, ExporterFormat, InsightLogicProps } from '~/types'
import { alertsToThresholdGoalLines, insightAlertsLogic } from 'products/alerts/frontend/logic/insightAlertsLogic'
+import { HogQLBoldNumber } from 'products/product_analytics/frontend/insights/shared/BoldNumber/BoldNumber'
import { DataNodeLogicProps, dataNodeLogic } from '../DataNode/dataNodeLogic'
import { DateRange } from '../DataNode/DateRange'
diff --git a/frontend/src/queries/nodes/InsightViz/DisplayOptions.tsx b/frontend/src/queries/nodes/InsightViz/DisplayOptions.tsx
index 39df5d090a12..4532ca2107fc 100644
--- a/frontend/src/queries/nodes/InsightViz/DisplayOptions.tsx
+++ b/frontend/src/queries/nodes/InsightViz/DisplayOptions.tsx
@@ -36,14 +36,14 @@ import { ValueOnSeriesFilter } from 'scenes/insights/EditorFilters/ValueOnSeries
import { YAxisRangeFilter } from 'scenes/insights/EditorFilters/YAxisRangeFilter'
import { insightLogic } from 'scenes/insights/insightLogic'
import { insightVizDataLogic } from 'scenes/insights/insightVizDataLogic'
-import { ConfidenceLevelInput } from 'scenes/insights/views/LineGraph/ConfidenceLevelInput'
-import { MovingAverageIntervalsInput } from 'scenes/insights/views/LineGraph/MovingAverageIntervalsInput'
import { isTrendsQuery } from '~/queries/utils'
import { ChartDisplayType } from '~/types'
import { RetentionCohortLabelStartIndexPicker } from 'products/product_analytics/frontend/insights/retention/filters/RetentionCohortLabelStartIndexPicker'
import { RetentionDashboardDisplayPicker } from 'products/product_analytics/frontend/insights/retention/filters/RetentionDashboardDisplayPicker'
+import { ConfidenceLevelInput } from 'products/product_analytics/frontend/insights/trends/filters/ConfidenceLevelInput'
+import { MovingAverageIntervalsInput } from 'products/product_analytics/frontend/insights/trends/filters/MovingAverageIntervalsInput'
import { trendsDataLogic } from 'products/product_analytics/frontend/insights/trends/trendsDataLogic'
import { displayMatches, isDefaultTrendsLineDisplay, LINE_DISPLAYS } from './displayTypes'
diff --git a/frontend/src/queries/nodes/InsightViz/InsightVizDisplay.tsx b/frontend/src/queries/nodes/InsightViz/InsightVizDisplay.tsx
index e10065e14a70..c2fbdb2a0836 100644
--- a/frontend/src/queries/nodes/InsightViz/InsightVizDisplay.tsx
+++ b/frontend/src/queries/nodes/InsightViz/InsightVizDisplay.tsx
@@ -30,9 +30,6 @@ import { insightNavLogic } from 'scenes/insights/InsightNav/insightNavLogic'
import { insightVizDataLogic } from 'scenes/insights/insightVizDataLogic'
import { keyForInsightLogicProps } from 'scenes/insights/sharedUtils'
import { isBoxPlotMissingProperty } from 'scenes/insights/utils/queryUtils'
-import { BoxPlotLegend } from 'scenes/insights/views/BoxPlot/BoxPlotLegend'
-import { BoxPlotResultsTable } from 'scenes/insights/views/BoxPlot/BoxPlotResultsTable'
-import { InsightsTable } from 'scenes/insights/views/InsightsTable/InsightsTable'
import { WebAnalyticsInsight } from 'scenes/web-analytics/WebAnalyticsInsight'
import { SceneSection } from '~/layout/scenes/components/SceneSection'
@@ -59,6 +56,9 @@ import { Journeys } from 'products/product_analytics/frontend/insights/journeys/
import { Paths } from 'products/product_analytics/frontend/insights/paths/Paths'
import { PathCanvasLabel } from 'products/product_analytics/frontend/insights/paths/PathsLabel'
import { RetentionContainer } from 'products/product_analytics/frontend/insights/retention/RetentionContainer'
+import { InsightsTable } from 'products/product_analytics/frontend/insights/shared/InsightsTable/InsightsTable'
+import { BoxPlotLegend } from 'products/product_analytics/frontend/insights/trends/BoxPlot/BoxPlotLegend'
+import { BoxPlotResultsTable } from 'products/product_analytics/frontend/insights/trends/BoxPlot/BoxPlotResultsTable'
import { TrendInsight } from 'products/product_analytics/frontend/insights/trends/Trends'
import { InsightDisplayConfig } from './InsightDisplayConfig'
diff --git a/frontend/src/scenes/data-warehouse/editor/OutputPane.tsx b/frontend/src/scenes/data-warehouse/editor/OutputPane.tsx
index a11e434b390f..7f55f13ec412 100644
--- a/frontend/src/scenes/data-warehouse/editor/OutputPane.tsx
+++ b/frontend/src/scenes/data-warehouse/editor/OutputPane.tsx
@@ -47,7 +47,6 @@ import { copyToClipboard } from 'lib/utils/copyToClipboard'
import { tryJsonParse } from 'lib/utils/json'
import { InsightErrorState, StatelessInsightLoadingState } from 'scenes/insights/EmptyStates'
import { insightLogic } from 'scenes/insights/insightLogic'
-import { HogQLBoldNumber } from 'scenes/insights/views/BoldNumber/BoldNumber'
import { urls } from 'scenes/urls'
import { themeLogic } from '~/layout/navigation-3000/themeLogic'
@@ -86,6 +85,7 @@ import {
} from '~/types'
import { WarehouseWizardHint } from 'products/data_warehouse/frontend/shared/components/WarehouseWizardHint'
+import { HogQLBoldNumber } from 'products/product_analytics/frontend/insights/shared/BoldNumber/BoldNumber'
import {
copyTableToCsv,
diff --git a/frontend/src/scenes/insights/EditorFilters/MetricFilters.tsx b/frontend/src/scenes/insights/EditorFilters/MetricFilters.tsx
index 879250dfb74e..16ebd8669e76 100644
--- a/frontend/src/scenes/insights/EditorFilters/MetricFilters.tsx
+++ b/frontend/src/scenes/insights/EditorFilters/MetricFilters.tsx
@@ -5,6 +5,7 @@ import { LemonSelect } from '@posthog/lemon-ui'
import { MetricDirectionColorPickers } from 'lib/components/Metric/MetricDirectionColorPickers'
import { LemonCheckbox } from 'lib/lemon-ui/LemonCheckbox'
import { insightVizDataLogic } from 'scenes/insights/insightVizDataLogic'
+
import {
METRIC_COLOR_BY_DIRECTION_DEFAULT,
METRIC_DEFAULT_DECREASE_COLOR,
@@ -12,7 +13,7 @@ import {
METRIC_SHOW_CHANGE_DEFAULT,
METRIC_SUMMARY_DEFAULT,
type MetricSummary,
-} from 'scenes/insights/views/Metric/Metric.utils'
+} from 'products/product_analytics/frontend/insights/trends/Metric/Metric.utils'
import { insightLogic } from '../insightLogic'
diff --git a/frontend/src/scenes/insights/insightVizDataLogic.ts b/frontend/src/scenes/insights/insightVizDataLogic.ts
index 2c61b8d83b5f..726be79c2d32 100644
--- a/frontend/src/scenes/insights/insightVizDataLogic.ts
+++ b/frontend/src/scenes/insights/insightVizDataLogic.ts
@@ -23,7 +23,6 @@ import { databaseTableListLogic } from 'scenes/data-management/database/database
import { dataThemeLogic } from 'scenes/dataThemeLogic'
import { insightDataLogic } from 'scenes/insights/insightDataLogic'
import { keyForInsightLogicProps } from 'scenes/insights/sharedUtils'
-import { AggregationType } from 'scenes/insights/views/InsightsTable/insightsTableDataLogic'
import { sceneLogic } from 'scenes/sceneLogic'
import { filterTestAccountsDefaultsLogic } from 'scenes/settings/environment/filterTestAccountDefaultsLogic'
@@ -116,6 +115,7 @@ import {
} from '~/types'
import { getClampedFunnelStepRange } from 'products/product_analytics/frontend/insights/funnels/funnelUtils'
+import { AggregationType } from 'products/product_analytics/frontend/insights/shared/InsightsTable/insightsTableDataLogic'
import { BASE_MATH_DEFINITIONS } from 'products/product_analytics/frontend/insights/trends/mathsLogic'
import type { DataColorTheme } from '../../lib/colors'
diff --git a/frontend/src/scenes/web-analytics/LiveMetricsDashboard/LiveWorldMap.tsx b/frontend/src/scenes/web-analytics/LiveMetricsDashboard/LiveWorldMap.tsx
index da3115981a38..a7ccf3beb56a 100644
--- a/frontend/src/scenes/web-analytics/LiveMetricsDashboard/LiveWorldMap.tsx
+++ b/frontend/src/scenes/web-analytics/LiveMetricsDashboard/LiveWorldMap.tsx
@@ -1,10 +1,10 @@
-import '~/scenes/insights/views/WorldMap/WorldMap.scss'
-
import { useActions, useValues } from 'kea'
import React, { useCallback, useEffect } from 'react'
import { gradateColor } from 'lib/utils/colors'
-import { countryVectors } from 'scenes/insights/views/WorldMap/countryVectors'
+
+import 'products/product_analytics/frontend/insights/trends/WorldMap/WorldMap.scss'
+import { countryVectors } from 'products/product_analytics/frontend/insights/trends/WorldMap/countryVectors'
import { CountryBreakdownItem } from './LiveWebAnalyticsMetricsTypes'
import { liveWorldMapLogic } from './liveWorldMapLogic'
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index b7cf827379a8..0ccb6a4e8d43 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -4242,12 +4242,18 @@ importers:
'@posthog/quill-charts':
specifier: workspace:*
version: link:../../packages/quill/packages/charts
+ '@posthog/quill-components':
+ specifier: workspace:*
+ version: link:../../packages/quill/packages/components
'@types/d3':
specifier: '*'
version: 7.4.3
'@types/react':
specifier: 18.3.27
version: 18.3.27
+ '@types/react-simple-maps':
+ specifier: '*'
+ version: 3.0.6
'@xyflow/react':
specifier: '*'
@@ -4284,9 +4290,15 @@ importers:
react:
specifier: 18.3.1
version: 18.3.1
+ react-simple-maps:
+ specifier: '*'
react-toastify:
specifier: '*'
+ use-resize-observer:
+ specifier: '*'
devDependencies:
'@storybook/react':
specifier: 'catalog:'
diff --git a/frontend/src/scenes/insights/views/BoldNumber/BoldNumber.scss b/products/product_analytics/frontend/insights/shared/BoldNumber/BoldNumber.scss
similarity index 87%
rename from frontend/src/scenes/insights/views/BoldNumber/BoldNumber.scss
rename to products/product_analytics/frontend/insights/shared/BoldNumber/BoldNumber.scss
index aa4588832836..c10e82080142 100644
--- a/frontend/src/scenes/insights/views/BoldNumber/BoldNumber.scss
+++ b/products/product_analytics/frontend/insights/shared/BoldNumber/BoldNumber.scss
@@ -1,5 +1,5 @@
-@import '../../../../styles/mixins';
-@import '../../../../styles/vars';
+@import '../../../../../../frontend/src/styles/mixins';
+@import '../../../../../../frontend/src/styles/vars';
.BoldNumber {
display: flex;
diff --git a/frontend/src/scenes/insights/views/BoldNumber/BoldNumber.stories.tsx b/products/product_analytics/frontend/insights/shared/BoldNumber/BoldNumber.stories.tsx
similarity index 100%
rename from frontend/src/scenes/insights/views/BoldNumber/BoldNumber.stories.tsx
rename to products/product_analytics/frontend/insights/shared/BoldNumber/BoldNumber.stories.tsx
diff --git a/frontend/src/scenes/insights/views/BoldNumber/BoldNumber.test.ts b/products/product_analytics/frontend/insights/shared/BoldNumber/BoldNumber.test.ts
similarity index 100%
rename from frontend/src/scenes/insights/views/BoldNumber/BoldNumber.test.ts
rename to products/product_analytics/frontend/insights/shared/BoldNumber/BoldNumber.test.ts
diff --git a/frontend/src/scenes/insights/views/BoldNumber/BoldNumber.tsx b/products/product_analytics/frontend/insights/shared/BoldNumber/BoldNumber.tsx
similarity index 99%
rename from frontend/src/scenes/insights/views/BoldNumber/BoldNumber.tsx
rename to products/product_analytics/frontend/insights/shared/BoldNumber/BoldNumber.tsx
index e2878032cbc1..0b3b181d983d 100644
--- a/frontend/src/scenes/insights/views/BoldNumber/BoldNumber.tsx
+++ b/products/product_analytics/frontend/insights/shared/BoldNumber/BoldNumber.tsx
@@ -13,6 +13,7 @@ import { IconFlare, IconTrendingDown, IconTrendingFlat } from 'lib/lemon-ui/icon
import { percentage } from 'lib/utils/numbers'
import { formatAggregationAxisValue } from 'scenes/insights/aggregationAxisFormat'
import { InsightEmptyState } from 'scenes/insights/EmptyStates'
+import { insightLogic } from 'scenes/insights/insightLogic'
import { InsightTooltip } from 'scenes/insights/InsightTooltip/InsightTooltip'
import { insightVizDataLogic } from 'scenes/insights/insightVizDataLogic'
import { useInsightTooltip } from 'scenes/insights/useInsightTooltip'
@@ -24,7 +25,6 @@ import { dataVisualizationLogic } from '~/queries/nodes/DataVisualization/dataVi
import { NodeKind } from '~/queries/schema/schema-general'
import { ChartParams, TrendResult } from '~/types'
-import { insightLogic } from '../../insightLogic'
import { Textfit } from './Textfit'
export interface ComparisonDisplay {
diff --git a/frontend/src/scenes/insights/views/BoldNumber/Textfit.stories.tsx b/products/product_analytics/frontend/insights/shared/BoldNumber/Textfit.stories.tsx
similarity index 100%
rename from frontend/src/scenes/insights/views/BoldNumber/Textfit.stories.tsx
rename to products/product_analytics/frontend/insights/shared/BoldNumber/Textfit.stories.tsx
diff --git a/frontend/src/scenes/insights/views/BoldNumber/Textfit.tsx b/products/product_analytics/frontend/insights/shared/BoldNumber/Textfit.tsx
similarity index 100%
rename from frontend/src/scenes/insights/views/BoldNumber/Textfit.tsx
rename to products/product_analytics/frontend/insights/shared/BoldNumber/Textfit.tsx
diff --git a/frontend/src/scenes/insights/views/BoldNumber/index.ts b/products/product_analytics/frontend/insights/shared/BoldNumber/index.ts
similarity index 100%
rename from frontend/src/scenes/insights/views/BoldNumber/index.ts
rename to products/product_analytics/frontend/insights/shared/BoldNumber/index.ts
diff --git a/frontend/src/scenes/insights/views/InsightsTable/DashboardInsightsTable.tsx b/products/product_analytics/frontend/insights/shared/InsightsTable/DashboardInsightsTable.tsx
similarity index 100%
rename from frontend/src/scenes/insights/views/InsightsTable/DashboardInsightsTable.tsx
rename to products/product_analytics/frontend/insights/shared/InsightsTable/DashboardInsightsTable.tsx
diff --git a/frontend/src/scenes/insights/views/InsightsTable/InsightsTable.scss b/products/product_analytics/frontend/insights/shared/InsightsTable/InsightsTable.scss
similarity index 100%
rename from frontend/src/scenes/insights/views/InsightsTable/InsightsTable.scss
rename to products/product_analytics/frontend/insights/shared/InsightsTable/InsightsTable.scss
diff --git a/frontend/src/scenes/insights/views/InsightsTable/InsightsTable.stories.tsx b/products/product_analytics/frontend/insights/shared/InsightsTable/InsightsTable.stories.tsx
similarity index 98%
rename from frontend/src/scenes/insights/views/InsightsTable/InsightsTable.stories.tsx
rename to products/product_analytics/frontend/insights/shared/InsightsTable/InsightsTable.stories.tsx
index 3782faf04471..5d070f1055de 100644
--- a/frontend/src/scenes/insights/views/InsightsTable/InsightsTable.stories.tsx
+++ b/products/product_analytics/frontend/insights/shared/InsightsTable/InsightsTable.stories.tsx
@@ -4,12 +4,12 @@ import { useState } from 'react'
import { insightLogic } from 'scenes/insights/insightLogic'
+import __trendsLineBreakdown from '~/mocks/fixtures/api/projects/team_id/insights/trendsLineBreakdown.json'
import { DataNodeLogicProps, dataNodeLogic } from '~/queries/nodes/DataNode/dataNodeLogic'
import { insightVizDataNodeKey } from '~/queries/nodes/InsightViz/InsightViz'
import { getCachedResults } from '~/queries/nodes/InsightViz/utils'
import { BaseMathType, InsightLogicProps } from '~/types'
-import __trendsLineBreakdown from '../../../../mocks/fixtures/api/projects/team_id/insights/trendsLineBreakdown.json'
import { InsightsTable, InsightsTableProps } from './InsightsTable'
type Story = StoryObj<InsightsTableProps>
diff --git a/frontend/src/scenes/insights/views/InsightsTable/InsightsTable.tsx b/products/product_analytics/frontend/insights/shared/InsightsTable/InsightsTable.tsx
similarity index 99%
rename from frontend/src/scenes/insights/views/InsightsTable/InsightsTable.tsx
rename to products/product_analytics/frontend/insights/shared/InsightsTable/InsightsTable.tsx
index cd14c11933fc..00224918780d 100644
--- a/frontend/src/scenes/insights/views/InsightsTable/InsightsTable.tsx
+++ b/products/product_analytics/frontend/insights/shared/InsightsTable/InsightsTable.tsx
@@ -8,6 +8,7 @@ import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { LemonTable, LemonTableColumn } from 'lib/lemon-ui/LemonTable'
import { COUNTRY_CODE_TO_LONG_NAME } from 'lib/utils/country'
import { formatAggregationAxisValue } from 'scenes/insights/aggregationAxisFormat'
+import { entityFilterLogic } from 'scenes/insights/filters/ActionFilter/entityFilterLogic'
import { insightLogic } from 'scenes/insights/insightLogic'
import { formatBreakdownLabel } from 'scenes/insights/utils'
import { teamLogic } from 'scenes/teamLogic'
@@ -21,7 +22,6 @@ import { ChartDisplayType, TrendsFilterType } from '~/types'
import { trendsDataLogic } from 'products/product_analytics/frontend/insights/trends/trendsDataLogic'
import { IndexedTrendResult } from 'products/product_analytics/frontend/insights/trends/types'
-import { entityFilterLogic } from '../../filters/ActionFilter/entityFilterLogic'
import {
AggregationColumnItem,
AggregationColumnTitle,
diff --git a/frontend/src/scenes/insights/views/InsightsTable/columns/AggregationColumn.scss b/products/product_analytics/frontend/insights/shared/InsightsTable/columns/AggregationColumn.scss
similarity index 100%
rename from frontend/src/scenes/insights/views/InsightsTable/columns/AggregationColumn.scss
rename to products/product_analytics/frontend/insights/shared/InsightsTable/columns/AggregationColumn.scss
diff --git a/frontend/src/scenes/insights/views/InsightsTable/columns/AggregationColumn.tsx b/products/product_analytics/frontend/insights/shared/InsightsTable/columns/AggregationColumn.tsx
similarity index 100%
rename from frontend/src/scenes/insights/views/InsightsTable/columns/AggregationColumn.tsx
rename to products/product_analytics/frontend/insights/shared/InsightsTable/columns/AggregationColumn.tsx
diff --git a/frontend/src/scenes/insights/views/InsightsTable/columns/BreakdownColumn.tsx b/products/product_analytics/frontend/insights/shared/InsightsTable/columns/BreakdownColumn.tsx
similarity index 100%
rename from frontend/src/scenes/insights/views/InsightsTable/columns/BreakdownColumn.tsx
rename to products/product_analytics/frontend/insights/shared/InsightsTable/columns/BreakdownColumn.tsx
diff --git a/frontend/src/scenes/insights/views/InsightsTable/columns/ColorCustomizationColumn.tsx b/products/product_analytics/frontend/insights/shared/InsightsTable/columns/ColorCustomizationColumn.tsx
similarity index 100%
rename from frontend/src/scenes/insights/views/InsightsTable/columns/ColorCustomizationColumn.tsx
rename to products/product_analytics/frontend/insights/shared/InsightsTable/columns/ColorCustomizationColumn.tsx
diff --git a/frontend/src/scenes/insights/views/InsightsTable/columns/SeriesCheckColumn.tsx b/products/product_analytics/frontend/insights/shared/InsightsTable/columns/SeriesCheckColumn.tsx
similarity index 100%
rename from frontend/src/scenes/insights/views/InsightsTable/columns/SeriesCheckColumn.tsx
rename to products/product_analytics/frontend/insights/shared/InsightsTable/columns/SeriesCheckColumn.tsx
diff --git a/frontend/src/scenes/insights/views/InsightsTable/columns/SeriesColumn.tsx b/products/product_analytics/frontend/insights/shared/InsightsTable/columns/SeriesColumn.tsx
similarity index 100%
rename from frontend/src/scenes/insights/views/InsightsTable/columns/SeriesColumn.tsx
rename to products/product_analytics/frontend/insights/shared/InsightsTable/columns/SeriesColumn.tsx
diff --git a/frontend/src/scenes/insights/views/InsightsTable/columns/ValueColumn.tsx b/products/product_analytics/frontend/insights/shared/InsightsTable/columns/ValueColumn.tsx
similarity index 100%
rename from frontend/src/scenes/insights/views/InsightsTable/columns/ValueColumn.tsx
rename to products/product_analytics/frontend/insights/shared/InsightsTable/columns/ValueColumn.tsx
diff --git a/frontend/src/scenes/insights/views/InsightsTable/columns/WorldMapColumn.tsx b/products/product_analytics/frontend/insights/shared/InsightsTable/columns/WorldMapColumn.tsx
similarity index 100%
rename from frontend/src/scenes/insights/views/InsightsTable/columns/WorldMapColumn.tsx
rename to products/product_analytics/frontend/insights/shared/InsightsTable/columns/WorldMapColumn.tsx
diff --git a/frontend/src/scenes/insights/views/InsightsTable/insightsTableDataLogic.test.ts b/products/product_analytics/frontend/insights/shared/InsightsTable/insightsTableDataLogic.test.ts
similarity index 100%
rename from frontend/src/scenes/insights/views/InsightsTable/insightsTableDataLogic.test.ts
rename to products/product_analytics/frontend/insights/shared/InsightsTable/insightsTableDataLogic.test.ts
diff --git a/frontend/src/scenes/insights/views/InsightsTable/insightsTableDataLogic.ts b/products/product_analytics/frontend/insights/shared/InsightsTable/insightsTableDataLogic.ts
similarity index 88%
rename from frontend/src/scenes/insights/views/InsightsTable/insightsTableDataLogic.ts
rename to products/product_analytics/frontend/insights/shared/InsightsTable/insightsTableDataLogic.ts
index a7b4867363a9..f29a998ee888 100644
--- a/frontend/src/scenes/insights/views/InsightsTable/insightsTableDataLogic.ts
+++ b/products/product_analytics/frontend/insights/shared/InsightsTable/insightsTableDataLogic.ts
@@ -3,18 +3,17 @@ import { MakeLogicType, actions, connect, kea, key, path, props, reducers, selec
import { insightVizDataLogic } from 'scenes/insights/insightVizDataLogic'
import { keyForInsightLogicProps } from 'scenes/insights/sharedUtils'
-import { ChartDisplayType, CompareLabelType, InsightLogicProps } from '~/types'
-
-import { trendsDataLogic } from 'products/product_analytics/frontend/insights/trends/trendsDataLogic'
-import { IndexedTrendResult } from 'products/product_analytics/frontend/insights/trends/types'
-
import type {
AnyDataWarehouseNode,
AnyEntityNode,
CompareFilter,
DataWarehouseNode,
GroupNode,
-} from '../../../../queries/schema/schema-general'
+} from '~/queries/schema/schema-general'
+import { ChartDisplayType, CompareLabelType, InsightLogicProps } from '~/types'
+
+import { trendsDataLogic } from 'products/product_analytics/frontend/insights/trends/trendsDataLogic'
+import { IndexedTrendResult } from 'products/product_analytics/frontend/insights/trends/types'
export enum AggregationType {
Total = 'total',
@@ -149,12 +148,8 @@ export const insightsTableDataLogic = kea<insightsTableDataLogicType>([
display: ChartDisplayType | null | undefined,
series:
| (
- | import('../../../../queries/schema').AnyEntityNode<
- import('../../../../queries/schema').AnyDataWarehouseNode
- >
- | import('../../../../queries/schema').GroupNode<
- import('../../../../queries/schema').DataWarehouseNode
- >
+ | import('~/queries/schema').AnyEntityNode<import('~/queries/schema').AnyDataWarehouseNode>
+ | import('~/queries/schema').GroupNode<import('~/queries/schema').DataWarehouseNode>
)[]
| null
| undefined
@@ -171,12 +166,8 @@ export const insightsTableDataLogic = kea<insightsTableDataLogicType>([
(
series:
| (
- | import('../../../../queries/schema').AnyEntityNode<
- import('../../../../queries/schema').AnyDataWarehouseNode
- >
- | import('../../../../queries/schema').GroupNode<
- import('../../../../queries/schema').DataWarehouseNode
- >
+ | import('~/queries/schema').AnyEntityNode<import('~/queries/schema').AnyDataWarehouseNode>
+ | import('~/queries/schema').GroupNode<import('~/queries/schema').DataWarehouseNode>
)[]
| null
| undefined,
@@ -193,7 +184,7 @@ export const insightsTableDataLogic = kea<insightsTableDataLogicType>([
previousResultMap: [
(s) => [s.compareFilter, s.indexedResults],
(
- compareFilter: null | import('../../../../queries/schema').CompareFilter | undefined,
+ compareFilter: null | import('~/queries/schema').CompareFilter | undefined,
indexedResults: IndexedTrendResult[]
): Map<string, IndexedTrendResult> => {
if (!compareFilter?.compare) {
@@ -211,7 +202,7 @@ export const insightsTableDataLogic = kea<insightsTableDataLogicType>([
getPreviousResult: [
(s) => [s.compareFilter, s.previousResultMap],
(
- compareFilter: null | import('../../../../queries/schema').CompareFilter | undefined,
+ compareFilter: null | import('~/queries/schema').CompareFilter | undefined,
previousResultMap: Map<string, IndexedTrendResult>
) =>
(item: IndexedTrendResult): IndexedTrendResult | undefined => {
@@ -224,7 +215,7 @@ export const insightsTableDataLogic = kea<insightsTableDataLogicType>([
displayResults: [
(s) => [s.compareFilter, s.indexedResults],
(
- compareFilter: null | import('../../../../queries/schema').CompareFilter | undefined,
+ compareFilter: null | import('~/queries/schema').CompareFilter | undefined,
indexedResults: IndexedTrendResult[]
): IndexedTrendResult[] => {
if (compareFilter?.compare) {
diff --git a/frontend/src/scenes/insights/views/BoxPlot/BoxPlot.stories.tsx b/products/product_analytics/frontend/insights/trends/BoxPlot/BoxPlot.stories.tsx
similarity index 100%
rename from frontend/src/scenes/insights/views/BoxPlot/BoxPlot.stories.tsx
rename to products/product_analytics/frontend/insights/trends/BoxPlot/BoxPlot.stories.tsx
diff --git a/frontend/src/scenes/insights/views/BoxPlot/BoxPlotChart.tsx b/products/product_analytics/frontend/insights/trends/BoxPlot/BoxPlotChart.tsx
similarity index 100%
rename from frontend/src/scenes/insights/views/BoxPlot/BoxPlotChart.tsx
rename to products/product_analytics/frontend/insights/trends/BoxPlot/BoxPlotChart.tsx
diff --git a/frontend/src/scenes/insights/views/BoxPlot/BoxPlotLegend.tsx b/products/product_analytics/frontend/insights/trends/BoxPlot/BoxPlotLegend.tsx
similarity index 100%
rename from frontend/src/scenes/insights/views/BoxPlot/BoxPlotLegend.tsx
rename to products/product_analytics/frontend/insights/trends/BoxPlot/BoxPlotLegend.tsx
diff --git a/frontend/src/scenes/insights/views/BoxPlot/BoxPlotResultsTable.tsx b/products/product_analytics/frontend/insights/trends/BoxPlot/BoxPlotResultsTable.tsx
similarity index 100%
rename from frontend/src/scenes/insights/views/BoxPlot/BoxPlotResultsTable.tsx
rename to products/product_analytics/frontend/insights/trends/BoxPlot/BoxPlotResultsTable.tsx
diff --git a/frontend/src/scenes/insights/views/BoxPlot/boxPlotChartLogic.tsx b/products/product_analytics/frontend/insights/trends/BoxPlot/boxPlotChartLogic.tsx
similarity index 95%
rename from frontend/src/scenes/insights/views/BoxPlot/boxPlotChartLogic.tsx
rename to products/product_analytics/frontend/insights/trends/BoxPlot/boxPlotChartLogic.tsx
index bcd806551291..c9bd22fdecb2 100644
--- a/frontend/src/scenes/insights/views/BoxPlot/boxPlotChartLogic.tsx
+++ b/products/product_analytics/frontend/insights/trends/BoxPlot/boxPlotChartLogic.tsx
@@ -1,10 +1,9 @@
import { MakeLogicType, connect, kea, key, path, props, selectors } from 'kea'
import { insightVizDataLogic } from 'scenes/insights/insightVizDataLogic'
+import { keyForInsightLogicProps } from 'scenes/insights/sharedUtils'
import { BoxPlotDatum } from '~/queries/schema/schema-general'
-import { InsightLogicProps } from '~/types'
-
import type {
FunnelsQuery,
LifecycleQuery,
@@ -15,10 +14,10 @@ import type {
TrendsQuery,
WebOverviewQuery,
WebStatsTableQuery,
-} from '../../../../queries/schema/schema-general'
-import type { PathsV2Query } from '../../../../queries/schema/schema-general'
-import type { IntervalType } from '../../../../types'
-import { keyForInsightLogicProps } from '../../sharedUtils'
+} from '~/queries/schema/schema-general'
+import type { PathsV2Query } from '~/queries/schema/schema-general'
+import { InsightLogicProps } from '~/types'
+import type { IntervalType } from '~/types'
export interface BoxPlotChartDatum {
min: number
diff --git a/frontend/src/scenes/insights/views/BoxPlot/index.ts b/products/product_analytics/frontend/insights/trends/BoxPlot/index.ts
similarity index 100%
rename from frontend/src/scenes/insights/views/BoxPlot/index.ts
rename to products/product_analytics/frontend/insights/trends/BoxPlot/index.ts
diff --git a/frontend/src/scenes/insights/views/CalendarHeatMap/TrendsCalendarHeatMap.tsx b/products/product_analytics/frontend/insights/trends/CalendarHeatMap/TrendsCalendarHeatMap.tsx
similarity index 100%
rename from frontend/src/scenes/insights/views/CalendarHeatMap/TrendsCalendarHeatMap.tsx
rename to products/product_analytics/frontend/insights/trends/CalendarHeatMap/TrendsCalendarHeatMap.tsx
diff --git a/frontend/src/scenes/insights/views/CalendarHeatMap/calendarHeatMapLogic.tsx b/products/product_analytics/frontend/insights/trends/CalendarHeatMap/calendarHeatMapLogic.tsx
similarity index 97%
rename from frontend/src/scenes/insights/views/CalendarHeatMap/calendarHeatMapLogic.tsx
rename to products/product_analytics/frontend/insights/trends/CalendarHeatMap/calendarHeatMapLogic.tsx
index 81eb1daea9f9..680714c6d006 100644
--- a/frontend/src/scenes/insights/views/CalendarHeatMap/calendarHeatMapLogic.tsx
+++ b/products/product_analytics/frontend/insights/trends/CalendarHeatMap/calendarHeatMapLogic.tsx
@@ -1,11 +1,10 @@
import { MakeLogicType, actions, connect, kea, key, path, props, reducers, selectors } from 'kea'
+import type { DataColorTheme } from 'lib/colors'
import { insightVizDataLogic } from 'scenes/insights/insightVizDataLogic'
+import { keyForInsightLogicProps } from 'scenes/insights/sharedUtils'
import { teamLogic } from 'scenes/teamLogic'
-import { InsightLogicProps, TrendResult } from '~/types'
-
-import type { DataColorTheme } from '../../../../lib/colors'
import type {
AnyDataWarehouseNode,
AnyEntityNode,
@@ -21,9 +20,10 @@ import type {
TrendsQuery,
WebOverviewQuery,
WebStatsTableQuery,
-} from '../../../../queries/schema/schema-general'
-import type { PathsV2Query } from '../../../../queries/schema/schema-general'
-import { keyForInsightLogicProps } from '../../sharedUtils'
+} from '~/queries/schema/schema-general'
+import type { PathsV2Query } from '~/queries/schema/schema-general'
+import { InsightLogicProps, TrendResult } from '~/types'
+
import { DaysAbbreviated, HoursAbbreviated } from './utils'
export interface CalendarHeatMapProcessedData {
diff --git a/frontend/src/scenes/insights/views/CalendarHeatMap/index.ts b/products/product_analytics/frontend/insights/trends/CalendarHeatMap/index.ts
similarity index 100%
rename from frontend/src/scenes/insights/views/CalendarHeatMap/index.ts
rename to products/product_analytics/frontend/insights/trends/CalendarHeatMap/index.ts
diff --git a/frontend/src/scenes/insights/views/CalendarHeatMap/utils.test.ts b/products/product_analytics/frontend/insights/trends/CalendarHeatMap/utils.test.ts
similarity index 100%
rename from frontend/src/scenes/insights/views/CalendarHeatMap/utils.test.ts
rename to products/product_analytics/frontend/insights/trends/CalendarHeatMap/utils.test.ts
diff --git a/frontend/src/scenes/insights/views/CalendarHeatMap/utils.ts b/products/product_analytics/frontend/insights/trends/CalendarHeatMap/utils.ts
similarity index 100%
rename from frontend/src/scenes/insights/views/CalendarHeatMap/utils.ts
rename to products/product_analytics/frontend/insights/trends/CalendarHeatMap/utils.ts
diff --git a/frontend/src/scenes/insights/views/Metric/Metric.stories.tsx b/products/product_analytics/frontend/insights/trends/Metric/Metric.stories.tsx
similarity index 100%
rename from frontend/src/scenes/insights/views/Metric/Metric.stories.tsx
rename to products/product_analytics/frontend/insights/trends/Metric/Metric.stories.tsx
diff --git a/frontend/src/scenes/insights/views/Metric/Metric.tsx b/products/product_analytics/frontend/insights/trends/Metric/Metric.tsx
similarity index 98%
rename from frontend/src/scenes/insights/views/Metric/Metric.tsx
rename to products/product_analytics/frontend/insights/trends/Metric/Metric.tsx
index 294265e18ea0..59e52b41b706 100644
--- a/frontend/src/scenes/insights/views/Metric/Metric.tsx
+++ b/products/product_analytics/frontend/insights/trends/Metric/Metric.tsx
@@ -17,6 +17,7 @@ import {
formatAggregationAxisValue,
} from 'scenes/insights/aggregationAxisFormat'
import { InsightEmptyState } from 'scenes/insights/EmptyStates'
+import { insightLogic } from 'scenes/insights/insightLogic'
import { insightVizDataLogic } from 'scenes/insights/insightVizDataLogic'
import { teamLogic } from 'scenes/teamLogic'
@@ -24,7 +25,6 @@ import { ChartDisplayType, ChartParams, TrendResult } from '~/types'
import { trendsDataLogic } from 'products/product_analytics/frontend/insights/trends/trendsDataLogic'
-import { insightLogic } from '../../insightLogic'
import {
computeMetricSummary,
computeMetricSummaryChange,
diff --git a/frontend/src/scenes/insights/views/Metric/Metric.utils.test.ts b/products/product_analytics/frontend/insights/trends/Metric/Metric.utils.test.ts
similarity index 100%
rename from frontend/src/scenes/insights/views/Metric/Metric.utils.test.ts
rename to products/product_analytics/frontend/insights/trends/Metric/Metric.utils.test.ts
diff --git a/frontend/src/scenes/insights/views/Metric/Metric.utils.ts b/products/product_analytics/frontend/insights/trends/Metric/Metric.utils.ts
similarity index 100%
rename from frontend/src/scenes/insights/views/Metric/Metric.utils.ts
rename to products/product_analytics/frontend/insights/trends/Metric/Metric.utils.ts
diff --git a/frontend/src/scenes/insights/views/RegionMap/RegionMap.scss b/products/product_analytics/frontend/insights/trends/RegionMap/RegionMap.scss
similarity index 100%
rename from frontend/src/scenes/insights/views/RegionMap/RegionMap.scss
rename to products/product_analytics/frontend/insights/trends/RegionMap/RegionMap.scss
diff --git a/frontend/src/scenes/insights/views/RegionMap/RegionMap.stories.tsx b/products/product_analytics/frontend/insights/trends/RegionMap/RegionMap.stories.tsx
similarity index 100%
rename from frontend/src/scenes/insights/views/RegionMap/RegionMap.stories.tsx
rename to products/product_analytics/frontend/insights/trends/RegionMap/RegionMap.stories.tsx
diff --git a/frontend/src/scenes/insights/views/RegionMap/RegionMap.tsx b/products/product_analytics/frontend/insights/trends/RegionMap/RegionMap.tsx
similarity index 99%
rename from frontend/src/scenes/insights/views/RegionMap/RegionMap.tsx
rename to products/product_analytics/frontend/insights/trends/RegionMap/RegionMap.tsx
index cf9a9b6f0087..035b8aa91e37 100644
--- a/frontend/src/scenes/insights/views/RegionMap/RegionMap.tsx
+++ b/products/product_analytics/frontend/insights/trends/RegionMap/RegionMap.tsx
@@ -9,6 +9,7 @@ import { COUNTRY_CODE_TO_LONG_NAME, countryCodeToFlag } from 'lib/utils/country'
import { formatAggregationAxisValue } from 'scenes/insights/aggregationAxisFormat'
import { insightLogic } from 'scenes/insights/insightLogic'
import { InsightTooltip } from 'scenes/insights/InsightTooltip/InsightTooltip'
+import { SeriesDatum } from 'scenes/insights/InsightTooltip/insightTooltipUtils'
import { useInsightTooltip } from 'scenes/insights/useInsightTooltip'
import { teamLogic } from 'scenes/teamLogic'
import { openPersonsModal } from 'scenes/trends/persons-modal/PersonsModal'
@@ -18,7 +19,6 @@ import { NodeKind } from '~/queries/schema/schema-general'
import { QueryContext } from '~/queries/types'
import { ChartParams, TrendResult } from '~/types'
-import { SeriesDatum } from '../../InsightTooltip/insightTooltipUtils'
import { regionMapLogic } from './regionMapLogic'
const SATURATION_FLOOR = 0.2
diff --git a/frontend/src/scenes/insights/views/RegionMap/index.ts b/products/product_analytics/frontend/insights/trends/RegionMap/index.ts
similarity index 100%
rename from frontend/src/scenes/insights/views/RegionMap/index.ts
rename to products/product_analytics/frontend/insights/trends/RegionMap/index.ts
diff --git a/frontend/src/scenes/insights/views/RegionMap/regionMapLogic.tsx b/products/product_analytics/frontend/insights/trends/RegionMap/regionMapLogic.tsx
similarity index 95%
rename from frontend/src/scenes/insights/views/RegionMap/regionMapLogic.tsx
rename to products/product_analytics/frontend/insights/trends/RegionMap/regionMapLogic.tsx
index 12f8742cd539..35f554a661ba 100644
--- a/frontend/src/scenes/insights/views/RegionMap/regionMapLogic.tsx
+++ b/products/product_analytics/frontend/insights/trends/RegionMap/regionMapLogic.tsx
@@ -1,10 +1,9 @@
import { MakeLogicType, actions, connect, kea, key, path, props, reducers, selectors } from 'kea'
+import type { DataColorTheme } from 'lib/colors'
import { insightVizDataLogic } from 'scenes/insights/insightVizDataLogic'
+import { keyForInsightLogicProps } from 'scenes/insights/sharedUtils'
-import { InsightLogicProps, TrendResult } from '~/types'
-
-import type { DataColorTheme } from '../../../../lib/colors'
import type {
AnyDataWarehouseNode,
AnyEntityNode,
@@ -20,9 +19,9 @@ import type {
TrendsQuery,
WebOverviewQuery,
WebStatsTableQuery,
-} from '../../../../queries/schema/schema-general'
-import type { PathsV2Query } from '../../../../queries/schema/schema-general'
-import { keyForInsightLogicProps } from '../../sharedUtils'
+} from '~/queries/schema/schema-general'
+import type { PathsV2Query } from '~/queries/schema/schema-general'
+import { InsightLogicProps, TrendResult } from '~/types'
const getTrendResults = (insightData: Record<string, any> | null | undefined): TrendResult[] =>
Array.isArray(insightData?.result) ? (insightData.result as TrendResult[]) : []
diff --git a/products/product_analytics/frontend/insights/trends/Trends.tsx b/products/product_analytics/frontend/insights/trends/Trends.tsx
index ab7b8751ddf4..5f9b34da535e 100644
--- a/products/product_analytics/frontend/insights/trends/Trends.tsx
+++ b/products/product_analytics/frontend/insights/trends/Trends.tsx
@@ -7,18 +7,18 @@ import { PIE_DISPLAY_TYPES } from 'lib/constants'
import { WrappingLoadingSkeleton } from 'lib/ui/WrappingLoadingSkeleton/WrappingLoadingSkeleton'
import { lazyWithRetry } from 'lib/utils/retryImport'
import { insightLogic } from 'scenes/insights/insightLogic'
-import { BoldNumber } from 'scenes/insights/views/BoldNumber'
-import { BoxPlotChart } from 'scenes/insights/views/BoxPlot'
-import { TrendsCalendarHeatMap } from 'scenes/insights/views/CalendarHeatMap'
-import { InsightsTable } from 'scenes/insights/views/InsightsTable/InsightsTable'
-import { MetricCard } from 'scenes/insights/views/Metric/Metric'
import { InsightVizNode } from '~/queries/schema/schema-general'
import { QueryContext } from '~/queries/types'
import { ChartDisplayType, InsightType } from '~/types'
+import { BoldNumber } from 'products/product_analytics/frontend/insights/shared/BoldNumber'
+import { InsightsTable } from 'products/product_analytics/frontend/insights/shared/InsightsTable/InsightsTable'
import { StickinessBarChart } from 'products/product_analytics/frontend/insights/stickiness/StickinessBarChart/StickinessBarChart'
import { StickinessLineChart } from 'products/product_analytics/frontend/insights/stickiness/StickinessLineChart/StickinessLineChart'
+import { BoxPlotChart } from 'products/product_analytics/frontend/insights/trends/BoxPlot'
+import { TrendsCalendarHeatMap } from 'products/product_analytics/frontend/insights/trends/CalendarHeatMap'
+import { MetricCard } from 'products/product_analytics/frontend/insights/trends/Metric/Metric'
import { TrendsBarChart } from 'products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart'
import { TrendsLifecycleChart } from 'products/product_analytics/frontend/insights/trends/TrendsLifecycleChart/TrendsLifecycleChart'
import { TrendsLineChart } from 'products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart'
@@ -27,8 +27,12 @@ import { TrendsSlopeChart } from 'products/product_analytics/frontend/insights/t
import { trendsDataLogic } from './trendsDataLogic'
// Maps carry ~1 MB of d3-geo + topojson data only the map display needs; kept lazy.
-const WorldMap = lazyWithRetry(() => import('scenes/insights/views/WorldMap').then((m) => ({ default: m.WorldMap })))
-const RegionMap = lazyWithRetry(() => import('scenes/insights/views/RegionMap').then((m) => ({ default: m.RegionMap })))
+const WorldMap = lazyWithRetry(() =>
+ import('products/product_analytics/frontend/insights/trends/WorldMap').then((m) => ({ default: m.WorldMap }))
+)
+const RegionMap = lazyWithRetry(() =>
+ import('products/product_analytics/frontend/insights/trends/RegionMap').then((m) => ({ default: m.RegionMap }))
+)
interface Props {
view: InsightType
diff --git a/frontend/src/scenes/insights/views/WorldMap/WorldMap.scss b/products/product_analytics/frontend/insights/trends/WorldMap/WorldMap.scss
similarity index 100%
rename from frontend/src/scenes/insights/views/WorldMap/WorldMap.scss
rename to products/product_analytics/frontend/insights/trends/WorldMap/WorldMap.scss
diff --git a/frontend/src/scenes/insights/views/WorldMap/WorldMap.stories.tsx b/products/product_analytics/frontend/insights/trends/WorldMap/WorldMap.stories.tsx
similarity index 100%
rename from frontend/src/scenes/insights/views/WorldMap/WorldMap.stories.tsx
rename to products/product_analytics/frontend/insights/trends/WorldMap/WorldMap.stories.tsx
diff --git a/frontend/src/scenes/insights/views/WorldMap/WorldMap.tsx b/products/product_analytics/frontend/insights/trends/WorldMap/WorldMap.tsx
similarity index 99%
rename from frontend/src/scenes/insights/views/WorldMap/WorldMap.tsx
rename to products/product_analytics/frontend/insights/trends/WorldMap/WorldMap.tsx
index d6ccc62fe5f3..501d2022ec5e 100644
--- a/frontend/src/scenes/insights/views/WorldMap/WorldMap.tsx
+++ b/products/product_analytics/frontend/insights/trends/WorldMap/WorldMap.tsx
@@ -9,6 +9,7 @@ import { COUNTRY_CODE_TO_LONG_NAME, countryCodeToFlag } from 'lib/utils/country'
import { formatAggregationAxisValue } from 'scenes/insights/aggregationAxisFormat'
import { insightLogic } from 'scenes/insights/insightLogic'
import { InsightTooltip } from 'scenes/insights/InsightTooltip/InsightTooltip'
+import { SeriesDatum } from 'scenes/insights/InsightTooltip/insightTooltipUtils'
import { useInsightTooltip } from 'scenes/insights/useInsightTooltip'
import { teamLogic } from 'scenes/teamLogic'
import { openPersonsModal } from 'scenes/trends/persons-modal/PersonsModal'
@@ -18,7 +19,6 @@ import { InsightQueryNode, NodeKind } from '~/queries/schema/schema-general'
import { QueryContext } from '~/queries/types'
import { ChartParams, TrendResult } from '~/types'
-import { SeriesDatum } from '../../InsightTooltip/insightTooltipUtils'
import { countryVectors } from './countryVectors'
import { worldMapLogic } from './worldMapLogic'
diff --git a/frontend/src/scenes/insights/views/WorldMap/countryVectors.tsx b/products/product_analytics/frontend/insights/trends/WorldMap/countryVectors.tsx
similarity index 100%
rename from frontend/src/scenes/insights/views/WorldMap/countryVectors.tsx
rename to products/product_analytics/frontend/insights/trends/WorldMap/countryVectors.tsx
diff --git a/frontend/src/scenes/insights/views/WorldMap/index.ts b/products/product_analytics/frontend/insights/trends/WorldMap/index.ts
similarity index 100%
rename from frontend/src/scenes/insights/views/WorldMap/index.ts
rename to products/product_analytics/frontend/insights/trends/WorldMap/index.ts
diff --git a/frontend/src/scenes/insights/views/WorldMap/worldMapLogic.tsx b/products/product_analytics/frontend/insights/trends/WorldMap/worldMapLogic.tsx
similarity index 94%
rename from frontend/src/scenes/insights/views/WorldMap/worldMapLogic.tsx
rename to products/product_analytics/frontend/insights/trends/WorldMap/worldMapLogic.tsx
index df8d22404396..649f28b81c0b 100644
--- a/frontend/src/scenes/insights/views/WorldMap/worldMapLogic.tsx
+++ b/products/product_analytics/frontend/insights/trends/WorldMap/worldMapLogic.tsx
@@ -1,10 +1,9 @@
import { MakeLogicType, actions, connect, kea, key, path, props, reducers, selectors } from 'kea'
+import type { DataColorTheme } from 'lib/colors'
import { insightVizDataLogic } from 'scenes/insights/insightVizDataLogic'
+import { keyForInsightLogicProps } from 'scenes/insights/sharedUtils'
-import { InsightLogicProps, TrendResult } from '~/types'
-
-import type { DataColorTheme } from '../../../../lib/colors'
import type {
AnyDataWarehouseNode,
AnyEntityNode,
@@ -20,9 +19,9 @@ import type {
TrendsQuery,
WebOverviewQuery,
WebStatsTableQuery,
-} from '../../../../queries/schema/schema-general'
-import type { PathsV2Query } from '../../../../queries/schema/schema-general'
-import { keyForInsightLogicProps } from '../../sharedUtils'
+} from '~/queries/schema/schema-general'
+import type { PathsV2Query } from '~/queries/schema/schema-general'
+import { InsightLogicProps, TrendResult } from '~/types'
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface worldMapLogicValues {
diff --git a/frontend/src/scenes/insights/views/LineGraph/ConfidenceLevelInput.tsx b/products/product_analytics/frontend/insights/trends/filters/ConfidenceLevelInput.tsx
similarity index 100%
rename from frontend/src/scenes/insights/views/LineGraph/ConfidenceLevelInput.tsx
rename to products/product_analytics/frontend/insights/trends/filters/ConfidenceLevelInput.tsx
diff --git a/frontend/src/scenes/insights/views/LineGraph/MovingAverageIntervalsInput.tsx b/products/product_analytics/frontend/insights/trends/filters/MovingAverageIntervalsInput.tsx
similarity index 100%
rename from frontend/src/scenes/insights/views/LineGraph/MovingAverageIntervalsInput.tsx
rename to products/product_analytics/frontend/insights/trends/filters/MovingAverageIntervalsInput.tsx
diff --git a/products/product_analytics/package.json b/products/product_analytics/package.json
index 94fc06ffa291..5458b3cdef75 100644
--- a/products/product_analytics/package.json
+++ b/products/product_analytics/package.json
@@ -21,8 +21,10 @@
"peerDependencies": {
"@posthog/brand": "catalog:",
"@posthog/icons": "catalog:",
+ "@posthog/quill-components": "workspace:*",
"@types/d3": "*",
"@types/react": "*",
+ "@types/react-simple-maps": "*",
"@xyflow/react": "*",
"clsx": "*",
"d3": "*",
@@ -30,6 +32,8 @@
"fuse.js": "*",
"natural-orderby": "*",
"react": "*",
- "react-toastify": "*"
+ "react-simple-maps": "*",
+ "react-toastify": "*",
+ "use-resize-observer": "*"
}
}
diff --git a/tools/playwright_area_map.json b/tools/playwright_area_map.json
index 1535dc39e12c..959958514c08 100644
--- a/tools/playwright_area_map.json
+++ b/tools/playwright_area_map.json
@@ -125,6 +125,16 @@
"products/web_analytics/frontend/heatmaps/**": ["playwright/e2e/auth.spec.ts"],
"products/signals/frontend/inbox/**": ["playwright/e2e/auth.spec.ts"],
"products/feature_flags/frontend/**": ["playwright/e2e/feature-flags.spec.ts"],
+ "products/product_analytics/frontend/insights/shared/**": [
+ "playwright/e2e/product-analytics/",
+ "playwright/e2e/insight-sharing-password.spec.ts",
+ "playwright/e2e/shared-insight-unauthenticated.spec.ts"
+ ],
+ "products/product_analytics/frontend/insights/trends/BoxPlot/**": [
+ "playwright/e2e/product-analytics/",
+ "playwright/e2e/insight-sharing-password.spec.ts",
+ "playwright/e2e/shared-insight-unauthenticated.spec.ts"
+ ],
"products/product_analytics/frontend/**": ["playwright/e2e/product-analytics/"],
"products/dashboards/frontend/**": [
"playwright/e2e/product-analytics/dashboards.spec.ts",