semiotic 3.8.8 → 3.9.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 (501) hide show
  1. package/README.md +82 -66
  2. package/agent-skill/semiotic-charts/SKILL.md +11 -2
  3. package/ai/behaviorContracts.cjs +33 -3
  4. package/ai/cli.js +53 -2
  5. package/ai/componentMetadata.cjs +15 -0
  6. package/ai/dist/mcp-server.js +1530 -611
  7. package/ai/examples.md +48 -42
  8. package/{CLAUDE.md → ai/reference.md} +46 -24
  9. package/ai/schema.json +10704 -825
  10. package/ai/surface-manifest.json +643 -2
  11. package/ai/system-prompt.md +83 -130
  12. package/dist/c-3BLJEQNG.min.js +1 -0
  13. package/dist/c-3KZD6AXJ.min.js +1 -0
  14. package/dist/c-4TWEX5HG.min.js +1 -0
  15. package/dist/c-52TEGIUJ.min.js +1 -0
  16. package/dist/c-5YCIX3VZ.min.js +1 -0
  17. package/dist/c-6FEKTA3U.min.js +1 -0
  18. package/dist/c-6O5EVOPH.min.js +1 -0
  19. package/dist/c-74HEEZGK.min.js +1 -0
  20. package/dist/c-AKAF6JAD.min.js +1 -0
  21. package/dist/c-BBKITSXB.min.js +1 -0
  22. package/dist/c-BWNB6USU.min.js +1 -0
  23. package/dist/c-C25ENHIK.min.js +1 -0
  24. package/dist/c-CDR5AO3R.min.js +1 -0
  25. package/dist/c-COHXCW3Q.min.js +1 -0
  26. package/dist/{chunk-scatterplotMatrixBrushOverlay-SDIZSN66.module.min.js → c-DADXPJXV.min.js} +0 -1
  27. package/dist/c-E3JFRRMI.min.js +1 -0
  28. package/dist/c-EBFPQHHO.min.js +1 -0
  29. package/dist/c-G36WS6LN.min.js +1 -0
  30. package/dist/c-GIKRQI4X.min.js +1 -0
  31. package/dist/c-GPYOFETM.min.js +1 -0
  32. package/dist/c-IDUHYYSI.min.js +1 -0
  33. package/dist/{chunk-chunk-FQPKOAIH.module.min.js → c-IUHFPMHD.min.js} +0 -1
  34. package/dist/c-J5G56TUH.min.js +1 -0
  35. package/dist/c-JAZ73J32.min.js +1 -0
  36. package/dist/c-KG3NXHAL.min.js +1 -0
  37. package/dist/c-KII3PLZE.min.js +1 -0
  38. package/dist/c-LIXGXMNS.min.js +1 -0
  39. package/dist/c-LVEY6D6B.min.js +1 -0
  40. package/dist/c-M4Y3BHFR.min.js +1 -0
  41. package/dist/c-MAIICR2Z.min.js +1 -0
  42. package/dist/c-MG5DM6VE.min.js +1 -0
  43. package/dist/{chunk-minimapBrushOverlay-JU57U7NM.module.min.js → c-MNF2S4AA.min.js} +0 -1
  44. package/dist/c-MT3WBK7M.min.js +1 -0
  45. package/dist/c-NY3JWV2K.min.js +1 -0
  46. package/dist/c-O6U6K4CW.min.js +1 -0
  47. package/dist/c-OCI56QF2.min.js +1 -0
  48. package/dist/c-OQ7M4AGV.min.js +1 -0
  49. package/dist/c-OXYMVK7Q.min.js +1 -0
  50. package/dist/c-PPWDL5ZI.min.js +1 -0
  51. package/dist/c-QHF5YON3.min.js +1 -0
  52. package/dist/c-RR3GO5SW.min.js +1 -0
  53. package/dist/{chunk-chunk-J5QD4RAM.module.min.js → c-RSVIHIQ4.min.js} +0 -1
  54. package/dist/{chunk-chunk-EMO5NUGE.module.min.js → c-S2BXNNJN.min.js} +0 -1
  55. package/dist/{chunk-chunk-YCQYG6J5.module.min.js → c-SLGMUBUL.min.js} +0 -1
  56. package/dist/c-SUILCHWU.min.js +1 -0
  57. package/dist/c-TZW3JGJ5.min.js +1 -0
  58. package/dist/c-US5ZFT6E.min.js +1 -0
  59. package/dist/{chunk-chunk-RZH7VZYS.module.min.js → c-USFMFKIH.min.js} +0 -1
  60. package/dist/c-UUKVD4WB.min.js +1 -0
  61. package/dist/{chunk-chunk-SV4XAZ3Q.module.min.js → c-VGW3VG3I.min.js} +0 -1
  62. package/dist/c-W3CE4A4S.min.js +1 -0
  63. package/dist/{chunk-chunk-2NVFEB7P.module.min.js → c-WJCD5EUY.min.js} +0 -1
  64. package/dist/{chunk-chunk-2JGJ5GUG.module.min.js → c-X5UBGU2V.min.js} +0 -1
  65. package/dist/c-YDAY2WFR.min.js +1 -0
  66. package/dist/c-ZOWWU34K.min.js +1 -0
  67. package/dist/components/AccessibleNavTree.d.ts +1 -1
  68. package/dist/components/CategoryColors.d.ts +1 -1
  69. package/dist/components/GradientLegend.d.ts +14 -0
  70. package/dist/components/Legend.d.ts +2 -7
  71. package/dist/components/LinkedCharts.d.ts +1 -1
  72. package/dist/components/MobileAnnotationCalloutList.d.ts +1 -1
  73. package/dist/components/ObservationReadout.d.ts +45 -0
  74. package/dist/components/ThemeProvider.d.ts +4 -4
  75. package/dist/components/Tooltip/FlippingTooltip.d.ts +5 -7
  76. package/dist/components/Tooltip/Tooltip.d.ts +83 -5
  77. package/dist/components/Tooltip/tooltipChrome.d.ts +43 -0
  78. package/dist/components/ai/chartCapabilityTypes.d.ts +86 -2
  79. package/dist/components/ai/chartClinic.d.ts +2 -0
  80. package/dist/components/ai/deriveProfileFields.d.ts +40 -0
  81. package/dist/components/ai/evaluateChart.d.ts +85 -0
  82. package/dist/components/ai/fieldPolicy.d.ts +7 -0
  83. package/dist/components/ai/fieldRoles.d.ts +24 -0
  84. package/dist/components/ai/generativeChart.d.ts +18 -2
  85. package/dist/components/ai/inferIntent.d.ts +26 -2
  86. package/dist/components/ai/intents.d.ts +35 -0
  87. package/dist/components/ai/navigationTree.d.ts +2 -2
  88. package/dist/components/ai/observedSceneAudit.d.ts +2 -1
  89. package/dist/components/ai/profileData.d.ts +11 -0
  90. package/dist/components/ai/repairChartConfig.d.ts +2 -3
  91. package/dist/components/ai/semanticEvidence.d.ts +4 -0
  92. package/dist/components/ai/semanticViability.d.ts +11 -0
  93. package/dist/components/ai/semanticViabilityRegistry.d.ts +5 -0
  94. package/dist/components/ai/streamingTypes.d.ts +4 -0
  95. package/dist/components/ai/suggestCharts.d.ts +5 -6
  96. package/dist/components/ai/suggestDashboard.d.ts +2 -3
  97. package/dist/components/ai/suggestStreamCharts.d.ts +1 -1
  98. package/dist/components/ai/suggestStretchCharts.d.ts +2 -3
  99. package/dist/components/ai/suggestionPropContracts.d.ts +20 -0
  100. package/dist/components/ai/variantDiscovery.d.ts +3 -1
  101. package/dist/components/charts/custom/NetworkCustomChart.d.ts +3 -0
  102. package/dist/components/charts/custom/OrdinalCustomChart.d.ts +3 -0
  103. package/dist/components/charts/custom/XYCustomChart.d.ts +1 -1
  104. package/dist/components/charts/geo/ChoroplethMap.d.ts +3 -1
  105. package/dist/components/charts/geo/DistanceCartogram.d.ts +2 -7
  106. package/dist/components/charts/geo/cartogramOverlay.d.ts +28 -0
  107. package/dist/components/charts/index.d.ts +4 -3
  108. package/dist/components/charts/network/ProcessSankey.d.ts +2 -136
  109. package/dist/components/charts/network/ProcessSankeyProps.d.ts +139 -0
  110. package/dist/components/charts/network/Treemap.d.ts +2 -1
  111. package/dist/components/charts/network/processSankey/boundaryHubOrdering.d.ts +23 -0
  112. package/dist/components/charts/network/processSankey/layoutGeometry.d.ts +2 -0
  113. package/dist/components/charts/network/processSankey/ordering.d.ts +3 -41
  114. package/dist/components/charts/network/processSankey/orderingTypes.d.ts +32 -0
  115. package/dist/components/charts/network/processSankey/packing.d.ts +1 -1
  116. package/dist/components/charts/network/processSankey/packingCache.d.ts +1 -1
  117. package/dist/components/charts/network/processSankey/packingOptimization.d.ts +72 -0
  118. package/dist/components/charts/ordinal/BarChart.d.ts +4 -3
  119. package/dist/components/charts/ordinal/FunnelChart.d.ts +2 -0
  120. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +3 -2
  121. package/dist/components/charts/ordinal/StackedBarChart.d.ts +4 -3
  122. package/dist/components/charts/ordinal/SwimlaneChart.d.ts +2 -2
  123. package/dist/components/charts/physics/GaltonBoardChart.d.ts +2 -9
  124. package/dist/components/charts/physics/GauntletChart.d.ts +10 -41
  125. package/dist/components/charts/physics/ProcessFlowChart.d.ts +1 -1
  126. package/dist/components/charts/physics/chainReactionAccessibleTable.d.ts +9 -0
  127. package/dist/components/charts/physics/chainReactionRuntime.d.ts +2 -1
  128. package/dist/components/charts/physics/chainReactionTypes.d.ts +6 -1
  129. package/dist/components/charts/physics/crucibleBodyRenderers.d.ts +2 -2
  130. package/dist/components/charts/physics/crucibleClone.d.ts +6 -0
  131. package/dist/components/charts/physics/crucibleEffects.d.ts +1 -2
  132. package/dist/components/charts/physics/crucibleRecord.d.ts +7 -0
  133. package/dist/components/charts/physics/gauntletChrome.d.ts +4 -4
  134. package/dist/components/charts/physics/gauntletPhysics.d.ts +1 -0
  135. package/dist/components/charts/physics/gauntletPublic.d.ts +4 -0
  136. package/dist/components/charts/physics/packetFlowOverlay.d.ts +7 -0
  137. package/dist/components/charts/physics/physicsChartLayout.d.ts +8 -0
  138. package/dist/components/charts/physics/physicsChartShared.d.ts +3 -1
  139. package/dist/components/charts/physics/physicsChartUtils.d.ts +1 -1
  140. package/dist/components/charts/physics/physicsHocUtils.d.ts +26 -13
  141. package/dist/components/charts/physics/physicsProjectionOverlays.d.ts +24 -0
  142. package/dist/components/charts/physics/processFlowOverlays.d.ts +9 -0
  143. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +17 -12
  144. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +12 -7
  145. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +37 -14
  146. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +23 -14
  147. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +22 -13
  148. package/dist/components/charts/realtime/aggregate.d.ts +4 -1
  149. package/dist/components/charts/realtime/eventTime.d.ts +4 -0
  150. package/dist/components/charts/realtime/realtimeChartRuntime.d.ts +27 -0
  151. package/dist/components/charts/realtime/realtimeChartTypes.d.ts +30 -0
  152. package/dist/components/charts/realtime/useRealtimeCategoryColors.d.ts +30 -0
  153. package/dist/components/charts/shared/FrameTextAnnotationSVG.d.ts +10 -0
  154. package/dist/components/charts/shared/annotationActivation.d.ts +3 -7
  155. package/dist/components/charts/shared/annotationBandFill.d.ts +6 -0
  156. package/dist/components/charts/shared/annotationDispatch.d.ts +31 -0
  157. package/dist/components/charts/shared/annotationIdentity.d.ts +8 -0
  158. package/dist/components/charts/shared/annotationRules.d.ts +1 -15
  159. package/dist/components/charts/shared/boundedCategoryRegistry.d.ts +8 -0
  160. package/dist/components/charts/shared/chainReactionChartSpec.d.ts +3 -0
  161. package/dist/components/charts/shared/chartMode.d.ts +3 -2
  162. package/dist/components/charts/shared/chartSpecCore.d.ts +1 -0
  163. package/dist/components/charts/shared/formatUtils.d.ts +40 -9
  164. package/dist/components/charts/shared/frameTextAnnotation.d.ts +63 -0
  165. package/dist/components/charts/shared/gradient.d.ts +16 -0
  166. package/dist/components/charts/shared/hatchFill.d.ts +15 -0
  167. package/dist/components/charts/shared/hooks.d.ts +4 -4
  168. package/dist/components/charts/shared/legendUtils.d.ts +1 -0
  169. package/dist/components/charts/shared/streamPropsHelpers.d.ts +3 -1
  170. package/dist/components/charts/shared/styleRules.d.ts +9 -2
  171. package/dist/components/charts/shared/styleRulesWireSchema.d.ts +353 -0
  172. package/dist/components/charts/shared/types.d.ts +26 -10
  173. package/dist/components/charts/shared/useChartLegend.d.ts +43 -9
  174. package/dist/components/charts/shared/useChartSetup.d.ts +3 -1
  175. package/dist/components/charts/shared/useCustomChartSetup.d.ts +5 -2
  176. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +5 -1
  177. package/dist/components/charts/shared/useOrdinalBrush.d.ts +3 -3
  178. package/dist/components/charts/shared/useStreamingLegend.d.ts +6 -1
  179. package/dist/components/charts/value/types.d.ts +1 -1
  180. package/dist/components/charts/xy/BubbleChart.d.ts +1 -1
  181. package/dist/components/charts/xy/BumpChart.capability.d.ts +14 -1
  182. package/dist/components/charts/xy/BumpChart.d.ts +13 -73
  183. package/dist/components/charts/xy/BumpChart.semanticViability.d.ts +5 -0
  184. package/dist/components/charts/xy/CandlestickChart.d.ts +2 -2
  185. package/dist/components/charts/xy/LineChart.d.ts +2 -2
  186. package/dist/components/charts/xy/Scatterplot.d.ts +1 -1
  187. package/dist/components/charts/xy/bumpData.d.ts +44 -0
  188. package/dist/components/charts/xy/bumpIdentity.d.ts +2 -0
  189. package/dist/components/charts/xy/bumpLayout.d.ts +45 -0
  190. package/dist/components/charts/xy/bumpTooltip.d.ts +20 -0
  191. package/dist/components/legendLayout.d.ts +131 -4
  192. package/dist/components/realtime/ReorderBuffer.d.ts +2 -0
  193. package/dist/components/realtime/types.d.ts +10 -1
  194. package/dist/components/recipes/balanceSnapshotsToFlows.d.ts +42 -0
  195. package/dist/components/recipes/directedReachability.d.ts +14 -0
  196. package/dist/components/recipes/gofishDisplayListFixtures.generated.d.ts +6 -6
  197. package/dist/components/recipes/gridObservatory.d.ts +1 -1
  198. package/dist/components/recipes/networkAnalysis.d.ts +1 -18
  199. package/dist/components/recipes/physics.d.ts +7 -4
  200. package/dist/components/recipes/processPhysics.d.ts +0 -1
  201. package/dist/components/recipes/waffle.d.ts +7 -4
  202. package/dist/components/semiotic-ai-core.d.ts +13 -4
  203. package/dist/components/semiotic-ai-observations.d.ts +3 -0
  204. package/dist/components/semiotic-ai.d.ts +16 -9
  205. package/dist/components/semiotic-client-shared.d.ts +10 -0
  206. package/dist/components/semiotic-experimental.d.ts +1 -1
  207. package/dist/components/semiotic-geo.d.ts +4 -1
  208. package/dist/components/semiotic-network.d.ts +7 -4
  209. package/dist/components/semiotic-ordinal.d.ts +4 -1
  210. package/dist/components/semiotic-physics.d.ts +11 -4
  211. package/dist/components/semiotic-realtime-core.d.ts +11 -4
  212. package/dist/components/semiotic-realtime-react.d.ts +4 -3
  213. package/dist/components/semiotic-realtime.d.ts +3 -1
  214. package/dist/components/semiotic-recipes-core.d.ts +7 -5
  215. package/dist/components/semiotic-server-edge.d.ts +3 -2
  216. package/dist/components/semiotic-server.d.ts +3 -2
  217. package/dist/components/semiotic-themes-core.d.ts +5 -48
  218. package/dist/components/semiotic-utils-core.d.ts +11 -5
  219. package/dist/components/semiotic-utils-react.d.ts +2 -0
  220. package/dist/components/semiotic-xy.d.ts +4 -1
  221. package/dist/components/semiotic.d.ts +68 -25
  222. package/dist/components/server/animatedGif.d.ts +1 -1
  223. package/dist/components/server/renderEvidence.d.ts +25 -2
  224. package/dist/components/server/renderToStaticSVG.d.ts +15 -7
  225. package/dist/components/server/serverChartConfigShared.d.ts +8 -1
  226. package/dist/components/server/serverChartConfigs.d.ts +1 -0
  227. package/dist/components/server/serverChartConfigsNetwork.d.ts +3 -3
  228. package/dist/components/server/serverChartConfigsNetworkChord.d.ts +2 -0
  229. package/dist/components/server/serverChartConfigsNetworkForce.d.ts +2 -0
  230. package/dist/components/server/serverChartConfigsNetworkHierarchy.d.ts +3 -0
  231. package/dist/components/server/serverChartConfigsXY.d.ts +3 -3
  232. package/dist/components/server/serverChartConfigsXYBubble.d.ts +5 -0
  233. package/dist/components/server/serverChartConfigsXYBump.d.ts +7 -0
  234. package/dist/components/server/serverChartConfigsXYScatter.d.ts +5 -0
  235. package/dist/components/server/staticAnnotationFallbacks.d.ts +10 -0
  236. package/dist/components/server/staticAnnotations.d.ts +28 -1
  237. package/dist/components/server/staticAxisTickLabel.d.ts +13 -0
  238. package/dist/components/server/staticLegend.d.ts +1 -1
  239. package/dist/components/server/staticLegendMargin.d.ts +41 -0
  240. package/dist/components/server/staticOrdinal.d.ts +8 -2
  241. package/dist/components/server/staticPhysics.d.ts +13 -1
  242. package/dist/components/server/staticPhysicsChrome.d.ts +20 -0
  243. package/dist/components/server/staticRawLegend.d.ts +15 -0
  244. package/dist/components/server/staticSVGChrome.d.ts +16 -55
  245. package/dist/components/server/staticXYAxes.d.ts +27 -0
  246. package/dist/components/server/staticXYAxisTicks.d.ts +39 -0
  247. package/dist/components/server/staticXYGrid.d.ts +11 -0
  248. package/dist/components/server/themeResolver.d.ts +5 -1
  249. package/dist/components/store/ThemeStore.d.ts +2 -98
  250. package/dist/components/store/designTokens.d.ts +1 -1
  251. package/dist/components/store/themeCSSVariables.d.ts +10 -0
  252. package/dist/components/store/themeCore.d.ts +91 -0
  253. package/dist/components/store/themePresets.d.ts +81 -0
  254. package/dist/components/store/themeSerialization.d.ts +2 -1
  255. package/dist/components/stream/AccessibleDataTable.d.ts +12 -14
  256. package/dist/components/stream/AccessibleTablePortalImpl.d.ts +6 -0
  257. package/dist/components/stream/GeoTileRenderer.d.ts +3 -0
  258. package/dist/components/stream/NetworkCanvasHitTester.d.ts +3 -1
  259. package/dist/components/stream/NetworkSSRFrame.d.ts +2 -1
  260. package/dist/components/stream/NetworkSVGOverlay.d.ts +3 -31
  261. package/dist/components/stream/OrdinalCanvasHitTester.d.ts +2 -0
  262. package/dist/components/stream/SVGChartTitle.d.ts +9 -0
  263. package/dist/components/stream/SVGOverlay.d.ts +1 -21
  264. package/dist/components/stream/SVGUnderlay.d.ts +24 -0
  265. package/dist/components/stream/SceneToSVG.d.ts +1 -1
  266. package/dist/components/stream/StreamGeoFrame.d.ts +1 -1
  267. package/dist/components/stream/StreamOrdinalFrame.d.ts +1 -1
  268. package/dist/components/stream/StreamXYFrame.d.ts +1 -1
  269. package/dist/components/stream/accessibleDataRows.d.ts +11 -0
  270. package/dist/components/stream/accessibleDataTableModel.d.ts +40 -0
  271. package/dist/components/stream/accessibleTableTypes.d.ts +11 -0
  272. package/dist/components/stream/axisTickUtils.d.ts +19 -0
  273. package/dist/components/stream/canvasBackground.d.ts +10 -0
  274. package/dist/components/stream/canvasSetup.d.ts +24 -4
  275. package/dist/components/stream/frameCursorInteraction.d.ts +25 -0
  276. package/dist/components/stream/frameDefaultMargins.d.ts +37 -0
  277. package/dist/components/stream/frameGraphics.d.ts +18 -0
  278. package/dist/components/stream/frameGraphicsSubscription.d.ts +26 -0
  279. package/dist/components/stream/frameLegendOptions.d.ts +18 -0
  280. package/dist/components/stream/geoFrameCursorInteraction.d.ts +9 -0
  281. package/dist/components/stream/geoFrameHelpers.d.ts +29 -1
  282. package/dist/components/stream/geoTypes.d.ts +12 -11
  283. package/dist/components/stream/hitTarget.d.ts +61 -2
  284. package/dist/components/stream/moduleWorkerSession.d.ts +6 -0
  285. package/dist/components/stream/networkAnnotationAnchors.d.ts +37 -0
  286. package/dist/components/stream/networkCustomLayout.d.ts +2 -2
  287. package/dist/components/stream/networkFrameCursorInteraction.d.ts +12 -0
  288. package/dist/components/stream/networkFrameInteraction.d.ts +2 -0
  289. package/dist/components/stream/networkFramePaint.d.ts +15 -0
  290. package/dist/components/stream/networkPipelineConfig.d.ts +1 -1
  291. package/dist/components/stream/networkTypes.d.ts +32 -32
  292. package/dist/components/stream/normalizeXYData.d.ts +7 -0
  293. package/dist/components/stream/ordinalFrameCursorInteraction.d.ts +7 -0
  294. package/dist/components/stream/ordinalFrameInteraction.d.ts +29 -0
  295. package/dist/components/stream/ordinalSceneSVG.d.ts +10 -0
  296. package/dist/components/stream/ordinalTypes.d.ts +12 -4
  297. package/dist/components/stream/physics/PhysicsBodySpatialIndex.d.ts +9 -1
  298. package/dist/components/stream/physics/PhysicsCanvasTheme.d.ts +25 -0
  299. package/dist/components/stream/physics/PhysicsControllers.d.ts +0 -3
  300. package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +4 -1
  301. package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +3 -24
  302. package/dist/components/stream/physics/PhysicsSettledSVG.d.ts +9 -21
  303. package/dist/components/stream/physics/PhysicsSettledSVGElement.d.ts +37 -0
  304. package/dist/components/stream/physics/PhysicsSettledScene.d.ts +7 -3
  305. package/dist/components/stream/physics/StreamPhysicsFrame.d.ts +1 -1
  306. package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +25 -4
  307. package/dist/components/stream/physics/physicsAnnotationContext.d.ts +19 -0
  308. package/dist/components/stream/physics/physicsBodyCanvas.d.ts +4 -0
  309. package/dist/components/stream/physics/physicsSettledChrome.d.ts +7 -0
  310. package/dist/components/stream/physics/usePhysicsCanvasPointer.d.ts +32 -0
  311. package/dist/components/stream/physics/usePhysicsSemanticNavigation.d.ts +36 -0
  312. package/dist/components/stream/pipelineConfig.d.ts +8 -17
  313. package/dist/components/stream/pipelineDomainResolution.d.ts +2 -2
  314. package/dist/components/stream/renderBackend.d.ts +2 -0
  315. package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +13 -2
  316. package/dist/components/stream/renderers/resolveCSSColor.d.ts +7 -0
  317. package/dist/components/stream/responsiveSize.d.ts +17 -0
  318. package/dist/components/stream/sceneCursor.d.ts +41 -0
  319. package/dist/components/stream/sceneRevisionDiagnostics.d.ts +1 -1
  320. package/dist/components/stream/svgOverlayUtils.d.ts +22 -1
  321. package/dist/components/stream/types.d.ts +33 -13
  322. package/dist/components/stream/useCanvasFrameHost.d.ts +12 -1
  323. package/dist/components/stream/useFrame.d.ts +24 -1
  324. package/dist/components/stream/useResponsiveSize.d.ts +6 -1
  325. package/dist/components/stream/useStalenessCheck.d.ts +1 -1
  326. package/dist/components/stream/xyFrameAxisTypes.d.ts +20 -4
  327. package/dist/components/stream/xyFrameCursorInteraction.d.ts +6 -0
  328. package/dist/components/stream/xySceneBuilders/swarmScene.d.ts +1 -1
  329. package/dist/components/stream/xySceneBuilders/types.d.ts +6 -26
  330. package/dist/components/types/legendTypes.d.ts +6 -0
  331. package/dist/components/types/marginType.d.ts +7 -8
  332. package/dist/controls.min.js +1 -1
  333. package/dist/controls.module.min.js +1 -1
  334. package/dist/forceLayoutWorker.js +1 -1
  335. package/dist/geo.min.js +1 -1
  336. package/dist/geo.module.min.js +1 -1
  337. package/dist/network.min.js +1 -1
  338. package/dist/network.module.min.js +1 -1
  339. package/dist/ordinal.min.js +1 -1
  340. package/dist/ordinal.module.min.js +1 -1
  341. package/dist/physics-matter.module.min.js +1 -1
  342. package/dist/physics-rapier.module.min.js +1 -1
  343. package/dist/physics.min.js +1 -1
  344. package/dist/physics.module.min.js +1 -1
  345. package/dist/physicsWorker.js +1 -1
  346. package/dist/processSankeyLayoutWorker.js +1 -1
  347. package/dist/realtime.min.js +1 -1
  348. package/dist/realtime.module.min.js +1 -1
  349. package/dist/rough.min.js +1 -1
  350. package/dist/rough.module.min.js +1 -1
  351. package/dist/semiotic-ai-core.d.ts +13 -4
  352. package/dist/semiotic-ai-core.min.js +1 -1
  353. package/dist/semiotic-ai-core.module.min.js +1 -1
  354. package/dist/semiotic-ai.d.ts +16 -9
  355. package/dist/semiotic-ai.min.js +1 -1
  356. package/dist/semiotic-ai.module.min.js +1 -1
  357. package/dist/semiotic-client-cjs-shared.min.js +1 -0
  358. package/dist/semiotic-client-glyph.module.min.js +2 -0
  359. package/dist/semiotic-client-responsive.module.min.js +2 -0
  360. package/dist/semiotic-client-shared.module.min.js +2 -0
  361. package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +2 -0
  362. package/dist/semiotic-data.min.js +1 -1
  363. package/dist/semiotic-data.module.min.js +1 -1
  364. package/dist/semiotic-experimental-auxiliary.module.min.js +2 -0
  365. package/dist/semiotic-experimental-node-auxiliary.module.min.js +2 -0
  366. package/dist/semiotic-experimental-node.module.min.js +2 -0
  367. package/dist/semiotic-experimental-react-shared.module.min.js +2 -0
  368. package/dist/semiotic-experimental-vacp.min.js +1 -1
  369. package/dist/semiotic-experimental-vacp.module.min.js +1 -1
  370. package/dist/semiotic-experimental.d.ts +1 -1
  371. package/dist/semiotic-experimental.min.js +1 -1
  372. package/dist/semiotic-experimental.module.min.js +1 -1
  373. package/dist/semiotic-geo.d.ts +4 -1
  374. package/dist/semiotic-network.d.ts +7 -4
  375. package/dist/semiotic-ordinal.d.ts +4 -1
  376. package/dist/semiotic-physics.d.ts +11 -4
  377. package/dist/semiotic-realtime-core.d.ts +11 -4
  378. package/dist/semiotic-realtime-core.min.js +2 -1
  379. package/dist/semiotic-realtime-core.module.min.js +2 -1
  380. package/dist/semiotic-realtime-react.d.ts +4 -3
  381. package/dist/semiotic-realtime-react.min.js +1 -1
  382. package/dist/semiotic-realtime-react.module.min.js +1 -1
  383. package/dist/semiotic-realtime.d.ts +3 -1
  384. package/dist/semiotic-recipes-core-cjs-base.min.js +1 -0
  385. package/dist/semiotic-recipes-core.d.ts +7 -5
  386. package/dist/semiotic-recipes-core.min.js +9 -1
  387. package/dist/semiotic-recipes-core.module.min.js +1 -1
  388. package/dist/semiotic-recipes-geo-cjs.min.js +1 -0
  389. package/dist/semiotic-recipes-react.min.js +1 -1
  390. package/dist/semiotic-recipes-react.module.min.js +1 -1
  391. package/dist/semiotic-recipes.min.js +7 -1
  392. package/dist/semiotic-recipes.module.min.js +2 -1
  393. package/dist/semiotic-server-edge-node.module.min.js +1 -0
  394. package/dist/semiotic-server-edge.d.ts +3 -2
  395. package/dist/semiotic-server-edge.min.js +1 -1
  396. package/dist/semiotic-server-edge.module.min.js +1 -1
  397. package/dist/semiotic-server-node.min.js +1 -1
  398. package/dist/semiotic-server-node.module.min.js +1 -1
  399. package/dist/semiotic-server.d.ts +3 -2
  400. package/dist/semiotic-themes-core.d.ts +5 -48
  401. package/dist/semiotic-themes-core.min.js +1 -1
  402. package/dist/semiotic-themes-core.module.min.js +1 -1
  403. package/dist/semiotic-themes-react.min.js +1 -1
  404. package/dist/semiotic-themes-react.module.min.js +1 -1
  405. package/dist/semiotic-themes.min.js +1 -1
  406. package/dist/semiotic-themes.module.min.js +1 -1
  407. package/dist/semiotic-utils-core.d.ts +11 -5
  408. package/dist/semiotic-utils-core.min.js +1 -1
  409. package/dist/semiotic-utils-core.module.min.js +1 -1
  410. package/dist/semiotic-utils-react.d.ts +2 -0
  411. package/dist/semiotic-utils-react.min.js +1 -1
  412. package/dist/semiotic-utils-react.module.min.js +1 -1
  413. package/dist/semiotic-utils.min.js +2 -1
  414. package/dist/semiotic-utils.module.min.js +2 -1
  415. package/dist/semiotic-value.min.js +1 -1
  416. package/dist/semiotic-value.module.min.js +1 -1
  417. package/dist/semiotic-xy.d.ts +4 -1
  418. package/dist/semiotic.d.ts +68 -25
  419. package/dist/semiotic.min.js +1 -1
  420. package/dist/semiotic.module.min.js +1 -1
  421. package/dist/server.min.js +1 -1
  422. package/dist/server.module.min.js +1 -1
  423. package/dist/xy.min.js +1 -1
  424. package/dist/xy.module.min.js +1 -1
  425. package/package.json +53 -19
  426. package/dist/__tests__/scenarios/mcpProtocolTypes.d.ts +0 -20
  427. package/dist/chunk-OrdinalBrushOverlay-PXHQYDB2.module.min.js +0 -2
  428. package/dist/chunk-XYBrushOverlay-ECZJJLAJ.module.min.js +0 -1
  429. package/dist/chunk-XYBrushOverlay-EP2SV3UI.module.min.js +0 -2
  430. package/dist/chunk-chartContainerDataAudit-IQ3NBN3Q.module.min.js +0 -2
  431. package/dist/chunk-chunk-2B3AIKUZ.module.min.js +0 -2
  432. package/dist/chunk-chunk-2CXCXRB4.module.min.js +0 -1
  433. package/dist/chunk-chunk-3GCILWPB.module.min.js +0 -2
  434. package/dist/chunk-chunk-46KRGJQP.module.min.js +0 -1
  435. package/dist/chunk-chunk-4ITOQRXM.module.min.js +0 -2
  436. package/dist/chunk-chunk-4MLLQUGW.module.min.js +0 -2
  437. package/dist/chunk-chunk-57RBPDBQ.module.min.js +0 -2
  438. package/dist/chunk-chunk-5UKL5W76.module.min.js +0 -2
  439. package/dist/chunk-chunk-5VVNW5AZ.module.min.js +0 -1
  440. package/dist/chunk-chunk-66PCWJUG.module.min.js +0 -1
  441. package/dist/chunk-chunk-6V5VQVCT.module.min.js +0 -2
  442. package/dist/chunk-chunk-7LE56WAE.module.min.js +0 -2
  443. package/dist/chunk-chunk-7T25U75Z.module.min.js +0 -2
  444. package/dist/chunk-chunk-ACLDBMRH.module.min.js +0 -2
  445. package/dist/chunk-chunk-AF53TBSN.module.min.js +0 -2
  446. package/dist/chunk-chunk-BTZYH2IE.module.min.js +0 -1
  447. package/dist/chunk-chunk-BWV55BZK.module.min.js +0 -2
  448. package/dist/chunk-chunk-BZNOAHJV.module.min.js +0 -2
  449. package/dist/chunk-chunk-CD6PVVS3.module.min.js +0 -2
  450. package/dist/chunk-chunk-DTSNLGRK.module.min.js +0 -2
  451. package/dist/chunk-chunk-FC3NZWYR.module.min.js +0 -2
  452. package/dist/chunk-chunk-FEPXDKJP.module.min.js +0 -1
  453. package/dist/chunk-chunk-FJ76HWQZ.module.min.js +0 -1
  454. package/dist/chunk-chunk-FRGBMTZR.module.min.js +0 -1
  455. package/dist/chunk-chunk-G75OPF5N.module.min.js +0 -2
  456. package/dist/chunk-chunk-H5IFO6CU.module.min.js +0 -2
  457. package/dist/chunk-chunk-HADHLMY5.module.min.js +0 -1
  458. package/dist/chunk-chunk-HBFA4NN6.module.min.js +0 -1
  459. package/dist/chunk-chunk-HCNDE26Q.module.min.js +0 -2
  460. package/dist/chunk-chunk-IY7RYD4S.module.min.js +0 -1
  461. package/dist/chunk-chunk-J3QOW4OE.module.min.js +0 -0
  462. package/dist/chunk-chunk-J3XWETBJ.module.min.js +0 -2
  463. package/dist/chunk-chunk-JJ4BSUYL.module.min.js +0 -2
  464. package/dist/chunk-chunk-JRHXQGEV.module.min.js +0 -2
  465. package/dist/chunk-chunk-KTWEBFMX.module.min.js +0 -2
  466. package/dist/chunk-chunk-L6FFYGYS.module.min.js +0 -1
  467. package/dist/chunk-chunk-LJDH3WV3.module.min.js +0 -2
  468. package/dist/chunk-chunk-LSJUXBMF.module.min.js +0 -1
  469. package/dist/chunk-chunk-N3Q33XCB.module.min.js +0 -2
  470. package/dist/chunk-chunk-NWIGA3UK.module.min.js +0 -1
  471. package/dist/chunk-chunk-OG3TTJGJ.module.min.js +0 -2
  472. package/dist/chunk-chunk-OZK46A5U.module.min.js +0 -1
  473. package/dist/chunk-chunk-PMR47KRY.module.min.js +0 -2
  474. package/dist/chunk-chunk-Q2YADC2V.module.min.js +0 -2
  475. package/dist/chunk-chunk-QQJNG23C.module.min.js +0 -2
  476. package/dist/chunk-chunk-RGJ6TKAH.module.min.js +0 -2
  477. package/dist/chunk-chunk-ROP4HI7H.module.min.js +0 -2
  478. package/dist/chunk-chunk-SFLUSZ73.module.min.js +0 -2
  479. package/dist/chunk-chunk-TCMHJWFJ.module.min.js +0 -1
  480. package/dist/chunk-chunk-TSCFL235.module.min.js +0 -1
  481. package/dist/chunk-chunk-U66USBWU.module.min.js +0 -1
  482. package/dist/chunk-chunk-UEZ6SHW5.module.min.js +0 -2
  483. package/dist/chunk-chunk-UOQRPGPK.module.min.js +0 -2
  484. package/dist/chunk-chunk-VUWYT7DY.module.min.js +0 -2
  485. package/dist/chunk-chunk-W5HWGQMD.module.min.js +0 -2
  486. package/dist/chunk-chunk-WFHZHWT7.module.min.js +0 -1
  487. package/dist/chunk-chunk-WGROBM3I.module.min.js +0 -2
  488. package/dist/chunk-chunk-WSDJFBKX.module.min.js +0 -2
  489. package/dist/chunk-chunk-YHNZCPOZ.module.min.js +0 -2
  490. package/dist/chunk-chunk-YWZB3KPI.module.min.js +0 -2
  491. package/dist/chunk-statisticalOverlays-HMYYSGPE.module.min.js +0 -2
  492. package/dist/components/stream/test-utils/frameScheduler.d.ts +0 -12
  493. package/dist/components/stream/test-utils/revisionConsumption.d.ts +0 -13
  494. package/dist/test-utils/canvasMock.d.ts +0 -86
  495. package/dist/test-utils/capturedFrameProps.d.ts +0 -67
  496. package/dist/test-utils/frameMock.d.ts +0 -81
  497. package/dist/test-utils/ordinalFixtures.d.ts +0 -48
  498. /package/dist/{chunk-chunk-JJ2OOIET.module.min.js → c-GGISSW5E.min.js} +0 -0
  499. /package/dist/{chunk-chunk-SIRIJ3DY.module.min.js → c-N4G2L7ID.min.js} +0 -0
  500. /package/dist/{chunk-chunk-CA3YDW6F.module.min.js → c-S6U5CGT5.min.js} +0 -0
  501. /package/dist/components/recipes/{mobileAnnotationStrategy.d.ts → mobileAnnotationBehavior.d.ts} +0 -0
@@ -1,7 +1,7 @@
1
- import type { ReactNode } from "react";
1
+ import type { CSSProperties, ReactNode } from "react";
2
2
  import type { ScaleLinear } from "d3-scale";
3
3
  import type { AnimateProp } from "./pipelineTransitionUtils";
4
- import type { LegendLayout, LegendValue } from "../types/legendTypes";
4
+ import type { LegendItem, LegendLayout, LegendValue } from "../types/legendTypes";
5
5
  import type { ArrowOfTime, WindowMode, LineStyle, BarStyle, WaterfallStyle, SwarmStyle, HoverAnnotationConfig, HoverData, AnnotationContext, AnnotationAnchorMode } from "../realtime/types";
6
6
  import type { Datum } from "../charts/shared/datumTypes";
7
7
  import type { HatchFill } from "../charts/shared/hatchFill";
@@ -13,6 +13,7 @@ import type { GlyphDef } from "./glyphDef";
13
13
  import type { SceneRenderMode } from "./sceneRenderBackendTypes";
14
14
  import type { StreamSemanticInteractionProps } from "./streamSemanticTypes";
15
15
  import type { XYFrameAxisConfig } from "./xyFrameAxisTypes";
16
+ import type { AccessibleTableProp } from "./accessibleTableTypes";
16
17
  export type { SceneRenderBackend, SceneRenderMode } from "./sceneRenderBackendTypes";
17
18
  export type { ThemeSemanticColors } from "./streamThemeTypes";
18
19
  export type { AxisTickFormat, AxisTickFormatter, XYFrameAxisConfig } from "./xyFrameAxisTypes";
@@ -110,6 +111,14 @@ export interface Style {
110
111
  fill?: string | HatchFill | CanvasPattern;
111
112
  fillOpacity?: number;
112
113
  opacity?: number;
114
+ /**
115
+ * CSS cursor shown for this rendered mark.
116
+ *
117
+ * Presentation only: this does not create click, keyboard, or observation
118
+ * behavior. Pair it with the frame/chart interaction API when the mark is
119
+ * actionable.
120
+ */
121
+ cursor?: CSSProperties["cursor"];
113
122
  /** For icon/isotype bars: an image to stamp instead of filling */
114
123
  icon?: HTMLImageElement | HTMLCanvasElement;
115
124
  /** Padding between stamped icons */
@@ -185,6 +194,7 @@ export interface AreaSceneNode {
185
194
  y: number;
186
195
  height: number;
187
196
  color?: string;
197
+ opacity?: number;
188
198
  }>;
189
199
  style: Style;
190
200
  datum: SeriesDatum;
@@ -416,7 +426,7 @@ export interface HeatcellSceneNode {
416
426
  accessibility?: SceneAccessibilityMetadata["accessibility"];
417
427
  /** Optional style object (used for decay/transition opacity on heatmap cells) */
418
428
  style?: Style;
419
- /** Numeric cell value (for canvas text rendering when showValues is enabled) */
429
+ /** Resolved numeric cell value used for domain emission and optional labels */
420
430
  value?: number;
421
431
  /** Whether to render the value as text inside the cell */
422
432
  showValues?: boolean;
@@ -464,7 +474,7 @@ export interface CandlestickSceneNode {
464
474
  _pulseGlowRadius?: number;
465
475
  /** Animation target opacity (set during enter/exit transitions) */
466
476
  _targetOpacity?: number;
467
- /** Decay opacity for candlestick nodes (no style object, stored separately) */
477
+ /** Decay opacity for candlestick paint, stored separately from presentation style. */
468
478
  _decayOpacity?: number;
469
479
  /** Stable identity key for transition tracking */
470
480
  _transitionKey?: string;
@@ -484,6 +494,8 @@ export interface CandlestickStyle {
484
494
  wickWidth?: number;
485
495
  /** Single color for range/dumbbell mode (replaces up/down when no open/close provided) */
486
496
  rangeColor?: string;
497
+ /** Presentation-only cursor for each candlestick/range mark. */
498
+ cursor?: CSSProperties["cursor"];
487
499
  }
488
500
  export interface Changeset<T = Datum> {
489
501
  inserts: T[];
@@ -645,6 +657,7 @@ export interface StreamXYFrameProps<T = Datum> extends StreamSemanticInteraction
645
657
  semanticLineStops?: Array<{
646
658
  offset: number;
647
659
  color: string;
660
+ opacity?: number;
648
661
  }>;
649
662
  /** Series names (matching lineBy/colorBy group keys) that render as filled areas in "mixed" chartType */
650
663
  areaGroups?: string[];
@@ -698,6 +711,12 @@ export interface StreamXYFrameProps<T = Datum> extends StreamSemanticInteraction
698
711
  };
699
712
  className?: string;
700
713
  background?: string;
714
+ /**
715
+ * Maximum canvas backing-store pixel ratio. Defaults to 3 on desktop and 2
716
+ * on coarse-pointer/small-screen devices. Increase this when mark crispness
717
+ * at high browser zoom is more important than canvas memory/paint cost.
718
+ */
719
+ maxDevicePixelRatio?: number;
701
720
  /** Optional scene paint backend. Exact scene geometry remains interactive. */
702
721
  renderMode?: SceneRenderMode<SceneNode>;
703
722
  lineStyle?: LineStyle | ((d: T, group?: string) => Style);
@@ -728,14 +747,15 @@ export interface StreamXYFrameProps<T = Datum> extends StreamSemanticInteraction
728
747
  * tick generator — round tick labels at the cost of ticks not
729
748
  * reaching the exact data min/max. `"exact"` pins the first
730
749
  * and last tick to the data domain and spaces intermediate
731
- * ticks equidistantly. Applies to both x and y axes. */
750
+ * ticks equidistantly. Applies to both x and y axes unless an entry in
751
+ * `axes` supplies its own `extent` override. */
732
752
  axisExtent?: import("../charts/shared/axisExtent").AxisExtentMode;
733
753
  tickFormatTime?: (value: number) => string;
734
754
  tickFormatValue?: (value: number) => string;
735
755
  hoverAnnotation?: boolean | HoverAnnotationConfig;
736
756
  tooltipContent?: (d: HoverData) => ReactNode;
737
757
  enableHover?: boolean;
738
- /** Max pixel distance for hover/click hit testing. Default 30. */
758
+ /** Requested minimum hit radius; visible mark size and the 12px floor may increase it. Default 30. */
739
759
  hoverRadius?: number;
740
760
  /** Tooltip mode: "single" (default) shows one datum, "multi" shows all series at the hovered X. */
741
761
  tooltipMode?: "single" | "multi";
@@ -762,12 +782,8 @@ export interface StreamXYFrameProps<T = Datum> extends StreamSemanticInteraction
762
782
  svgAnnotationRules?: (annotation: Datum, index: number, context: AnnotationContext) => ReactNode;
763
783
  showGrid?: boolean;
764
784
  legend?: LegendValue;
765
- legendHoverBehavior?: (item: {
766
- label: string;
767
- } | null) => void;
768
- legendClickBehavior?: (item: {
769
- label: string;
770
- }) => void;
785
+ legendHoverBehavior?: (item: LegendItem | null) => void;
786
+ legendClickBehavior?: (item: LegendItem) => void;
771
787
  legendHighlightedCategory?: string | null;
772
788
  legendIsolatedCategories?: Set<string>;
773
789
  legendPosition?: "right" | "left" | "top" | "bottom";
@@ -822,8 +838,12 @@ export interface StreamXYFrameProps<T = Datum> extends StreamSemanticInteraction
822
838
  showValues?: boolean;
823
839
  /** Format function for heatmap cell value labels */
824
840
  heatmapValueFormat?: (v: number) => string;
841
+ /** Explicit value-to-color function for heatmap cells. */
842
+ heatmapColorScale?: (value: number) => string;
843
+ /** Reports the current heatcell value domain after scene recomputation. */
844
+ onColorDomainChange?: (domain: [number, number] | null) => void;
825
845
  /** Render a visually-hidden data table from the scene graph for screen readers */
826
- accessibleTable?: boolean;
846
+ accessibleTable?: AccessibleTableProp;
827
847
  /** Accessible description overriding the auto-generated aria-label on the chart container */
828
848
  description?: string;
829
849
  /** Accessible summary rendered as a screen-reader-only note */
@@ -27,6 +27,8 @@ export interface UseCanvasFrameHostInput<TStore extends object> {
27
27
  manageFrameRuntime?: boolean;
28
28
  hydrated: boolean;
29
29
  wasHydratingFromSSR: boolean;
30
+ /** Consumer override for the canvas backing-store DPR ceiling. */
31
+ maxDevicePixelRatio?: number;
30
32
  /** Family-specific teardown such as clearing a streaming data adapter. */
31
33
  cleanup?: () => void;
32
34
  /**
@@ -53,6 +55,13 @@ export interface CanvasFrameHostResult {
53
55
  canvasRef: RefObject<HTMLCanvasElement | null>;
54
56
  /** Optional family use for hover/crosshair/highlight canvas content. */
55
57
  interactionCanvasRef: RefObject<HTMLCanvasElement | null>;
58
+ /**
59
+ * Set when only the canvas backing store must re-rasterize retained
60
+ * geometry (browser zoom / display DPR / maxDevicePixelRatio). Families
61
+ * should OR this into the paint gate but **not** into scene rebuild so a
62
+ * zoom does not re-run layout or scale construction.
63
+ */
64
+ resolutionDirtyRef: MutableRefObject<boolean>;
56
65
  }
57
66
  type FrameCanvasHost = Pick<UseFrameResult, "renderFnRef" | "scheduleRender" | "cancelRender" | "frameRuntime">;
58
67
  type FrameCanvasHostInput<TStore extends object> = Omit<UseCanvasFrameHostInput<TStore>, "renderFnRef" | "scheduleRender" | "cancelRender" | "frameRuntime">;
@@ -66,6 +75,8 @@ export interface CanvasFrameBackgroundProps {
66
75
  children: ReactNode;
67
76
  size: readonly [number, number];
68
77
  margin: FrameMargin;
78
+ /** Optional full-frame paint beneath translated background graphics. */
79
+ backdropFill?: string;
69
80
  /** Preserve a family's existing SVG overflow behavior when it needs it. */
70
81
  overflowVisible?: boolean;
71
82
  }
@@ -73,5 +84,5 @@ export interface CanvasFrameBackgroundProps {
73
84
  * The shared SVG background layer. Its coordinate translation is common;
74
85
  * resolving graphics and choosing their contents remain family-specific.
75
86
  */
76
- export declare function CanvasFrameBackground({ children, size, margin, overflowVisible, }: CanvasFrameBackgroundProps): React.ReactNode;
87
+ export declare function CanvasFrameBackground({ children, size, margin, backdropFill, overflowVisible, }: CanvasFrameBackgroundProps): React.ReactNode;
77
88
  export {};
@@ -1,12 +1,14 @@
1
1
  import * as React from "react";
2
2
  import type { ReactNode } from "react";
3
- import type { SemioticTheme } from "../store/ThemeStore";
3
+ import type { SemioticTheme } from "../store/themeCore";
4
4
  import { useResponsiveSize } from "./useResponsiveSize";
5
5
  import { resolveAnimateConfig } from "./pipelineTransitionUtils";
6
6
  import type { AnimateProp } from "./pipelineTransitionUtils";
7
7
  import type { TransitionConfig } from "./types";
8
8
  import type { HoverPointerCoords } from "./hoverUtils";
9
9
  import { FrameRuntime, type FrameClock, type FrameRandom } from "./FrameRuntime";
10
+ import { type AxisChromeInput } from "../legendLayout";
11
+ import type { LegendLayout } from "../types/legendTypes";
10
12
  /**
11
13
  * The small scheduling surface `useFrame` needs. Keeping this separate from
12
14
  * the browser global gives hook tests a deterministic, handle-agnostic seam
@@ -60,6 +62,12 @@ export interface UseFrameInput {
60
62
  legend?: unknown;
61
63
  /** Legend placement used for shared top-chrome clearance. */
62
64
  legendPosition?: "right" | "left" | "top" | "bottom";
65
+ /** Shared legend metrics used to reserve direct-frame plot space. */
66
+ legendLayout?: LegendLayout;
67
+ /** Axis chrome adjacent to the legend, when the frame has axes. */
68
+ axisChrome?: AxisChromeInput;
69
+ /** A chart HOC already calculated the legend-aware margin. */
70
+ legendMarginReserved?: boolean;
63
71
  /** Frame's `foregroundGraphics` prop. */
64
72
  foregroundGraphics?: FrameGraphicsProp;
65
73
  /** Frame's `backgroundGraphics` prop. */
@@ -101,6 +109,12 @@ export interface UseFrameInput {
101
109
  * timing on those three).
102
110
  */
103
111
  themeDirtyRef?: React.MutableRefObject<boolean>;
112
+ /**
113
+ * Skip the mount-time invalidation while retaining later theme-change
114
+ * repaints. Useful for frames that synchronously paint their initial settled
115
+ * state and would otherwise queue a redundant animation frame on mount.
116
+ */
117
+ skipInitialThemeInvalidation?: boolean;
104
118
  }
105
119
  export interface UseFrameResult {
106
120
  /** Reduced-motion preference at last render (for re-render gating). */
@@ -155,6 +169,15 @@ export interface UseFrameResult {
155
169
  /** Stable callback to attach to canvas's onPointerLeave (or onMouseLeave).
156
170
  * Cancels any pending hover rAF and invokes hoverLeaveRef. */
157
171
  onPointerLeave: () => void;
172
+ /** Last pointer position over the frame. Frames use this to refresh
173
+ * geometry-derived presentation while marks animate under a stationary
174
+ * pointer; reading/writing the ref never schedules work by itself. */
175
+ pointerStateRef: React.MutableRefObject<{
176
+ inside: boolean;
177
+ clientX: number;
178
+ clientY: number;
179
+ pointerType?: string;
180
+ }>;
158
181
  }
159
182
  /**
160
183
  * Bundles the universally-shared setup boilerplate that opens every
@@ -1,3 +1,7 @@
1
+ import { type RefObject } from "react";
2
+ import { type ResponsiveSizeOptions } from "./responsiveSize";
3
+ export { resolveResponsiveDimension } from "./responsiveSize";
4
+ export type { ResponsiveSizeOptions } from "./responsiveSize";
1
5
  /**
2
6
  * Hook that measures the parent container and returns responsive dimensions.
3
7
  * Uses ResizeObserver to track container size changes.
@@ -5,6 +9,7 @@
5
9
  * @param baseSize - The default [width, height] from the size prop
6
10
  * @param responsiveWidth - Whether width should follow container width
7
11
  * @param responsiveHeight - Whether height should follow container height
12
+ * @param options - Optional min/max and resize-quantization constraints
8
13
  * @returns [containerRef, effectiveSize] — attach the ref to the container div
9
14
  */
10
- export declare function useResponsiveSize(baseSize: [number, number], responsiveWidth?: boolean, responsiveHeight?: boolean): [React.RefObject<HTMLDivElement>, [number, number]];
15
+ export declare function useResponsiveSize(baseSize: [number, number], responsiveWidth?: boolean, responsiveHeight?: boolean, options?: ResponsiveSizeOptions): [RefObject<HTMLDivElement | null>, [number, number]];
@@ -17,5 +17,5 @@ interface StoreWithIngestTime {
17
17
  * declared. The `isStale` / `setIsStale` state must live in the caller
18
18
  * so that the `useState` call order stays unchanged.
19
19
  */
20
- export declare function useStalenessCheck(staleness: StalenessConfig | undefined, storeRef: React.RefObject<StoreWithIngestTime | null>, dirtyRef: React.MutableRefObject<boolean>, scheduleRender: () => void, isStale: boolean, setIsStale: (stale: boolean) => void): void;
20
+ export declare function useStalenessCheck(staleness: StalenessConfig | undefined, storeRef: React.RefObject<StoreWithIngestTime | null>, dirtyRef: React.MutableRefObject<boolean>, scheduleRender: () => void, now: () => number, isStale: boolean, setIsStale: (stale: boolean) => void): void;
21
21
  export {};
@@ -3,6 +3,13 @@ export type AxisTickFormat = ((d: number, index?: number, allTicks?: number[]) =
3
3
  export type AxisTickFormatter = {
4
4
  bivarianceHack(d: string | number | Date, index?: number, allTicks?: number[]): string | ReactNode;
5
5
  }["bivarianceHack"];
6
+ /** SVG stroke properties shared by an axis baseline/ticks or its grid lines. */
7
+ export interface AxisLineStyle {
8
+ stroke?: string;
9
+ strokeWidth?: number;
10
+ strokeOpacity?: number;
11
+ strokeDasharray?: string;
12
+ }
6
13
  /**
7
14
  * Per-axis configuration object for an XY frame's `axes: []` array.
8
15
  * Distinct from `AxisConfig` exported from the HOC layer (which is the
@@ -18,6 +25,13 @@ export interface XYFrameAxisConfig {
18
25
  orient: "left" | "right" | "top" | "bottom";
19
26
  label?: string;
20
27
  ticks?: number;
28
+ /** Compatibility alias for `ticks`; `ticks` wins when both are supplied. */
29
+ tickCount?: number;
30
+ /**
31
+ * Override the chart-level `axisExtent` mode for this axis. Horizontal
32
+ * (`top`/`bottom`) and vertical (`left`/`right`) axes resolve independently.
33
+ */
34
+ extent?: import("../charts/shared/axisExtent").AxisExtentMode;
21
35
  /** Per-axis tick label formatter. ReactNode return is supported and
22
36
  * renders inside a `<foreignObject>`. */
23
37
  tickFormat?: AxisTickFormatter;
@@ -28,10 +42,12 @@ export interface XYFrameAxisConfig {
28
42
  * the positions. Pixel-distance filtering downstream still drops
29
43
  * overlapping labels. Mirrors the ordinal frame's `rTickValues`. */
30
44
  tickValues?: Array<number | Date>;
31
- /** Grid line stroke style: `"dashed"` (6,4), `"dotted"` (2,4), or a
32
- * custom strokeDasharray string. Applied to grid lines extending
33
- * from ticks across the chart area. */
34
- gridStyle?: "dashed" | "dotted" | string;
45
+ /** Grid line stroke style. A string is a dash preset (`"dashed"`,
46
+ * `"dotted"`) or custom strokeDasharray; an object controls each grid
47
+ * line's SVG stroke attributes. */
48
+ gridStyle?: "dashed" | "dotted" | string | AxisLineStyle;
49
+ /** Baseline and tick-mark stroke styling for this axis. */
50
+ axisStyle?: AxisLineStyle;
35
51
  /** Set false to suppress grid lines emitted from this axis while retaining
36
52
  * its ticks and baseline. For example, set the bottom axis to `false` for
37
53
  * horizontal-only (y-axis) grid lines. */
@@ -0,0 +1,6 @@
1
+ import type { PipelineStore } from "./PipelineStore";
2
+ import type { CursorFrameGeometry } from "./frameCursorInteraction";
3
+ export declare function rehitXYFrameCursor(options: CursorFrameGeometry & {
4
+ store: PipelineStore;
5
+ hoverRadius: number;
6
+ }): void;
@@ -2,7 +2,7 @@ import type { Datum } from "../../charts/shared/datumTypes";
2
2
  /**
3
3
  * Realtime swarm chart scene builder.
4
4
  *
5
- * Simple point scatter with category-based coloring from barColors config.
5
+ * Simple point scatter with lazily resolved category-based coloring.
6
6
  *
7
7
  * Consumed by: PipelineStore.buildSceneNodes (chartType "swarm")
8
8
  */
@@ -8,7 +8,7 @@ import type { AreaGradientConfig } from "./areaGradient";
8
8
  * Scene builders are pure functions that receive this context instead of
9
9
  * accessing PipelineStore instance fields directly.
10
10
  */
11
- import type { StreamScales, Style, CurveType, BarStyle, ThemeSemanticColors } from "../types";
11
+ import type { StreamScales, Style, CurveType, BarStyle, CandlestickStyle, SwarmStyle, ThemeSemanticColors, WaterfallStyle } from "../types";
12
12
  import type { SymbolName } from "../symbolPath";
13
13
  import type { ResolvedRibbon } from "./ribbonScene";
14
14
  import type { GradientConfig } from "../../charts/shared/gradient";
@@ -66,6 +66,7 @@ export interface XYSceneConfig {
66
66
  semanticLineStops?: Array<{
67
67
  offset: number;
68
68
  color: string;
69
+ opacity?: number;
69
70
  }>;
70
71
  annotations?: Datum[];
71
72
  pointStyle?: (d: Datum) => Style & {
@@ -82,6 +83,7 @@ export interface XYSceneConfig {
82
83
  heatmapYBins?: number;
83
84
  showValues?: boolean;
84
85
  heatmapValueFormat?: (v: number) => string;
86
+ heatmapColorScale?: (value: number) => string;
85
87
  binSize?: number;
86
88
  barColors?: Record<string, string>;
87
89
  /** Bar fill/stroke/strokeWidth/gap. Threaded through from RealtimeHistogram. */
@@ -91,31 +93,9 @@ export interface XYSceneConfig {
91
93
  themeSequential?: string;
92
94
  /** Theme diverging scheme name — fallback when colorScheme is not set. */
93
95
  themeDiverging?: string;
94
- swarmStyle?: {
95
- radius?: number;
96
- fill?: string;
97
- opacity?: number;
98
- stroke?: string;
99
- strokeWidth?: number;
100
- };
101
- waterfallStyle?: {
102
- positiveColor?: string;
103
- negativeColor?: string;
104
- gap?: number;
105
- stroke?: string;
106
- strokeWidth?: number;
107
- opacity?: number;
108
- connectorStroke?: string;
109
- connectorWidth?: number;
110
- };
111
- candlestickStyle?: {
112
- upColor?: string;
113
- downColor?: string;
114
- wickColor?: string;
115
- wickWidth?: number;
116
- bodyWidth?: number;
117
- rangeColor?: string;
118
- };
96
+ swarmStyle?: SwarmStyle;
97
+ waterfallStyle?: WaterfallStyle;
98
+ candlestickStyle?: CandlestickStyle;
119
99
  /** True when candlestick is in range/dumbbell mode (no open/close accessors provided) */
120
100
  candlestickRangeMode?: boolean;
121
101
  boundsStyle?: Style | ((d: Datum, group: string) => Style);
@@ -60,6 +60,12 @@ export interface LegendLayout {
60
60
  rowHeight?: number;
61
61
  /** Override the alignment width used for top/bottom legends */
62
62
  maxWidth?: number;
63
+ /**
64
+ * Space between a left/right legend and the outer SVG edge. The default is
65
+ * sized for the interactive swatch focus ring; set to 0 to preserve the
66
+ * historical flush placement.
67
+ */
68
+ edgeGutter?: number;
63
69
  /**
64
70
  * Space between the plot and a left/right legend reserved for adjacent
65
71
  * chart chrome such as axis ticks and an axis title. Ignored for top/bottom
@@ -8,17 +8,16 @@ export interface MarginType {
8
8
  left: number;
9
9
  right: number;
10
10
  }
11
- /** Public margin side value. Numbers pin a side to an exact pixel value.
12
- * `"auto"` and `null` explicitly leave that side to chart defaults plus
13
- * auto-reservation such as legends. */
11
+ /** Public margin side value. Numbers set a pixel baseline; chart-owned chrome
12
+ * such as legends may grow that side when it needs more room. `"auto"` and
13
+ * `null` explicitly start from the chart-mode default. */
14
14
  export type MarginSide = number | "auto" | null | undefined;
15
15
  /** Public-API margin shape. Users can pass any subset of sides (`{ left: 120 }`
16
16
  * for wide y-axis labels is a common pattern) or a single number as shorthand
17
- * for "same on all sides". Pass a side as `"auto"` or `null` to explicitly
18
- * opt back into chart auto-reservation for that side, e.g.
19
- * `{ right: "auto" }` with a right-side legend. The frame fills missing/auto
20
- * sides from chart-mode defaults before handing a fully-resolved
21
- * `MarginType` to the layout code. */
17
+ * for "same baseline on all sides". Numeric values are minima when Semiotic
18
+ * reserves chart-owned chrome such as legends. Pass a side as `"auto"` or
19
+ * `null` to start from the chart-mode default. The frame fills missing/auto
20
+ * sides before handing a fully-resolved `MarginType` to layout code. */
22
21
  export type PartialMargin = number | {
23
22
  top?: MarginSide;
24
23
  right?: MarginSide;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- var e,t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,l=(e,t,o,l)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of a(t))i.call(e,s)||s===o||n(e,s,{get:()=>t[s],enumerable:!(l=r(t,s))||l.enumerable});return e},s=(e,r,a)=>(a=null!=e?t(o(e)):{},l(!r&&e&&e.__esModule?a:n(a,"default",{value:e,enumerable:!0}),e)),u={};((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(u,{CircularBrush:()=>Q,DirectManipulationControl:()=>b,MobileStandardControls:()=>pe,SentenceFilter:()=>K,VISUALIZATION_CONTROL_TYPES:()=>p,auditVisualizationControls:()=>_,clampMobileRange:()=>ne,createControlObservationAdapter:()=>f,useMobileRangeControls:()=>ae,zoomMobileRange:()=>re}),module.exports=(e=u,l(n({},"__esModule",{value:!0}),e));var c=s(require("react")),d=require("react"),p=["value","threshold","partition-boundary","time-window","range-boundary"];function f({controlType:e,controlId:t,chartId:n,chartType:r="VisualizationControl",onObservation:a}){return(o,i,l)=>{a?.({type:o,controlType:e,value:i,chartType:r,timestamp:Date.now(),...t?{controlId:t}:{},...n?{chartId:n}:{},...l?{source:l}:{}})}}var m=require("react/jsx-runtime");function h(e,t,n,r){return Math.min(n,Math.max(t,Number((t+Math.round((Math.min(n,Math.max(t,e))-t)/r)*r).toFixed(12))))}function b({value:e,onChange:t,pointerToValue:n,min:r,max:a,step:o=1,largeStep:i=5*o,x:l,y:s,controlType:u="value",controlId:p,label:b,valueText:y,radius:g=12,fill:x="var(--semiotic-bg, #ffffff)",stroke:v="var(--semiotic-primary, #4e79a7)",strokeWidth:w=4,labelText:j,labelDx:k=16,labelDy:C=-16,labelClassName:$,className:M,disabled:S=!1,onChangeStart:A,onChangeEnd:I,onObservation:T,chartId:D,chartType:z}){const L=(0,d.useRef)(null),N=(0,d.useRef)(e);N.current=e;const E=c.useMemo(()=>f({controlType:u,controlId:p,chartId:D,chartType:z,onObservation:T}),[D,z,p,u,T]),R=e=>{if(S)return;const i=n(e);if(null==i||!Number.isFinite(i))return;const l=h(i,r,a,o);N.current=l,t(l),E("control-change",l,"pointer")},V=e=>{e.stopPropagation(),L.current===e.pointerId&&(e.currentTarget.hasPointerCapture?.(e.pointerId)&&e.currentTarget.releasePointerCapture?.(e.pointerId),L.current=null,I?.(N.current),E("control-end",N.current,"pointer"))},P=["semiotic-direct-manipulation-control",M].filter(Boolean).join(" ");return(0,m.jsxs)("g",{className:P,role:"slider",tabIndex:S?-1:0,"aria-disabled":S||void 0,"aria-label":b,"aria-valuemin":r,"aria-valuemax":a,"aria-valuenow":e,"aria-valuetext":y??`${b}: ${e}`,"aria-roledescription":"visualization control","data-viz-control":u,"data-viz-control-id":p,"data-viz-control-state":"controlled",pointerEvents:"all",onPointerDown:e=>{S||(e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture?.(e.pointerId),L.current=e.pointerId,A?.(N.current),E("control-start",N.current,"pointer"),R(e))},onPointerMove:e=>{e.stopPropagation(),L.current===e.pointerId&&R(e)},onPointerUp:V,onPointerCancel:V,onLostPointerCapture:V,onKeyDown:e=>{if(S)return;const n=e.shiftKey?i:o,l=N.current;let s=null;if("ArrowLeft"!==e.key&&"ArrowDown"!==e.key||(s=l-n),"ArrowRight"!==e.key&&"ArrowUp"!==e.key||(s=l+n),"Home"===e.key&&(s=r),"End"===e.key&&(s=a),null===s)return;e.preventDefault();const u=h(s,r,a,o);N.current=u,t(u),E("control-change",u,"keyboard")},style:{cursor:S?"default":"grab",touchAction:"none"},children:[(0,m.jsx)("circle",{className:"semiotic-direct-manipulation-control__hit",cx:l,cy:s,r:g+10,fill:"transparent"}),(0,m.jsx)("circle",{className:"semiotic-direct-manipulation-control__handle",cx:l,cy:s,r:g,fill:x,stroke:v,strokeWidth:w}),j?(0,m.jsx)("text",{className:$,x:l+k,y:s+C,fill:v,children:j}):null]})}var y=s(require("react")),g=require("react/jsx-runtime"),x="undefined"==typeof window?y.useEffect:y.useLayoutEffect,v={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0},w={position:"absolute",zIndex:30,top:"calc(100% + 0.5rem)",left:0,boxSizing:"border-box",display:"flex",flexDirection:"column",gap:8,width:"var(--sentence-filter-popover-width, 18rem)",maxWidth:"min(22rem, calc(100vw - 2rem))",maxHeight:"min(24rem, calc(100vh - 2rem))",overflow:"auto",padding:12,color:"var(--sentence-filter-text-color, var(--semiotic-text, #1f2933))",backgroundColor:"var(--semiotic-bg, #fff)",border:"1px solid var(--semiotic-border, #cbd5e1)",borderRadius:6,boxShadow:"0 10px 28px rgba(15, 23, 42, 0.18)",fontFamily:"inherit",fontSize:"1rem",fontWeight:400,lineHeight:1.4,textAlign:"left",whiteSpace:"normal"},j={offsetX:0,placement:"below",maxHeight:null,maxWidth:null},k={boxSizing:"border-box",width:"100%",minHeight:38,padding:"6px 8px",color:"inherit",backgroundColor:"var(--semiotic-bg, #fff)",border:"1px solid var(--semiotic-border, #94a3b8)",borderRadius:4,font:"inherit"},C={display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,width:"100%",minHeight:38,padding:"7px 8px",color:"inherit",backgroundColor:"transparent",border:0,borderRadius:4,font:"inherit",textAlign:"left",cursor:"pointer"};function $(e){return null==e||"boolean"==typeof e?"":"string"==typeof e||"number"==typeof e?e+"":Array.isArray(e)?e.map($).join(""):y.isValidElement(e)?$(e.props.children):""}function M(e,t){return Object.is(e,t)}function S(e,t){return e.find(e=>M(e.value,t))}function A(e){return null==e||""===e||Array.isArray(e)&&0===e.length}function I(e,t){if(A(t))return e.emptyLabel??"Any";if("select"===e.type)return S(e.options,t)?.label??t+"";if("multiselect"===e.type){const n=t.map(t=>S(e.options,t)?.label??t+""),r="or"===e.conjunction?" or ":" and ";return n.map((e,t)=>(0,g.jsxs)(y.Fragment,{children:[t>0?r:null,e]},t))}return"toggle"===e.type?t?e.trueLabel??"on":e.falseLabel??"off":"range"===e.type?`${t[0]} to ${t[1]}`:t+""}function T(e,t,n){return A(t)?$(e.emptyLabel??"Any"):e.getAccessibleValue?e.getAccessibleValue(t,n):$(I(e,t))||t+""}function D(e){return 0===e.detail?"keyboard":"pointer"}function z(e,t){const n=t.trim().toLocaleLowerCase();return n?e.filter(e=>[$(e.label),...e.keywords??[]].some(e=>e.toLocaleLowerCase().includes(n))):e}function L(e,t,n){if(0===e.length)return-1;for(let r=1;e.length>=r;r+=1){const a=(t+n*r+e.length)%e.length;if(!e[a].disabled)return a}return-1}function N(e,t=0){const[n,r]=y.useState(()=>e[t]&&!e[t].disabled?t:L(e,-1,1)),a=y.useRef(null),o=y.useRef({value:"",at:0});y.useEffect(()=>{(0>n||!e[n]||e[n].disabled)&&r(L(e,-1,1))},[n,e]);const i=y.useCallback(e=>{0>e||(r(e),a.current?.querySelector(`[data-sentence-filter-option-index="${e}"]`)?.focus())},[]),l=y.useCallback(t=>{let r=-1;if("ArrowDown"===t.key)r=L(e,n,1);else if("ArrowUp"===t.key)r=L(e,n,-1);else if("Home"===t.key)r=L(e,-1,1);else if("End"===t.key)r=L(e,0,-1);else if(1===t.key.length&&!t.altKey&&!t.ctrlKey&&!t.metaKey){const a=Date.now(),i=o.current,l=`${a-i.at>600?"":i.value}${t.key}`.toLocaleLowerCase();o.current={value:l,at:a};for(let t=1;e.length>=t;t+=1){const a=(Math.max(n,-1)+t)%e.length,o=e[a],i=[$(o.label),...o.keywords??[]];if(!o.disabled&&i.some(e=>e.toLocaleLowerCase().startsWith(l))){r=a;break}}}0>r||(t.preventDefault(),i(r))},[n,i,e]);return{activeIndex:n,focusIndex:i,listRef:a,onKeyDown:l}}function E({option:e}){return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("span",{children:e.label}),null!=e.count?(0,g.jsx)("span",{"aria-label":e.count+" results",children:e.count}):null,e.description?(0,g.jsx)("span",{style:{display:"block",fontSize:"0.82em",opacity:.78},children:e.description}):null]})}function R({value:e,definition:t,setValue:n,close:r}){const a=t,[o,i]=y.useState(""),l=y.useMemo(()=>z(a.options,o),[o,a.options]),s=Math.max(0,l.findIndex(t=>M(t.value,e))),u=N(l,s);return(0,g.jsxs)(g.Fragment,{children:[a.searchable?(0,g.jsx)("input",{"data-sentence-filter-autofocus":!0,type:"search","aria-label":"Search "+a.label,value:o,onChange:e=>i(e.currentTarget.value),onKeyDown:e=>{"ArrowDown"===e.key&&(e.preventDefault(),u.focusIndex(L(l,-1,1)))},style:k}):null,(0,g.jsxs)("span",{ref:u.listRef,role:"listbox","aria-label":a.label,style:{display:"flex",flexDirection:"column",gap:2},children:[l.map((t,o)=>(0,g.jsx)("button",{"data-sentence-filter-option-index":o,"data-sentence-filter-autofocus":a.searchable||o!==u.activeIndex?void 0:"",type:"button",role:"option","aria-selected":M(t.value,e),tabIndex:o===u.activeIndex?0:-1,disabled:t.disabled,onKeyDown:u.onKeyDown,onClick:e=>{n(t.value,D(e)),r()},style:{...C,backgroundColor:M(t.value,e)?"var(--sentence-filter-hover-background, rgba(78, 121, 167, 0.12))":"transparent",opacity:t.disabled?.5:1},children:(0,g.jsx)(E,{option:t})},`${t.value+""}-${o}`)),0===l.length?(0,g.jsx)("span",{role:"status",children:"No options found."}):null]})]})}function V({value:e,definition:t,setValue:n}){const r=t,[a,o]=y.useState(""),i=y.useMemo(()=>z(r.options,a),[r.options,a]),l=Array.isArray(e)?e:[],s=N(i);return(0,g.jsxs)(g.Fragment,{children:[r.searchable?(0,g.jsx)("input",{"data-sentence-filter-autofocus":!0,type:"search","aria-label":"Search "+r.label,value:a,onChange:e=>o(e.currentTarget.value),onKeyDown:e=>{"ArrowDown"===e.key&&(e.preventDefault(),s.focusIndex(L(i,-1,1)))},style:k}):null,(0,g.jsxs)("span",{ref:s.listRef,role:"group","aria-label":r.label,style:{display:"flex",flexDirection:"column",gap:2},children:[i.map((e,t)=>{const a=l.some(t=>M(t,e.value));return(0,g.jsxs)("label",{style:{...C,justifyContent:"flex-start",opacity:e.disabled?.5:1},children:[(0,g.jsx)("input",{"data-sentence-filter-option-index":t,"data-sentence-filter-autofocus":r.searchable||t!==s.activeIndex?void 0:"",type:"checkbox",checked:a,disabled:e.disabled,tabIndex:t===s.activeIndex?0:-1,onKeyDown:s.onKeyDown,onChange:t=>{const r=t.currentTarget.checked?[...l,e.value]:l.filter(t=>!M(t,e.value));n(r,"input")}}),(0,g.jsx)("span",{style:{flex:1},children:(0,g.jsx)(E,{option:e})})]},`${e.value+""}-${t}`)}),0===i.length?(0,g.jsx)("span",{role:"status",children:"No options found."}):null]})]})}function P({value:e,definition:t,setValue:n}){const r=t,a=r.inputMode??"input",o={min:r.min,max:r.max,step:r.step??1,value:"number"==typeof e?e:r.min??0,onChange:e=>{const t=e.currentTarget.valueAsNumber;Number.isFinite(t)&&n(t,"input")}};return(0,g.jsxs)(g.Fragment,{children:["slider"!==a?(0,g.jsx)("input",{...o,"data-sentence-filter-autofocus":!0,type:"number","aria-label":r.label,style:k}):null,"input"!==a?(0,g.jsx)("input",{...o,"data-sentence-filter-autofocus":"slider"===a?"":void 0,type:"range","aria-label":r.label,style:{width:"100%"}}):null]})}function F({value:e,definition:t,setValue:n}){const r=t,a=Array.isArray(e)&&e.length>=2?[Number(e[0]),Number(e[1])]:[r.min,r.max],o=(e,t)=>{if(!Number.isFinite(t))return;const o=Math.min(r.max,Math.max(r.min,t));n(0===e?[Math.min(o,a[1]),a[1]]:[a[0],Math.max(o,a[0])],"input")},i={min:r.min,max:r.max,step:r.step??1};return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("span",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[(0,g.jsxs)("label",{children:[(0,g.jsx)("span",{children:"Minimum"}),(0,g.jsx)("input",{...i,"data-sentence-filter-autofocus":!0,type:"number",value:a[0],onChange:e=>o(0,e.currentTarget.valueAsNumber),style:k})]}),(0,g.jsxs)("label",{children:[(0,g.jsx)("span",{children:"Maximum"}),(0,g.jsx)("input",{...i,type:"number",value:a[1],onChange:e=>o(1,e.currentTarget.valueAsNumber),style:k})]})]}),(0,g.jsxs)("label",{children:[(0,g.jsxs)("span",{style:v,children:["Minimum ",r.label]}),(0,g.jsx)("input",{...i,type:"range",value:a[0],onChange:e=>o(0,e.currentTarget.valueAsNumber),style:{width:"100%"}})]}),(0,g.jsxs)("label",{children:[(0,g.jsxs)("span",{style:v,children:["Maximum ",r.label]}),(0,g.jsx)("input",{...i,type:"range",value:a[1],onChange:e=>o(1,e.currentTarget.valueAsNumber),style:{width:"100%"}})]})]})}function O({value:e,definition:t,setValue:n,close:r}){const a=t,o=[{value:!0,label:a.trueLabel??"On"},{value:!1,label:a.falseLabel??"Off"}],i=N(o.map(e=>({...e})),!1===e?1:0);return(0,g.jsx)("span",{ref:i.listRef,role:"listbox","aria-label":a.label,style:{display:"flex",gap:4},children:o.map((t,a)=>(0,g.jsx)("button",{"data-sentence-filter-option-index":a,"data-sentence-filter-autofocus":a===i.activeIndex?"":void 0,type:"button",role:"option","aria-selected":e===t.value,tabIndex:a===i.activeIndex?0:-1,onKeyDown:i.onKeyDown,onClick:e=>{n(t.value,D(e)),r()},style:{...C,justifyContent:"center",backgroundColor:e===t.value?"var(--sentence-filter-hover-background, rgba(78, 121, 167, 0.12))":"transparent"},children:t.label},t.value+""))})}function W({value:e,definition:t,setValue:n,close:r}){const a=t,o="string"==typeof e?e:"",[i,l]=y.useState(""),s=y.useMemo(()=>z(a.suggestions??[],i),[i,a.suggestions]),u=N(s);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("input",{"data-sentence-filter-autofocus":!0,type:"text","aria-label":a.label,placeholder:a.placeholder,value:o,onChange:e=>{l(e.currentTarget.value),n(e.currentTarget.value,"input")},onKeyDown:e=>{"ArrowDown"===e.key&&s.length>0&&(e.preventDefault(),u.focusIndex(L(s,-1,1)))},style:k}),s.length>0?(0,g.jsx)("span",{ref:u.listRef,role:"listbox","aria-label":a.label+" suggestions",style:{display:"flex",flexDirection:"column",gap:2},children:s.map((e,t)=>(0,g.jsx)("button",{"data-sentence-filter-option-index":t,type:"button",role:"option","aria-selected":e.value===o,disabled:e.disabled,tabIndex:t===u.activeIndex?0:-1,onKeyDown:u.onKeyDown,onClick:t=>{n(e.value,D(t)),r()},style:{...C,opacity:e.disabled?.5:1},children:(0,g.jsx)(E,{option:e})},`${e.value}-${t}`))}):null]})}function H(e){switch(e.definition.type){case"select":return(0,g.jsx)(R,{...e});case"multiselect":return(0,g.jsx)(V,{...e});case"number":return(0,g.jsx)(P,{...e});case"range":return(0,g.jsx)(F,{...e});case"toggle":return(0,g.jsx)(O,{...e});case"text":return(0,g.jsx)(W,{...e})}}function K({sentence:e,filters:t,defaultFilters:n,definitions:r,onChange:a,as:o="div",className:i,style:l,size:s="inherit",align:u="start",wrap:c=!0,disabled:d=!1,readOnly:p=!1,ariaLabel:f,id:m,renderControl:h,onOpenChange:b}){const[k,$]=y.useState(()=>({...n??{}})),M=t??k,S=y.useRef(M);S.current=M;const D=void 0!==t,z=y.useMemo(()=>function(e){const t=[];let n="";const r=()=>{if(!n)return;const e=t[t.length-1];"text"===e?.type?e.value+=n:t.push({type:"text",value:n}),n=""};for(let a=0;e.length>a;)if(e.startsWith("{{",a))n+="{",a+=2;else if(e.startsWith("}}",a))n+="}",a+=2;else{if("{"===e[a]){const n=e.indexOf("}",a+1);if(-1!==n){const o=e.slice(a+1,n);if(o.length>0&&!o.includes("{")){r(),t.push({type:"filter",key:o}),a=n+1;continue}}}n+=e[a],a+=1}return r(),t}(e),[e]),[L,N]=y.useState(null),[E,R]=y.useState(j),V=y.useRef(L);V.current=L;const P=y.useRef(null),F=y.useRef(null),O=y.useRef(new Set),[W,K]=y.useState(""),[Z,_]=y.useState(null),[q,B]=y.useState(null),U=y.useId().replace(/:/g,""),X=m??"sentence-filter-"+U;y.useEffect(()=>{if("undefined"==typeof process||"production"!==process.env?.NODE_ENV)for(const e of z){if("filter"!==e.type)continue;let t=null;r[e.key]?e.key in M||(t=`SentenceFilter: placeholder "{${e.key}}" has no matching filter value.`):t=`SentenceFilter: placeholder "{${e.key}}" has no matching definition.`,t&&!O.current.has(t)&&(O.current.add(t),console.warn(t))}},[r,M,z]);const G=y.useCallback(()=>{V.current&&(V.current=null,N(null),R(j),b?.(null),F.current?.focus())},[b]);y.useEffect(()=>{if(!L)return;const e=e=>{P.current?.contains(e.target)||G()},t=e=>{"Escape"===e.key&&(e.preventDefault(),G())};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),document.addEventListener("click",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e),document.removeEventListener("click",e),document.removeEventListener("keydown",t)}},[G,L]),x(()=>{if(!L||"undefined"==typeof window)return;const e=P.current?.querySelector(`[data-sentence-filter-popover="${L.occurrence}"]`);if(!e)return;const t=()=>{const t=16,n=e.getBoundingClientRect();if(0>=n.width)return;const r=F.current?.getBoundingClientRect(),a=window.visualViewport,o=a?.offsetLeft??0,i=a?.offsetTop??0,l=a?.width??window.innerWidth,s=o+l,u=i+(a?.height??window.innerHeight),c=window.getComputedStyle(e),d=Number.parseFloat(c.getPropertyValue("--sentence-filter-popover-viewport-inset-top")),p=Number.parseFloat(c.getPropertyValue("--sentence-filter-popover-viewport-inset-bottom"));let f=i+(Number.isFinite(d)?Math.max(0,d):0),m=u-(Number.isFinite(p)?Math.max(0,p):0),h=F.current?.parentElement??null;for(;h;){const e=window.getComputedStyle(h);if("sticky"===e.position){const t=h.getBoundingClientRect(),n=Number.parseFloat(e.top),r=Number.parseFloat(e.bottom);Number.isFinite(n)&&1>=Math.abs(t.top-(i+n))&&(f=Math.max(f,t.bottom)),Number.isFinite(r)&&1>=Math.abs(t.bottom-(u-r))&&(m=Math.min(m,t.top))}h=h.parentElement}const b=n.left-E.offsetX,y=n.right-E.offsetX;let g=0;y>s-t&&(g-=y-(s-t)),o+t>b+g&&(g+=o+t-(b+g));const x=r?m-r.bottom-8-t:m-f-32,v=r?r.top-f-8-t:0,w=Math.min(Math.max(n.height,e.scrollHeight),160)>x&&v>x?"above":"below",j=Math.max(0,Math.min(384,Math.floor("above"===w?v:x))),k=Math.max(0,Math.floor(l-32));R(e=>e.offsetX===g&&e.placement===w&&e.maxHeight===j&&e.maxWidth===k?e:{offsetX:g,placement:w,maxHeight:j,maxWidth:k})};return t(),window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),window.visualViewport?.addEventListener("resize",t),window.visualViewport?.addEventListener("scroll",t),()=>{window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0),window.visualViewport?.removeEventListener("resize",t),window.visualViewport?.removeEventListener("scroll",t)}},[L,E]),y.useEffect(()=>{if(!L)return;const e=P.current?.querySelector(`[data-sentence-filter-popover="${L.occurrence}"]`),t=e?.querySelector("[data-sentence-filter-autofocus]")??e;t?.focus()},[L]),y.useEffect(()=>{L&&(d||p||r[L.key]?.disabled)&&G()},[G,r,d,L,p]);const Y=y.useCallback((e,t,n)=>{const o=S.current,i=o[e]??null,l={...o,[e]:t};D||(S.current=l,$(l));const s={key:e,previousValue:i,value:t,source:n};a?.(l,s);const u=r[e];if(u){const e=T(u,i,o),n=T(u,t,l);K(`${u.label} changed from ${e} to ${n}.`)}},[D,r,a]),J=y.useMemo(()=>z.map(e=>{if("text"===e.type)return e.value;const t=r[e.key];return t?T(t,M[e.key],M):`{${e.key}}`}).join(""),[r,M,z]),Q={position:"relative",margin:0,color:"var(--sentence-filter-text-color, inherit)",fontFamily:"inherit",fontSize:"small"===s?"0.875rem":"medium"===s?"1rem":"large"===s?"1.5rem":"inherit",lineHeight:"inherit",textAlign:"start"===u?"start":"end"===u?"end":"center",whiteSpace:c?"normal":"nowrap",...l},ee=["semiotic-sentence-filter",i].filter(Boolean).join(" ");let te=0;return(0,g.jsxs)(o,{ref:e=>{P.current=e},id:X,className:ee,style:Q,role:"div"===o||"span"===o?"group":void 0,"aria-label":f??J,"data-semiotic-control":"sentence-filter","data-sentence-filter-state":D?"controlled":"uncontrolled",children:[z.map((e,t)=>{if("text"===e.type)return(0,g.jsx)("span",{"aria-hidden":"true",children:e.value},t);const n=r[e.key];if(!n)return(0,g.jsx)("span",{"aria-hidden":"true",children:`{${e.key}}`},t);const a=te;te+=1;const o=M[e.key]??null,i=function(e,t,n){return A(t)?e.emptyLabel??"Any":e.formatValue?e.formatValue(t,n):I(e,t)}(n,o,M),l=T(n,o,M),s=L?.key===e.key&&L.occurrence===a,u=d||p||!!n.disabled,c=e.key.replace(/[^a-zA-Z0-9_-]/g,"-"),f=`${X}-${c}-${a}-popover`;return(0,g.jsxs)("span",{className:"semiotic-sentence-filter__value",style:{position:"relative",display:"inline"},children:[(0,g.jsx)("button",{type:"button","aria-haspopup":"dialog","aria-expanded":s,"aria-controls":f,"aria-label":`${n.label}: ${l}. Activate to change.`,disabled:u,"data-sentence-filter-key":e.key,"data-sentence-filter-type":n.type,"data-sentence-filter-open":s||void 0,onMouseEnter:()=>_(a),onMouseLeave:()=>_(e=>e===a?null:e),onFocus:()=>B(a),onBlur:()=>B(e=>e===a?null:e),onClick:t=>{if(u)return;if(s)return void G();F.current=t.currentTarget;const r={key:e.key,occurrence:a};V.current=r,R(j),N(r),K(n.label+" control opened."),b?.(e.key)},style:{appearance:"none",display:"inline",minWidth:24,padding:"0.35em 0.12em",margin:"-0.35em 0",color:n.accent??"var(--sentence-filter-accent, var(--semiotic-primary, #4e79a7))",backgroundColor:Z===a||s?"var(--sentence-filter-hover-background, rgba(78, 121, 167, 0.12))":"transparent",border:0,borderBottom:"var(--sentence-filter-underline-thickness, 0.09em) solid currentColor",borderRadius:2,outline:q===a?"2px solid var(--sentence-filter-focus-color, currentColor)":"2px solid transparent",outlineOffset:2,font:"inherit",fontWeight:600,lineHeight:"inherit",textAlign:"inherit",cursor:u?"default":"pointer",opacity:u?.6:1},children:i}),s?(0,g.jsxs)("span",{id:f,role:"dialog","aria-label":n.label,"aria-describedby":n.description?f+"-description":void 0,tabIndex:-1,"data-sentence-filter-popover":a,"data-sentence-filter-key":e.key,style:{...w,top:"below"===E.placement?"calc(100% + 0.5rem)":"auto",bottom:"above"===E.placement?"calc(100% + 0.5rem)":"auto",left:E.offsetX,maxHeight:E.maxHeight??w.maxHeight,maxWidth:E.maxWidth??w.maxWidth},children:[(0,g.jsx)("span",{style:{fontWeight:650},children:n.label}),n.description?(0,g.jsx)("span",{id:f+"-description",style:{fontSize:"0.88em",opacity:.78},children:n.description}):null,h?h({key:e.key,value:o,filters:M,definition:n,setValue:(t,n="programmatic")=>Y(e.key,t,n),close:G}):(0,g.jsx)(H,{value:o,definition:n,setValue:(t,n)=>Y(e.key,t,n),close:G}),n.allowClear&&!A(o)?(0,g.jsxs)("button",{type:"button",onClick:()=>{Y(e.key,"multiselect"===n.type?[]:null,"clear"),G()},style:{...C,justifyContent:"center",border:"1px solid var(--semiotic-border, #cbd5e1)"},children:["Clear ",n.label]}):null]}):null]},`${e.key}-${a}`)}),(0,g.jsx)("span",{role:"status","aria-live":"polite","aria-atomic":"true","data-sentence-filter-live-region":!0,style:v,children:W})]})}function Z(e,t,n,r,a){return{id:e,...t?{controlId:t}:{},status:n,message:r,...a?{remediation:a}:{}}}function _({controls:e=[],minimumTargetSize:t=24}){const n=[],r=new Set;for(const a of e){const e=a?.id,o="controls."+(e||"unknown"),i=a?.domain,l=Array.isArray(i)&&2===i.length&&Number.isFinite(i[0])&&Number.isFinite(i[1])&&i[1]>i[0],s=p.includes(a?.type),u="string"==typeof a?.target&&a.target.trim().length>0,c=["slider","buttons","native-range"].includes(a?.keyboard??""),d=a?.minimumTargetSize;n.push(Z(o+".semantic-type",e,s?"pass":"fail",s?`Control uses the semantic type "${a.type}".`:"Control has no recognized semantic type.","Use one of VISUALIZATION_CONTROL_TYPES.")),n.push(Z(o+".state-binding",e,u?"pass":"fail",u?`Control is bound to "${a.target}".`:"Control has no declarative state binding.","Declare the controlled state key with target.")),n.push(Z(o+".domain",e,l?"pass":"fail",l?"Control has a finite ordered value domain.":"Control has no finite ordered value domain.","Declare domain as [minimum, maximum].")),n.push(Z(o+".keyboard",e,c?"pass":"fail",c?`Control declares a ${a.keyboard} keyboard path.`:"Control does not declare a keyboard path.","Declare slider, buttons, or native-range keyboard interaction.")),n.push(Z(o+".value-text",e,"string"==typeof a?.valueText&&a.valueText.trim().length>0?"pass":"fail","string"==typeof a?.valueText&&a.valueText.trim().length>0?"Control declares human-readable value text.":"Control does not declare human-readable value text.","Provide valueText, typically with a {value} placeholder.")),n.push(Z(o+".target-size",e,"number"!=typeof d||t>d?"fail":"pass","number"!=typeof d||t>d?`Control target is below the ${t}px minimum or undeclared.`:`Control declares a ${d}px target.`,`Declare minimumTargetSize of at least ${t}.`)),null!=a?.step&&n.push(Z(o+".step",e,Number.isFinite(a.step)&&a.step>0?"pass":"fail",Number.isFinite(a.step)&&a.step>0?"Control has a positive quantization step.":"Control step must be a positive finite number.","Use a positive finite step.")),a?.observations?.length&&n.push(Z(o+".observations",e,a.observations.includes("control-change")?"pass":"warn",a.observations.includes("control-change")?"Control declares control-change observation coverage.":"Control declares observations but omits control-change.","Include control-change so observable state changes are represented.")),e&&!r.has(e)||n.push(Z(o+".identity",e,"fail",e?"Control id is duplicated.":"Control id is missing.","Use a unique stable control id.")),e&&r.add(e)}return{ok:n.every(e=>"fail"!==e.status),findings:n}}var q=require("react"),B=2*Math.PI;function U(e,t,n){const r=n?.center?.x??0,a=n?.center?.y??0;return{x:r+Math.sin(e)*t,y:a-Math.cos(e)*t}}function X(e,t,n,r,a){const o=a?.center,i=(e,t)=>{const{x:n,y:r}=U(e,t,{center:o});return`${G(n)},${G(r)}`},l=Math.max(0,n),s=Math.max(l,r),u=Math.abs(t-e),c=e>t?0:1;if(u>=B-1e-6){const e=o?.x??0,t=o?.y??0,n=`${G(e)},${G(t-s)}`,r=`${G(e)},${G(t+s)}`;let a=`M${n} A${G(s)},${G(s)} 0 1 1 ${r} A${G(s)},${G(s)} 0 1 1 ${n} Z`;if(l>0){const n=`${G(e)},${G(t-l)}`,r=`${G(e)},${G(t+l)}`;a+=` M${n} A${G(l)},${G(l)} 0 1 0 ${r} A${G(l)},${G(l)} 0 1 0 ${n} Z`}return a}const d=u>Math.PI?1:0,p=i(e,s),f=i(t,s);if(0>=l){const e=o?.x??0,t=o?.y??0;return`M${G(e)},${G(t)} L${p} A${G(s)},${G(s)} 0 ${d} ${c} ${f} Z`}const m=i(t,l),h=i(e,l);return`M${p} A${G(s)},${G(s)} 0 ${d} ${c} ${f} L${m} A${G(l)},${G(l)} 0 ${d} ${1===c?0:1} ${h} Z`}function G(e){return Math.round(1e3*e)/1e3}function Y(e,t,n=0){return t>0?((e-n)%t+t)%t+n:e}var J=require("react/jsx-runtime");function Q({value:e,onChange:t,period:n=365,radius:r=180,innerRadius:a=14,width:o,height:i,step:l=1,largeStep:s=7,label:u="Range",formatValue:c,arcFill:d="var(--semiotic-primary, #4e79a7)",stroke:p="var(--semiotic-bg, #ffffff)",className:f,style:m}){const h=o??2*r+40,b=i??2*r+40,y=h/2,g=b/2,x=function(e){const[t,n]=e,r=n-t||1,a=B;return e=>0+(e-t)/r*(a-0)}([0,n]),v=(0,q.useRef)(null),w=e=>{const t=e.currentTarget.ownerSVGElement??e.currentTarget,r=t.getBoundingClientRect(),a=t.viewBox?.baseVal;return Math.round((Math.atan2((a?.width||h)/(r.width||1)*(e.clientX-r.left)-y-0,-((a?.height||b)/(r.height||1)*(e.clientY-r.top)-g-0))+B)%B/B*n)%n},j=(e,t)=>{e.preventDefault(),e.stopPropagation();const n=e.currentTarget.ownerSVGElement;n?.setPointerCapture?.(e.pointerId),v.current={mode:t,lastValue:w(e)}},k=e=>{const t=e.currentTarget.ownerSVGElement??e.currentTarget;t?.hasPointerCapture?.(e.pointerId)&&t.releasePointerCapture(e.pointerId),v.current=null},C=(e,r)=>{t("range"===e?e=>({start:Y(e.start+r,n),end:Y(e.end+r,n)}):t=>({...t,[e]:Y(t[e]+r,n)}))},$=e=>t=>{const n=t.shiftKey?s:l;"ArrowRight"===t.key||"ArrowUp"===t.key?(t.preventDefault(),C(e,n)):"ArrowLeft"!==t.key&&"ArrowDown"!==t.key||(t.preventDefault(),C(e,-n))},M=e.start>e.end?[[e.start,n],[0,e.end]]:[[e.start,e.end]],S=e=>c?c(e):e+"";return(0,J.jsx)("svg",{viewBox:`0 0 ${h} ${b}`,width:h,height:b,className:f,onPointerMove:e=>{const r=v.current;if(!r)return;const a=w(e);if("range"===r.mode){const e=function(e,t,n){if(0>=n)return t-e;let r=(t-e)%n;return r>n/2?r-=n:-n/2>r&&(r+=n),r}(r.lastValue,a,n);if(0===e)return;return r.lastValue=a,void t(t=>({start:Y(t.start+e,n),end:Y(t.end+e,n)}))}t(e=>({...e,[r.mode]:a}))},onPointerUp:k,onPointerCancel:k,onLostPointerCapture:k,style:{touchAction:"none",...m},"aria-label":u+" brush",children:(0,J.jsxs)("g",{transform:`translate(${y},${g})`,children:[(0,J.jsx)("g",{role:"slider",tabIndex:0,"aria-label":u+" (move both ends)","aria-valuemin":0,"aria-valuemax":n-1,"aria-valuenow":e.start,"aria-valuetext":`${S(e.start)} to ${S(e.end)}`,onPointerDown:e=>j(e,"range"),onKeyDown:$("range"),style:{cursor:"grab"},children:M.map(([e,t],n)=>(0,J.jsx)("path",{d:X(x(e),x(t),a,r),fill:d,fillOpacity:.35,stroke:p,strokeWidth:1},n))}),["start","end"].map(t=>{const o=e[t],i=(e=>U(x(e),a))(o),l=(e=>U(x(e),r+8))(o);return(0,J.jsxs)("g",{role:"slider",tabIndex:0,"aria-label":`${u} ${t}`,"aria-valuemin":0,"aria-valuemax":n-1,"aria-valuenow":o,"aria-valuetext":S(o),onPointerDown:e=>j(e,t),onKeyDown:$(t),style:{cursor:"grab"},children:[(0,J.jsx)("line",{x1:i.x,y1:i.y,x2:l.x,y2:l.y,stroke:"transparent",strokeWidth:20}),(0,J.jsx)("line",{x1:i.x,y1:i.y,x2:l.x,y2:l.y,stroke:p,strokeWidth:1.5}),(0,J.jsx)("circle",{cx:l.x,cy:l.y,r:4.5,fill:p,stroke:d,strokeWidth:1})]},t)})]})})}var ee=s(require("react")),te=require("react/jsx-runtime");function ne(e,t,n=0){const r=Math.min(t[0],t[1]),a=Math.max(t[0],t[1]),o=Math.max(r,Math.min(a,e[0])),i=Math.max(r,Math.min(a,e[1])),l=o>i?[i,o]:[o,i];if(l[1]-l[0]>=n)return l;const s=(l[0]+l[1])/2,u=n/2;return[Math.max(r,Math.min(a-n,s-u)),Math.min(a,Math.max(r+n,s+u))]}function re(e,t,n,r=1,a=r){const o="in"===n?r:-r;return ne([e[0]+o,e[1]-o],t,a)}function ae(e){const{domain:t,initialValue:n=t,step:r=1,minSpan:a=r,label:o,formatValue:i,onChange:l}=e,[s,u]=ee.useState(()=>ne(n,t,a)),c=ne(s,t,a),d=ee.useCallback(e=>{const n=ne(e,t,a);u(n),l?.(n)},[t,a,l]),p=ee.useMemo(()=>({label:o,domain:t,value:c,step:r,formatValue:i,onChange:d,onClear:()=>d(t)}),[t,i,o,d,r,c]),f=ee.useMemo(()=>({onZoomIn:()=>d(re(c,t,"in",r,a)),onZoomOut:()=>d(re(c,t,"out",r,a)),onReset:()=>d(t)}),[t,a,d,r,c]);return{value:c,setValue:d,xExtent:c,brush:p,zoom:f}}var oe={display:"grid",gap:8,padding:"10px 12px",border:"1px solid var(--semiotic-border, #d8dee4)",borderRadius:12,background:"var(--semiotic-surface, var(--semiotic-bg, rgba(255,255,255,0.92)))"},ie={fontSize:11,fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--semiotic-text-secondary, #57606a)"};function le(e,t){return{minWidth:e,minHeight:e,padding:"0 12px",borderRadius:999,border:"1px solid var(--semiotic-border, #d8dee4)",background:t?"var(--semiotic-primary, #0969da)":"var(--semiotic-bg, #fff)",color:t?"var(--semiotic-bg, #fff)":"var(--semiotic-text, #24292f)",fontSize:13,fontWeight:650,touchAction:"manipulation"}}function se(e){return"function"==typeof e}function ue({brush:e,targetSize:t}){const n=e?.value,r=e?.domain,a=!!n&&!!r,o=!0===e?.disabled,i=e?.formatValue??(e=>e),l=!!e?.onChange&&a&&!o,s=r?.[0]??0,u=r?.[1]??1,c=n?.[0]??s,d=n?.[1]??u,p=e?.step??((u-s)/100||1);return(0,te.jsxs)("section",{style:oe,"aria-label":"Brush controls",children:[(0,te.jsx)("div",{style:ie,children:e?.label??"Filter range"}),a?(0,te.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,te.jsxs)("label",{style:{display:"grid",gap:4,fontSize:12},children:[(0,te.jsxs)("span",{children:["Start: ",i(c)]}),(0,te.jsx)("input",{type:"range",min:s,max:u,step:p,value:c,disabled:!l,style:{minHeight:t},onChange:t=>{const n=Number(t.currentTarget.value);e?.onChange?.([Math.min(n,d),d])}})]}),(0,te.jsxs)("label",{style:{display:"grid",gap:4,fontSize:12},children:[(0,te.jsxs)("span",{children:["End: ",i(d)]}),(0,te.jsx)("input",{type:"range",min:s,max:u,step:p,value:d,disabled:!l,style:{minHeight:t},onChange:t=>{const n=Number(t.currentTarget.value);e?.onChange?.([c,Math.max(n,c)])}})]})]}):(0,te.jsx)("div",{style:{fontSize:12,color:"var(--semiotic-text-secondary, #57606a)"},children:"Provide a brush domain and value to expose range inputs beside the drag gesture."}),(0,te.jsx)("button",{type:"button",disabled:o||!se(e?.onClear),onClick:e?.onClear,style:le(t),children:"Clear range"})]})}function ce({zoom:e,targetSize:t}){const n=!0===e?.disabled;return(0,te.jsxs)("section",{style:oe,"aria-label":"Zoom controls",children:[(0,te.jsx)("div",{style:ie,children:e?.label??"Zoom"}),(0,te.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,te.jsx)("button",{type:"button","aria-label":"Zoom out",disabled:n||!se(e?.onZoomOut),onClick:e?.onZoomOut,style:le(t),children:"-"}),(0,te.jsx)("button",{type:"button","aria-label":"Reset zoom",disabled:n||!se(e?.onReset),onClick:e?.onReset,style:le(t),children:"Reset"}),(0,te.jsx)("button",{type:"button","aria-label":"Zoom in",disabled:n||!se(e?.onZoomIn),onClick:e?.onZoomIn,style:le(t),children:"+"})]})]})}function de({legend:e,targetSize:t}){const n=!0===e?.disabled,r=e?.items??[];return(0,te.jsxs)("section",{style:oe,"aria-label":"Legend controls",children:[(0,te.jsx)("div",{style:ie,children:e?.label??"Series"}),r.length>0&&(0,te.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:r.map(r=>{const a=!1!==r.active;return(0,te.jsxs)("button",{type:"button",disabled:n||r.disabled||!e?.onToggle,onClick:()=>e?.onToggle?.(r.id,!a),style:le(t,a),"aria-pressed":a,children:[r.color&&(0,te.jsx)("span",{"aria-hidden":"true",style:{display:"inline-block",width:9,height:9,marginRight:6,borderRadius:999,background:r.color}}),r.label??r.id]},r.id)})}),(0,te.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,te.jsx)("button",{type:"button",disabled:n||!se(e?.onShowAll),onClick:e?.onShowAll,style:le(t),children:"Show all"}),(0,te.jsx)("button",{type:"button",disabled:n||!se(e?.onHideAll),onClick:e?.onHideAll,style:le(t),children:"Hide all"})]})]})}function pe({controls:e,targetSize:t=44,compact:n=!1,className:r,style:a,ariaLabel:o="Mobile chart controls",brush:i,zoom:l,legend:s}){const u=function(e,t){if(!1===e)return[];if(!0===e||"all"===e)return["brush","zoom","legend"];if(Array.isArray(e))return e;if(e)return[e];const n=[];return t.brush&&n.push("brush"),t.zoom&&n.push("zoom"),t.legend&&n.push("legend"),n}(e,{brush:i,zoom:l,legend:s});return 0===u.length?null:(0,te.jsxs)("div",{className:r,role:"group","aria-label":o,style:{display:"grid",gridTemplateColumns:n?"1fr":"repeat(auto-fit, minmax(180px, 1fr))",gap:10,...a},children:[u.includes("brush")&&(0,te.jsx)(ue,{brush:i,targetSize:t}),u.includes("zoom")&&(0,te.jsx)(ce,{zoom:l,targetSize:t}),u.includes("legend")&&(0,te.jsx)(de,{legend:s,targetSize:t})]})}
2
+ module.exports=require("./semiotic-client-cjs-shared.min.js").controls;