@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 @@
1
+ {"version":3,"sources":["../src/maplibre.ts"],"names":[],"mappings":";;;;;;;;AAwJA,IAAM,IAAA,GAAO,CAAC,CAAA,KAA4B,OAAO,MAAM,QAAA,IAAY,MAAA,CAAO,SAAS,CAAC,CAAA;AAKpF,SAAS,MAAM,CAAA,EAA2B;AACxC,EAAA,MAAM,CAAA,GAAI,OAAO,CAAA,KAAM,QAAA,GAAW,IAAI,OAAO,CAAA,KAAM,QAAA,IAAY,CAAA,CAAE,MAAK,KAAM,EAAA,GAAK,MAAA,CAAO,CAAC,IAAI,MAAA,CAAO,GAAA;AACpG,EAAA,OAAO,MAAA,CAAO,QAAA,CAAS,CAAC,CAAA,GAAI,CAAA,GAAI,IAAA;AAClC;AAEA,SAAS,WAAA,CAAY,GAAA,EAAa,IAAA,EAAc,KAAA,EAA+B;AAC7E,EAAA,IAAI,KAAA,CAAM,WAAW,CAAA,EAAG;AACxB,EAAA,MAAM,QACJ,KAAA,CAAM,KAAA,CAAM,GAAG,EAAE,CAAA,CAAE,IAAI,MAAM,CAAA,CAAE,KAAK,IAAI,CAAA,IAAK,MAAM,MAAA,GAAS,EAAA,GAAK,QAAQ,KAAA,CAAM,MAAA,GAAS,EAAE,CAAA,KAAA,CAAA,GAAU,EAAA,CAAA;AACtG,EAAA,IAAA,CAAK,CAAA,EAAG,GAAG,CAAA,CAAA,EAAI,KAAK,CAAA,CAAA,EAAI,CAAA,QAAA,EAAW,KA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CAAA;AAAA,QACxB,CAAA,CAAE,QAAA,CAAS,WAAA,CAAY,CAAC,CAAA;AAAA,QACxB,EAAA,CAAG,GAAA,CAAI,CAAA,CAAE,UAAA,CAAW,IAAI,CAAA;AAAA,QACxB,EAAE,UAAA,CAAW;AAAA;AACf,KACF;AAAA,EACF,CAAC,CAAA;AACH","file":"maplibre.js","sourcesContent":["/**\n * The MapLibre GL JS 6 adapter: team logos as a native `symbol` layer (`logoSymbols`, with `addLogoImages` to load\n * each logo once into the map's images), team-coloured travel lines as a `line` layer (`routeLines`), and a free,\n * keyless basemap (`basemap`, OpenFreeMap). Each builder returns plain style JSON: a GeoJSON source and a layer that\n * reads it, for `map.addSource(set.id, set.source)` and `map.addLayer(set.layer)`. Pure: `maplibre-gl` (an optional\n * peer, 6.14 or later) is never imported at runtime, only its types; the map is passed in. For deck.gl layers on a\n * MapLibre map, hand `@sportsdataverse/sdvplot/deckgl`'s `logoIconLayer` / `passArcLayer` props to deck.gl's layers\n * inside `@deck.gl/mapbox`'s `MapboxOverlay`. Synchronous builders: call after `loadLeague(league)` / `preloadAll()`.\n */\nimport type {\n GeoJSONSourceSpecification,\n LineLayerSpecification,\n Map as MapLibreMap,\n SymbolLayerSpecification,\n} from \"maplibre-gl\";\nimport { type DrawnMark, type Row, checkAlpha, colorPalette, column, markPlacements } from \"./_web.js\";\nimport { contentId } from \"./content-id.js\";\nimport { InputError, warn } from \"./errors.js\";\nimport { normValue } from \"./normalize.js\";\nimport { type Value, resolveSync } from \"./resolve.js\";\nimport type { IdSystem, League, SeasonInput, Variant, Which } from \"./types.js\";\n\nexport type { DrawnMark, Row } from \"./_web.js\";\n\n/** `logoSymbols` options. */\nexport interface LogoSymbolOptions {\n /** Name of the row column holding each logo's longitude. */\n x: string;\n /** Name of the row column holding each logo's latitude. */\n y: string;\n /** Name of the row column holding the team (abbreviation, name or id, a number or a string; see `idSystem`). */\n team: string;\n /** The league the teams belong to, e.g. \"nfl\". */\n league: League;\n /** A season (number or string) for every row, or the name of a row column holding each row's season. */\n season?: SeasonInput;\n /** Logo variant, e.g. \"dark\". Default \"default\". */\n variant?: Variant;\n /** How the `team` values are read. Default \"auto\". */\n idSystem?: IdSystem;\n /** The logo's height on screen in px, 1 or more. Default 32. */\n size?: number;\n /** The logos' opacity in [0, 1] (`icon-opacity`). Default 1. */\n alpha?: number;\n /** The source and layer id. Default \"sdvplot-logos\". */\n id?: string;\n}\n/** A logo feature's properties. */\nexport interface LogoProperties {\n /** The resolved team id. */\n team: string;\n /** The map image the symbol draws (`icon-image`), one per logo and size. */\n icon: string;\n /** The logo's URL. */\n url: string;\n /** The row's position in the input (left-out rows leave gaps). */\n index: number;\n}\n/** One logo the map needs as an image: `addLogoImages` loads `url` and adds it as `id`, drawn `height` px tall. */\nexport interface LogoImage {\n id: string;\n url: string;\n height: number;\n}\n/** A GeoJSON point: [longitude, latitude]. */\nexport interface PointGeometry {\n type: \"Point\";\n coordinates: [lon: number, lat: number];\n}\n/** A GeoJSON line through [longitude, latitude] positions. */\nexport interface LineGeometry {\n type: \"LineString\";\n coordinates: [lon: number, lat: number][];\n}\n/** A GeoJSON feature; its id is the row's index in the input. */\nexport interface Feature<G, P> {\n type: \"Feature\";\n id: number;\n geometry: G;\n properties: P;\n}\n/** A GeoJSON source holding a feature collection: `map.addSource(id, source)`. */\nexport type FeatureSource<G, P> = GeoJSONSourceSpecification & {\n type: \"geojson\";\n data: { type: \"FeatureCollection\"; features: Feature<G, P>[] };\n};\n/** `logoSymbols`' result: a source and a symbol layer for the map, and the images that layer draws. */\nexport interface LogoSymbols {\n /** The source id (the layer's own id too). */\n id: string;\n /** One point feature per drawn row; the feature id is the row's index. */\n source: FeatureSource<PointGeometry, LogoProperties>;\n layer: SymbolLayerSpecification;\n /** One per distinct logo: what `addLogoImages` loads. */\n images: LogoImage[];\n}\n\n/** `routeLines` options. */\nexport interface RouteLineOptions {\n /** Name of the row column holding each leg's start longitude. */\n x: string;\n /** Name of the row column holding each leg's start latitude. */\n y: string;\n /** Name of the row column holding each leg's end longitude. */\n xend: string;\n /** Name of the row column holding each leg's end latitude. */\n yend: string;\n /** Name of the row column holding the team the leg is coloured by. */\n team: string;\n /** The league the teams belong to, e.g. \"nfl\". */\n league: League;\n /** The season the teams are resolved for. */\n season?: SeasonInput;\n /** How the `team` values are read. Default \"auto\". */\n idSystem?: IdSystem;\n /** \"primary\" (default) or \"secondary\" colour. */\n which?: Which;\n /**\n * The basemap's background (`basemap(\"dark\").background` under the dark basemap). Given, every team colour keeps 3:1\n * contrast against it and aims to stay distinct from the other teams' (CIE76 ΔE of 20 or more), through the shared\n * team palette, as `teamColorPalette` does in the other adapters.\n */\n background?: string;\n /** The colour of a team that does not resolve, or has no colour. Default \"#808080\". */\n fallback?: string;\n /** The line's width in px, 1 or more. Default 3. */\n width?: number;\n /** The lines' opacity in [0, 1] (`line-opacity`). Default 1. */\n alpha?: number;\n /** The source and layer id. Default \"sdvplot-routes\". */\n id?: string;\n}\n/** A route feature's properties. */\nexport interface RouteProperties {\n /** The resolved team id, or the row's own value as text when it does not resolve. */\n team: string;\n /** The line's colour, `#rrggbb`. */\n color: string;\n /** The row's position in the input (left-out rows leave gaps). */\n index: number;\n}\n/** `routeLines`' result: a source and a line layer for the map. */\nexport interface RouteLines {\n id: string;\n /** One two-point line per drawn row; the feature id is the row's index. */\n source: FeatureSource<LineGeometry, RouteProperties>;\n layer: LineLayerSpecification;\n}\n\n/** The map methods `addLogoImages` calls: a MapLibre `Map`. */\nexport type LogoImageMap = Pick<MapLibreMap, \"loadImage\" | \"addImage\" | \"hasImage\">;\n\nconst real = (v: unknown): v is number => typeof v === \"number\" && Number.isFinite(v);\n/**\n * A longitude or latitude as a number: a finite number, or a string that reads as one (\"-94.7\", as a CSV gives it).\n * Anything else (missing, blank, not a number, infinite) is null: the row is left out.\n */\nfunction coord(v: unknown): number | null {\n const n = typeof v === \"number\" ? v : typeof v === \"string\" && v.trim() !== \"\" ? Number(v) : Number.NaN;\n return Number.isFinite(n) ? n : null;\n}\n/** One warning for the rows left out for a coordinate, naming their teams. */\nfunction skippedRows(key: string, what: string, teams: readonly Value[]): void {\n if (teams.length === 0) return;\n const shown =\n teams.slice(0, 10).map(String).join(\", \") + (teams.length > 10 ? ` and ${teams.length - 10} more` : \"\");\n warn(`${key}:${shown}`, `skipped ${teams.length} ${what} with a missing coordinate: ${shown}`);\n}\nfunction checkPx(name: string, v: unknown): number {\n if (!real(v) || v < 1) throw new InputError(`${name} is in px, 1 or more, got ${String(v)}`);\n return v;\n}\n\n/**\n * Each row's team logo at its (longitude, latitude), as a GeoJSON source and a MapLibre `symbol` layer: one point\n * feature per row (its `id` is the row's index; `team`, `icon`, `url` and `index` are its properties), and a layer\n * drawing `icon-image: [\"get\", \"icon\"]`, every logo shown even where two overlap. A team with no logo (or one that\n * does not resolve) is left out with one warning; so is a row with a missing, non-numeric or infinite coordinate (a\n * numeric string such as \"-94.7\" is read as its number). Team values may be numbers or strings (ESPN ids,\n * abbreviations, names). The map needs the logos as images first:\n * `await addLogoImages(map, logos)`, then `map.addSource(logos.id, logos.source)` and `map.addLayer(logos.layer)`.\n *\n * @example\n * ```ts\n * import { loadLeague } from \"@sportsdataverse/sdvplot\";\n * import { logoSymbols } from \"@sportsdataverse/sdvplot/maplibre\";\n *\n * await loadLeague(\"nfl\");\n * // Kansas City's home airport, from nflverse's nfldata airports.csv\n * const logos = logoSymbols([{ team: \"KC\", lon: -94.714, lat: 39.297 }], {\n * x: \"lon\",\n * y: \"lat\",\n * team: \"team\",\n * league: \"nfl\",\n * size: 40,\n * });\n * // in the browser: await addLogoImages(map, logos); map.addSource(logos.id, logos.source); map.addLayer(logos.layer)\n * logos.source.data.features[0]?.properties.icon;\n * ```\n */\nexport function logoSymbols(rows: readonly Row[], o: LogoSymbolOptions): LogoSymbols {\n const size = checkPx(\"size\", o.size ?? 32);\n const opacity = checkAlpha(o.alpha ?? 1);\n const id = o.id ?? \"sdvplot-logos\";\n const images = new Map<string, LogoImage>();\n // placeSync leaves out a null or NaN coordinate; a value that is not a number, or not finite, is left out here\n const placed = markPlacements(rows, \"logo\", o);\n const at = placed.map((p) => [coord(p.x), coord(p.y)] as const);\n skippedRows(\n `maplibre:logos:${o.league}:missing`,\n \"logo(s)\",\n placed.filter((_, k) => at[k]?.includes(null)).map((p) => p.id),\n );\n const features = placed.flatMap((p, k): Feature<PointGeometry, LogoProperties>[] => {\n const [lon, lat] = at[k] as readonly [number | null, number | null];\n if (lon === null || lat === null) return [];\n const icon = `${contentId(\"sdv-logo\", p.url)}-${size}`;\n if (!images.has(icon)) images.set(icon, { id: icon, url: p.url, height: size });\n return [\n {\n type: \"Feature\",\n id: p.index,\n geometry: { type: \"Point\", coordinates: [lon, lat] },\n properties: { team: p.id, icon, url: p.url, index: p.index },\n },\n ];\n });\n return {\n id,\n source: { type: \"geojson\", data: { type: \"FeatureCollection\", features } },\n layer: {\n id,\n type: \"symbol\",\n source: id,\n layout: {\n \"icon-image\": [\"get\", \"icon\"],\n \"icon-allow-overlap\": true,\n \"icon-ignore-placement\": true,\n },\n paint: { \"icon-opacity\": opacity },\n },\n images: [...images.values()],\n };\n}\n\n/**\n * Loads each logo of `logoSymbols` sets into the map's images, once: `map.loadImage(url)`, then\n * `map.addImage(id, image, { pixelRatio })`, the pixel ratio making the image draw `size` px tall at icon size 1 (and\n * stay sharp on a high-density screen). An image the map already has is skipped, so calling it again adds nothing\n * twice. `map.setStyle` drops the map's images, sources and layers: on the map's `style.load` event, call it again\n * (it adds back only what the new style lacks) and re-add the source and layer. A logo that fails to load is left undrawn with one\n * warning. Resolves when every image is in. Call it before adding the layers that draw them.\n *\n * @example\n * ```ts\n * import { loadLeague } from \"@sportsdataverse/sdvplot\";\n * import { addLogoImages, logoSymbols } from \"@sportsdataverse/sdvplot/maplibre\";\n *\n * await loadLeague(\"nfl\");\n * const logos = logoSymbols([{ team: \"KC\", lon: -94.714, lat: 39.297 }], { x: \"lon\", y: \"lat\", team: \"team\", league: \"nfl\" });\n * // a stand-in for a MapLibre map (in the browser: the map from `new maplibregl.Map(...)`, once it has loaded)\n * const added: string[] = [];\n * const map = {\n * hasImage: (id: string) => added.includes(id),\n * loadImage: async () => ({ data: { width: 500, height: 500 } as ImageBitmap }),\n * addImage(id: string) {\n * added.push(id);\n * return this;\n * },\n * };\n * await addLogoImages(map as never, logos);\n * added;\n * ```\n */\nexport async function addLogoImages(map: LogoImageMap, ...sets: readonly LogoSymbols[]): Promise<void> {\n const want = new Map(sets.flatMap((s) => s.images).map((im) => [im.id, im]));\n await Promise.all(\n [...want.values()].map(async (im) => {\n if (map.hasImage(im.id)) return;\n let image: HTMLImageElement | ImageBitmap;\n try {\n image = (await map.loadImage(im.url)).data;\n } catch (e) {\n warn(`maplibre:image:${im.url}`, `could not load the logo ${im.url}: ${String(e)}`);\n return;\n }\n if (map.hasImage(im.id)) return; // another call added it while this one loaded\n map.addImage(im.id, image, { pixelRatio: image.height / im.height });\n }),\n );\n}\n\n/** An unresolved team value as text: a number without \".0\", a missing one empty (as `./deckgl`'s arcs). */\nconst label = (t: unknown): string =>\n t === null || t === undefined ? \"\" : typeof t === \"number\" ? (normValue(t) ?? \"\") : String(t);\n\n/**\n * Team-coloured travel legs as a GeoJSON source and a MapLibre `line` layer: one straight line per row from (x, y) to\n * (xend, yend) in longitude and latitude, in the team's colour (`line-color: [\"get\", \"color\"]`). Each team keeps one\n * colour, from the shared team palette; with `background` the colours read on the basemap (dark mode) and stay\n * distinct. A team that does not resolve takes `fallback`. A coordinate may be a number or a numeric string, as for\n * `logoSymbols`; a row with a missing, non-numeric or infinite one is left out with one warning. The feature id is the row's index. The same rows feed `./deckgl`'s `passArcLayer` for arcs instead.\n *\n * @example\n * ```ts\n * import { loadLeague } from \"@sportsdataverse/sdvplot\";\n * import { routeLines } from \"@sportsdataverse/sdvplot/maplibre\";\n *\n * await loadLeague(\"nfl\");\n * // Kansas City to Buffalo, airport to airport (nflverse nfldata airports.csv): week 11 of 2024\n * const leg = { team: \"KC\", lon: -94.714, lat: 39.297, lon_end: -78.732, lat_end: 42.94 };\n * const routes = routeLines([leg], { x: \"lon\", y: \"lat\", xend: \"lon_end\", yend: \"lat_end\", team: \"team\", league: \"nfl\" });\n * // in the browser: map.addSource(routes.id, routes.source); map.addLayer(routes.layer)\n * routes.source.data.features[0]?.properties.color;\n * ```\n */\nexport function routeLines(rows: readonly Row[], o: RouteLineOptions): RouteLines {\n const width = checkPx(\"width\", o.width ?? 3);\n const opacity = checkAlpha(o.alpha ?? 1);\n const id = o.id ?? \"sdvplot-routes\";\n const cols = [o.x, o.y, o.xend, o.yend].map((c, k) =>\n column(rows, c, [\"x\", \"y\", \"xend\", \"yend\"][k] as string),\n );\n const teams = column(rows, o.team, \"team\");\n // each row's four coordinates as numbers (a numeric string is read as one), or null\n const at = rows.map((_, i) => cols.map((c) => coord(c[i])));\n const keep = rows.flatMap((_, i) => (at[i]?.includes(null) ? [] : [i]));\n skippedRows(\n `maplibre:routes:${o.league}:missing`,\n \"route leg(s)\",\n rows.flatMap((_, i) => (at[i]?.includes(null) ? [teams[i] as Value] : [])),\n );\n const kept = keep.map((i) => teams[i] as Value);\n const ro = {\n ...(o.season === undefined ? {} : { season: o.season }),\n ...(o.idSystem === undefined ? {} : { idSystem: o.idSystem }),\n };\n const resolved = resolveSync(kept, o.league, ro);\n // keyed by the resolved team, so 12 and \"12\" (or \"KC\" and 12) are one team with one colour\n const keys = kept.map((t, j) => resolved[j] ?? `?${label(t)}`);\n const distinct = [...new Set(keys)];\n const known = distinct.filter((k) => !k.startsWith(\"?\"));\n const palette = colorPalette(o.league, known, {\n ...ro,\n idSystem: \"team_id\",\n ...(o.which === undefined ? {} : { which: o.which }),\n ...(o.background === undefined ? {} : { background: o.background }),\n ...(o.fallback === undefined ? {} : { fallback: o.fallback }),\n });\n const colorOf = new Map(known.map((k, j) => [k, palette[j] as string]));\n const fallback = o.fallback ?? \"#808080\";\n const features = keep.map((i, j): Feature<LineGeometry, RouteProperties> => {\n const c = at[i] as number[];\n return {\n type: \"Feature\",\n id: i,\n geometry: {\n type: \"LineString\",\n coordinates: [\n [c[0] as number, c[1] as number],\n [c[2] as number, c[3] as number],\n ],\n },\n properties: {\n team: resolved[j] ?? label(kept[j]),\n color: colorOf.get(keys[j] as string) ?? fallback,\n index: i,\n },\n };\n });\n return {\n id,\n source: { type: \"geojson\", data: { type: \"FeatureCollection\", features } },\n layer: {\n id,\n type: \"line\",\n source: id,\n layout: { \"line-cap\": \"round\", \"line-join\": \"round\" },\n paint: { \"line-color\": [\"get\", \"color\"], \"line-width\": width, \"line-opacity\": opacity },\n },\n };\n}\n\n/** OpenFreeMap's credit, exactly as its TileJSON (`https://tiles.openfreemap.org/planet`) gives it (read 2026-10-27). */\nconst OPENFREEMAP_ATTRIBUTION =\n '<a href=\"https://openfreemap.org\" target=\"_blank\">OpenFreeMap</a> <a href=\"https://www.openmaptiles.org/\" target=\"_blank\">&copy; OpenMapTiles</a> Data from <a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap</a>';\n\n/** `basemap`'s result. */\nexport interface Basemap {\n /** The style URL, for the map's `style` option. */\n style: string;\n /**\n * The provider's credit (HTML). MapLibre shows it by itself from the style's source, in its attribution control (on\n * by default; keep it). Anything else that draws these tiles, or a static export of the map, must show it.\n */\n attribution: string;\n /**\n * The colour of the style's `background` layer, the land (read from the style on 2026-10-27), for `routeLines`' and\n * `passArcLayer`'s `background` (dark mode). Their 3:1 contrast is measured against it, not against the water,\n * which is a little lighter on the dark style (#1b1b1d) and a little darker on the light one (#c2c8ca).\n */\n background: string;\n}\nconst STYLES = {\n light: { style: \"https://tiles.openfreemap.org/styles/positron\", background: \"#f2f3f0\" },\n dark: { style: \"https://tiles.openfreemap.org/styles/dark\", background: \"#0c0c0c\" },\n} as const;\n\n/**\n * A free basemap that needs no API key: OpenFreeMap's `positron` (light) or `dark` vector style, built from\n * OpenStreetMap data. Pass `style` to `new maplibregl.Map({ style })`. OpenFreeMap's public instance asks for no\n * registration or key and sets no request limit; the credit is required, and MapLibre's attribution control shows it\n * from the style's source (`attribution` is the same text, for anything else). Each map view requests the\n * provider's tiles: build or test pages without a map, or serve a local style.\n *\n * @example\n * ```ts\n * import { basemap } from \"@sportsdataverse/sdvplot/maplibre\";\n *\n * const { style, background } = basemap(\"dark\");\n * // in the browser: new maplibregl.Map({ container, style, center: [-96, 38], zoom: 3 })\n * [style, background];\n * ```\n */\nexport function basemap(theme: \"light\" | \"dark\" = \"light\"): Basemap {\n const s = STYLES[theme];\n if (s === undefined) throw new InputError(`theme is \"light\" or \"dark\", got ${JSON.stringify(theme)}`);\n return { ...s, attribution: OPENFREEMAP_ATTRIBUTION };\n}\n\n/**\n * What `logoSymbols` sets draw, as `[team, longitude, latitude, px, url]` per feature, in order: the module's test\n * hook, as the other adapters' `drawnMarks`.\n *\n * @example\n * ```ts\n * import { loadLeague } from \"@sportsdataverse/sdvplot\";\n * import { drawnMarks, logoSymbols } from \"@sportsdataverse/sdvplot/maplibre\";\n *\n * await loadLeague(\"nfl\");\n * // 12 is Kansas City's ESPN team id\n * drawnMarks(logoSymbols([{ team: 12, lon: -94.714, lat: 39.297 }], { x: \"lon\", y: \"lat\", team: \"team\", league: \"nfl\" }));\n * ```\n */\nexport function drawnMarks(...sets: readonly LogoSymbols[]): DrawnMark[] {\n return sets.flatMap((s) => {\n const px = new Map(s.images.map((im) => [im.id, im.height]));\n return s.source.data.features.map(\n (f): DrawnMark => [\n f.properties.team,\n f.geometry.coordinates[0],\n f.geometry.coordinates[1],\n px.get(f.properties.icon) as number,\n f.properties.url,\n ],\n );\n });\n}\n"]}
@@ -0,0 +1,75 @@
1
+ import { R as ResolveOptions, V as Value } from './resolve-CQW-jzvr.js';
2
+ import { W as Which, L as League, S as SeasonInput, V as Variant, M as MarkType, I as IdSystem, a as MarkRow } from './types-C7n6gJF3.js';
3
+
4
+ interface ColorOptions extends ResolveOptions {
5
+ which?: Which;
6
+ }
7
+ type ColorResult<T> = T extends readonly Value[] ? (string | undefined)[] : string | undefined;
8
+ /**
9
+ * `{team: "#hex"}` for a league. Without `teams`: keyed by abbr, or team_id where abbr is null/shared (one warning).
10
+ * With `teams`: keyed by the caller's own values; first team wins on a reused value.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * import { palette } from "@sportsdataverse/sdvplot";
15
+ *
16
+ * await palette("nfl", ["KC", "BUF", "PHI"]);
17
+ * ```
18
+ */
19
+ declare function palette(league: League, teams?: Value | readonly Value[], opts?: ColorOptions): Promise<Record<string, string>>;
20
+ /** One `#hex` (or undefined) per team value, in the container the values came in. Call after the league is loaded. */
21
+ declare function teamColorsSync<T extends Value | readonly Value[]>(league: League, teams: T, opts?: ColorOptions): ColorResult<T>;
22
+ /**
23
+ * Team colour(s), loading the league first: one team gives one `#hex` (or `undefined`), an array gives one per team.
24
+ * `which: "secondary"` picks the second colour; an unknown team gives `undefined` and one warning.
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * import { teamColors } from "@sportsdataverse/sdvplot";
29
+ *
30
+ * await teamColors("nba", ["LAL", "BOS"], { which: "secondary" });
31
+ * ```
32
+ */
33
+ declare function teamColors<T extends Value | readonly Value[]>(league: League, teams: T, opts?: ColorOptions): Promise<ColorResult<T>>;
34
+
35
+ interface SelectOptions {
36
+ season?: SeasonInput;
37
+ variant?: Variant;
38
+ markType?: MarkType;
39
+ }
40
+ interface LogoUrlOptions extends SelectOptions {
41
+ idSystem?: IdSystem;
42
+ strict?: boolean;
43
+ }
44
+ /** Port of `select_mark` (post-preload): requested variant, then (keeping polarity) default / polarity variants, then any; within each, season-covering rows (dated before open-ended), else the best row. Rows are already ranked best-first. */
45
+ declare function selectMarkSync(team: Value, league: League, o?: SelectOptions): MarkRow | undefined;
46
+ declare function selectMark(team: Value, league: League, o?: SelectOptions): Promise<MarkRow | undefined>;
47
+ /** Port of `logo_url` (post-preload): archive URL of the team's logo/wordmark for the season; `undefined` for an unknown team (the resolver warns) or when no mark of that type exists (one warning). */
48
+ declare function logoUrlSync(team: Value, league: League, o?: LogoUrlOptions): string | undefined;
49
+ /**
50
+ * Archive URL of a team's logo (or wordmark, `markType`) for the season, loading the league first; `undefined` for an
51
+ * unknown team (the resolver warns) or when no mark of that type is archived (one warning).
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * import { logoUrl } from "@sportsdataverse/sdvplot";
56
+ *
57
+ * await logoUrl("KC", "nfl", { markType: "wordmark" });
58
+ * ```
59
+ */
60
+ declare function logoUrl(team: Value, league: League, o?: LogoUrlOptions): Promise<string | undefined>;
61
+ /**
62
+ * Every archived mark for one team, best first (logos and wordmarks, every variant and source).
63
+ * Default: the committed shard (deduped, ranked rows). `full: true` fetches the CDN manifest lazily (once per process)
64
+ * and returns every manifest row for the team, including rows the shard dedupe dropped; a failed download throws
65
+ * `DownloadError`. Both paths filter on the team only. `fetch` overrides the global fetch for the manifest download.
66
+ * Throws `UnresolvedTeamError` when the team is null or does not resolve (strict, as Python).
67
+ */
68
+ declare function marks(team: Value, league: League, o?: {
69
+ season?: SeasonInput;
70
+ idSystem?: IdSystem;
71
+ full?: boolean;
72
+ fetch?: typeof fetch;
73
+ }): Promise<readonly MarkRow[]>;
74
+
75
+ export { type ColorOptions as C, type LogoUrlOptions as L, type SelectOptions as S, type ColorResult as a, logoUrlSync as b, selectMarkSync as c, teamColorsSync as d, logoUrl as l, marks as m, palette as p, selectMark as s, teamColors as t };