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(insights): move shared trends helpers to viz/shared/ (#58025)

Sam Penningtonbde9c1e418d8
diff --git a/frontend/src/scenes/trends/viz/trends-line-chart/AnnotationsLayer.tsx b/frontend/src/scenes/trends/viz/shared/AnnotationsLayer.tsx
similarity index 100%
rename from frontend/src/scenes/trends/viz/trends-line-chart/AnnotationsLayer.tsx
rename to frontend/src/scenes/trends/viz/shared/AnnotationsLayer.tsx
diff --git a/frontend/src/scenes/trends/viz/trends-line-chart/TrendsAlertOverlays.tsx b/frontend/src/scenes/trends/viz/shared/TrendsAlertOverlays.tsx
similarity index 100%
rename from frontend/src/scenes/trends/viz/trends-line-chart/TrendsAlertOverlays.tsx
rename to frontend/src/scenes/trends/viz/shared/TrendsAlertOverlays.tsx
diff --git a/frontend/src/scenes/trends/viz/trends-line-chart/TrendsTooltip.tsx b/frontend/src/scenes/trends/viz/shared/TrendsTooltip.tsx
similarity index 100%
rename from frontend/src/scenes/trends/viz/trends-line-chart/TrendsTooltip.tsx
rename to frontend/src/scenes/trends/viz/shared/TrendsTooltip.tsx
diff --git a/frontend/src/scenes/trends/viz/trends-line-chart/anomalyPointsAdapter.test.ts b/frontend/src/scenes/trends/viz/shared/anomalyPointsAdapter.test.ts
similarity index 100%
rename from frontend/src/scenes/trends/viz/trends-line-chart/anomalyPointsAdapter.test.ts
rename to frontend/src/scenes/trends/viz/shared/anomalyPointsAdapter.test.ts
diff --git a/frontend/src/scenes/trends/viz/trends-line-chart/anomalyPointsAdapter.ts b/frontend/src/scenes/trends/viz/shared/anomalyPointsAdapter.ts
similarity index 100%
rename from frontend/src/scenes/trends/viz/trends-line-chart/anomalyPointsAdapter.ts
rename to frontend/src/scenes/trends/viz/shared/anomalyPointsAdapter.ts
diff --git a/frontend/src/scenes/trends/viz/trends-line-chart/goalLinesAdapter.test.ts b/frontend/src/scenes/trends/viz/shared/goalLinesAdapter.test.ts
similarity index 100%
rename from frontend/src/scenes/trends/viz/trends-line-chart/goalLinesAdapter.test.ts
rename to frontend/src/scenes/trends/viz/shared/goalLinesAdapter.test.ts
diff --git a/frontend/src/scenes/trends/viz/trends-line-chart/goalLinesAdapter.ts b/frontend/src/scenes/trends/viz/shared/goalLinesAdapter.ts
similarity index 100%
rename from frontend/src/scenes/trends/viz/trends-line-chart/goalLinesAdapter.ts
rename to frontend/src/scenes/trends/viz/shared/goalLinesAdapter.ts
diff --git a/frontend/src/scenes/trends/viz/trends-line-chart/trendsAxisFormat.test.ts b/frontend/src/scenes/trends/viz/shared/trendsAxisFormat.test.ts
similarity index 100%
rename from frontend/src/scenes/trends/viz/trends-line-chart/trendsAxisFormat.test.ts
rename to frontend/src/scenes/trends/viz/shared/trendsAxisFormat.test.ts
diff --git a/frontend/src/scenes/trends/viz/trends-line-chart/trendsAxisFormat.ts b/frontend/src/scenes/trends/viz/shared/trendsAxisFormat.ts
similarity index 100%
rename from frontend/src/scenes/trends/viz/trends-line-chart/trendsAxisFormat.ts
rename to frontend/src/scenes/trends/viz/shared/trendsAxisFormat.ts
diff --git a/frontend/src/scenes/trends/viz/trends-line-chart/trendsSeriesMeta.ts b/frontend/src/scenes/trends/viz/shared/trendsSeriesMeta.ts
similarity index 100%
rename from frontend/src/scenes/trends/viz/trends-line-chart/trendsSeriesMeta.ts
rename to frontend/src/scenes/trends/viz/shared/trendsSeriesMeta.ts
diff --git a/frontend/src/scenes/trends/viz/trends-bar-chart/TrendsBarChart.tsx b/frontend/src/scenes/trends/viz/trends-bar-chart/TrendsBarChart.tsx
index 31a12f205d9a..65cf2dfc5864 100644
--- a/frontend/src/scenes/trends/viz/trends-bar-chart/TrendsBarChart.tsx
+++ b/frontend/src/scenes/trends/viz/trends-bar-chart/TrendsBarChart.tsx
@@ -27,12 +27,12 @@ import { openPersonsModal } from '../../persons-modal/PersonsModal'
import { trendsDataLogic } from '../../trendsDataLogic'
import type { IndexedTrendResult } from '../../types'
import { handleTrendsChartClick, type TrendsChartClickDeps } from '../handleTrendsChartClick'
-import { AnnotationsLayer } from '../trends-line-chart/AnnotationsLayer'
-import { goalLinesToReferenceLines } from '../trends-line-chart/goalLinesAdapter'
-import { TrendsAlertOverlays } from '../trends-line-chart/TrendsAlertOverlays'
-import { trendsFilterToYFormatterConfig } from '../trends-line-chart/trendsAxisFormat'
-import type { TrendsSeriesMeta } from '../trends-line-chart/trendsSeriesMeta'
-import { TrendsTooltip } from '../trends-line-chart/TrendsTooltip'
+import { AnnotationsLayer } from '../shared/AnnotationsLayer'
+import { goalLinesToReferenceLines } from '../shared/goalLinesAdapter'
+import { TrendsAlertOverlays } from '../shared/TrendsAlertOverlays'
+import { trendsFilterToYFormatterConfig } from '../shared/trendsAxisFormat'
+import type { TrendsSeriesMeta } from '../shared/trendsSeriesMeta'
+import { TrendsTooltip } from '../shared/TrendsTooltip'
import { handleTrendsBarAggregatedChartClick } from './handleTrendsBarAggregatedChartClick'
import { buildTrendsBarAggregatedSeries, buildTrendsBarTimeSeries } from './trendsBarChartTransforms'
diff --git a/frontend/src/scenes/trends/viz/trends-line-chart/TrendsLineChart.tsx b/frontend/src/scenes/trends/viz/trends-line-chart/TrendsLineChart.tsx
index 98559096cfc2..b748c73eabbd 100644
--- a/frontend/src/scenes/trends/viz/trends-line-chart/TrendsLineChart.tsx
+++ b/frontend/src/scenes/trends/viz/trends-line-chart/TrendsLineChart.tsx
@@ -20,13 +20,13 @@ import { openPersonsModal } from '../../persons-modal/PersonsModal'
import { trendsDataLogic } from '../../trendsDataLogic'
import type { IndexedTrendResult } from '../../types'
import { handleTrendsChartClick } from '../handleTrendsChartClick'
-import { AnnotationsLayer } from './AnnotationsLayer'
-import { schemaGoalLinesToConfigs } from './goalLinesAdapter'
-import { TrendsAlertOverlays } from './TrendsAlertOverlays'
-import { buildTrendsYAxisConfig } from './trendsAxisFormat'
+import { AnnotationsLayer } from '../shared/AnnotationsLayer'
+import { schemaGoalLinesToConfigs } from '../shared/goalLinesAdapter'
+import { TrendsAlertOverlays } from '../shared/TrendsAlertOverlays'
+import { buildTrendsYAxisConfig } from '../shared/trendsAxisFormat'
+import type { TrendsSeriesMeta } from '../shared/trendsSeriesMeta'
+import { TrendsTooltip } from '../shared/TrendsTooltip'
import { buildDerivedConfigs, buildTrendsSeries } from './trendsChartTransforms'
-import type { TrendsSeriesMeta } from './trendsSeriesMeta'
-import { TrendsTooltip } from './TrendsTooltip'
interface TrendsLineChartProps {
context?: QueryContext<InsightVizNode>