diff --git a/docs/src/examples/catalog/Axis.json b/docs/src/examples/catalog/Axis.json index c6a20ce635..e5be72c98b 100644 --- a/docs/src/examples/catalog/Axis.json +++ b/docs/src/examples/catalog/Axis.json @@ -4228,6 +4228,27 @@ "lineNumber": 37, "line": "" }, + { + "example": "college-football-upsets", + "component": "Image", + "path": "/docs/components/Image/college-football-upsets", + "lineNumber": 158, + "line": "" + }, + { + "example": "college-football-upsets", + "component": "Image", + "path": "/docs/components/Image/college-football-upsets", + "lineNumber": 159, + "line": "" + }, + { + "example": "college-football-upsets", + "component": "Image", + "path": "/docs/components/Image/college-football-upsets", + "lineNumber": 160, + "line": " `#${d}`} />" + }, { "example": "country-flags", "component": "Image", @@ -4361,18 +4382,46 @@ "lineNumber": 13, "line": "" }, + { + "example": "bump-sports-rankings", + "component": "LineChart", + "path": "/docs/components/LineChart/bump-sports-rankings", + "lineNumber": 206, + "line": "" + }, + { + "example": "bump-sports-rankings", + "component": "LineChart", + "path": "/docs/components/LineChart/bump-sports-rankings", + "lineNumber": 207, + "line": "" + }, + { + "example": "bump-sports-rankings", + "component": "LineChart", + "path": "/docs/components/LineChart/bump-sports-rankings", + "lineNumber": 208, + "line": " `#${d}`} />" + }, + { + "example": "bump-sports-rankings", + "component": "LineChart", + "path": "/docs/components/LineChart/bump-sports-rankings", + "lineNumber": 209, + "line": "" }, { "example": "bump-state-population-ranks", "component": "LineChart", "path": "/docs/components/LineChart/bump-state-population-ranks", - "lineNumber": 113, + "lineNumber": 117, "line": "" }, { @@ -5902,5 +5951,5 @@ "line": "" }, + { + "example": "bump-sports-rankings", + "component": "LineChart", + "path": "/docs/components/LineChart/bump-sports-rankings", + "lineNumber": 183, + "line": "" }, + { + "example": "bump-sports-rankings", + "component": "LineChart", + "path": "/docs/components/LineChart/bump-sports-rankings", + "lineNumber": 231, + "line": "" } ], - "updatedAt": "2026-10-16T16:15:13.291Z" + "updatedAt": "2026-10-19T19:57:16.344Z" } \ No newline at end of file diff --git a/docs/src/examples/catalog/Group.json b/docs/src/examples/catalog/Group.json index 4c39d3b875..ee8edca522 100644 --- a/docs/src/examples/catalog/Group.json +++ b/docs/src/examples/catalog/Group.json @@ -271,6 +271,20 @@ "lineNumber": 33, "line": "" }, + { + "example": "college-football-upsets", + "component": "Image", + "path": "/docs/components/Image/college-football-upsets", + "lineNumber": 166, + "line": "" + }, + { + "component": "Axis", + "lineNumber": 158, + "line": "" + }, + { + "component": "Group", + "lineNumber": 166, + "line": "" + } + ], + "description": "Every game involving a ranked team, placed at the team", + "createdAt": "2026-10-19T19:53:08.000Z", + "updatedAt": "2026-10-19T19:53:08.000Z" + }, { "name": "country-flags", "title": "country flags", @@ -210,6 +255,20 @@ "lineNumber": 85, "line": "" }, + { + "example": "college-football-upsets", + "component": "Image", + "path": "/docs/components/Image/college-football-upsets", + "lineNumber": 157, + "line": "" + }, { "example": "country-flags", "component": "Image", @@ -2986,11 +2993,18 @@ "lineNumber": 7, "line": "" }, + { + "example": "bump-sports-rankings", + "component": "LineChart", + "path": "/docs/components/LineChart/bump-sports-rankings", + "lineNumber": 196, + "line": "" + }, { "example": "bump-state-population-ranks", "component": "LineChart", "path": "/docs/components/LineChart/bump-state-population-ranks", - "lineNumber": 102, + "lineNumber": 106, "line": "" }, { @@ -4562,5 +4576,5 @@ "line": "" } ], - "updatedAt": "2026-10-16T16:15:14.129Z" + "updatedAt": "2026-10-19T19:57:17.329Z" } \ No newline at end of file diff --git a/docs/src/examples/catalog/LineChart.json b/docs/src/examples/catalog/LineChart.json index 314b77cc8c..43aeef92c4 100644 --- a/docs/src/examples/catalog/LineChart.json +++ b/docs/src/examples/catalog/LineChart.json @@ -57,49 +57,104 @@ "createdAt": "2026-03-31T15:09:10.000Z", "updatedAt": "2026-04-12T21:37:32.000Z" }, + { + "name": "bump-sports-rankings", + "title": "Bump chart (sports rankings)", + "path": "/docs/components/LineChart/bump-sports-rankings", + "components": [ + { + "component": "Chart", + "lineNumber": 183, + "line": "" + }, + { + "component": "LinearGradient", + "lineNumber": 197, + "line": "" + }, + { + "component": "Group", + "lineNumber": 218, + "line": "" + } + ], + "description": "Weekly AP Top 25 poll for a college football or basketball season", + "createdAt": "2026-10-19T19:53:08.000Z", + "updatedAt": "2026-10-19T19:53:08.000Z" + }, { "name": "bump-state-population-ranks", - "title": "bump state population ranks", + "title": "Bump chart (state population)", "path": "/docs/components/LineChart/bump-state-population-ranks", "components": [ { "component": "Chart", - "lineNumber": 91, + "lineNumber": 95, "line": "" }, { "component": "LinearGradient", - "lineNumber": 103, + "lineNumber": 107, "line": "" }, { "component": "Spline", - "lineNumber": 123, + "lineNumber": 127, "line": "" }, + { + "example": "bump-sports-rankings", + "component": "LineChart", + "path": "/docs/components/LineChart/bump-sports-rankings", + "lineNumber": 197, + "line": "" } ], - "updatedAt": "2026-09-03T20:00:07.738Z" + "updatedAt": "2026-10-19T19:57:17.437Z" } \ No newline at end of file diff --git a/docs/src/examples/catalog/Rect.json b/docs/src/examples/catalog/Rect.json index 473044e839..0b56fa7e68 100644 --- a/docs/src/examples/catalog/Rect.json +++ b/docs/src/examples/catalog/Rect.json @@ -379,6 +379,13 @@ "lineNumber": 367, "line": "" } ], - "updatedAt": "2026-10-16T16:15:15.002Z" + "updatedAt": "2026-10-19T19:57:18.028Z" } \ No newline at end of file diff --git a/docs/src/examples/catalog/Text.json b/docs/src/examples/catalog/Text.json index 072589a617..e665555526 100644 --- a/docs/src/examples/catalog/Text.json +++ b/docs/src/examples/catalog/Text.json @@ -779,7 +779,7 @@ "example": "bump-state-population-ranks", "component": "LineChart", "path": "/docs/components/LineChart/bump-state-population-ranks", - "lineNumber": 160, + "lineNumber": 164, "line": "" }, + { + "example": "college-football-upsets", + "component": "Image", + "path": "/docs/components/Image/college-football-upsets", + "lineNumber": 198, + "line": "" + }, + { + "example": "college-football-upsets", + "component": "Image", + "path": "/docs/components/Image/college-football-upsets", + "lineNumber": 201, + "line": "" + }, + { + "example": "college-football-upsets", + "component": "Image", + "path": "/docs/components/Image/college-football-upsets", + "lineNumber": 207, + "line": "" + }, + { + "example": "bump-sports-rankings", + "component": "LineChart", + "path": "/docs/components/LineChart/bump-sports-rankings", + "lineNumber": 251, + "line": "" + }, + { + "example": "bump-sports-rankings", + "component": "LineChart", + "path": "/docs/components/LineChart/bump-sports-rankings", + "lineNumber": 258, + "line": "" + }, + { + "example": "bump-sports-rankings", + "component": "LineChart", + "path": "/docs/components/LineChart/bump-sports-rankings", + "lineNumber": 264, + "line": "" + }, + { + "example": "bump-sports-rankings", + "component": "LineChart", + "path": "/docs/components/LineChart/bump-sports-rankings", + "lineNumber": 265, + "line": "" + }, + { + "example": "bump-sports-rankings", + "component": "LineChart", + "path": "/docs/components/LineChart/bump-sports-rankings", + "lineNumber": 266, + "line": "" + }, + { + "example": "bump-sports-rankings", + "component": "LineChart", + "path": "/docs/components/LineChart/bump-sports-rankings", + "lineNumber": 268, + "line": "" + }, + { + "example": "bump-sports-rankings", + "component": "LineChart", + "path": "/docs/components/LineChart/bump-sports-rankings", + "lineNumber": 272, + "line": "" + }, + { + "example": "bump-sports-rankings", + "component": "LineChart", + "path": "/docs/components/LineChart/bump-sports-rankings", + "lineNumber": 274, + "line": "" + }, + { + "example": "bump-sports-rankings", + "component": "LineChart", + "path": "/docs/components/LineChart/bump-sports-rankings", + "lineNumber": 296, + "line": "" + }, { "example": "custom", "component": "LineChart", @@ -8295,5 +8379,5 @@ "line": "" } ], - "updatedAt": "2026-10-16T16:15:15.158Z" + "updatedAt": "2026-10-19T19:57:18.171Z" } \ No newline at end of file diff --git a/docs/src/examples/components/Image/college-football-upsets.svelte b/docs/src/examples/components/Image/college-football-upsets.svelte new file mode 100644 index 0000000000..5fc6ae6c5f --- /dev/null +++ b/docs/src/examples/components/Image/college-football-upsets.svelte @@ -0,0 +1,242 @@ + + + + + { + if (e.key === 'Shift') hideTooltip = true; + }} + onkeyup={(e) => { + if (e.key === 'Shift') hideTooltip = false; + }} + onblur={() => (hideTooltip = false)} +/> + + + data.season, + (v) => { + if (v !== data.season) season = v; + } + } + clearable={false} + toggleIcon={null} + stepper + /> + + {#each Object.values(styles) as style (style.label)} + + + {style.label} + + {/each} + {upsetCount} upsets + + + + + {#snippet children({ context })} + {@const highlightId = context.tooltip.data?.game.id} + + + + `#${d}`} /> + + {#each cells as cell (cell.game.id + cell.team.id)} + {@const x = context.xScale(cell.week) ?? 0} + {@const y = context.yScale(cell.rank)} + {@const style = cellStyle(cell)} + + + + + + {/each} + + + {#if !hideTooltip} + + {#snippet children({ data: cell })} + {@const result = cell.team.result} + + + + {cell.team.name} (#{cell.rank}) + + + + + {#if result} + + {result} + + {cell.team.score}-{cell.opponent.score} + {:else} + {cell.game.status} + {/if} + vs + + {cell.opponent.abbreviation} + {cell.opponent.rank ? `(#${cell.opponent.rank})` : ''} + + {#if cell.upset} + + Upset + + {/if} + + + Hold Shift to hide tooltip + + {/snippet} + + {/if} + {/snippet} + diff --git a/docs/src/examples/components/LineChart/bump-sports-rankings.svelte b/docs/src/examples/components/LineChart/bump-sports-rankings.svelte new file mode 100644 index 0000000000..0ff034dd4c --- /dev/null +++ b/docs/src/examples/components/LineChart/bump-sports-rankings.svelte @@ -0,0 +1,308 @@ + + + + + { + if (e.key === 'Shift') hideTooltip = true; + }} + onkeyup={(e) => { + if (e.key === 'Shift') hideTooltip = false; + }} + onblur={() => (hideTooltip = false)} +/> + + + sport, + (v) => { + sport = v; + season = undefined; + } + } + clearable={false} + toggleIcon={null} + stepper + /> + data.season, + (v) => { + if (v !== data.season) season = v; + } + } + clearable={false} + toggleIcon={null} + stepper + /> + + +AP Top 25 + + + {#snippet children({ context })} + {@const highlightId = context.tooltip.data?.teamId} + + + + + + + `#${d}`} /> + finalAbbreviations.get(d) ?? ''} + /> + + {#each teamsInDrawOrder(highlightId) as team (team.id)} + {@const segments = teamSegments(team.id)} + {@const ranks = segments.flat()} + + {#each segments as segment, i (i)} + + {/each} + + + + {/each} + + + {#if !hideTooltip} + + {#snippet children({ data: d })} + {@const team = teamsById.get(d.teamId)} + {@const gameWindow = pollWindow(d.week)} + {@const games = gameWindow + ? getTeamGames({ sport, season: data.season, teamId: d.teamId }) + : undefined} + + + + {team?.name} + + + + + + {#if d.record} + + {/if} + + {#if gameWindow && games && !games.error} + + {#if games.current == null} + + {:else} + {#each gamesInWindow(games.current, gameWindow) as game (game.id)} + + {#if game.result} + + {game.result} + + {game.score}-{game.opponentScore} + {:else} + {game.status} + {/if} + {game.home || game.neutralSite ? 'vs' : '@'} + + {opponentLabel(game)} + + {:else} + + {/each} + {/if} + {/if} + + + Hold Shift to hide tooltip + + {/snippet} + + {/if} + {/snippet} + diff --git a/docs/src/examples/components/LineChart/bump-state-population-ranks.svelte b/docs/src/examples/components/LineChart/bump-state-population-ranks.svelte index 1b939639d3..2ce2921369 100644 --- a/docs/src/examples/components/LineChart/bump-state-population-ranks.svelte +++ b/docs/src/examples/components/LineChart/bump-state-population-ranks.svelte @@ -1,3 +1,7 @@ + +