@sportsdataverse/sdvplot 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE.md +109 -0
  3. package/README.md +984 -2
  4. package/dist/_web-D7Aa5Rd8.d.ts +69 -0
  5. package/dist/aaf-GJ3SH34T.js +13 -0
  6. package/dist/aaf-HCYN5T6Y.js +37 -0
  7. package/dist/aaf-ZAE5KS2Y.js +13 -0
  8. package/dist/ahl-E66MDVCU.js +66 -0
  9. package/dist/ahl-NPQQWZEV.js +249 -0
  10. package/dist/ahl-QRDU73XX.js +309 -0
  11. package/dist/axis-CraWQRUJ.d.ts +49 -0
  12. package/dist/bins.d.ts +174 -0
  13. package/dist/bins.js +4 -0
  14. package/dist/bins.js.map +1 -0
  15. package/dist/cfb-F42SVS4X.js +5000 -0
  16. package/dist/cfb-P3SHEYRZ.js +692 -0
  17. package/dist/cfb-WXRZANLP.js +10226 -0
  18. package/dist/chartjs-surface.d.ts +42 -0
  19. package/dist/chartjs-surface.js +65 -0
  20. package/dist/chartjs-surface.js.map +1 -0
  21. package/dist/chartjs.d.ts +162 -0
  22. package/dist/chartjs.js +342 -0
  23. package/dist/chartjs.js.map +1 -0
  24. package/dist/chunk-4C3GX6QO.js +92 -0
  25. package/dist/chunk-4C3GX6QO.js.map +1 -0
  26. package/dist/chunk-57WFSI4Q.js +128 -0
  27. package/dist/chunk-57WFSI4Q.js.map +1 -0
  28. package/dist/chunk-7ULOCCFL.js +313 -0
  29. package/dist/chunk-7ULOCCFL.js.map +1 -0
  30. package/dist/chunk-AMXASQHT.js +120 -0
  31. package/dist/chunk-AMXASQHT.js.map +1 -0
  32. package/dist/chunk-B2MP37SR.js +175 -0
  33. package/dist/chunk-B2MP37SR.js.map +1 -0
  34. package/dist/chunk-C2CDY5OG.js +137 -0
  35. package/dist/chunk-C2CDY5OG.js.map +1 -0
  36. package/dist/chunk-DYMUVE6K.js +127 -0
  37. package/dist/chunk-DYMUVE6K.js.map +1 -0
  38. package/dist/chunk-E7G7VSLV.js +43 -0
  39. package/dist/chunk-E7G7VSLV.js.map +1 -0
  40. package/dist/chunk-H2C3FMMA.js +300 -0
  41. package/dist/chunk-H2C3FMMA.js.map +1 -0
  42. package/dist/chunk-J4P4HDBF.js +175 -0
  43. package/dist/chunk-J4P4HDBF.js.map +1 -0
  44. package/dist/chunk-J6R2LEJ7.js +58 -0
  45. package/dist/chunk-J6R2LEJ7.js.map +1 -0
  46. package/dist/chunk-M3XD2OSN.js +132 -0
  47. package/dist/chunk-M3XD2OSN.js.map +1 -0
  48. package/dist/chunk-OIILARXI.js +30 -0
  49. package/dist/chunk-OIILARXI.js.map +1 -0
  50. package/dist/chunk-RPVVJY74.js +170 -0
  51. package/dist/chunk-RPVVJY74.js.map +1 -0
  52. package/dist/chunk-UL5M6KDE.js +205 -0
  53. package/dist/chunk-UL5M6KDE.js.map +1 -0
  54. package/dist/chunk-WQT4IVLX.js +10 -0
  55. package/dist/chunk-WQT4IVLX.js.map +1 -0
  56. package/dist/chunk-ZAEQXFJM.js +556 -0
  57. package/dist/chunk-ZAEQXFJM.js.map +1 -0
  58. package/dist/cricket-KPCYG2HL.js +493 -0
  59. package/dist/cricket-NDXLE25B.js +116 -0
  60. package/dist/cricket-YUUF7P6M.js +160 -0
  61. package/dist/cytoscape.d.ts +188 -0
  62. package/dist/cytoscape.js +219 -0
  63. package/dist/cytoscape.js.map +1 -0
  64. package/dist/d3.d.ts +234 -0
  65. package/dist/d3.js +198 -0
  66. package/dist/d3.js.map +1 -0
  67. package/dist/deckgl.d.ts +232 -0
  68. package/dist/deckgl.js +197 -0
  69. package/dist/deckgl.js.map +1 -0
  70. package/dist/echarts.d.ts +121 -0
  71. package/dist/echarts.js +228 -0
  72. package/dist/echarts.js.map +1 -0
  73. package/dist/echl-3CR4RGFC.js +241 -0
  74. package/dist/echl-NPC32C23.js +107 -0
  75. package/dist/echl-PI33DGJC.js +64 -0
  76. package/dist/export.d.ts +130 -0
  77. package/dist/export.js +258 -0
  78. package/dist/export.js.map +1 -0
  79. package/dist/g2.d.ts +251 -0
  80. package/dist/g2.js +102 -0
  81. package/dist/g2.js.map +1 -0
  82. package/dist/headshots-B2J_LOO8.d.ts +40 -0
  83. package/dist/index.d.ts +183 -0
  84. package/dist/index.js +9 -0
  85. package/dist/index.js.map +1 -0
  86. package/dist/interact.d.ts +567 -0
  87. package/dist/interact.js +809 -0
  88. package/dist/interact.js.map +1 -0
  89. package/dist/lightweight-charts.d.ts +217 -0
  90. package/dist/lightweight-charts.js +155 -0
  91. package/dist/lightweight-charts.js.map +1 -0
  92. package/dist/maplibre.d.ts +271 -0
  93. package/dist/maplibre.js +175 -0
  94. package/dist/maplibre.js.map +1 -0
  95. package/dist/marks-DH-tQIP-.d.ts +75 -0
  96. package/dist/mbb-3TRLVW3H.js +3619 -0
  97. package/dist/mbb-DQUHCHZP.js +5111 -0
  98. package/dist/mbb-PRAIO2P5.js +371 -0
  99. package/dist/milb-6IQ6NCEW.js +291 -0
  100. package/dist/milb-EYY5MD4T.js +1752 -0
  101. package/dist/milb-EYZ4SZLI.js +797 -0
  102. package/dist/mlb-4PBUJSVQ.js +35 -0
  103. package/dist/mlb-FHPY3GQJ.js +701 -0
  104. package/dist/mlb-REVGL3N2.js +665 -0
  105. package/dist/mui.d.ts +338 -0
  106. package/dist/mui.js +184 -0
  107. package/dist/mui.js.map +1 -0
  108. package/dist/nba-ATT775GS.js +485 -0
  109. package/dist/nba-LKM4UHVU.js +482 -0
  110. package/dist/nba-YX7PXM3R.js +35 -0
  111. package/dist/nbagl-3WGZCZ4S.js +37 -0
  112. package/dist/nbagl-LP4XJRAL.js +229 -0
  113. package/dist/nbagl-VTTOU7LN.js +499 -0
  114. package/dist/ncaa_baseball-UV75LNVR.js +2670 -0
  115. package/dist/ncaa_baseball-VD5J5C72.js +419 -0
  116. package/dist/ncaa_baseball-YRBS32D6.js +4592 -0
  117. package/dist/ncaa_mhockey-IMYHS7QS.js +1033 -0
  118. package/dist/ncaa_mhockey-TXTKWHE3.js +115 -0
  119. package/dist/ncaa_mhockey-U3MFW5VT.js +663 -0
  120. package/dist/ncaa_softball-6WR6KS64.js +420 -0
  121. package/dist/ncaa_softball-RZCTIE56.js +2654 -0
  122. package/dist/ncaa_softball-VOD4PVGY.js +4599 -0
  123. package/dist/ncaa_whockey-6XXGUTBK.js +607 -0
  124. package/dist/ncaa_whockey-AKKYKY67.js +53 -0
  125. package/dist/ncaa_whockey-KBEKXFBB.js +293 -0
  126. package/dist/nfl-BDB2HYAR.js +625 -0
  127. package/dist/nfl-EHYHDLJD.js +37 -0
  128. package/dist/nfl-VF4NJCHY.js +514 -0
  129. package/dist/nfl_gsis-UY64JO37.js +4 -0
  130. package/dist/nhl-6WPHME7H.js +511 -0
  131. package/dist/nhl-EMIJFZHY.js +884 -0
  132. package/dist/nhl-ISFUKRFU.js +37 -0
  133. package/dist/nivo.d.ts +193 -0
  134. package/dist/nivo.js +8 -0
  135. package/dist/nivo.js.map +1 -0
  136. package/dist/ohl-2FEM554G.js +113 -0
  137. package/dist/ohl-C5Q4W6JB.js +32 -0
  138. package/dist/ohl-TQ4J46VC.js +66 -0
  139. package/dist/perspective.d.ts +198 -0
  140. package/dist/perspective.js +171 -0
  141. package/dist/perspective.js.map +1 -0
  142. package/dist/phf-H7POU2KW.js +32 -0
  143. package/dist/phf-K5IFMZUM.js +13 -0
  144. package/dist/phf-TWJI3BOW.js +20 -0
  145. package/dist/placement-UWkqUzpa.d.ts +32 -0
  146. package/dist/plot.d.ts +451 -0
  147. package/dist/plot.js +712 -0
  148. package/dist/plot.js.map +1 -0
  149. package/dist/plotly.d.ts +129 -0
  150. package/dist/plotly.js +360 -0
  151. package/dist/plotly.js.map +1 -0
  152. package/dist/pwhl-OX3BO4JI.js +53 -0
  153. package/dist/pwhl-W44OC3C6.js +17 -0
  154. package/dist/pwhl-ZJGG3H7W.js +23 -0
  155. package/dist/qmjhl-5HISEHLL.js +35 -0
  156. package/dist/qmjhl-DA3UHKE5.js +125 -0
  157. package/dist/qmjhl-YG4BOQPF.js +614 -0
  158. package/dist/react.d.ts +377 -0
  159. package/dist/react.js +522 -0
  160. package/dist/react.js.map +1 -0
  161. package/dist/recharts.d.ts +162 -0
  162. package/dist/recharts.js +8 -0
  163. package/dist/recharts.js.map +1 -0
  164. package/dist/resolve-CQW-jzvr.d.ts +28 -0
  165. package/dist/selection-D4T3PkRt.d.ts +140 -0
  166. package/dist/shadcn.d.ts +83 -0
  167. package/dist/shadcn.js +88 -0
  168. package/dist/shadcn.js.map +1 -0
  169. package/dist/shots.d.ts +364 -0
  170. package/dist/shots.js +86 -0
  171. package/dist/shots.js.map +1 -0
  172. package/dist/soccer-7BH3ZLVL.js +7898 -0
  173. package/dist/soccer-MRU25OGE.js +2636 -0
  174. package/dist/soccer-PF4IPPVA.js +12342 -0
  175. package/dist/surface-TR7YFJW3.js +4 -0
  176. package/dist/surface-TR7YFJW3.js.map +1 -0
  177. package/dist/surfaces-MIG7HOFU.js +6 -0
  178. package/dist/surfaces-MIG7HOFU.js.map +1 -0
  179. package/dist/surfaces-W-odWLpT.d.ts +47 -0
  180. package/dist/svelte/HeadshotMark.svelte +25 -0
  181. package/dist/svelte/HeadshotMark.svelte.d.ts +10 -0
  182. package/dist/svelte/HeadshotMark.svelte.d.ts.map +1 -0
  183. package/dist/svelte/LogoMark.svelte +25 -0
  184. package/dist/svelte/LogoMark.svelte.d.ts +10 -0
  185. package/dist/svelte/LogoMark.svelte.d.ts.map +1 -0
  186. package/dist/svelte/Marks.svelte +25 -0
  187. package/dist/svelte/Marks.svelte.d.ts +10 -0
  188. package/dist/svelte/Marks.svelte.d.ts.map +1 -0
  189. package/dist/svelte/Surface.svelte +29 -0
  190. package/dist/svelte/Surface.svelte.d.ts +9 -0
  191. package/dist/svelte/Surface.svelte.d.ts.map +1 -0
  192. package/dist/svelte/SurfaceBackdrop.svelte +26 -0
  193. package/dist/svelte/SurfaceBackdrop.svelte.d.ts +11 -0
  194. package/dist/svelte/SurfaceBackdrop.svelte.d.ts.map +1 -0
  195. package/dist/svelte/index.d.ts +13 -0
  196. package/dist/svelte/index.d.ts.map +1 -0
  197. package/dist/svelte/index.js +11 -0
  198. package/dist/svelte-core.d.ts +139 -0
  199. package/dist/svelte-core.js +123 -0
  200. package/dist/svelte-core.js.map +1 -0
  201. package/dist/tanstack.d.ts +240 -0
  202. package/dist/tanstack.js +110 -0
  203. package/dist/tanstack.js.map +1 -0
  204. package/dist/testing.d.ts +75 -0
  205. package/dist/testing.js +239 -0
  206. package/dist/testing.js.map +1 -0
  207. package/dist/three.d.ts +223 -0
  208. package/dist/three.js +50 -0
  209. package/dist/three.js.map +1 -0
  210. package/dist/tiers-BN4md-GB.d.ts +65 -0
  211. package/dist/types-C7n6gJF3.d.ts +62 -0
  212. package/dist/ufl-7VLZTLTT.js +143 -0
  213. package/dist/ufl-CCMBLPSW.js +100 -0
  214. package/dist/ufl-F2BJRXME.js +16 -0
  215. package/dist/unovis.d.ts +127 -0
  216. package/dist/unovis.js +108 -0
  217. package/dist/unovis.js.map +1 -0
  218. package/dist/uplot.d.ts +120 -0
  219. package/dist/uplot.js +110 -0
  220. package/dist/uplot.js.map +1 -0
  221. package/dist/usfl-4CR5RMZJ.js +32 -0
  222. package/dist/usfl-LD7HP2YK.js +14 -0
  223. package/dist/usfl-VU4YSJQD.js +19 -0
  224. package/dist/ushl-CPG2LB4L.js +73 -0
  225. package/dist/ushl-PQL6HJAD.js +88 -0
  226. package/dist/ushl-ZT2ATPHK.js +22 -0
  227. package/dist/vega.d.ts +85 -0
  228. package/dist/vega.js +362 -0
  229. package/dist/vega.js.map +1 -0
  230. package/dist/victory.d.ts +107 -0
  231. package/dist/victory.js +38 -0
  232. package/dist/victory.js.map +1 -0
  233. package/dist/wbb-3KHCDYTK.js +5087 -0
  234. package/dist/wbb-BMX53Q3Q.js +369 -0
  235. package/dist/wbb-QNRN2CJJ.js +3620 -0
  236. package/dist/whl-4ATYZWUB.js +97 -0
  237. package/dist/whl-RVFPL6MH.js +79 -0
  238. package/dist/whl-Y7ASKYMM.js +28 -0
  239. package/dist/wnba-FWX5SFVI.js +232 -0
  240. package/dist/wnba-GX6HZR4B.js +220 -0
  241. package/dist/wnba-NTMWIPP6.js +20 -0
  242. package/dist/xfl-43R2JMJK.js +30 -0
  243. package/dist/xfl-H3BXQPZZ.js +16 -0
  244. package/dist/xfl-XON7A7FI.js +69 -0
  245. package/package.json +366 -3
@@ -0,0 +1,377 @@
1
+ import { ReactElement, ImgHTMLAttributes } from 'react';
2
+ import { L as LogoUrlOptions, C as ColorOptions } from './marks-DH-tQIP-.js';
3
+ import { E as EspnHeadshotLeague } from './headshots-B2J_LOO8.js';
4
+ import { V as Value, R as ResolveOptions } from './resolve-CQW-jzvr.js';
5
+ import { S as SelectionStore, a as SelectionState } from './selection-D4T3PkRt.js';
6
+ import { L as League, S as SeasonInput, I as IdSystem, V as Variant, M as MarkType, W as Which, H as HeadshotIdSystem, T as TeamId } from './types-C7n6gJF3.js';
7
+ import { NivoLayerOptions } from './nivo.js';
8
+ import './_web-D7Aa5Rd8.js';
9
+
10
+ /**
11
+ * `<SurfaceBackdrop>` props: the league whose surface to draw, how to paint it (the options of sdvplot's other
12
+ * `surface` functions), and which axes place it. The sporty-specific options are typed loosely, so `sdvplot/react`'s
13
+ * types never name `@sportsdataverse/sporty` (an optional peer); sporty checks them when the surface is built.
14
+ */
15
+ interface SurfaceBackdropProps {
16
+ /** The league whose court, field or rink to draw, e.g. "nba". */
17
+ league: League;
18
+ /** The team whose colours paint the surface. */
19
+ team?: Value;
20
+ /** The season the team's colours are taken from. */
21
+ season?: SeasonInput;
22
+ /** Overrides on top of the team painting, keyed by sporty colour key (e.g. `{ painted_area: "#0e2240" }`). */
23
+ colorUpdates?: Readonly<Record<string, string>>;
24
+ /** Degrees to rotate the surface by. */
25
+ rotation?: number;
26
+ /** A sporty display range for the league's sport, e.g. "defense"; one the sport does not know throws. */
27
+ displayRange?: string;
28
+ xlim?: readonly [number, number];
29
+ ylim?: readonly [number, number];
30
+ units?: "ft" | "m" | "yd" | "in" | "cm" | "mm";
31
+ /** Sporty parameter overrides for the league's surface. */
32
+ updates?: Readonly<Record<string, unknown>>;
33
+ arcResolution?: number;
34
+ xTrans?: number;
35
+ yTrans?: number;
36
+ /** The `xAxisId` of the numeric x axis the surface's units are on. Default 0. */
37
+ xAxisId?: string | number;
38
+ /** The `yAxisId` of the numeric y axis the surface's units are on. Default 0. */
39
+ yAxisId?: string | number;
40
+ }
41
+ /**
42
+ * A team-painted court, field or rink under a Recharts chart's series: place it as a child of the chart (before the
43
+ * series), as Recharts 3 renders any element there (`<Customized>` is deprecated). The surface is drawn in the
44
+ * numeric axes' units: set both axes' `domain` to the surface's bbox (sporty's `surface(...).bbox`) to fill the plot
45
+ * area, or to any range in those units to show part of it. recharts (3.8 or later) and `@sportsdataverse/sporty`
46
+ * load when it first renders, never with `sdvplot/react`; either missing throws `OptionalDependencyError` then. A
47
+ * server render draws nothing (it loads on the client).
48
+ *
49
+ * @example
50
+ * ```tsx
51
+ * import { SurfaceBackdrop } from "@sportsdataverse/sdvplot/react";
52
+ * import { surface } from "@sportsdataverse/sporty";
53
+ * import { Scatter, ScatterChart, XAxis, YAxis } from "recharts";
54
+ *
55
+ * const [x0, y0, x1, y1] = surface("basketball", "nba", { displayRange: "defense" }).bbox;
56
+ * <ScatterChart width={500} height={470}>
57
+ * <XAxis type="number" dataKey="x" domain={[x0, x1]} hide />
58
+ * <YAxis type="number" dataKey="y" domain={[y0, y1]} hide />
59
+ * <SurfaceBackdrop league="nba" team="DEN" displayRange="defense" />
60
+ * <Scatter data={[{ x: 0, y: 5.25 }]} />
61
+ * </ScatterChart>;
62
+ * ```
63
+ */
64
+ declare function SurfaceBackdrop(props: SurfaceBackdropProps): ReactElement;
65
+
66
+ /**
67
+ * `<LogoBump>` props: the series, the league their ids belong to, and how to draw the logos; every other prop goes to
68
+ * nivo's `Bump` as is (typed loosely, so `sdvplot/react`'s types never name `@nivo/bump`, an optional peer).
69
+ */
70
+ interface LogoBumpProps {
71
+ /** nivo Bump series, `{ id, data: [{ x, y }] }`: each `id` is a team (abbreviation, name or id). */
72
+ data: readonly {
73
+ readonly id: string;
74
+ readonly data: readonly {
75
+ x: number | string;
76
+ y: number | null;
77
+ }[];
78
+ }[];
79
+ /** The league the series' teams belong to, e.g. "nfl". */
80
+ league: League;
81
+ /** The season the teams are resolved for. */
82
+ season?: SeasonInput;
83
+ /** How the series' ids are read. Default "auto". */
84
+ idSystem?: IdSystem;
85
+ /** The chart's background: the line colours keep 3:1 contrast against it and aim to stay distinct (`teamColors`). */
86
+ background?: string;
87
+ /** Logo height as a fraction of the plot height, in (0, 1]. Default 0.08. */
88
+ logoHeight?: number;
89
+ /** Which points get a logo: "last" (default), "first" or "all". */
90
+ at?: NivoLayerOptions["at"];
91
+ /** Logo variant, e.g. "dark". Default "default". */
92
+ variant?: Variant;
93
+ /** "logo" (default) or "wordmark". */
94
+ markType?: MarkType;
95
+ /** Width and height in px. Both given: a fixed-size `Bump`; otherwise a `ResponsiveBump` that fills its parent. */
96
+ width?: number;
97
+ /** Chart height in px (see `width`). */
98
+ height?: number;
99
+ /**
100
+ * nivo's layers. Default nivo's own: grid, axes, labels, lines, points, then the logos, then mesh. Given, the logos
101
+ * are appended after them all, after any "mesh" too, which is harmless: the logo layer has `pointer-events: none`.
102
+ */
103
+ layers?: readonly unknown[];
104
+ /** Any other nivo `Bump` prop (margin, axes, pointSize, animate, theme, ...). */
105
+ [prop: string]: unknown;
106
+ }
107
+ /**
108
+ * A nivo bump chart of teams: each line in its team's colour (`teamColors`), a logo at the end of each line
109
+ * (`logoLayer`). `@nivo/bump` (0.99 or later) loads when it first renders, never with `sdvplot/react`; missing, it
110
+ * throws `OptionalDependencyError` then. A server render draws nothing (it loads on the client). For anything this
111
+ * does not cover, use `teamColors` and `logoLayer` from `sdvplot/nivo` on nivo's own `Bump`. A `colors` prop replaces
112
+ * the team colours (it is passed to nivo after them).
113
+ */
114
+ declare function LogoBump({ league, season, idSystem, background, logoHeight, at, variant, markType, layers, ...rest }: LogoBumpProps): ReactElement;
115
+
116
+ interface Shared {
117
+ /** The league the teams belong to, e.g. "nfl". */
118
+ league: League;
119
+ /** Logo variant, e.g. "dark". Default "default". */
120
+ variant?: Variant;
121
+ /** How the team values are read. Default "auto". */
122
+ idSystem?: IdSystem;
123
+ /** "logo" (default) or "wordmark". */
124
+ markType?: MarkType;
125
+ /** url → data URI map from `embedSources`, to inline the images. */
126
+ embed?: ReadonlyMap<string, string>;
127
+ }
128
+ /**
129
+ * `<LogoPoint>` props: yours (the league, the datum field holding the team, ...), plus the point Victory hands its
130
+ * `dataComponent` (`x`, `y`, `size`, `datum`, `events`), which you leave out.
131
+ */
132
+ interface LogoPointProps extends Shared {
133
+ /** The field of each datum (each data row) holding the team: abbreviation, name or id (see `idSystem`). */
134
+ team: string;
135
+ /** A season (number or string) for every point, or the name of the datum field holding each one's season. */
136
+ season?: SeasonInput;
137
+ /** Opacity in [0, 1]. Default 1. */
138
+ alpha?: number;
139
+ /** Set by Victory: the point's centre in px. */
140
+ x?: number;
141
+ /** Set by Victory: the point's centre in px. */
142
+ y?: number;
143
+ /** Set by Victory: the point's radius in px (the scatter's `size`). The logo is twice it tall. */
144
+ size?: number;
145
+ /** Set by Victory: the data row the point was drawn from. */
146
+ datum?: object;
147
+ /** Set by Victory: the point's event handlers (tooltips, voronoi, your `events`). */
148
+ events?: object;
149
+ }
150
+ /**
151
+ * `<LogoTick>` props: yours (the league, the logo size, ...), plus the tick label Victory hands its
152
+ * `tickLabelComponent` (`x`, `y`, `text`, the anchors, and VictoryLabel's other props), which you leave out.
153
+ */
154
+ interface LogoTickProps extends Shared {
155
+ /** The season the axis' teams are resolved for. */
156
+ season?: SeasonInput;
157
+ /** The logo's height in px, 1 or more (Victory hands a tick label no plot height). Default 24. */
158
+ size?: number;
159
+ /** Set by Victory: the label's anchor in px. */
160
+ x?: number;
161
+ /** Set by Victory: the label's anchor in px. */
162
+ y?: number;
163
+ /** Set by Victory: the tick's label, the team (abbreviation, name or id; see `idSystem`). */
164
+ text?: unknown;
165
+ /** Set by Victory: which side of the anchor the label would run. VictoryLabel's default "start". */
166
+ textAnchor?: string;
167
+ /** Set by Victory: which side of the anchor the label would hang. VictoryLabel's default "middle". */
168
+ verticalAnchor?: string;
169
+ }
170
+ /**
171
+ * Team logos as a Victory scatter's points: `<VictoryScatter dataComponent={<LogoPoint league team />}>`. Each point
172
+ * draws the logo of its datum's `team` field, centred on the point and as tall as the point it replaces (twice the
173
+ * scatter's `size`, in px: set `size` on the `VictoryScatter`). A team with no logo draws nothing and warns once, as
174
+ * `sdvplot/echarts` does. Victory's event handlers (tooltips, voronoi) stay on the image. Synchronous: call it after
175
+ * `loadLeague(league)`. Needs nothing from victory itself, so it also renders on the server.
176
+ *
177
+ * @example
178
+ * ```tsx
179
+ * import { loadLeague } from "@sportsdataverse/sdvplot";
180
+ * import { LogoPoint } from "@sportsdataverse/sdvplot/react";
181
+ * import { VictoryChart, VictoryScatter } from "victory";
182
+ *
183
+ * await loadLeague("nfl");
184
+ * const rows = [
185
+ * { team: "KC", pf: 385, pa: 326 },
186
+ * { team: "LAC", pf: 402, pa: 301 },
187
+ * { team: "DEN", pf: 425, pa: 311 },
188
+ * ];
189
+ * <VictoryChart domainPadding={30}>
190
+ * <VictoryScatter data={rows} x="pf" y="pa" size={14} dataComponent={<LogoPoint league="nfl" team="team" />} />
191
+ * </VictoryChart>;
192
+ * ```
193
+ */
194
+ declare function LogoPoint(props: LogoPointProps): ReactElement | null;
195
+ /**
196
+ * Team logos as an axis' tick labels: `<VictoryAxis tickLabelComponent={<LogoTick league />} />` on an axis whose
197
+ * labels are teams. The logo sits where the label would, on the side of Victory's anchor the label would run (under
198
+ * a bottom axis, left of a left one), `size` px tall. A label that resolves to no logo keeps its text, drawn by
199
+ * Victory's own `VictoryLabel` (loaded from victory when it first draws one; it then also warns once), as
200
+ * `sdvplot/echarts`' `withAxisLogos` does. Logos do not
201
+ * rotate with a tick's `angle`. Synchronous: call it after `loadLeague(league)`.
202
+ *
203
+ * @example
204
+ * ```tsx
205
+ * import { loadLeague } from "@sportsdataverse/sdvplot";
206
+ * import { LogoTick } from "@sportsdataverse/sdvplot/react";
207
+ * import { VictoryAxis, VictoryBar, VictoryChart } from "victory";
208
+ *
209
+ * await loadLeague("nfl");
210
+ * const rows = [
211
+ * { team: "KC", wins: 15 },
212
+ * { team: "BUF", wins: 13 },
213
+ * { team: "LAC", wins: 11 },
214
+ * ];
215
+ * <VictoryChart domainPadding={40} padding={{ top: 20, bottom: 60, left: 50, right: 20 }}>
216
+ * <VictoryAxis tickLabelComponent={<LogoTick league="nfl" size={32} />} />
217
+ * <VictoryAxis dependentAxis />
218
+ * <VictoryBar data={rows} x="team" y="wins" />
219
+ * </VictoryChart>;
220
+ * ```
221
+ */
222
+ declare function LogoTick(props: LogoTickProps): ReactElement;
223
+
224
+ /** `<Surface3D>` props: sporty's sport and league, and sporty's `surface()` options. */
225
+ interface Surface3DProps {
226
+ /** sporty's sport, e.g. "baseball". */
227
+ sport: string;
228
+ /** sporty's league key for it, e.g. "mlb". */
229
+ league: string;
230
+ /** sporty's `surface()` options (`colorUpdates`, `units`, `rotation`, ...). */
231
+ options?: Record<string, unknown>;
232
+ /** The mesh's `renderOrder`. Default -1: drawn before the scene's other objects, as a ground should be. */
233
+ renderOrder?: number;
234
+ }
235
+ /**
236
+ * sporty's playing surface in a react-three-fiber scene: `surfaceMesh` as one mesh in the z = 0 plane, in the
237
+ * surface's own units (feet for a baseball field or a rink, metres for a pitch), z up, so set the camera's
238
+ * `up={[0, 0, 1]}`. Drawn unlit in sporty's colours, before the scene's other objects and without depth writes, so its
239
+ * features paint over each other in order with no z-fighting. Put it inside your `<Canvas>`. `three` and
240
+ * `@react-three/fiber` (0.186.1 and 9.8.1 or later) and `@sportsdataverse/sporty` load when it first renders, never
241
+ * with `sdvplot/react`; a missing peer throws `OptionalDependencyError` then. The failed load is kept until the page
242
+ * reloads, so installing the peer needs a reload. A server render draws nothing.
243
+ *
244
+ * See it drawn in the Three.js guide (`sdvplot/three/statcast-pitches` in the gallery).
245
+ */
246
+ declare function Surface3D(props: Surface3DProps): ReactElement;
247
+ /** `<Trajectory>` props: the path, the tube's radius in world units, and its colour or team. */
248
+ interface TrajectoryProps {
249
+ /** The path, `[x, y, z]` points in world units (`statcastPitchPath` gives a pitch's). */
250
+ points: readonly (readonly [x: number, y: number, z: number])[];
251
+ /** The tube's radius in the points' world units, not px (a baseball's is 0.121 ft). */
252
+ radius: number;
253
+ /** Vertices round each ring, 3 or more. Default 12. */
254
+ radialSegments?: number;
255
+ /** The tube's colour, `#rrggbb`. Give this or `team` and `league`. */
256
+ color?: string;
257
+ /** The team whose colour the tube takes (abbreviation, name or id), with `league`. */
258
+ team?: unknown;
259
+ league?: League;
260
+ season?: SeasonInput;
261
+ idSystem?: IdSystem;
262
+ /** "primary" (default) or "secondary". */
263
+ which?: Which;
264
+ /** What the tube is seen against: the colour keeps 3:1 contrast against it (`teamColorPalette`). */
265
+ background?: string;
266
+ /** The colour of a team that does not resolve. Default "#808080". */
267
+ fallback?: string;
268
+ /** The mesh's `renderOrder`. Default 0. */
269
+ renderOrder?: number;
270
+ }
271
+ /**
272
+ * A team-coloured tube along a 3D path (a pitch, a ball flight) in a react-three-fiber scene: `trajectoryTube` as one
273
+ * mesh, `radius` round in the points' world units, drawn unlit and not tone-mapped so the team's colour shows as it
274
+ * is. Put it inside your `<Canvas>`, over a `<Surface3D>` in the same units. `three` and `@react-three/fiber` load
275
+ * when it first renders, never with `sdvplot/react`; a missing peer throws `OptionalDependencyError` then (kept until
276
+ * the page reloads, so installing the peer needs a reload), and a bad radius or colour throws `InputError`. With
277
+ * `team`, the team's league must be loaded for its colour: until it is, the tube draws nothing (one warning), and in
278
+ * the browser it loads the league and then draws. A server render draws nothing.
279
+ *
280
+ * See it drawn in the Three.js guide (`sdvplot/three/statcast-pitches` in the gallery).
281
+ */
282
+ declare function Trajectory({ points, renderOrder, ...o }: TrajectoryProps): ReactElement | null;
283
+
284
+ type ImgProps = Omit<ImgHTMLAttributes<HTMLImageElement>, "src" | "alt" | "height" | "width">;
285
+ interface TeamLogoProps extends ImgProps {
286
+ team: Value;
287
+ league: League;
288
+ season?: LogoUrlOptions["season"];
289
+ variant?: Variant;
290
+ markType?: MarkType;
291
+ /** Rendered `height` in px; width is left unset so the browser keeps the aspect. */
292
+ size?: number;
293
+ /** Defaults to the team's name. */
294
+ alt?: string;
295
+ }
296
+ /**
297
+ * Team logo `<img>`. Loads the league index on first use; renders nothing until resolved and for an unknown team.
298
+ *
299
+ * @example
300
+ * ```tsx
301
+ * import { TeamLogo } from "@sportsdataverse/sdvplot/react";
302
+ *
303
+ * <TeamLogo team="KC" league="nfl" size={64} />;
304
+ * ```
305
+ */
306
+ declare function TeamLogo({ team, league, season, variant, markType, size, alt, ...imgProps }: TeamLogoProps): ReactElement | null;
307
+ /** `TeamLogo` with `markType="wordmark"`. */
308
+ declare function Wordmark(props: Omit<TeamLogoProps, "markType">): ReactElement | null;
309
+ interface HeadshotProps extends ImgProps {
310
+ playerId: Value;
311
+ league: EspnHeadshotLeague;
312
+ idSystem?: HeadshotIdSystem;
313
+ /** Height in px (default 60); width follows the 600:436 headshot aspect. */
314
+ height?: number;
315
+ /** Default `name`, then "Player headshot". `""` marks it decorative (the initials box is then `aria-hidden`). */
316
+ alt?: string;
317
+ /**
318
+ * `"initials"`: when there is no headshot URL or the image fails to load, show up to three initials of `name` in a
319
+ * box of the headshot's size (blazing-the-nets `main` `components/Headshot.tsx:15-29`). Default `"none"`: a failed
320
+ * load leaves the `<img>`, and an id with no URL renders nothing.
321
+ */
322
+ fallback?: "none" | "initials";
323
+ /** The player's name, for the initials and the default alt text. */
324
+ name?: string;
325
+ }
326
+ /**
327
+ * Player headshot `<img>`: sync for ESPN ids; gsis ids render once the gsis map has loaded. Renders nothing for an
328
+ * unknown/malformed id, or a league/idSystem `headshotUrl` rejects, unless `fallback="initials"` and a `name` are
329
+ * given, which show the player's initials instead.
330
+ *
331
+ * @example
332
+ * ```tsx
333
+ * import { Headshot } from "@sportsdataverse/sdvplot/react";
334
+ *
335
+ * <Headshot playerId="3918298" league="nfl" height={80} alt="Josh Allen" />;
336
+ * ```
337
+ */
338
+ declare function Headshot({ playerId, league, idSystem, height, alt, fallback, name, ...imgProps }: HeadshotProps): ReactElement | null;
339
+ /** `{team: "#hex"}` for a league once loaded (`undefined` before); reloads when `league`/`which` change. */
340
+ declare function useTeamColors(league: League, { which }?: {
341
+ which?: ColorOptions["which"];
342
+ }): Record<string, string> | undefined;
343
+ /** Sync resolver `(value, opts?) => TeamId | undefined` once the league is loaded (`undefined` before); reloads when `league` changes. */
344
+ declare function useResolve(league: League): ((value: Value, opts?: ResolveOptions) => TeamId | undefined) | undefined;
345
+ /**
346
+ * The state of a `createSelection` store (J31), re-rendering on every change and never on a no-op patch. On the
347
+ * server, and in the first client render, it reads the store's current state, so server and client markup agree.
348
+ * Redrawing from it is the component's choice: filter rows with `state.predicate`, emphasise `state.selected`.
349
+ *
350
+ * @example
351
+ * ```tsx
352
+ * import { createSelection } from "@sportsdataverse/sdvplot";
353
+ * import { useSelection } from "@sportsdataverse/sdvplot/react";
354
+ * import type { ReactElement } from "react";
355
+ *
356
+ * const store = createSelection();
357
+ * store.set({ selected: ["KC", "BUF"] });
358
+ * function Picked(): ReactElement {
359
+ * const { selected } = useSelection(store); // re-renders on every change of the store
360
+ * return (
361
+ * <table>
362
+ * <tbody>
363
+ * {[...selected].map((id) => (
364
+ * <tr key={id}>
365
+ * <td>{id}</td>
366
+ * </tr>
367
+ * ))}
368
+ * </tbody>
369
+ * </table>
370
+ * );
371
+ * }
372
+ * <Picked />;
373
+ * ```
374
+ */
375
+ declare function useSelection<Row>(store: SelectionStore<Row>): SelectionState<Row>;
376
+
377
+ export { Headshot, type HeadshotProps, LogoBump, type LogoBumpProps, LogoPoint, type LogoPointProps, LogoTick, type LogoTickProps, Surface3D, type Surface3DProps, SurfaceBackdrop, type SurfaceBackdropProps, TeamLogo, type TeamLogoProps, Trajectory, type TrajectoryProps, Wordmark, useResolve, useSelection, useTeamColors };