diff --git a/assets/js/dashboard/extra/exploration.js b/assets/js/dashboard/extra/exploration.js index 09aecc2467e3..635fc5aeb945 100644 --- a/assets/js/dashboard/extra/exploration.js +++ b/assets/js/dashboard/extra/exploration.js @@ -342,13 +342,14 @@ function CandidateCard({ onSelect }) { const isCustomEvent = step.name !== 'pageview' + const isGoal = step.is_goal const visitorsToShow = isSelected && selectedVisitors !== null ? selectedVisitors : visitors const barWidth = isSelected && selectedConversionRate !== null - ? selectedConversionRate - : Math.round((visitors / stepMaxVisitors) * 100) + ? Math.max(1, selectedConversionRate) + : Math.max(1, Math.round((visitors / stepMaxVisitors) * 100)) const textColor = isDimmed ? 'text-gray-400 dark:text-gray-500 group-hover:text-gray-600 dark:group-hover:text-gray-400' @@ -389,9 +390,9 @@ function CandidateCard({ : step.label } > - {isCustomEvent && ( + {(isCustomEvent || isGoal) && ( )} @@ -412,9 +413,7 @@ function CandidateCard({ - - {numberShortFormatter(visitorsToShow)} - + @@ -422,6 +421,22 @@ function CandidateCard({ ) } +function VisitorsMetric({ visitors }) { + const shortNumber = numberShortFormatter(visitors) + const longNumber = numberLongFormatter(visitors) + const showTooltip = shortNumber !== longNumber + + if (showTooltip) { + return ( + + {shortNumber} + + ) + } else { + return shortNumber + } +} + function ColumnEmptyState({ active, filter, colIndex, direction }) { if (!active) { const prompt =