: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
feat(insights): add horizontal funnel bar chart on hog-charts (#60385)
Sam Penningtonac10cb3d9908
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 405308b9b3d4..387697e297c4 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -1935,7 +1935,7 @@ snapshots:filters-taxonomic-filter-headless--properties--dark:hash: v1.k794b7964.4ee695e5751c6f73e9742ab0cfeecf61b5adfe829cf3a0d49ab2877cae8b212f.jPN9l5TDgLRy9NzHenXHCU903UDg8-GdeGpf4PXt7aAfilters-taxonomic-filter-headless--properties--light:- hash: v1.k794b7964.7af6b884e5d826df422db99e4a99d2172f3316561a499dbe386ea098b1fc54a9.rti2DMpqC0WEtd_AtG838vQlgQMHfwjBAR4uLN_HnUk+ hash: v1.k794b7964.bd715b36b456df8730e934366a35faed4556dffa881456db1272e2804047a036.IH74-bf3miZ6nC3E0bqbzIb0km4fBh97_2XubTpcmnsfilters-taxonomic-filter-headless--suggested-filters-with-recents--dark:hash: v1.k794b7964.c3a6cd419610bc486261efa753816547f080f00c838bde0b8720cf12067b3b22.nxBtExiDfJ3USkhV9RY1VPU_U2dGyEYCMFbhvtOcuVsfilters-taxonomic-filter-headless--suggested-filters-with-recents--light:@@ -1984,6 +1984,14 @@ snapshots:hash: v1.k794b7964.bfc37a73be2626e96bbe4548242573265a4cfc32ff528d4693b9627858a5b094.PNqTcfHLhDIniPZ3XrENsyI8NRgW72ID4rIzEPoxjUQhome-recordingrow--default--light:hash: v1.k794b7964.329d31ae48aa77fb3985b7b04d9dd7442300f121a5216295ae62403ee2822c73.4UlskD-jaI7b0oEHZVJSnt34xEIL6IBubmZlb3edfvE+ insights-funnelbarhorizontalchart--breakdown--dark:+ hash: v1.k794b7964.2399c3aaefe28872b98a766828373dfa2a2af07e570e51c3916a5e6441e56c99.Jwv9SlihbIqbaNbNtPtMNGdYFZpcBQffhH939az6JlU+ insights-funnelbarhorizontalchart--breakdown--light:+ hash: v1.k794b7964.eb99a41493e9ab9534721b2c768aba6804be2a11c8d0d0b6bba635a95f60bbe1.Pvd4_u21_pG3USKvQqwfTEu66VQltyBQ6rXeLvbR5vE+ insights-funnelbarhorizontalchart--default--dark:+ hash: v1.k794b7964.43302c9174c7cd7a3ea66450b3c50d69c219a1ddb770a6211f035460e4af6370.zHS6Xm-tU3FD8tmRHll7kATc3ei-klj3jYBVFVcEz1o+ insights-funnelbarhorizontalchart--default--light:+ hash: v1.k794b7964.766e219b80c8d0bd5ef7d3e70c55e3ccac4149e5bbf0df28700ec80823b83752.SbbGf02Ugrx7Nm6nR8gxDe_HZrhFoPNSNzVGhzU-kYUinsights-funnelcorrelationtable--default--dark:hash: v1.k794b7964.85a7028e6729988dedf767a52640b16c94aa48baf0ab9c89b1085c38d4e8cc8e.wDERvaZQvyEVwZsoj2q7nTwZSDswGOq-6dnRNcvuRpwinsights-funnelcorrelationtable--default--light:@@ -4877,7 +4885,7 @@ snapshots:scenes-app-insights-funnels--funnel-left-to-right-edit-viewports--wide--dark:hash: v1.k794b7964.293297b83994468984576e5c15fa2cbbb2c4c0a7a8234959b9deba539efa383b.O7SwG4Drfr3z02hcLNC1LsLsGWddouhybBp4xZaUE-Ascenes-app-insights-funnels--funnel-left-to-right-edit-viewports--wide--light:- hash: v1.k794b7964.6c391cbc05b64230fbd8defdbb960b131fd433409817497873fb9ffc705cd360.EIwByuofuT77yP259A9ffqfjSFwW9MrUDOvsZNA_aZM+ hash: v1.k794b7964.c63132bb5b13cbe97938ebdb2e59e320ebc338bd12b2d3bfd6af81e56270650a.KSiw8WpvjWXIDh87ExL4cPnopVJlTXvzU8N8ruh6Hi8scenes-app-insights-funnels--funnel-time-to-convert--dark:hash: v1.k794b7964.d64808d2bfc36017f89b57feeaa373e20188738a622801207fa1beb59d02fdd9.cFuKF_Ow887Z3X3BoNhtTvkUWY2vips9HDBe-B02eQEscenes-app-insights-funnels--funnel-time-to-convert--light:diff --git a/frontend/src/scenes/funnels/Funnel.tsx b/frontend/src/scenes/funnels/Funnel.tsxindex 7d1dee8ba011..b8e757b560c7 100644--- a/frontend/src/scenes/funnels/Funnel.tsx+++ b/frontend/src/scenes/funnels/Funnel.tsx@@ -9,6 +9,7 @@ import { insightLogic } from 'scenes/insights/insightLogic'import { ChartParams, FunnelVizType } from '~/types'+import { FunnelBarHorizontalChart } from 'products/product_analytics/frontend/insights/funnels/FunnelBarHorizontalChart/FunnelBarHorizontalChart'import { FunnelHistogramChart } from 'products/product_analytics/frontend/insights/funnels/FunnelHistogramChart/FunnelHistogramChart'import { FunnelLineChart } from 'products/product_analytics/frontend/insights/funnels/FunnelLineChart/FunnelLineChart'import { FunnelStepsBarChart } from 'products/product_analytics/frontend/insights/funnels/FunnelStepsBarChart/FunnelStepsBarChart'@@ -35,7 +36,7 @@ export function Funnel(props: ChartParams): JSX.Element {} else if ((layout || FunnelLayout.vertical) === FunnelLayout.vertical) {viz = hogChartsFunnelEnabled ? <FunnelStepsBarChart {...props} /> : <FunnelBarVertical {...props} />} else {- viz = <FunnelBarHorizontal {...props} />+ viz = hogChartsFunnelEnabled ? <FunnelBarHorizontalChart {...props} /> : <FunnelBarHorizontal {...props} />}return (diff --git a/products/product_analytics/frontend/insights/funnels/FunnelBarHorizontalChart/FunnelBarHorizontalChart.stories.tsx b/products/product_analytics/frontend/insights/funnels/FunnelBarHorizontalChart/FunnelBarHorizontalChart.stories.tsxnew file mode 100644index 000000000000..37839f0ff2ed--- /dev/null+++ b/products/product_analytics/frontend/insights/funnels/FunnelBarHorizontalChart/FunnelBarHorizontalChart.stories.tsx@@ -0,0 +1,69 @@+import { Meta, StoryObj } from '@storybook/react'+import { BindLogic } from 'kea'+import { useState } from 'react'++import { insightLogic } from 'scenes/insights/insightLogic'++import funnelTopToBottomFixture from '~/mocks/fixtures/api/projects/team_id/insights/funnelTopToBottom.json'+import funnelTopToBottomBreakdownFixture from '~/mocks/fixtures/api/projects/team_id/insights/funnelTopToBottomBreakdown.json'+import { dataNodeLogic } from '~/queries/nodes/DataNode/dataNodeLogic'+import type { DataNodeLogicProps } from '~/queries/nodes/DataNode/dataNodeLogic'+import { insightVizDataNodeKey } from '~/queries/nodes/InsightViz/InsightViz'+import { getCachedResults } from '~/queries/nodes/InsightViz/utils'+import { InsightLogicProps, InsightShortId } from '~/types'++import { FunnelBarHorizontalChart } from './FunnelBarHorizontalChart'++type Story = StoryObj<{}>++const meta: Meta = {+ title: 'Insights/FunnelBarHorizontalChart',+ component: FunnelBarHorizontalChart,+ parameters: {+ layout: 'centered',+ mockDate: '2022-03-12',+ testOptions: { snapshotBrowsers: ['chromium'] },+ },+}+export default meta++let uniqueNode = 0++function Stage({ children }: { children: React.ReactNode }): JSX.Element {+ return (+ // eslint-disable-next-line react/forbid-dom-props+ <div style={{ height: 480, width: 720, display: 'flex', flexDirection: 'column' }}>{children}</div>+ )+}++function StoryRender({ insightFixture }: { insightFixture: any }): JSX.Element {+ const [dashboardItemId] = useState(() => `FunnelBarHorizontalChartStory.${uniqueNode++}` as InsightShortId)+ const source = insightFixture.query.source+ const cachedInsight = { ...insightFixture, short_id: dashboardItemId }++ const insightProps: InsightLogicProps = { dashboardItemId, doNotLoad: true, cachedInsight }+ const dataNodeLogicProps: DataNodeLogicProps = {+ query: source,+ key: insightVizDataNodeKey(insightProps),+ cachedResults: getCachedResults(cachedInsight, source),+ doNotLoad: true,+ }++ return (+ <BindLogic logic={insightLogic} props={insightProps}>+ <BindLogic logic={dataNodeLogic} props={dataNodeLogicProps}>+ <Stage>+ <FunnelBarHorizontalChart />+ </Stage>+ </BindLogic>+ </BindLogic>+ )+}++export const Default: Story = {+ render: () => <StoryRender insightFixture={funnelTopToBottomFixture} />,+}++export const Breakdown: Story = {+ render: () => <StoryRender insightFixture={funnelTopToBottomBreakdownFixture} />,+}diff --git a/products/product_analytics/frontend/insights/funnels/FunnelBarHorizontalChart/FunnelBarHorizontalChart.tsx b/products/product_analytics/frontend/insights/funnels/FunnelBarHorizontalChart/FunnelBarHorizontalChart.tsxnew file mode 100644index 000000000000..1ebe58c288ee--- /dev/null+++ b/products/product_analytics/frontend/insights/funnels/FunnelBarHorizontalChart/FunnelBarHorizontalChart.tsx@@ -0,0 +1,156 @@+import { useActions, useValues } from 'kea'+import posthog from 'posthog-js'+import { useMemo, type ErrorInfo } from 'react'++import { buildTheme } from 'lib/charts/utils/theme'+import { BarChart, type BarChartConfig, type PointClickData, type TooltipContext } from 'lib/hog-charts'+import { funnelDataLogic } from 'scenes/funnels/funnelDataLogic'+import { funnelPersonsModalLogic } from 'scenes/funnels/funnelPersonsModalLogic'+import { insightLogic } from 'scenes/insights/insightLogic'++import { themeLogic } from '~/layout/navigation-3000/themeLogic'+import { groupsModel } from '~/models/groupsModel'+import { type ChartParams, FunnelStepReference } from '~/types'++import { FunnelBarHorizontalTooltip } from './FunnelBarHorizontalTooltip'+import { buildFunnelBarHorizontalData, type FunnelBarHorizontalSegmentMeta } from './funnelBarHorizontalTransforms'+import { StepDecorations } from './StepDecorations'++const ROW_HEIGHT_PX = 76+const BAR_PADDING = 0.6+const GLYPH_COLUMN_WIDTH_PX = 24++function getFillerColor(): string {+ if (typeof document === 'undefined') {+ return 'rgba(0, 0, 0, 0.08)'+ }+ return getComputedStyle(document.body).getPropertyValue('--color-border-primary').trim() || 'rgba(0, 0, 0, 0.08)'+}++const handleChartError = (error: Error, info: ErrorInfo): void => {+ posthog.captureException(error, {+ feature: 'funnels-bar-horizontal-chart',+ componentStack: info.componentStack ?? undefined,+ })+}++export function FunnelBarHorizontalChart({+ showPersonsModal: showPersonsModalProp = true,+ inCardView,+}: ChartParams): JSX.Element | null {+ const { isDarkModeOn } = useValues(themeLogic)+ const theme = useMemo(() => buildTheme(), [isDarkModeOn])+ const fillerColor = useMemo(() => getFillerColor(), [isDarkModeOn])++ const { insightProps } = useValues(insightLogic)+ const {+ visibleStepsWithConversionMetrics,+ aggregationTargetLabel,+ funnelsFilter,+ breakdownFilter,+ isStepOptional,+ getFunnelsColor,+ querySource,+ } = useValues(funnelDataLogic(insightProps))+ const { canOpenPersonModal } = useValues(funnelPersonsModalLogic(insightProps))+ const { openPersonsModalForStep, openPersonsModalForSeries } = useActions(funnelPersonsModalLogic(insightProps))+ const { aggregationLabel } = useValues(groupsModel)++ const steps = visibleStepsWithConversionMetrics+ const stepReference = funnelsFilter?.funnelStepReference || FunnelStepReference.total+ const showPersonsModal = canOpenPersonModal && showPersonsModalProp+ const interactive = showPersonsModal && !inCardView+ const hasOptionalSteps = steps.some((_, stepIndex) => isStepOptional(stepIndex + 1))+ const groupTypeLabel = aggregationLabel(querySource?.aggregation_group_type_index).plural++ const { series, labels } = useMemo(+ () =>+ buildFunnelBarHorizontalData(steps, {+ stepReference,+ breakdownFilter,+ getColor: getFunnelsColor,+ getLabel: (variant) => String(variant.breakdown_value ?? variant.name ?? ''),+ fillerColor,+ }),+ [steps, stepReference, breakdownFilter, getFunnelsColor, fillerColor]+ )++ const chartConfig = useMemo<BarChartConfig>(+ () => ({+ barLayout: 'stacked',+ barCornerRadius: 4,+ axisOrientation: 'horizontal',+ hideXAxis: true,+ hideYAxis: true,+ showGrid: false,+ animateHover: true,+ bandPadding: BAR_PADDING,+ margins: { top: 0, right: 0, bottom: 0, left: GLYPH_COLUMN_WIDTH_PX },+ tooltip: { placement: 'top' },+ }),+ []+ )++ const onPointClick = (clickData: PointClickData<FunnelBarHorizontalSegmentMeta>): void => {+ const meta = clickData.series.meta+ const step = steps[clickData.dataIndex]+ if (!step || !meta) {+ return+ }+ if (meta.isDropOff) {+ openPersonsModalForStep({ step, converted: false })+ return+ }+ if (meta.breakdownIndex != null && step.nested_breakdown?.[meta.breakdownIndex]) {+ openPersonsModalForSeries({+ step,+ series: step.nested_breakdown[meta.breakdownIndex],+ converted: true,+ })+ return+ }+ openPersonsModalForStep({ step, converted: true })+ }++ const renderTooltip = (ctx: TooltipContext<FunnelBarHorizontalSegmentMeta>): JSX.Element | null => (+ <FunnelBarHorizontalTooltip+ context={ctx}+ steps={steps}+ breakdownFilter={breakdownFilter}+ groupTypeLabel={groupTypeLabel}+ showPersonsModal={showPersonsModal}+ />+ )++ if (steps.length === 0) {+ return null+ }++ return (+ <div data-attr="funnel-bar-horizontal" className="w-full p-4">+ {/* eslint-disable-next-line react/forbid-dom-props */}+ <div className="relative flex w-full" style={{ height: steps.length * ROW_HEIGHT_PX }}>+ <BarChart<FunnelBarHorizontalSegmentMeta>+ series={series}+ labels={labels}+ theme={theme}+ config={chartConfig}+ tooltip={renderTooltip}+ onPointClick={interactive ? onPointClick : undefined}+ onError={handleChartError}+ >+ <StepDecorations+ steps={steps}+ funnelsFilter={funnelsFilter}+ aggregationTargetLabel={aggregationTargetLabel}+ isStepOptional={isStepOptional}+ hasOptionalSteps={hasOptionalSteps}+ showPersonsModal={showPersonsModal}+ openPersonsModalForStep={openPersonsModalForStep}+ gapFraction={BAR_PADDING / 2}+ />+ </BarChart>+ </div>+ </div>+ )+}diff --git a/products/product_analytics/frontend/insights/funnels/FunnelBarHorizontalChart/FunnelBarHorizontalTooltip.tsx b/products/product_analytics/frontend/insights/funnels/FunnelBarHorizontalChart/FunnelBarHorizontalTooltip.tsxnew file mode 100644index 000000000000..942d68f1b38f--- /dev/null+++ b/products/product_analytics/frontend/insights/funnels/FunnelBarHorizontalChart/FunnelBarHorizontalTooltip.tsx@@ -0,0 +1,44 @@+import type { TooltipContext } from 'lib/hog-charts'+import { FunnelTooltip } from 'scenes/funnels/FunnelTooltip'++import type { BreakdownFilter } from '~/queries/schema/schema-general'+import type { FunnelStepWithConversionMetrics } from '~/types'++import type { FunnelBarHorizontalSegmentMeta } from './funnelBarHorizontalTransforms'++interface FunnelBarHorizontalTooltipProps {+ context: TooltipContext<FunnelBarHorizontalSegmentMeta>+ steps: FunnelStepWithConversionMetrics[]+ breakdownFilter: BreakdownFilter | null | undefined+ groupTypeLabel: string+ showPersonsModal: boolean+}++export function FunnelBarHorizontalTooltip({+ context,+ steps,+ breakdownFilter,+ groupTypeLabel,+ showPersonsModal,+}: FunnelBarHorizontalTooltipProps): JSX.Element | null {+ const stepIndex = context.dataIndex+ const step = steps[stepIndex]+ const entry = context.seriesData[0]+ if (!step || !entry) {+ return null+ }++ const breakdownIndex = entry.series.meta?.breakdownIndex+ const series =+ breakdownIndex != null && step.nested_breakdown?.[breakdownIndex] ? step.nested_breakdown[breakdownIndex] : step++ return (+ <FunnelTooltip+ showPersonsModal={showPersonsModal}+ stepIndex={stepIndex}+ series={series}+ groupTypeLabel={groupTypeLabel}+ breakdownFilter={breakdownFilter}+ />+ )+}diff --git a/products/product_analytics/frontend/insights/funnels/FunnelBarHorizontalChart/StepDecorations.tsx b/products/product_analytics/frontend/insights/funnels/FunnelBarHorizontalChart/StepDecorations.tsxnew file mode 100644index 000000000000..f79258fc0e9f--- /dev/null+++ b/products/product_analytics/frontend/insights/funnels/FunnelBarHorizontalChart/StepDecorations.tsx@@ -0,0 +1,211 @@+/* eslint-disable react/forbid-dom-props */+import clsx from 'clsx'++import { IconInfinity } from '@posthog/icons'++import { EntityFilterInfo } from 'lib/components/EntityFilterInfo'+import { SeriesGlyph } from 'lib/components/SeriesGlyph'+import { useChartLayout } from 'lib/hog-charts'+import { IconTrendingFlat, IconTrendingFlatDown } from 'lib/lemon-ui/icons'+import { Tooltip } from 'lib/lemon-ui/Tooltip'+import { humanFriendlyDuration } from 'lib/utils'+import { DuplicateStepIndicator } from 'scenes/funnels/FunnelBarHorizontal/DuplicateStepIndicator'+import { FunnelStepMore } from 'scenes/funnels/FunnelStepMore'+import {+ formatConvertedCount,+ formatConvertedPercentage,+ formatDroppedOffCount,+ formatDroppedOffPercentage,+ getTooltipTitleForConverted,+ getTooltipTitleForDroppedOff,+} from 'scenes/funnels/funnelUtils'+import { ValueInspectorButton } from 'scenes/funnels/ValueInspectorButton'+import { getActionFilterFromFunnelStep } from 'scenes/insights/views/Funnels/funnelStepTableUtils'++import type { FunnelsFilter } from '~/queries/schema/schema-general'+import { type FunnelStepWithConversionMetrics, StepOrderValue } from '~/types'++import type { FunnelBarHorizontalSegmentMeta } from './funnelBarHorizontalTransforms'++const GLYPH_HEIGHT_PX = 23++interface StepDecorationsProps {+ steps: FunnelStepWithConversionMetrics[]+ funnelsFilter: FunnelsFilter | null | undefined+ aggregationTargetLabel: { singular: string; plural: string }+ isStepOptional: (step: number) => boolean+ hasOptionalSteps: boolean+ showPersonsModal: boolean+ openPersonsModalForStep: (args: { step: FunnelStepWithConversionMetrics; converted: boolean }) => void+ /** Fraction of each band reserved for gap. Header and metadata rows each occupy half this gap. */+ gapFraction: number+}++export function StepDecorations({+ steps,+ funnelsFilter,+ aggregationTargetLabel,+ isStepOptional,+ hasOptionalSteps,+ showPersonsModal,+ openPersonsModalForStep,+ gapFraction,+}: StepDecorationsProps): JSX.Element {+ const layout = useChartLayout<FunnelBarHorizontalSegmentMeta>()+ const { plotTop, plotLeft, plotHeight, plotWidth } = layout.dimensions+ const rowHeight = steps.length > 0 ? plotHeight / steps.length : 0++ return (+ <>+ {steps.map((step, stepIndex) => {+ const rowTop = plotTop + stepIndex * rowHeight+ const isOptional = isStepOptional(stepIndex + 1)+ const isFirstStep = stepIndex === 0+ const isUnordered = funnelsFilter?.funnelOrderType === StepOrderValue.UNORDERED+ const gapHeight = rowHeight * gapFraction++ const dimRow = isOptional ? 'opacity-60' : ''++ const halfGlyph = `${GLYPH_HEIGHT_PX / 2}px`+ const lineStyle = {+ position: 'absolute' as const,+ left: 'calc(50% - 1px)',+ width: '2px',+ borderRight: '2px solid var(--color-border-primary)',+ opacity: 0.5,+ }++ return (+ <div+ key={step.order}+ style={{ position: 'absolute', top: rowTop, left: 0, width: '100%', height: rowHeight }}+ className="pointer-events-none [&_[role=button]]:pointer-events-auto [&_a]:pointer-events-auto [&_button]:pointer-events-auto"+ >+ <div+ style={{ position: 'absolute', top: 0, left: 0, width: plotLeft, height: rowHeight }}+ className={clsx('flex flex-col items-center justify-center', isOptional && 'opacity-70')}+ >+ {stepIndex > 0 && (+ <div style={{ ...lineStyle, top: 0, height: `calc(50% - ${halfGlyph})` }} />+ )}+ {isOptional && hasOptionalSteps && (+ <div className="absolute top-0 left-[calc(50%-1px)] w-[2px] h-full bg-[var(--color-border-primary)] opacity-50 z-[1]" />+ )}+ {isOptional && (+ <div className="absolute top-[calc(50%-1px)] left-[calc(50%-1px)] w-6 h-[2px] bg-[var(--color-border-primary)] opacity-50" />+ )}+ <div+ className={clsx('relative z-10 select-none', isOptional && 'ml-6')}+ style={{ pointerEvents: 'auto' }}+ >+ <SeriesGlyph variant="funnel-step-glyph">+ {isUnordered ? (+ <IconInfinity style={{ fill: 'var(--primary_alt)', width: 14 }} />+ ) : (+ step.order + 1+ )}+ </SeriesGlyph>+ </div>+ {stepIndex < steps.length - 1 && (+ <div style={{ ...lineStyle, top: `calc(50% + ${halfGlyph})`, bottom: 0 }} />+ )}+ </div>++ <header+ style={{+ position: 'absolute',+ top: 0,+ left: plotLeft,+ width: plotWidth,+ height: gapHeight,+ }}+ className={clsx('flex flex-wrap items-center justify-between leading-5', dimRow)}+ >+ <div className="flex items-center max-w-full grow">+ <div className="overflow-hidden font-bold break-words whitespace-normal">+ {isUnordered ? (+ <span>Completed {step.order + 1} steps</span>+ ) : (+ <EntityFilterInfo filter={getActionFilterFromFunnelStep(step)} allowWrap />+ )}+ </div>+ {isOptional ? <div className="ml-1 text-xs">(optional)</div> : null}+ {!isUnordered && stepIndex > 0 && step.action_id === steps[stepIndex - 1].action_id && (+ <DuplicateStepIndicator />+ )}+ <FunnelStepMore stepIndex={stepIndex} />+ </div>+ {step.average_conversion_time && step.average_conversion_time >= Number.EPSILON ? (+ <div+ className="text-secondary text-xs"+ title="Average time of conversion from previous step"+ >+ Avg time:{' '}+ <b>{humanFriendlyDuration(step.average_conversion_time, { maxUnits: 2 })}</b>+ </div>+ ) : null}+ </header>++ <div+ style={{+ position: 'absolute',+ top: rowHeight - gapHeight,+ left: plotLeft,+ width: plotWidth,+ height: gapHeight,+ }}+ className={clsx('flex flex-wrap items-center gap-2 leading-5', dimRow)}+ >+ <Tooltip+ title={getTooltipTitleForConverted(funnelsFilter, aggregationTargetLabel, stepIndex)}+ placement="bottom"+ >+ <ValueInspectorButton+ onClick={+ showPersonsModal+ ? () => openPersonsModalForStep({ step, converted: true })+ : undefined+ }+ >+ <IconTrendingFlat+ style={{ color: 'var(--success)' }}+ className="mr-1 text-xl align-bottom"+ />+ <b>{formatConvertedCount(step, aggregationTargetLabel)}</b>+ </ValueInspectorButton>{' '}+ {!isFirstStep && (+ <span className="text-secondary grow">+ {`(${formatConvertedPercentage(step)}) completed step`}+ </span>+ )}+ </Tooltip>+ {!isFirstStep && (+ <Tooltip+ title={getTooltipTitleForDroppedOff(funnelsFilter, aggregationTargetLabel)}+ placement="bottom"+ >+ <ValueInspectorButton+ onClick={+ showPersonsModal+ ? () => openPersonsModalForStep({ step, converted: false })+ : undefined+ }+ >+ <IconTrendingFlatDown+ style={{ color: 'var(--danger)' }}+ className="mr-1 text-xl align-bottom"+ />+ <b>{formatDroppedOffCount(step, aggregationTargetLabel)}</b>+ </ValueInspectorButton>{' '}+ <span className="text-secondary">+ {`(${formatDroppedOffPercentage(step)}) dropped off`}+ </span>+ </Tooltip>+ )}+ </div>+ </div>+ )+ })}+ </>+ )+}diff --git a/products/product_analytics/frontend/insights/funnels/FunnelBarHorizontalChart/funnelBarHorizontalTransforms.ts b/products/product_analytics/frontend/insights/funnels/FunnelBarHorizontalChart/funnelBarHorizontalTransforms.tsindex 15b128901b52..8610d676efe1 100644--- a/products/product_analytics/frontend/insights/funnels/FunnelBarHorizontalChart/funnelBarHorizontalTransforms.ts+++ b/products/product_analytics/frontend/insights/funnels/FunnelBarHorizontalChart/funnelBarHorizontalTransforms.ts@@ -47,7 +47,9 @@ export function buildFunnelBarHorizontalData(return { series: [], labels: [] }}- const labels = steps.map((step) => step.name)+ // Band keys must be unique — funnels often repeat the same event, so step names collide and+ // d3.scaleBand would collapse them into one band. The visible step names come from StepDecorations.+ const labels = steps.map((_, stepIndex) => String(stepIndex))if (isBreakdownLayout(steps)) {return { series: buildBreakdownSeries(steps, options), labels }