feat(analytics): cross-filter hover between chart, countries, and files - #465
Draft
alukach wants to merge 8 commits into
Draft
feat(analytics): cross-filter hover between chart, countries, and files#465alukach wants to merge 8 commits into
alukach wants to merge 8 commits into
Conversation
Hovering a bar on the product downloads chart now narrows the by-country list and top-files table to that UTC day, matching the stats row. The breakdown fetch gains a second query wave scoped to the window's top countries/files via IN (bounded rows), keyed by ISO day so independently cached grids can't misalign. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Claude finished @alukach's task in 4m 46s —— View job Review of PR #465
✅ No blocking issues — safe to merge. Traced the cross-filter/pin logic end-to-end (hover/pin state →
Minor, non-blocking note: the new pin interactions (chart bar click, country row click, file row click) are mouse-only — no |
Hovering a country or file now narrows the other panels too: the chart shows that slice's daily series, and the opposite list re-ranks to its values via a bounded country-x-file cross query. Hovered slices sort the country/file lists descending (a list never re-sorts on its own hover, so rows can't shuffle under the cursor). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The Downloads / Daily avg / Data served / Countries stats now update for a hovered country or file (window queries gain per-country bytes and per-file distinct-country counts). Clicking a country/file row pins that slice: the chart and stats stay scoped to it, and hovering a chart day then reads that day's values within the pin. Clicking again unpins; hovering another row previews it over the pin. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Reconciles the table with the file-traffic total: a footer row shows the distinct-file count, requests, and bytes outside the top list, making long-tail traffic (e.g. bulk mirrors) visible instead of alarming. The remainder is window-wide only, so it blanks to an em dash while a day/country slice re-values the table. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Hovering the opposite type of an active pin no longer replaces the pin (which snapped both lists back to window values and re-sorted them under the cursor). The pin keeps scoping the lists and chart; the stats row narrows to pin ∩ hover from the country×file cross data, and the caption shows both. Same-type hover still previews that row. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Pinning a country and hovering a file (or vice versa) now redraws the chart with that intersection's daily series. Two more bounded queries fetch the day-x-country-x-file cube for the top 5 countries x top 10 files plus an others-x-file-x-day aggregate, nested under each file's byCountry/otherCountries entries. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replace the single pin with one pin per dimension, toggled by clicking a row or a chart bar; pins compose into an intersection filter (all combos are served by the existing cross/cube data). A hover substitutes for its own dimension's pin while the cursor is there, so sweeping rows previews siblings without dropping the other pins. This also collapses the special-cased slice/cross logic into one effective-filter model. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Pins get their own persistent line above the chart (green square, 'PINNED: …' with the pinned country/file/date), and the line below is purely transient hover state (hovered date or row preview), so the two no longer overwrite each other in the same slot. Co-Authored-By: Claude Fable 5 <noreply@anthropic.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.
Hovering any of the three product-analytics panels narrows the other two to that slice, and clicking pins a slice for deeper interrogation:
How
getProductBreakdownsruns a second query wave after the window ranking, scoped to the top entries withIN (…)— bounded row counts, no 10k-cap risk: per-day series (requests + bytes) for countries/others/files, a single country×file cross query (≤ 5×10 rows) serving both hover directions, and an others-per-file aggregate. Window queries also gain per-country bytes and per-fileCOUNT(DISTINCT blob6)so the stats row can follow non-day slices.UsagePoint.date) rather than array index, so the independently cached usage grid and breakdowns can never misalign.ProductAnalyticsViewholds one hover state (day | country | file) plus a pinned slice; each panel derives its shown values from them.HoverCaptiongains an optionalfilterLabel.Testing
byDay/byCountry/otherCountriesconstruction and the quotedIN/NOT INclauses.tsc --noEmit, lint, and all analytics suites green (29 tests).IN-list SQL follows AE's documented syntax but couldn't be run against live AE locally.🤖 Generated with Claude Code