: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(insights): move trends bar/line charts into product_analytics (#59674)
Sam Pennington127e540f5b18
diff --git a/frontend/src/scenes/funnels/viz/funnel-line-chart/FunnelLineChart.tsx b/frontend/src/scenes/funnels/viz/funnel-line-chart/FunnelLineChart.tsxindex e1840e64d922..0c18aa8f8c74 100644--- a/frontend/src/scenes/funnels/viz/funnel-line-chart/FunnelLineChart.tsx+++ b/frontend/src/scenes/funnels/viz/funnel-line-chart/FunnelLineChart.tsx@@ -9,7 +9,6 @@ import { insightLogic } from 'scenes/insights/insightLogic'import type { SeriesDatum } from 'scenes/insights/InsightTooltip/insightTooltipUtils'import { teamLogic } from 'scenes/teamLogic'import { openPersonsModal } from 'scenes/trends/persons-modal/PersonsModal'-import { AnnotationsLayer } from 'scenes/trends/viz/shared/AnnotationsLayer'import { themeLogic } from '~/layout/navigation-3000/themeLogic'import { cohortsModel } from '~/models/cohortsModel'@@ -19,6 +18,8 @@ import { propertyDefinitionsModel } from '~/models/propertyDefinitionsModel'import { isFunnelsQuery } from '~/queries/utils'import { ChartParams, type FunnelStepWithConversionMetrics } from '~/types'+import { AnnotationsLayer } from 'products/product_analytics/frontend/insights/trends/shared/AnnotationsLayer'+import { funnelDataLogic } from '../../funnelDataLogic'import { funnelPersonsModalLogic } from '../../funnelPersonsModalLogic'import type { FunnelSeriesMeta } from '../shared/funnelSeriesMeta'diff --git a/frontend/src/scenes/funnels/viz/funnel-line-chart/funnelChartTransforms.ts b/frontend/src/scenes/funnels/viz/funnel-line-chart/funnelChartTransforms.tsindex a194fbd3be3e..5d453d3f8c01 100644--- a/frontend/src/scenes/funnels/viz/funnel-line-chart/funnelChartTransforms.ts+++ b/frontend/src/scenes/funnels/viz/funnel-line-chart/funnelChartTransforms.ts@@ -1,13 +1,14 @@import type { Series, TimeSeriesLineChartConfig, TooltipConfig } from 'lib/hog-charts'import type { SeriesDatum } from 'scenes/insights/InsightTooltip/insightTooltipUtils'-import {- buildTrendsLineTimeSeriesConfig,- buildTrendsSeries,-} from 'scenes/trends/viz/trends-line-chart/trendsChartTransforms'import type { GoalLine as SchemaGoalLine, TrendsFilter } from '~/queries/schema/schema-general'import type { FunnelStepWithNestedBreakdown, IntervalType } from '~/types'+import {+ buildTrendsLineTimeSeriesConfig,+ buildTrendsSeries,+} from 'products/product_analytics/frontend/insights/trends/TrendsLineChart/trendsChartTransforms'+import type { FunnelSeriesMeta } from '../shared/funnelSeriesMeta'export type IndexedFunnelStep = FunnelStepWithNestedBreakdown & { id: number; seriesIndex: number }diff --git a/frontend/src/scenes/retention/retentionChartTransforms.ts b/frontend/src/scenes/retention/retentionChartTransforms.tsindex 1a8410dc558b..8fa73bb5684a 100644--- a/frontend/src/scenes/retention/retentionChartTransforms.ts+++ b/frontend/src/scenes/retention/retentionChartTransforms.ts@@ -2,7 +2,8 @@ import type { GoalLineConfig, Series, TimeSeriesLineChartConfig, TooltipConfig,import type { GoalLine as SchemaGoalLine } from '~/queries/schema/schema-general'-import { schemaGoalLinesToConfigs } from '../trends/viz/shared/goalLinesAdapter'+import { schemaGoalLinesToConfigs } from 'products/product_analytics/frontend/insights/trends/shared/goalLinesAdapter'+import type { RetentionTrendPayload } from './types'// `retentionGraphLogic.trendSeries` spreads `cohortRetention` onto each entry, so thediff --git a/frontend/src/scenes/trends/Trends.tsx b/frontend/src/scenes/trends/Trends.tsxindex e0ea2cd61801..135eac8a837e 100644--- a/frontend/src/scenes/trends/Trends.tsx+++ b/frontend/src/scenes/trends/Trends.tsx@@ -25,10 +25,14 @@ const TrendsCalendarHeatMap = lazy(() =>const BoxPlotChart = lazy(() => import('scenes/insights/views/BoxPlot').then((m) => ({ default: m.BoxPlotChart })))// Flag-gated — keep full d3 out of the eager Trends/Dashboard bundleconst TrendsLineChart = lazy(() =>- import('./viz/trends-line-chart/TrendsLineChart').then((m) => ({ default: m.TrendsLineChart }))+ import('products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart').then((m) => ({+ default: m.TrendsLineChart,+ })))const TrendsBarChart = lazy(() =>- import('./viz/trends-bar-chart/TrendsBarChart').then((m) => ({ default: m.TrendsBarChart }))+ import('products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart').then((m) => ({+ default: m.TrendsBarChart,+ })))interface Props {diff --git a/frontend/src/test/insight-testing/interactions.ts b/frontend/src/test/insight-testing/interactions.tsindex 596a815cf4ef..307bd601e2ec 100644--- a/frontend/src/test/insight-testing/interactions.ts+++ b/frontend/src/test/insight-testing/interactions.ts@@ -142,14 +142,14 @@ export const chart = {index: number,totalLabels = trendsSeries.pageviews.labels.length): Promise<InsightTooltipAccessor> {- const canvas = await screen.findByRole('img', { name: /chart with/i })+ const canvas = await screen.findByRole('img', { name: /chart with/i }, { timeout: DEBOUNCE_TIMEOUT })const wrapper = canvas.parentElement!hoverAtIndex(wrapper, index, totalLabels)const tooltip = await waitForHogChartTooltip()return createInsightTooltipAccessor(tooltip)},async clickAtIndex(index: number, totalLabels = trendsSeries.pageviews.labels.length): Promise<void> {- const canvas = await screen.findByRole('img', { name: /chart with/i })+ const canvas = await screen.findByRole('img', { name: /chart with/i }, { timeout: DEBOUNCE_TIMEOUT })const wrapper = canvas.parentElement!await clickAtIndex(wrapper, index, totalLabels)},diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 49f7d9bd0a6b..b0d0627401e1 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -3169,9 +3169,19 @@ importers:kea-router:specifier: 'catalog:'version: 3.4.1([email protected]([email protected]))+ posthog-js:+ specifier: 'catalog:'+ version: 1.376.0react:specifier: 18.3.1version: 18.3.1+ devDependencies:+ '@storybook/react':+ specifier: 'catalog:'+ version: 7.6.24([email protected])([email protected]([email protected]))([email protected])([email protected])+ '@testing-library/react':+ specifier: '*'+ version: 14.3.1(@types/[email protected])([email protected]([email protected]))([email protected])products/product_tours: {}diff --git a/frontend/src/scenes/trends/viz/trends-bar-chart/TrendsBarChart.stories.tsx b/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart.stories.tsxsimilarity index 100%rename from frontend/src/scenes/trends/viz/trends-bar-chart/TrendsBarChart.stories.tsxrename to products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart.stories.tsxdiff --git a/frontend/src/scenes/trends/viz/trends-bar-chart/TrendsBarChart.test.tsx b/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart.test.tsxsimilarity index 100%rename from frontend/src/scenes/trends/viz/trends-bar-chart/TrendsBarChart.test.tsxrename to products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart.test.tsxdiff --git a/frontend/src/scenes/trends/viz/trends-bar-chart/TrendsBarChart.tsx b/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart.tsxsimilarity index 98%rename from frontend/src/scenes/trends/viz/trends-bar-chart/TrendsBarChart.tsxrename to products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart.tsxindex 3acf407e77f5..5cd72e55e02b 100644--- a/frontend/src/scenes/trends/viz/trends-bar-chart/TrendsBarChart.tsx+++ b/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart.tsx@@ -17,18 +17,18 @@ import { InsightEmptyState } from 'scenes/insights/EmptyStates'import { insightLogic } from 'scenes/insights/insightLogic'import type { SeriesDatum } from 'scenes/insights/InsightTooltip/insightTooltipUtils'import { teamLogic } from 'scenes/teamLogic'+import { openPersonsModal } from 'scenes/trends/persons-modal/PersonsModal'+import { trendsDataLogic } from 'scenes/trends/trendsDataLogic'+import type { IndexedTrendResult } from 'scenes/trends/types'import { groupsModel } from '~/models/groupsModel'import { InsightVizNode } from '~/queries/schema/schema-general'import { QueryContext } from '~/queries/types'import { ChartDisplayType } from '~/types'-import { openPersonsModal } from '../../persons-modal/PersonsModal'-import { trendsDataLogic } from '../../trendsDataLogic'-import type { IndexedTrendResult } from '../../types'-import { handleTrendsChartClick, type TrendsChartClickDeps } from '../handleTrendsChartClick'import { AnnotationsLayer } from '../shared/AnnotationsLayer'import { goalLinesToReferenceLines } from '../shared/goalLinesAdapter'+import { handleTrendsChartClick, type TrendsChartClickDeps } from '../shared/handleTrendsChartClick'import { TrendsAlertOverlays } from '../shared/TrendsAlertOverlays'import { trendsFilterToYFormatterConfig } from '../shared/trendsAxisFormat'import type { TrendsSeriesMeta } from '../shared/trendsSeriesMeta'diff --git a/frontend/src/scenes/trends/viz/trends-bar-chart/handleTrendsBarAggregatedChartClick.test.ts b/products/product_analytics/frontend/insights/trends/TrendsBarChart/handleTrendsBarAggregatedChartClick.test.tssimilarity index 96%rename from frontend/src/scenes/trends/viz/trends-bar-chart/handleTrendsBarAggregatedChartClick.test.tsrename to products/product_analytics/frontend/insights/trends/TrendsBarChart/handleTrendsBarAggregatedChartClick.test.tsindex 033d5578d742..c5f2beaebee7 100644--- a/frontend/src/scenes/trends/viz/trends-bar-chart/handleTrendsBarAggregatedChartClick.test.ts+++ b/products/product_analytics/frontend/insights/trends/TrendsBarChart/handleTrendsBarAggregatedChartClick.test.ts@@ -1,8 +1,9 @@+import type { IndexedTrendResult } from 'scenes/trends/types'+import { NodeKind } from '~/queries/schema/schema-general'import { EntityTypes } from '~/types'-import type { IndexedTrendResult } from '../../types'-import type { TrendsChartClickDeps } from '../handleTrendsChartClick'+import type { TrendsChartClickDeps } from '../shared/handleTrendsChartClick'import { handleTrendsBarAggregatedChartClick } from './handleTrendsBarAggregatedChartClick'function makeTrendResult(overrides: Partial<IndexedTrendResult> = {}): IndexedTrendResult {diff --git a/frontend/src/scenes/trends/viz/trends-bar-chart/handleTrendsBarAggregatedChartClick.ts b/products/product_analytics/frontend/insights/trends/TrendsBarChart/handleTrendsBarAggregatedChartClick.tssimilarity index 88%rename from frontend/src/scenes/trends/viz/trends-bar-chart/handleTrendsBarAggregatedChartClick.tsrename to products/product_analytics/frontend/insights/trends/TrendsBarChart/handleTrendsBarAggregatedChartClick.tsindex e0c850f9c6eb..ae03c6534133 100644--- a/frontend/src/scenes/trends/viz/trends-bar-chart/handleTrendsBarAggregatedChartClick.ts+++ b/products/product_analytics/frontend/insights/trends/TrendsBarChart/handleTrendsBarAggregatedChartClick.ts@@ -1,5 +1,6 @@-import { datasetToActorsQuery } from '../datasetToActorsQuery'-import type { TrendsChartClickDeps } from '../handleTrendsChartClick'+import { datasetToActorsQuery } from 'scenes/trends/viz/datasetToActorsQuery'++import type { TrendsChartClickDeps } from '../shared/handleTrendsChartClick'// Sparse-stacked: resolve by dataIndex, not series.key — buildPointClickData would otherwise// dispatch the first non-excluded series regardless of which band was clicked.diff --git a/frontend/src/scenes/trends/viz/trends-bar-chart/trendsBarChartTransforms.test.ts b/products/product_analytics/frontend/insights/trends/TrendsBarChart/trendsBarChartTransforms.test.tssimilarity index 100%rename from frontend/src/scenes/trends/viz/trends-bar-chart/trendsBarChartTransforms.test.tsrename to products/product_analytics/frontend/insights/trends/TrendsBarChart/trendsBarChartTransforms.test.tsdiff --git a/frontend/src/scenes/trends/viz/trends-bar-chart/trendsBarChartTransforms.ts b/products/product_analytics/frontend/insights/trends/TrendsBarChart/trendsBarChartTransforms.tssimilarity index 98%rename from frontend/src/scenes/trends/viz/trends-bar-chart/trendsBarChartTransforms.tsrename to products/product_analytics/frontend/insights/trends/TrendsBarChart/trendsBarChartTransforms.tsindex 6c6ca4387fa0..b31808055362 100644--- a/frontend/src/scenes/trends/viz/trends-bar-chart/trendsBarChartTransforms.ts+++ b/products/product_analytics/frontend/insights/trends/TrendsBarChart/trendsBarChartTransforms.ts@@ -1,12 +1,12 @@import type { Series, TimeSeriesBarChartConfig } from 'lib/hog-charts'import { hexToRGBA } from 'lib/utils'+import { COMPARE_PREVIOUS_DIM_OPACITY } from 'scenes/trends/viz/trendsAdapterConstants'import type { CurrencyCode, GoalLine as SchemaGoalLine, TrendsFilter } from '~/queries/schema/schema-general'import type { IntervalType } from '~/types'import { schemaGoalLinesToConfigs } from '../shared/goalLinesAdapter'import { buildTrendsYAxisConfig } from '../shared/trendsAxisFormat'-import { COMPARE_PREVIOUS_DIM_OPACITY } from '../trendsAdapterConstants'// Shape both IndexedTrendResult (kea) and TrendsResultItem (MCP) satisfy.export interface TrendsBarResultLike {diff --git a/frontend/src/scenes/trends/viz/trends-line-chart/TrendsLineChart.stories.tsx b/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.stories.tsxsimilarity index 88%rename from frontend/src/scenes/trends/viz/trends-line-chart/TrendsLineChart.stories.tsxrename to products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.stories.tsxindex 9ee13efb17b3..a1c0fca0e931 100644--- a/frontend/src/scenes/trends/viz/trends-line-chart/TrendsLineChart.stories.tsx+++ b/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.stories.tsx@@ -5,6 +5,9 @@ import { useState } from 'react'import { insightLogic } from 'scenes/insights/insightLogic'import { mswDecorator } from '~/mocks/browser'+import trendsLineFixture from '~/mocks/fixtures/api/projects/team_id/insights/trendsLine.json'+import trendsLineBreakdownFixture from '~/mocks/fixtures/api/projects/team_id/insights/trendsLineBreakdown.json'+import trendsLineMultiFixture from '~/mocks/fixtures/api/projects/team_id/insights/trendsLineMulti.json'import { dataNodeLogic } from '~/queries/nodes/DataNode/dataNodeLogic'import type { DataNodeLogicProps } from '~/queries/nodes/DataNode/dataNodeLogic'import { insightVizDataNodeKey } from '~/queries/nodes/InsightViz/InsightViz'@@ -107,21 +110,14 @@ function renderTrendsLineChart(insightFixture: any): JSX.Element {)}-/* eslint-disable @typescript-eslint/no-var-requires */export const Default: Story = {- render: () =>- renderTrendsLineChart(require('../../../../mocks/fixtures/api/projects/team_id/insights/trendsLineMulti.json')),+ render: () => renderTrendsLineChart(trendsLineMultiFixture),}export const SingleSeries: Story = {- render: () =>- renderTrendsLineChart(require('../../../../mocks/fixtures/api/projects/team_id/insights/trendsLine.json')),+ render: () => renderTrendsLineChart(trendsLineFixture),}export const Breakdown: Story = {- render: () =>- renderTrendsLineChart(- require('../../../../mocks/fixtures/api/projects/team_id/insights/trendsLineBreakdown.json')- ),+ render: () => renderTrendsLineChart(trendsLineBreakdownFixture),}-/* eslint-enable @typescript-eslint/no-var-requires */diff --git a/frontend/src/scenes/trends/viz/trends-line-chart/TrendsLineChart.test.tsx b/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.test.tsxsimilarity index 100%rename from frontend/src/scenes/trends/viz/trends-line-chart/TrendsLineChart.test.tsxrename to products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.test.tsxdiff --git a/frontend/src/scenes/trends/viz/trends-line-chart/TrendsLineChart.tsx b/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.tsxsimilarity index 96%rename from frontend/src/scenes/trends/viz/trends-line-chart/TrendsLineChart.tsxrename to products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.tsxindex 5aabdfa77766..4e863479fb1e 100644--- a/frontend/src/scenes/trends/viz/trends-line-chart/TrendsLineChart.tsx+++ b/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.tsx@@ -6,21 +6,21 @@ import { buildTheme } from 'lib/charts/utils/theme'import { DEFAULT_Y_AXIS_ID, TimeSeriesLineChart } from 'lib/hog-charts'import type { PointClickData, Series, TimeSeriesLineChartConfig, TooltipConfig, TooltipContext } from 'lib/hog-charts'import { formatPercentStackAxisValue } from 'scenes/insights/aggregationAxisFormat'+import { InsightEmptyState } from 'scenes/insights/EmptyStates'import { insightLogic } from 'scenes/insights/insightLogic'import type { SeriesDatum } from 'scenes/insights/InsightTooltip/insightTooltipUtils'import { teamLogic } from 'scenes/teamLogic'+import { openPersonsModal } from 'scenes/trends/persons-modal/PersonsModal'+import { trendsDataLogic } from 'scenes/trends/trendsDataLogic'+import type { IndexedTrendResult } from 'scenes/trends/types'import { themeLogic } from '~/layout/navigation-3000/themeLogic'import { groupsModel } from '~/models/groupsModel'import { InsightVizNode } from '~/queries/schema/schema-general'import { QueryContext } from '~/queries/types'-import { InsightEmptyState } from '../../../insights/EmptyStates'-import { openPersonsModal } from '../../persons-modal/PersonsModal'-import { trendsDataLogic } from '../../trendsDataLogic'-import type { IndexedTrendResult } from '../../types'-import { handleTrendsChartClick } from '../handleTrendsChartClick'import { AnnotationsLayer } from '../shared/AnnotationsLayer'+import { handleTrendsChartClick } from '../shared/handleTrendsChartClick'import { TrendsAlertOverlays } from '../shared/TrendsAlertOverlays'import type { TrendsSeriesMeta } from '../shared/trendsSeriesMeta'import { TrendsTooltip } from '../shared/TrendsTooltip'@@ -210,7 +210,6 @@ export function TrendsLineChart({ context, inSharedMode = false }: TrendsLineChainsightData?.resolved_date_range,querySource,indexedResults,- openPersonsModal,])diff --git a/frontend/src/scenes/trends/viz/trends-line-chart/trendsChartTransforms.test.ts b/products/product_analytics/frontend/insights/trends/TrendsLineChart/trendsChartTransforms.test.tssimilarity index 100%rename from frontend/src/scenes/trends/viz/trends-line-chart/trendsChartTransforms.test.tsrename to products/product_analytics/frontend/insights/trends/TrendsLineChart/trendsChartTransforms.test.tsdiff --git a/frontend/src/scenes/trends/viz/trends-line-chart/trendsChartTransforms.ts b/products/product_analytics/frontend/insights/trends/TrendsLineChart/trendsChartTransforms.tssimilarity index 100%rename from frontend/src/scenes/trends/viz/trends-line-chart/trendsChartTransforms.tsrename to products/product_analytics/frontend/insights/trends/TrendsLineChart/trendsChartTransforms.tsdiff --git a/frontend/src/scenes/trends/viz/shared/AnnotationsLayer.tsx b/products/product_analytics/frontend/insights/trends/shared/AnnotationsLayer.tsxsimilarity index 100%rename from frontend/src/scenes/trends/viz/shared/AnnotationsLayer.tsxrename to products/product_analytics/frontend/insights/trends/shared/AnnotationsLayer.tsxdiff --git a/frontend/src/scenes/trends/viz/shared/TrendsAlertOverlays.tsx b/products/product_analytics/frontend/insights/trends/shared/TrendsAlertOverlays.tsxsimilarity index 97%rename from frontend/src/scenes/trends/viz/shared/TrendsAlertOverlays.tsxrename to products/product_analytics/frontend/insights/trends/shared/TrendsAlertOverlays.tsxindex 5f5ce4e476fd..285ba9fbf6eb 100644--- a/frontend/src/scenes/trends/viz/shared/TrendsAlertOverlays.tsx+++ b/products/product_analytics/frontend/insights/trends/shared/TrendsAlertOverlays.tsx@@ -3,10 +3,10 @@ import React, { useMemo } from 'react'import { insightAlertsLogic } from 'lib/components/Alerts/insightAlertsLogic'import { AnomalyPointsLayer, ReferenceLines } from 'lib/hog-charts'+import type { IndexedTrendResult } from 'scenes/trends/types'import type { InsightLogicProps } from '~/types'-import type { IndexedTrendResult } from '../../types'import { buildAnomalyMarkers } from './anomalyPointsAdapter'import { alertThresholdsToReferenceLines } from './goalLinesAdapter'diff --git a/frontend/src/scenes/trends/viz/shared/TrendsTooltip.tsx b/products/product_analytics/frontend/insights/trends/shared/TrendsTooltip.tsxsimilarity index 100%rename from frontend/src/scenes/trends/viz/shared/TrendsTooltip.tsxrename to products/product_analytics/frontend/insights/trends/shared/TrendsTooltip.tsxdiff --git a/frontend/src/scenes/trends/viz/shared/anomalyPointsAdapter.test.ts b/products/product_analytics/frontend/insights/trends/shared/anomalyPointsAdapter.test.tssimilarity index 98%rename from frontend/src/scenes/trends/viz/shared/anomalyPointsAdapter.test.tsrename to products/product_analytics/frontend/insights/trends/shared/anomalyPointsAdapter.test.tsindex 2453644c7b39..19e6ca5da499 100644--- a/frontend/src/scenes/trends/viz/shared/anomalyPointsAdapter.test.ts+++ b/products/product_analytics/frontend/insights/trends/shared/anomalyPointsAdapter.test.ts@@ -1,8 +1,8 @@import type { AnomalyPoint } from 'lib/components/Alerts/types'+import type { IndexedTrendResult } from 'scenes/trends/types'import { EntityTypes } from '~/types'-import type { IndexedTrendResult } from '../../types'import { buildAnomalyMarkers } from './anomalyPointsAdapter'function makeResult(overrides: Partial<IndexedTrendResult> = {}): IndexedTrendResult {diff --git a/frontend/src/scenes/trends/viz/shared/anomalyPointsAdapter.ts b/products/product_analytics/frontend/insights/trends/shared/anomalyPointsAdapter.tssimilarity index 97%rename from frontend/src/scenes/trends/viz/shared/anomalyPointsAdapter.tsrename to products/product_analytics/frontend/insights/trends/shared/anomalyPointsAdapter.tsindex 7ad12e6efbd9..6f532328e667 100644--- a/frontend/src/scenes/trends/viz/shared/anomalyPointsAdapter.ts+++ b/products/product_analytics/frontend/insights/trends/shared/anomalyPointsAdapter.ts@@ -1,7 +1,6 @@import type { AnomalyPoint } from 'lib/components/Alerts/types'import type { AnomalyMarker as BaseAnomalyMarker } from 'lib/hog-charts'--import type { IndexedTrendResult } from '../../types'+import type { IndexedTrendResult } from 'scenes/trends/types'export interface AnomalyMarker extends BaseAnomalyMarker {/** Originating alert anomaly score (0..1) if available. */diff --git a/frontend/src/scenes/trends/viz/shared/goalLinesAdapter.test.ts b/products/product_analytics/frontend/insights/trends/shared/goalLinesAdapter.test.tssimilarity index 100%rename from frontend/src/scenes/trends/viz/shared/goalLinesAdapter.test.tsrename to products/product_analytics/frontend/insights/trends/shared/goalLinesAdapter.test.tsdiff --git a/frontend/src/scenes/trends/viz/shared/goalLinesAdapter.ts b/products/product_analytics/frontend/insights/trends/shared/goalLinesAdapter.tssimilarity index 100%rename from frontend/src/scenes/trends/viz/shared/goalLinesAdapter.tsrename to products/product_analytics/frontend/insights/trends/shared/goalLinesAdapter.tsdiff --git a/frontend/src/scenes/trends/viz/handleTrendsChartClick.test.tsx b/products/product_analytics/frontend/insights/trends/shared/handleTrendsChartClick.test.tsxsimilarity index 99%rename from frontend/src/scenes/trends/viz/handleTrendsChartClick.test.tsxrename to products/product_analytics/frontend/insights/trends/shared/handleTrendsChartClick.test.tsxindex 2f4207cd178d..5f2181586a04 100644--- a/frontend/src/scenes/trends/viz/handleTrendsChartClick.test.tsx+++ b/products/product_analytics/frontend/insights/trends/shared/handleTrendsChartClick.test.tsx@@ -1,7 +1,8 @@+import type { IndexedTrendResult } from 'scenes/trends/types'+import { NodeKind } from '~/queries/schema/schema-general'import { CompareLabelType, EntityTypes } from '~/types'-import type { IndexedTrendResult } from '../types'import { handleTrendsChartClick, type TrendsChartClickDeps } from './handleTrendsChartClick'function makeTrendResult(overrides: Partial<IndexedTrendResult> = {}): IndexedTrendResult {diff --git a/frontend/src/scenes/trends/viz/handleTrendsChartClick.tsx b/products/product_analytics/frontend/insights/trends/shared/handleTrendsChartClick.tsxsimilarity index 92%rename from frontend/src/scenes/trends/viz/handleTrendsChartClick.tsxrename to products/product_analytics/frontend/insights/trends/shared/handleTrendsChartClick.tsxindex a976319614cc..c23589db86b7 100644--- a/frontend/src/scenes/trends/viz/handleTrendsChartClick.tsx+++ b/products/product_analytics/frontend/insights/trends/shared/handleTrendsChartClick.tsx@@ -1,13 +1,12 @@import { DateDisplay } from 'lib/components/DateDisplay'+import type { OpenPersonsModalProps } from 'scenes/trends/persons-modal/PersonsModal'+import type { IndexedTrendResult } from 'scenes/trends/types'+import { datasetToActorsQuery } from 'scenes/trends/viz/datasetToActorsQuery'import { InsightActorsQuery, InsightVizNode, ResolvedDateRangeResponse } from '~/queries/schema/schema-general'import { QueryContext } from '~/queries/types'import { IntervalType } from '~/types'-import type { OpenPersonsModalProps } from '../persons-modal/PersonsModal'-import type { IndexedTrendResult } from '../types'-import { datasetToActorsQuery } from './datasetToActorsQuery'-export interface TrendsChartClickDeps {context?: QueryContext<InsightVizNode>hasPersonsModal: booleandiff --git a/frontend/src/scenes/trends/viz/shared/trendsAxisFormat.test.ts b/products/product_analytics/frontend/insights/trends/shared/trendsAxisFormat.test.tssimilarity index 100%rename from frontend/src/scenes/trends/viz/shared/trendsAxisFormat.test.tsrename to products/product_analytics/frontend/insights/trends/shared/trendsAxisFormat.test.tsdiff --git a/frontend/src/scenes/trends/viz/shared/trendsAxisFormat.ts b/products/product_analytics/frontend/insights/trends/shared/trendsAxisFormat.tssimilarity index 100%rename from frontend/src/scenes/trends/viz/shared/trendsAxisFormat.tsrename to products/product_analytics/frontend/insights/trends/shared/trendsAxisFormat.tsdiff --git a/frontend/src/scenes/trends/viz/shared/trendsSeriesMeta.ts b/products/product_analytics/frontend/insights/trends/shared/trendsSeriesMeta.tssimilarity index 100%rename from frontend/src/scenes/trends/viz/shared/trendsSeriesMeta.tsrename to products/product_analytics/frontend/insights/trends/shared/trendsSeriesMeta.tsdiff --git a/products/product_analytics/package.json b/products/product_analytics/package.jsonindex c569651a72cc..1e2611521bc6 100644--- a/products/product_analytics/package.json+++ b/products/product_analytics/package.json@@ -6,7 +6,12 @@"dependencies": {"kea": "catalog:","kea-loaders": "catalog:",- "kea-router": "catalog:"+ "kea-router": "catalog:",+ "posthog-js": "catalog:"+ },+ "devDependencies": {+ "@storybook/react": "catalog:",+ "@testing-library/react": "*"},"peerDependencies": {"@posthog/icons": "*",