Repository navigation
feat(charts): add funnel, retention, and journey visualizations - #57
Merged
Merged
Conversation
redox
approved these changes
Oct 9, 2026
Merged
Comment on lines
+13
to
+15
| export function formatAnalyticsValue(value: number) { | ||
| return new Intl.NumberFormat().format(value); | ||
| } |
Member
There was a problem hiding this comment.
We should clean this up and move to our existing helpers. Also, what's an "analytics value"? Prob needs more semantic meaning
Comment on lines
+21
to
+22
| import { chartBarFill } from '@/src/react/ui/chartColor'; | ||
| export { chartBarFill } from '@/src/react/ui/chartColor'; |
Member
There was a problem hiding this comment.
Prob need to clean up our exports so entry paths aren't duplicated.
| * Defaults match the shared bar or accent-colored series primitives. */ | ||
| function ChartLegendMarker({ | ||
| kind, | ||
| kind = 'square', |
Member
There was a problem hiding this comment.
We should perhaps force the agent to pass a deliberate value instead of lazily fall back.
| className, | ||
| formatValue = formatAnalyticsValue, | ||
| }: FunnelChartProps) { | ||
| const chartId = useId().replace(/[^a-zA-Z0-9_-]/g, ''); |
Member
There was a problem hiding this comment.
Could extract to a Hook to provide as an API.
| cancelClear(); | ||
| clearTimer.current = setTimeout(() => setHighlighted(null), 100); | ||
| } | ||
| validateAnalyticsIds('funnel step', steps); |
Member
There was a problem hiding this comment.
Hiding a direct call to invariant() doesn't seem like a good pattern
Comment on lines
+49
to
+56
| const label = | ||
| outcome === 'truncated' | ||
| ? 'More steps' | ||
| : outcome === 'drop-off' | ||
| ? 'Drop-off' | ||
| : outcome === 'converted' | ||
| ? 'Converted' | ||
| : 'End of path'; |
Member
There was a problem hiding this comment.
Should be derived from outcome, right?
robinvrd
added a commit
that referenced
this pull request
Oct 9, 2026
Addresses the remaining review feedback from #57: - Remove committed screenshots ([comment](#57 (comment))). - Reuse `formatNumber()` and `formatPercent()`, replace the generic analytics helpers, and call `invariant()` directly ([formatting](#57 (comment)), [validation](#57 (comment))). - Import `chartBarFill` from its owning module without a duplicate re-export ([comment](#57 (comment))). - Require an explicit legend marker kind; built-in charts retain square markers ([comment](#57 (comment))). - Expose `useSvgId()` and use it for funnel definitions ([comment](#57 (comment))). - Derive terminal labels through an outcome mapping ([comment](#57 (comment))). Breaking API change: `<ChartLegend.Marker>` requires `kind`; pass `kind="square"` for the shared chart styling. Validation: `bun run check` passes, including 177 tests, published declarations, package verification, and starter checks.
leonkenneth
pushed a commit
that referenced
this pull request
Oct 9, 2026
🤖 I have created a release *beep* *boop* --- ## [0.68.0](v0.67.0...v0.68.0) (2026-10-09) ### ⚠ BREAKING CHANGES * **charts:** apply post-merge review feedback ([#59](#59)) ### Features * **charts:** add funnel, retention, and journey visualizations ([#57](#57)) ([48e8e44](48e8e44)) ### Bug Fixes * **charts:** apply post-merge review feedback ([#59](#59)) ([8789d8e](8789d8e)) * **worker:** accept any hyphenated preview host label ([#61](#61)) ([28f0bc2](28f0bc2)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds FunnelChart, RetentionChart, and JourneyChart with typed product analytics inputs, adapted from the frontend visualizations and composed through the existing widget workflow.
Includes portion-specific funnel inspection, incomplete retention tails, expandable journey branches, shared square markers, and pointer focus handling. Adds gallery examples and concise API guidance.
Validation:
bun run checkpasses, including 156 tests, package verification, and starter checks. Visually checked desktop and phone layouts in both themes.Funnel and retention
Journey