@sqlrooms/mosaic 0.29.0-rc.7 → 0.29.0-rc.9

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 (572) hide show
  1. package/LICENSE.md +2 -1
  2. package/README.md +179 -35
  3. package/dist/MosaicSlice.d.ts +1 -0
  4. package/dist/MosaicSlice.d.ts.map +1 -1
  5. package/dist/MosaicSlice.js.map +1 -1
  6. package/dist/VgPlotChart.d.ts.map +1 -1
  7. package/dist/VgPlotChart.js +9 -3
  8. package/dist/VgPlotChart.js.map +1 -1
  9. package/dist/ai/agentIntent.d.ts +5 -0
  10. package/dist/ai/agentIntent.d.ts.map +1 -0
  11. package/dist/ai/agentIntent.js +8 -0
  12. package/dist/ai/agentIntent.js.map +1 -0
  13. package/dist/ai/block-document/constants.d.ts +9 -0
  14. package/dist/ai/block-document/constants.d.ts.map +1 -0
  15. package/dist/ai/block-document/constants.js +9 -0
  16. package/dist/ai/block-document/constants.js.map +1 -0
  17. package/dist/ai/block-document/createAddMosaicDashboardBlockTool.d.ts +48 -0
  18. package/dist/ai/block-document/createAddMosaicDashboardBlockTool.d.ts.map +1 -0
  19. package/dist/ai/block-document/createAddMosaicDashboardBlockTool.js +59 -0
  20. package/dist/ai/block-document/createAddMosaicDashboardBlockTool.js.map +1 -0
  21. package/dist/ai/block-document/createBlockDocumentChartTools.d.ts +19 -0
  22. package/dist/ai/block-document/createBlockDocumentChartTools.d.ts.map +1 -0
  23. package/dist/ai/block-document/createBlockDocumentChartTools.js +37 -0
  24. package/dist/ai/block-document/createBlockDocumentChartTools.js.map +1 -0
  25. package/dist/ai/block-document/createBlockDocumentDataTableExplorerTool.d.ts +32 -0
  26. package/dist/ai/block-document/createBlockDocumentDataTableExplorerTool.d.ts.map +1 -0
  27. package/dist/ai/block-document/createBlockDocumentDataTableExplorerTool.js +37 -0
  28. package/dist/ai/block-document/createBlockDocumentDataTableExplorerTool.js.map +1 -0
  29. package/dist/ai/constants.d.ts +3 -0
  30. package/dist/ai/constants.d.ts.map +1 -0
  31. package/dist/ai/constants.js +3 -0
  32. package/dist/ai/constants.js.map +1 -0
  33. package/dist/ai/createDataTableExplorerTool.d.ts +69 -0
  34. package/dist/ai/createDataTableExplorerTool.d.ts.map +1 -0
  35. package/dist/ai/createDataTableExplorerTool.js +68 -0
  36. package/dist/ai/createDataTableExplorerTool.js.map +1 -0
  37. package/dist/ai/dashboard/constants.d.ts +6 -0
  38. package/dist/ai/dashboard/constants.d.ts.map +1 -0
  39. package/dist/ai/dashboard/constants.js +6 -0
  40. package/dist/ai/dashboard/constants.js.map +1 -0
  41. package/dist/ai/dashboard/createDashboardAgentTool.d.ts +17 -0
  42. package/dist/ai/dashboard/createDashboardAgentTool.d.ts.map +1 -0
  43. package/dist/ai/dashboard/createDashboardAgentTool.js +205 -0
  44. package/dist/ai/dashboard/createDashboardAgentTool.js.map +1 -0
  45. package/dist/ai/dashboard/createDashboardAiAdapter.d.ts +14 -0
  46. package/dist/ai/dashboard/createDashboardAiAdapter.d.ts.map +1 -0
  47. package/dist/ai/dashboard/createDashboardAiAdapter.js +75 -0
  48. package/dist/ai/dashboard/createDashboardAiAdapter.js.map +1 -0
  49. package/dist/ai/dashboard/createDashboardAiTools.d.ts +26 -0
  50. package/dist/ai/dashboard/createDashboardAiTools.d.ts.map +1 -0
  51. package/dist/ai/dashboard/createDashboardAiTools.js +40 -0
  52. package/dist/ai/dashboard/createDashboardAiTools.js.map +1 -0
  53. package/dist/ai/dashboard/createDashboardChartTools.d.ts +27 -0
  54. package/dist/ai/dashboard/createDashboardChartTools.d.ts.map +1 -0
  55. package/dist/ai/dashboard/createDashboardChartTools.js +55 -0
  56. package/dist/ai/dashboard/createDashboardChartTools.js.map +1 -0
  57. package/dist/ai/dashboard/createDashboardDataTableExplorerTool.d.ts +23 -0
  58. package/dist/ai/dashboard/createDashboardDataTableExplorerTool.d.ts.map +1 -0
  59. package/dist/ai/dashboard/createDashboardDataTableExplorerTool.js +29 -0
  60. package/dist/ai/dashboard/createDashboardDataTableExplorerTool.js.map +1 -0
  61. package/dist/ai/dashboard/createListDashboardPanelsTool.d.ts +28 -0
  62. package/dist/ai/dashboard/createListDashboardPanelsTool.d.ts.map +1 -0
  63. package/dist/ai/dashboard/createListDashboardPanelsTool.js +54 -0
  64. package/dist/ai/dashboard/createListDashboardPanelsTool.js.map +1 -0
  65. package/dist/ai/dashboard/dashboard-types.d.ts +59 -0
  66. package/dist/ai/dashboard/dashboard-types.d.ts.map +1 -0
  67. package/dist/ai/dashboard/dashboard-types.js +2 -0
  68. package/dist/ai/dashboard/dashboard-types.js.map +1 -0
  69. package/dist/ai/database-types.d.ts +12 -0
  70. package/dist/ai/database-types.d.ts.map +1 -0
  71. package/dist/ai/database-types.js +2 -0
  72. package/dist/ai/database-types.js.map +1 -0
  73. package/dist/ai/errors.d.ts +8 -0
  74. package/dist/ai/errors.d.ts.map +1 -0
  75. package/dist/ai/errors.js +11 -0
  76. package/dist/ai/errors.js.map +1 -0
  77. package/dist/ai/tool-helpers.d.ts +28 -29
  78. package/dist/ai/tool-helpers.d.ts.map +1 -1
  79. package/dist/ai/tool-helpers.js +38 -76
  80. package/dist/ai/tool-helpers.js.map +1 -1
  81. package/dist/ai/tool-schemas.d.ts +9 -4
  82. package/dist/ai/tool-schemas.d.ts.map +1 -1
  83. package/dist/ai/tool-schemas.js +12 -12
  84. package/dist/ai/tool-schemas.js.map +1 -1
  85. package/dist/ai/tool-types.d.ts +19 -1
  86. package/dist/ai/tool-types.d.ts.map +1 -1
  87. package/dist/ai/tool-types.js.map +1 -1
  88. package/dist/ai/types.d.ts +64 -0
  89. package/dist/ai/types.d.ts.map +1 -0
  90. package/dist/ai/types.js +2 -0
  91. package/dist/ai/types.js.map +1 -0
  92. package/dist/ai.d.ts +16 -2
  93. package/dist/ai.d.ts.map +1 -1
  94. package/dist/ai.js +14 -5
  95. package/dist/ai.js.map +1 -1
  96. package/dist/charts/MosaicChart.d.ts +3 -1
  97. package/dist/charts/MosaicChart.d.ts.map +1 -1
  98. package/dist/charts/MosaicChart.js +2 -2
  99. package/dist/charts/MosaicChart.js.map +1 -1
  100. package/dist/charts/MosaicChartError.d.ts +8 -2
  101. package/dist/charts/MosaicChartError.d.ts.map +1 -1
  102. package/dist/charts/MosaicChartError.js +29 -3
  103. package/dist/charts/MosaicChartError.js.map +1 -1
  104. package/dist/charts/MosaicChartSettingsButton.d.ts +15 -0
  105. package/dist/charts/MosaicChartSettingsButton.d.ts.map +1 -0
  106. package/dist/charts/MosaicChartSettingsButton.js +7 -0
  107. package/dist/charts/MosaicChartSettingsButton.js.map +1 -0
  108. package/dist/charts/MosaicChartView.d.ts +2 -0
  109. package/dist/charts/MosaicChartView.d.ts.map +1 -1
  110. package/dist/charts/MosaicChartView.js +19 -7
  111. package/dist/charts/MosaicChartView.js.map +1 -1
  112. package/dist/charts/chart-settings/MosaicChartSettings.d.ts.map +1 -1
  113. package/dist/charts/chart-settings/MosaicChartSettings.js +3 -3
  114. package/dist/charts/chart-settings/MosaicChartSettings.js.map +1 -1
  115. package/dist/charts/chart-settings/MosaicChartSettingsPanel.js +1 -1
  116. package/dist/charts/chart-settings/MosaicChartSettingsPanel.js.map +1 -1
  117. package/dist/charts/chart-settings/MosaicChartSpecViewerPanel.d.ts.map +1 -1
  118. package/dist/charts/chart-settings/MosaicChartSpecViewerPanel.js +2 -1
  119. package/dist/charts/chart-settings/MosaicChartSpecViewerPanel.js.map +1 -1
  120. package/dist/charts/chart-settings/MosaicChartTypeSelector.d.ts.map +1 -1
  121. package/dist/charts/chart-settings/MosaicChartTypeSelector.js +3 -3
  122. package/dist/charts/chart-settings/MosaicChartTypeSelector.js.map +1 -1
  123. package/dist/charts/chart-types/base-types.d.ts +40 -25
  124. package/dist/charts/chart-types/base-types.d.ts.map +1 -1
  125. package/dist/charts/chart-types/base-types.js +5 -0
  126. package/dist/charts/chart-types/base-types.js.map +1 -1
  127. package/dist/charts/chart-types/box-plot/definition.d.ts.map +1 -1
  128. package/dist/charts/chart-types/box-plot/definition.js +1 -0
  129. package/dist/charts/chart-types/box-plot/definition.js.map +1 -1
  130. package/dist/charts/chart-types/box-plot/renderer/BoxPlotClient.d.ts +37 -3
  131. package/dist/charts/chart-types/box-plot/renderer/BoxPlotClient.d.ts.map +1 -1
  132. package/dist/charts/chart-types/box-plot/renderer/BoxPlotClient.js +28 -13
  133. package/dist/charts/chart-types/box-plot/renderer/BoxPlotClient.js.map +1 -1
  134. package/dist/charts/chart-types/box-plot/renderer/BoxPlotPanelRenderer.js +2 -2
  135. package/dist/charts/chart-types/box-plot/renderer/BoxPlotPanelRenderer.js.map +1 -1
  136. package/dist/charts/chart-types/box-plot/renderer/useBoxPlotClient.d.ts +12 -1
  137. package/dist/charts/chart-types/box-plot/renderer/useBoxPlotClient.d.ts.map +1 -1
  138. package/dist/charts/chart-types/box-plot/renderer/useBoxPlotClient.js +13 -3
  139. package/dist/charts/chart-types/box-plot/renderer/useBoxPlotClient.js.map +1 -1
  140. package/dist/charts/chart-types/box-plot/tool.d.ts +20 -24
  141. package/dist/charts/chart-types/box-plot/tool.d.ts.map +1 -1
  142. package/dist/charts/chart-types/box-plot/tool.js +25 -33
  143. package/dist/charts/chart-types/box-plot/tool.js.map +1 -1
  144. package/dist/charts/chart-types/box-plot/validation.d.ts +9 -0
  145. package/dist/charts/chart-types/box-plot/validation.d.ts.map +1 -0
  146. package/dist/charts/chart-types/box-plot/validation.js +32 -0
  147. package/dist/charts/chart-types/box-plot/validation.js.map +1 -0
  148. package/dist/charts/chart-types/chart-config.d.ts +3 -1
  149. package/dist/charts/chart-types/chart-config.d.ts.map +1 -1
  150. package/dist/charts/chart-types/chart-config.js +2 -2
  151. package/dist/charts/chart-types/chart-config.js.map +1 -1
  152. package/dist/charts/chart-types/column-types.d.ts +8 -0
  153. package/dist/charts/chart-types/column-types.d.ts.map +1 -0
  154. package/dist/charts/chart-types/column-types.js +2 -0
  155. package/dist/charts/chart-types/column-types.js.map +1 -0
  156. package/dist/charts/chart-types/count-plot/definition.d.ts.map +1 -1
  157. package/dist/charts/chart-types/count-plot/definition.js +1 -0
  158. package/dist/charts/chart-types/count-plot/definition.js.map +1 -1
  159. package/dist/charts/chart-types/count-plot/spec.d.ts +2 -1
  160. package/dist/charts/chart-types/count-plot/spec.d.ts.map +1 -1
  161. package/dist/charts/chart-types/count-plot/spec.js +47 -34
  162. package/dist/charts/chart-types/count-plot/spec.js.map +1 -1
  163. package/dist/charts/chart-types/count-plot/tool.d.ts +19 -24
  164. package/dist/charts/chart-types/count-plot/tool.d.ts.map +1 -1
  165. package/dist/charts/chart-types/count-plot/tool.js +26 -33
  166. package/dist/charts/chart-types/count-plot/tool.js.map +1 -1
  167. package/dist/charts/chart-types/count-plot/validation.d.ts +8 -0
  168. package/dist/charts/chart-types/count-plot/validation.d.ts.map +1 -0
  169. package/dist/charts/chart-types/count-plot/validation.js +20 -0
  170. package/dist/charts/chart-types/count-plot/validation.js.map +1 -0
  171. package/dist/charts/chart-types/createChartInstructions.d.ts +3 -0
  172. package/dist/charts/chart-types/createChartInstructions.d.ts.map +1 -0
  173. package/dist/charts/chart-types/createChartInstructions.js +12 -0
  174. package/dist/charts/chart-types/createChartInstructions.js.map +1 -0
  175. package/dist/charts/chart-types/createChartTools.d.ts +15 -9
  176. package/dist/charts/chart-types/createChartTools.d.ts.map +1 -1
  177. package/dist/charts/chart-types/createChartTools.js +16 -10
  178. package/dist/charts/chart-types/createChartTools.js.map +1 -1
  179. package/dist/charts/chart-types/createDefaultChartTypes.js +2 -2
  180. package/dist/charts/chart-types/createDefaultChartTypes.js.map +1 -1
  181. package/dist/charts/chart-types/custom-spec/definition.d.ts.map +1 -1
  182. package/dist/charts/chart-types/custom-spec/definition.js +1 -0
  183. package/dist/charts/chart-types/custom-spec/definition.js.map +1 -1
  184. package/dist/charts/chart-types/custom-spec/spec.d.ts +2 -1
  185. package/dist/charts/chart-types/custom-spec/spec.d.ts.map +1 -1
  186. package/dist/charts/chart-types/custom-spec/spec.js +16 -12
  187. package/dist/charts/chart-types/custom-spec/spec.js.map +1 -1
  188. package/dist/charts/chart-types/errors.d.ts +35 -0
  189. package/dist/charts/chart-types/errors.d.ts.map +1 -1
  190. package/dist/charts/chart-types/errors.js +56 -0
  191. package/dist/charts/chart-types/errors.js.map +1 -1
  192. package/dist/charts/chart-types/heatmap/definition.d.ts.map +1 -1
  193. package/dist/charts/chart-types/heatmap/definition.js +1 -0
  194. package/dist/charts/chart-types/heatmap/definition.js.map +1 -1
  195. package/dist/charts/chart-types/heatmap/spec.d.ts +2 -1
  196. package/dist/charts/chart-types/heatmap/spec.d.ts.map +1 -1
  197. package/dist/charts/chart-types/heatmap/spec.js +21 -21
  198. package/dist/charts/chart-types/heatmap/spec.js.map +1 -1
  199. package/dist/charts/chart-types/heatmap/tool.d.ts +20 -24
  200. package/dist/charts/chart-types/heatmap/tool.d.ts.map +1 -1
  201. package/dist/charts/chart-types/heatmap/tool.js +27 -37
  202. package/dist/charts/chart-types/heatmap/tool.js.map +1 -1
  203. package/dist/charts/chart-types/heatmap/validation.d.ts +9 -0
  204. package/dist/charts/chart-types/heatmap/validation.d.ts.map +1 -0
  205. package/dist/charts/chart-types/heatmap/validation.js +34 -0
  206. package/dist/charts/chart-types/heatmap/validation.js.map +1 -0
  207. package/dist/charts/chart-types/histogram/HistogramSettings.d.ts.map +1 -1
  208. package/dist/charts/chart-types/histogram/HistogramSettings.js +3 -1
  209. package/dist/charts/chart-types/histogram/HistogramSettings.js.map +1 -1
  210. package/dist/charts/chart-types/histogram/definition.d.ts.map +1 -1
  211. package/dist/charts/chart-types/histogram/definition.js +1 -0
  212. package/dist/charts/chart-types/histogram/definition.js.map +1 -1
  213. package/dist/charts/chart-types/histogram/schema.d.ts +2 -0
  214. package/dist/charts/chart-types/histogram/schema.d.ts.map +1 -1
  215. package/dist/charts/chart-types/histogram/schema.js +1 -0
  216. package/dist/charts/chart-types/histogram/schema.js.map +1 -1
  217. package/dist/charts/chart-types/histogram/spec.d.ts +2 -1
  218. package/dist/charts/chart-types/histogram/spec.d.ts.map +1 -1
  219. package/dist/charts/chart-types/histogram/spec.js +31 -28
  220. package/dist/charts/chart-types/histogram/spec.js.map +1 -1
  221. package/dist/charts/chart-types/histogram/tool.d.ts +39 -24
  222. package/dist/charts/chart-types/histogram/tool.d.ts.map +1 -1
  223. package/dist/charts/chart-types/histogram/tool.js +39 -33
  224. package/dist/charts/chart-types/histogram/tool.js.map +1 -1
  225. package/dist/charts/chart-types/histogram/validation.d.ts +9 -0
  226. package/dist/charts/chart-types/histogram/validation.d.ts.map +1 -0
  227. package/dist/charts/chart-types/histogram/validation.js +22 -0
  228. package/dist/charts/chart-types/histogram/validation.js.map +1 -0
  229. package/dist/charts/chart-types/index.d.ts +5 -11
  230. package/dist/charts/chart-types/index.d.ts.map +1 -1
  231. package/dist/charts/chart-types/index.js +6 -12
  232. package/dist/charts/chart-types/index.js.map +1 -1
  233. package/dist/charts/chart-types/line-chart/LineChartSettings.d.ts.map +1 -1
  234. package/dist/charts/chart-types/line-chart/LineChartSettings.js +4 -13
  235. package/dist/charts/chart-types/line-chart/LineChartSettings.js.map +1 -1
  236. package/dist/charts/chart-types/line-chart/LineChartXFieldSelector.d.ts +7 -0
  237. package/dist/charts/chart-types/line-chart/LineChartXFieldSelector.d.ts.map +1 -0
  238. package/dist/charts/chart-types/line-chart/LineChartXFieldSelector.js +22 -0
  239. package/dist/charts/chart-types/line-chart/LineChartXFieldSelector.js.map +1 -0
  240. package/dist/charts/chart-types/line-chart/LineChartYFieldsSelector.d.ts +7 -0
  241. package/dist/charts/chart-types/line-chart/LineChartYFieldsSelector.d.ts.map +1 -0
  242. package/dist/charts/chart-types/line-chart/LineChartYFieldsSelector.js +42 -0
  243. package/dist/charts/chart-types/line-chart/LineChartYFieldsSelector.js.map +1 -0
  244. package/dist/charts/chart-types/line-chart/definition.d.ts.map +1 -1
  245. package/dist/charts/chart-types/line-chart/definition.js +1 -0
  246. package/dist/charts/chart-types/line-chart/definition.js.map +1 -1
  247. package/dist/charts/chart-types/line-chart/schema.d.ts +2 -0
  248. package/dist/charts/chart-types/line-chart/schema.d.ts.map +1 -1
  249. package/dist/charts/chart-types/line-chart/schema.js +5 -0
  250. package/dist/charts/chart-types/line-chart/schema.js.map +1 -1
  251. package/dist/charts/chart-types/line-chart/spec.d.ts +2 -1
  252. package/dist/charts/chart-types/line-chart/spec.d.ts.map +1 -1
  253. package/dist/charts/chart-types/line-chart/spec.js +56 -65
  254. package/dist/charts/chart-types/line-chart/spec.js.map +1 -1
  255. package/dist/charts/chart-types/line-chart/tool.d.ts +28 -24
  256. package/dist/charts/chart-types/line-chart/tool.d.ts.map +1 -1
  257. package/dist/charts/chart-types/line-chart/tool.js +27 -39
  258. package/dist/charts/chart-types/line-chart/tool.js.map +1 -1
  259. package/dist/charts/chart-types/line-chart/utils.d.ts +7 -0
  260. package/dist/charts/chart-types/line-chart/utils.d.ts.map +1 -0
  261. package/dist/charts/chart-types/line-chart/utils.js +17 -0
  262. package/dist/charts/chart-types/line-chart/utils.js.map +1 -0
  263. package/dist/charts/chart-types/line-chart/validation.d.ts +16 -0
  264. package/dist/charts/chart-types/line-chart/validation.d.ts.map +1 -0
  265. package/dist/charts/chart-types/line-chart/validation.js +43 -0
  266. package/dist/charts/chart-types/line-chart/validation.js.map +1 -0
  267. package/dist/charts/chart-types/mosaicChartTypes.d.ts +4 -2
  268. package/dist/charts/chart-types/mosaicChartTypes.d.ts.map +1 -1
  269. package/dist/charts/chart-types/mosaicChartTypes.js +2 -2
  270. package/dist/charts/chart-types/mosaicChartTypes.js.map +1 -1
  271. package/dist/charts/chart-types/resolveChartTypes.d.ts +3 -0
  272. package/dist/charts/chart-types/resolveChartTypes.d.ts.map +1 -0
  273. package/dist/charts/chart-types/resolveChartTypes.js +8 -0
  274. package/dist/charts/chart-types/resolveChartTypes.js.map +1 -0
  275. package/dist/charts/chart-types/scatter-plot/ScatterPlotSettings.d.ts +3 -0
  276. package/dist/charts/chart-types/scatter-plot/ScatterPlotSettings.d.ts.map +1 -0
  277. package/dist/charts/chart-types/{bubble-chart/BubbleChartSettings.js → scatter-plot/ScatterPlotSettings.js} +4 -4
  278. package/dist/charts/chart-types/scatter-plot/ScatterPlotSettings.js.map +1 -0
  279. package/dist/charts/chart-types/scatter-plot/definition.d.ts +4 -0
  280. package/dist/charts/chart-types/scatter-plot/definition.d.ts.map +1 -0
  281. package/dist/charts/chart-types/scatter-plot/definition.js +25 -0
  282. package/dist/charts/chart-types/scatter-plot/definition.js.map +1 -0
  283. package/dist/charts/chart-types/{bubble-chart → scatter-plot}/schema.d.ts +5 -5
  284. package/dist/charts/chart-types/scatter-plot/schema.d.ts.map +1 -0
  285. package/dist/charts/chart-types/{bubble-chart → scatter-plot}/schema.js +5 -5
  286. package/dist/charts/chart-types/scatter-plot/schema.js.map +1 -0
  287. package/dist/charts/chart-types/scatter-plot/spec.d.ts +5 -0
  288. package/dist/charts/chart-types/scatter-plot/spec.d.ts.map +1 -0
  289. package/dist/charts/chart-types/scatter-plot/spec.js +37 -0
  290. package/dist/charts/chart-types/scatter-plot/spec.js.map +1 -0
  291. package/dist/charts/chart-types/scatter-plot/tool.d.ts +39 -0
  292. package/dist/charts/chart-types/scatter-plot/tool.d.ts.map +1 -0
  293. package/dist/charts/chart-types/scatter-plot/tool.js +57 -0
  294. package/dist/charts/chart-types/scatter-plot/tool.js.map +1 -0
  295. package/dist/charts/chart-types/scatter-plot/validation.d.ts +13 -0
  296. package/dist/charts/chart-types/scatter-plot/validation.d.ts.map +1 -0
  297. package/dist/charts/chart-types/scatter-plot/validation.js +52 -0
  298. package/dist/charts/chart-types/scatter-plot/validation.js.map +1 -0
  299. package/dist/charts/chart-types/tool-types.d.ts +43 -0
  300. package/dist/charts/chart-types/tool-types.d.ts.map +1 -0
  301. package/dist/charts/chart-types/tool-types.js +2 -0
  302. package/dist/charts/chart-types/tool-types.js.map +1 -0
  303. package/dist/charts/chart-types/utils.d.ts +3 -0
  304. package/dist/charts/chart-types/utils.d.ts.map +1 -0
  305. package/dist/charts/chart-types/utils.js +4 -0
  306. package/dist/charts/chart-types/utils.js.map +1 -0
  307. package/dist/charts/dashboard/MosaicDashboardChartHeaderActions.d.ts.map +1 -1
  308. package/dist/charts/dashboard/MosaicDashboardChartHeaderActions.js +12 -5
  309. package/dist/charts/dashboard/MosaicDashboardChartHeaderActions.js.map +1 -1
  310. package/dist/charts/dashboard/MosaicDashboardChartRenderer.d.ts.map +1 -1
  311. package/dist/charts/dashboard/MosaicDashboardChartRenderer.js +6 -4
  312. package/dist/charts/dashboard/MosaicDashboardChartRenderer.js.map +1 -1
  313. package/dist/charts/useChartDataPolicy.d.ts.map +1 -1
  314. package/dist/charts/useChartDataPolicy.js +2 -1
  315. package/dist/charts/useChartDataPolicy.js.map +1 -1
  316. package/dist/charts/useChartPanelClients.d.ts +8 -0
  317. package/dist/charts/useChartPanelClients.d.ts.map +1 -0
  318. package/dist/charts/useChartPanelClients.js +22 -0
  319. package/dist/charts/useChartPanelClients.js.map +1 -0
  320. package/dist/charts/useMosaicChartRenderContext.d.ts +2 -3
  321. package/dist/charts/useMosaicChartRenderContext.d.ts.map +1 -1
  322. package/dist/charts/useMosaicChartRenderContext.js +15 -15
  323. package/dist/charts/useMosaicChartRenderContext.js.map +1 -1
  324. package/dist/charts/worksheet/ChartBlockHeader.d.ts.map +1 -1
  325. package/dist/charts/worksheet/ChartBlockHeader.js +4 -3
  326. package/dist/charts/worksheet/ChartBlockHeader.js.map +1 -1
  327. package/dist/charts/worksheet/ChartBlockRenderer.d.ts.map +1 -1
  328. package/dist/charts/worksheet/ChartBlockRenderer.js +3 -13
  329. package/dist/charts/worksheet/ChartBlockRenderer.js.map +1 -1
  330. package/dist/column-types-utils.d.ts.map +1 -1
  331. package/dist/column-types-utils.js +12 -4
  332. package/dist/column-types-utils.js.map +1 -1
  333. package/dist/components/AggregationSelector.d.ts.map +1 -1
  334. package/dist/components/AggregationSelector.js +9 -2
  335. package/dist/components/AggregationSelector.js.map +1 -1
  336. package/dist/components/BlockCaptionEditor.d.ts +20 -0
  337. package/dist/components/BlockCaptionEditor.d.ts.map +1 -0
  338. package/dist/components/BlockCaptionEditor.js +15 -0
  339. package/dist/components/BlockCaptionEditor.js.map +1 -0
  340. package/dist/components/ColorSelector.d.ts +12 -0
  341. package/dist/components/ColorSelector.d.ts.map +1 -0
  342. package/dist/components/ColorSelector.js +13 -0
  343. package/dist/components/ColorSelector.js.map +1 -0
  344. package/dist/components/ColumnSelector.d.ts +1 -0
  345. package/dist/components/ColumnSelector.d.ts.map +1 -1
  346. package/dist/components/ColumnSelector.js +2 -2
  347. package/dist/components/ColumnSelector.js.map +1 -1
  348. package/dist/components/FieldSelectorInput.d.ts +1 -0
  349. package/dist/components/FieldSelectorInput.d.ts.map +1 -1
  350. package/dist/components/FieldSelectorInput.js +4 -9
  351. package/dist/components/FieldSelectorInput.js.map +1 -1
  352. package/dist/components/MultiFieldSelector.d.ts +4 -1
  353. package/dist/components/MultiFieldSelector.d.ts.map +1 -1
  354. package/dist/components/MultiFieldSelector.js +4 -13
  355. package/dist/components/MultiFieldSelector.js.map +1 -1
  356. package/dist/components/TemporalGranularitySelector.d.ts.map +1 -1
  357. package/dist/components/TemporalGranularitySelector.js +13 -9
  358. package/dist/components/TemporalGranularitySelector.js.map +1 -1
  359. package/dist/constants/chart-colors.d.ts +3 -0
  360. package/dist/constants/chart-colors.d.ts.map +1 -0
  361. package/dist/constants/chart-colors.js +5 -0
  362. package/dist/constants/chart-colors.js.map +1 -0
  363. package/dist/dashboard/DefaultMosaicDashboardBlock.d.ts +2 -1
  364. package/dist/dashboard/DefaultMosaicDashboardBlock.d.ts.map +1 -1
  365. package/dist/dashboard/DefaultMosaicDashboardBlock.js +1 -1
  366. package/dist/dashboard/DefaultMosaicDashboardBlock.js.map +1 -1
  367. package/dist/dashboard/MosaicDashboardCommands.d.ts +19 -0
  368. package/dist/dashboard/MosaicDashboardCommands.d.ts.map +1 -0
  369. package/dist/dashboard/MosaicDashboardCommands.js +226 -0
  370. package/dist/dashboard/MosaicDashboardCommands.js.map +1 -0
  371. package/dist/dashboard/MosaicDashboardSlice.d.ts +22 -4
  372. package/dist/dashboard/MosaicDashboardSlice.d.ts.map +1 -1
  373. package/dist/dashboard/MosaicDashboardSlice.js +55 -0
  374. package/dist/dashboard/MosaicDashboardSlice.js.map +1 -1
  375. package/dist/dashboard/components/ResetFiltersButton.d.ts +14 -0
  376. package/dist/dashboard/components/ResetFiltersButton.d.ts.map +1 -0
  377. package/dist/dashboard/components/ResetFiltersButton.js +15 -0
  378. package/dist/dashboard/components/ResetFiltersButton.js.map +1 -0
  379. package/dist/dashboard/dashboard-types.d.ts +9 -3
  380. package/dist/dashboard/dashboard-types.d.ts.map +1 -1
  381. package/dist/dashboard/dashboard-types.js.map +1 -1
  382. package/dist/dashboard/hooks/useDashboardResetFilters.d.ts +14 -0
  383. package/dist/dashboard/hooks/useDashboardResetFilters.d.ts.map +1 -0
  384. package/dist/dashboard/hooks/useDashboardResetFilters.js +39 -0
  385. package/dist/dashboard/hooks/useDashboardResetFilters.js.map +1 -0
  386. package/dist/dashboard/hooks/usePanelResetFilters.d.ts +16 -0
  387. package/dist/dashboard/hooks/usePanelResetFilters.d.ts.map +1 -0
  388. package/dist/dashboard/hooks/usePanelResetFilters.js +47 -0
  389. package/dist/dashboard/hooks/usePanelResetFilters.js.map +1 -0
  390. package/dist/dashboard/panel/MosaicDashboardPanel.d.ts.map +1 -1
  391. package/dist/dashboard/panel/MosaicDashboardPanel.js +1 -1
  392. package/dist/dashboard/panel/MosaicDashboardPanel.js.map +1 -1
  393. package/dist/dashboard/panel/MosaicDashboardPanelLayout.d.ts.map +1 -1
  394. package/dist/dashboard/panel/MosaicDashboardPanelLayout.js +3 -3
  395. package/dist/dashboard/panel/MosaicDashboardPanelLayout.js.map +1 -1
  396. package/dist/dashboard/panel/MosaicDashboardPanels.d.ts.map +1 -1
  397. package/dist/dashboard/panel/MosaicDashboardPanels.js +4 -2
  398. package/dist/dashboard/panel/MosaicDashboardPanels.js.map +1 -1
  399. package/dist/dashboard/toolbar/MosaicDashboardAddPanelDropdown.d.ts.map +1 -1
  400. package/dist/dashboard/toolbar/MosaicDashboardAddPanelDropdown.js +3 -3
  401. package/dist/dashboard/toolbar/MosaicDashboardAddPanelDropdown.js.map +1 -1
  402. package/dist/dashboard/toolbar/MosaicDashboardDataTableSelector.d.ts +7 -0
  403. package/dist/dashboard/toolbar/MosaicDashboardDataTableSelector.d.ts.map +1 -0
  404. package/dist/dashboard/toolbar/MosaicDashboardDataTableSelector.js +18 -0
  405. package/dist/dashboard/toolbar/MosaicDashboardDataTableSelector.js.map +1 -0
  406. package/dist/dashboard/toolbar/MosaicDashboardResetFiltersButton.d.ts.map +1 -1
  407. package/dist/dashboard/toolbar/MosaicDashboardResetFiltersButton.js +4 -32
  408. package/dist/dashboard/toolbar/MosaicDashboardResetFiltersButton.js.map +1 -1
  409. package/dist/dashboard/toolbar/MosaicDashboardToolbar.d.ts +2 -2
  410. package/dist/dashboard/toolbar/MosaicDashboardToolbar.d.ts.map +1 -1
  411. package/dist/dashboard/toolbar/MosaicDashboardToolbar.js +14 -10
  412. package/dist/dashboard/toolbar/MosaicDashboardToolbar.js.map +1 -1
  413. package/dist/dashboard/usePanelClientRegistration.d.ts +7 -0
  414. package/dist/dashboard/usePanelClientRegistration.d.ts.map +1 -0
  415. package/dist/dashboard/usePanelClientRegistration.js +30 -0
  416. package/dist/dashboard/usePanelClientRegistration.js.map +1 -0
  417. package/dist/dashboard/usePanelClients.d.ts +7 -0
  418. package/dist/dashboard/usePanelClients.d.ts.map +1 -0
  419. package/dist/dashboard/usePanelClients.js +13 -0
  420. package/dist/dashboard/usePanelClients.js.map +1 -0
  421. package/dist/dashboard/useSelectedOrFirstTable.d.ts +1 -1
  422. package/dist/dashboard/useSelectedOrFirstTable.d.ts.map +1 -1
  423. package/dist/dashboard/useSelectedOrFirstTable.js +10 -8
  424. package/dist/dashboard/useSelectedOrFirstTable.js.map +1 -1
  425. package/dist/data-table-explorer/DataTableExplorer.d.ts +4 -2
  426. package/dist/data-table-explorer/DataTableExplorer.d.ts.map +1 -1
  427. package/dist/data-table-explorer/DataTableExplorer.js +4 -4
  428. package/dist/data-table-explorer/DataTableExplorer.js.map +1 -1
  429. package/dist/data-table-explorer/DataTableExplorerCategoryClient.d.ts +3 -2
  430. package/dist/data-table-explorer/DataTableExplorerCategoryClient.d.ts.map +1 -1
  431. package/dist/data-table-explorer/DataTableExplorerCategoryClient.js +4 -3
  432. package/dist/data-table-explorer/DataTableExplorerCategoryClient.js.map +1 -1
  433. package/dist/data-table-explorer/DataTableExplorerCountClient.d.ts +3 -1
  434. package/dist/data-table-explorer/DataTableExplorerCountClient.d.ts.map +1 -1
  435. package/dist/data-table-explorer/DataTableExplorerCountClient.js +3 -3
  436. package/dist/data-table-explorer/DataTableExplorerCountClient.js.map +1 -1
  437. package/dist/data-table-explorer/DataTableExplorerHistogramClient.d.ts +3 -2
  438. package/dist/data-table-explorer/DataTableExplorerHistogramClient.d.ts.map +1 -1
  439. package/dist/data-table-explorer/DataTableExplorerHistogramClient.js +4 -4
  440. package/dist/data-table-explorer/DataTableExplorerHistogramClient.js.map +1 -1
  441. package/dist/data-table-explorer/DataTableExplorerPageClient.d.ts +3 -1
  442. package/dist/data-table-explorer/DataTableExplorerPageClient.d.ts.map +1 -1
  443. package/dist/data-table-explorer/DataTableExplorerPageClient.js +3 -1
  444. package/dist/data-table-explorer/DataTableExplorerPageClient.js.map +1 -1
  445. package/dist/data-table-explorer/DataTableExplorerUnsupportedSummaryClient.d.ts +3 -2
  446. package/dist/data-table-explorer/DataTableExplorerUnsupportedSummaryClient.d.ts.map +1 -1
  447. package/dist/data-table-explorer/DataTableExplorerUnsupportedSummaryClient.js +3 -3
  448. package/dist/data-table-explorer/DataTableExplorerUnsupportedSummaryClient.js.map +1 -1
  449. package/dist/data-table-explorer/createDataTableExplorerStore.d.ts +3 -0
  450. package/dist/data-table-explorer/createDataTableExplorerStore.d.ts.map +1 -1
  451. package/dist/data-table-explorer/createDataTableExplorerStore.js +6 -0
  452. package/dist/data-table-explorer/createDataTableExplorerStore.js.map +1 -1
  453. package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerHeaderActions.d.ts +4 -0
  454. package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerHeaderActions.d.ts.map +1 -0
  455. package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerHeaderActions.js +13 -0
  456. package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerHeaderActions.js.map +1 -0
  457. package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerPanelRenderer.d.ts.map +1 -1
  458. package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerPanelRenderer.js +26 -8
  459. package/dist/data-table-explorer/dashboard/MosaicDashboardDataTableExplorerPanelRenderer.js.map +1 -1
  460. package/dist/data-table-explorer/dashboard/useDataTableExplorerPanelClients.d.ts +13 -0
  461. package/dist/data-table-explorer/dashboard/useDataTableExplorerPanelClients.d.ts.map +1 -0
  462. package/dist/data-table-explorer/dashboard/useDataTableExplorerPanelClients.js +32 -0
  463. package/dist/data-table-explorer/dashboard/useDataTableExplorerPanelClients.js.map +1 -0
  464. package/dist/data-table-explorer/dataTableExplorerController.d.ts +63 -3
  465. package/dist/data-table-explorer/dataTableExplorerController.d.ts.map +1 -1
  466. package/dist/data-table-explorer/dataTableExplorerController.js +73 -10
  467. package/dist/data-table-explorer/dataTableExplorerController.js.map +1 -1
  468. package/dist/data-table-explorer/hooks/useDataTableExplorerColumns.d.ts +12 -0
  469. package/dist/data-table-explorer/hooks/useDataTableExplorerColumns.d.ts.map +1 -0
  470. package/dist/data-table-explorer/hooks/useDataTableExplorerColumns.js +19 -0
  471. package/dist/data-table-explorer/hooks/useDataTableExplorerColumns.js.map +1 -0
  472. package/dist/data-table-explorer/hooks/useDataTableExplorerLifecycles.d.ts +52 -0
  473. package/dist/data-table-explorer/hooks/useDataTableExplorerLifecycles.d.ts.map +1 -0
  474. package/dist/data-table-explorer/hooks/useDataTableExplorerLifecycles.js +153 -0
  475. package/dist/data-table-explorer/hooks/useDataTableExplorerLifecycles.js.map +1 -0
  476. package/dist/data-table-explorer/hooks/useDataTableExplorerQueryState.d.ts +42 -0
  477. package/dist/data-table-explorer/hooks/useDataTableExplorerQueryState.d.ts.map +1 -0
  478. package/dist/data-table-explorer/hooks/useDataTableExplorerQueryState.js +43 -0
  479. package/dist/data-table-explorer/hooks/useDataTableExplorerQueryState.js.map +1 -0
  480. package/dist/data-table-explorer/hooks/useDataTableExplorerSelection.d.ts +13 -0
  481. package/dist/data-table-explorer/hooks/useDataTableExplorerSelection.d.ts.map +1 -0
  482. package/dist/data-table-explorer/hooks/useDataTableExplorerSelection.js +40 -0
  483. package/dist/data-table-explorer/hooks/useDataTableExplorerSelection.js.map +1 -0
  484. package/dist/data-table-explorer/hooks/useDataTableExplorerStatus.d.ts +18 -0
  485. package/dist/data-table-explorer/hooks/useDataTableExplorerStatus.d.ts.map +1 -0
  486. package/dist/data-table-explorer/hooks/useDataTableExplorerStatus.js +23 -0
  487. package/dist/data-table-explorer/hooks/useDataTableExplorerStatus.js.map +1 -0
  488. package/dist/data-table-explorer/hooks/useDataTableExplorerStoreState.d.ts +27 -0
  489. package/dist/data-table-explorer/hooks/useDataTableExplorerStoreState.d.ts.map +1 -0
  490. package/dist/data-table-explorer/hooks/useDataTableExplorerStoreState.js +28 -0
  491. package/dist/data-table-explorer/hooks/useDataTableExplorerStoreState.js.map +1 -0
  492. package/dist/data-table-explorer/hooks/useDataTableExplorerVisiblePage.d.ts +15 -0
  493. package/dist/data-table-explorer/hooks/useDataTableExplorerVisiblePage.d.ts.map +1 -0
  494. package/dist/data-table-explorer/hooks/useDataTableExplorerVisiblePage.js +21 -0
  495. package/dist/data-table-explorer/hooks/useDataTableExplorerVisiblePage.js.map +1 -0
  496. package/dist/data-table-explorer/types.d.ts +16 -3
  497. package/dist/data-table-explorer/types.d.ts.map +1 -1
  498. package/dist/data-table-explorer/types.js.map +1 -1
  499. package/dist/data-table-explorer/useDataTableExplorer.d.ts.map +1 -1
  500. package/dist/data-table-explorer/useDataTableExplorer.js +20 -279
  501. package/dist/data-table-explorer/useDataTableExplorer.js.map +1 -1
  502. package/dist/data-table-explorer/utils.d.ts +64 -6
  503. package/dist/data-table-explorer/utils.d.ts.map +1 -1
  504. package/dist/data-table-explorer/utils.js +58 -0
  505. package/dist/data-table-explorer/utils.js.map +1 -1
  506. package/dist/data-table-explorer/worksheet/DataTableBlockHeader.d.ts +1 -0
  507. package/dist/data-table-explorer/worksheet/DataTableBlockHeader.d.ts.map +1 -1
  508. package/dist/data-table-explorer/worksheet/DataTableBlockHeader.js +4 -2
  509. package/dist/data-table-explorer/worksheet/DataTableBlockHeader.js.map +1 -1
  510. package/dist/data-table-explorer/worksheet/DataTableBlockRenderer.d.ts.map +1 -1
  511. package/dist/data-table-explorer/worksheet/DataTableBlockRenderer.js +4 -4
  512. package/dist/data-table-explorer/worksheet/DataTableBlockRenderer.js.map +1 -1
  513. package/dist/index.d.ts +55 -31
  514. package/dist/index.d.ts.map +1 -1
  515. package/dist/index.js +86 -26
  516. package/dist/index.js.map +1 -1
  517. package/dist/mosaicTableReference.d.ts +59 -0
  518. package/dist/mosaicTableReference.d.ts.map +1 -0
  519. package/dist/mosaicTableReference.js +68 -0
  520. package/dist/mosaicTableReference.js.map +1 -0
  521. package/dist/useVgPlotChartRender.d.ts.map +1 -1
  522. package/dist/useVgPlotChartRender.js +151 -25
  523. package/dist/useVgPlotChartRender.js.map +1 -1
  524. package/dist/useVgPlotChartRetention.d.ts +11 -0
  525. package/dist/useVgPlotChartRetention.d.ts.map +1 -1
  526. package/dist/useVgPlotChartRetention.js.map +1 -1
  527. package/dist/utils/table-lookup.d.ts +7 -0
  528. package/dist/utils/table-lookup.d.ts.map +1 -0
  529. package/dist/utils/table-lookup.js +10 -0
  530. package/dist/utils/table-lookup.js.map +1 -0
  531. package/package.json +14 -14
  532. package/dist/ai/ai.d.ts +0 -103
  533. package/dist/ai/ai.d.ts.map +0 -1
  534. package/dist/ai/ai.js +0 -419
  535. package/dist/ai/ai.js.map +0 -1
  536. package/dist/ai/data-table-explorer-tool.d.ts +0 -40
  537. package/dist/ai/data-table-explorer-tool.d.ts.map +0 -1
  538. package/dist/ai/data-table-explorer-tool.js +0 -75
  539. package/dist/ai/data-table-explorer-tool.js.map +0 -1
  540. package/dist/ai/list-panels-tool.d.ts +0 -35
  541. package/dist/ai/list-panels-tool.d.ts.map +0 -1
  542. package/dist/ai/list-panels-tool.js +0 -66
  543. package/dist/ai/list-panels-tool.js.map +0 -1
  544. package/dist/ai/remove-panel-tool.d.ts +0 -31
  545. package/dist/ai/remove-panel-tool.d.ts.map +0 -1
  546. package/dist/ai/remove-panel-tool.js +0 -55
  547. package/dist/ai/remove-panel-tool.js.map +0 -1
  548. package/dist/ai/tool-validation.d.ts +0 -3
  549. package/dist/ai/tool-validation.d.ts.map +0 -1
  550. package/dist/ai/tool-validation.js +0 -11
  551. package/dist/ai/tool-validation.js.map +0 -1
  552. package/dist/charts/chart-types/bubble-chart/BubbleChartSettings.d.ts +0 -3
  553. package/dist/charts/chart-types/bubble-chart/BubbleChartSettings.d.ts.map +0 -1
  554. package/dist/charts/chart-types/bubble-chart/BubbleChartSettings.js.map +0 -1
  555. package/dist/charts/chart-types/bubble-chart/definition.d.ts +0 -4
  556. package/dist/charts/chart-types/bubble-chart/definition.d.ts.map +0 -1
  557. package/dist/charts/chart-types/bubble-chart/definition.js +0 -24
  558. package/dist/charts/chart-types/bubble-chart/definition.js.map +0 -1
  559. package/dist/charts/chart-types/bubble-chart/schema.d.ts.map +0 -1
  560. package/dist/charts/chart-types/bubble-chart/schema.js.map +0 -1
  561. package/dist/charts/chart-types/bubble-chart/spec.d.ts +0 -4
  562. package/dist/charts/chart-types/bubble-chart/spec.d.ts.map +0 -1
  563. package/dist/charts/chart-types/bubble-chart/spec.js +0 -31
  564. package/dist/charts/chart-types/bubble-chart/spec.js.map +0 -1
  565. package/dist/charts/chart-types/bubble-chart/tool.d.ts +0 -42
  566. package/dist/charts/chart-types/bubble-chart/tool.d.ts.map +0 -1
  567. package/dist/charts/chart-types/bubble-chart/tool.js +0 -66
  568. package/dist/charts/chart-types/bubble-chart/tool.js.map +0 -1
  569. package/dist/hooks/useDataTable.d.ts +0 -3
  570. package/dist/hooks/useDataTable.d.ts.map +0 -1
  571. package/dist/hooks/useDataTable.js +0 -28
  572. package/dist/hooks/useDataTable.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"BoxPlotPanelRenderer.js","sourceRoot":"","sources":["../../../../../src/charts/chart-types/box-plot/renderer/BoxPlotPanelRenderer.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACxE,OAAO,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AACzC,OAAO,EAAgB,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAEzE,OAAO,EACL,oBAAoB,EACpB,OAAO,GAGR,MAAM,aAAa,CAAC;AACrB,OAAO,EAAC,oBAAoB,EAAC,MAAM,QAAQ,CAAC;AAE5C,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAC,cAAc,EAAE,UAAU,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;AAClE,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAE5D;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAE7B,CAAC,EACH,SAAS,EACT,MAAM,EACN,WAAW,EACX,MAAM,EACN,UAAU,EACV,mBAAmB,EACnB,oBAAoB,GACrB,EAAE,EAAE;IACH,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IAClC,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ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cACE,SAAS,EAAC,qEAAqE,EAC/E,KAAK,EAAE,UAAU,GACjB,CACH,CAAC,CAAC,CAAC,IAAI,EACR,cACE,SAAS,EAAC,8CAA8C,EACxD,eAAe,EAAE,UAAU,EAC3B,aAAa,EAAE,iBAAiB,EAChC,aAAa,EAAE,iBAAiB,EAChC,WAAW,EAAE,UAAU,GACvB,IACa,CAClB,GACG,GACF,GACe,CACxB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type {FC, PointerEvent as ReactPointerEvent} from 'react';\nimport {useCallback, useEffect, useMemo, useRef, useState} from 'react';\nimport {SpinnerPane} from '@sqlrooms/ui';\nimport {type PlotSize, ResponsivePlot} from '../../../../ResponsivePlot';\nimport type {ChartRendererProps} from '../../base-types';\nimport {\n DRAG_CLICK_THRESHOLD,\n MARGINS,\n type PlotOutlierDatum,\n type PlotSummaryDatum,\n} from './constants';\nimport {createBoxPlotElement} from './plot';\nimport type {BoxPlotChartConfig} from '../schema';\nimport {useBoxPlotClient} from './useBoxPlotClient';\nimport {formatCategory, getYDomain, yPixelToValue} from './utils';\nimport {BoxPlotErrorBoundary} from './BoxPlotErrorBoundary';\n\n/**\n * Custom renderer for box-plot chart type.\n * Uses BoxPlotClient for SQL-based quartile calculations and custom Observable Plot rendering.\n */\nexport const BoxPlotPanelRenderer: FC<\n ChartRendererProps<BoxPlotChartConfig>\n> = ({\n tableName,\n config,\n coordinator,\n params,\n dataPolicy,\n runtimeIssueContext,\n runtimeIssueReporter,\n}) => {\n const configX = config.settings.x;\n const configY = config.settings.y;\n const boxPlotConfig = useMemo(\n () =>\n typeof configX === 'string' && typeof configY === 'string'\n ? {x: configX, y: configY}\n : null,\n [configX, configY],\n );\n\n const [size, setSize] = useState<PlotSize | null>(null);\n const [drag, setDrag] = useState<{startY: number; currentY: number} | null>(\n null,\n );\n const plotRef = useRef<HTMLDivElement>(null);\n\n const {clientRef, state} = useBoxPlotClient({\n config: boxPlotConfig,\n coordinator,\n dataPolicy,\n params,\n runtimeIssueContext,\n runtimeIssueReporter,\n tableName,\n });\n\n const summaries = useMemo<PlotSummaryDatum[]>(\n () =>\n state.summaries.map((row) => ({\n ...row,\n categoryLabel: formatCategory(row.category),\n })),\n [state.summaries],\n );\n const outliers = useMemo<PlotOutlierDatum[]>(\n () =>\n state.outliers.map((row) => ({\n ...row,\n categoryLabel: formatCategory(row.category),\n })),\n [state.outliers],\n );\n const yDomain = useMemo(\n () => getYDomain(state.summaries, state.outliers),\n [state.outliers, state.summaries],\n );\n\n useEffect(() => {\n const container = plotRef.current;\n if (!container || !size || !boxPlotConfig) {\n return;\n }\n if (!summaries.length) {\n container.replaceChildren();\n return;\n }\n\n const plot = createBoxPlotElement({\n config: boxPlotConfig,\n domain: yDomain,\n outliers,\n size,\n summaries,\n });\n container.replaceChildren(plot);\n }, [boxPlotConfig, outliers, size, summaries, yDomain]);\n\n const getLocalY = useCallback((event: ReactPointerEvent<HTMLDivElement>) => {\n const rect = event.currentTarget.getBoundingClientRect();\n return event.clientY - rect.top;\n }, []);\n\n const handlePointerDown = useCallback(\n (event: ReactPointerEvent<HTMLDivElement>) => {\n if (!size || !summaries.length) return;\n event.currentTarget.setPointerCapture(event.pointerId);\n const y = getLocalY(event);\n setDrag({currentY: y, startY: y});\n },\n [getLocalY, size, summaries.length],\n );\n\n const handlePointerMove = useCallback(\n (event: ReactPointerEvent<HTMLDivElement>) => {\n if (!drag) return;\n setDrag({...drag, currentY: getLocalY(event)});\n },\n [drag, getLocalY],\n );\n\n const finishDrag = useCallback(\n (event: ReactPointerEvent<HTMLDivElement>) => {\n if (!drag || !size) return;\n event.currentTarget.releasePointerCapture(event.pointerId);\n const currentY = getLocalY(event);\n const pixelDistance = Math.abs(currentY - drag.startY);\n setDrag(null);\n if (pixelDistance < DRAG_CLICK_THRESHOLD) {\n clientRef.current?.updateYBrush();\n return;\n }\n clientRef.current?.updateYBrush([\n yPixelToValue(drag.startY, size, yDomain),\n yPixelToValue(currentY, size, yDomain),\n ]);\n },\n [clientRef, drag, getLocalY, size, yDomain],\n );\n\n const brushStyle = useMemo(() => {\n const extent = drag\n ? [drag.startY, drag.currentY]\n : state.yBrush && size\n ? state.yBrush.map((value) => {\n const plotHeight = Math.max(\n 1,\n size.height - MARGINS.top - MARGINS.bottom,\n );\n const span = yDomain[1] - yDomain[0] || 1;\n const pixelPos =\n MARGINS.top + ((yDomain[1] - value) / span) * plotHeight;\n return Math.max(\n MARGINS.top,\n Math.min(MARGINS.top + plotHeight, pixelPos),\n );\n })\n : null;\n if (!extent) return undefined;\n const top = Math.max(MARGINS.top, Math.min(...extent));\n const bottom = Math.min(\n size?.height ? size.height - MARGINS.bottom : Number.POSITIVE_INFINITY,\n Math.max(...extent),\n );\n return {\n height: `${Math.max(0, bottom - top)}px`,\n left: `${MARGINS.left}px`,\n right: `${MARGINS.right}px`,\n top: `${top}px`,\n };\n }, [drag, size, state.yBrush, yDomain]);\n\n if (!config.settings.x || !config.settings.y) {\n return (\n <div className=\"flex h-full flex-col items-center justify-center\">\n <div className=\"text-center font-medium\">\n Configure chart to display visualization\n </div>\n <div className=\"text-center text-xs\">\n X and Y fields are required for box plot\n </div>\n </div>\n );\n }\n\n return (\n <BoxPlotErrorBoundary>\n <div className=\"h-full min-h-0 overflow-auto p-2\">\n <div className=\"bg-background text-foreground relative flex h-full min-h-[220px] w-full items-center justify-center rounded-md p-2\">\n {state.error ? (\n <div className=\"text-destructive flex h-full items-center justify-center p-4 text-sm\">\n {state.error.message}\n </div>\n ) : state.isLoading && !state.summaries.length ? (\n <SpinnerPane className=\"h-full w-full\" />\n ) : !state.summaries.length ? (\n <div className=\"text-muted-foreground flex h-full items-center justify-center text-sm\">\n No numeric values for this box plot\n </div>\n ) : (\n <ResponsivePlot\n onResize={setSize}\n className=\"relative h-full min-h-[220px] w-full\"\n >\n <div ref={plotRef} className=\"absolute inset-0\" />\n {brushStyle ? (\n <div\n className=\"bg-primary/15 border-primary/60 pointer-events-none absolute border\"\n style={brushStyle}\n />\n ) : null}\n <div\n className=\"absolute inset-0 cursor-crosshair touch-none\"\n onPointerCancel={finishDrag}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={finishDrag}\n />\n </ResponsivePlot>\n )}\n </div>\n </div>\n </BoxPlotErrorBoundary>\n );\n};\n"]}
1
+ {"version":3,"file":"BoxPlotPanelRenderer.js","sourceRoot":"","sources":["../../../../../src/charts/chart-types/box-plot/renderer/BoxPlotPanelRenderer.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACxE,OAAO,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AACzC,OAAO,EAAgB,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAEzE,OAAO,EACL,oBAAoB,EACpB,OAAO,GAGR,MAAM,aAAa,CAAC;AACrB,OAAO,EAAC,oBAAoB,EAAC,MAAM,QAAQ,CAAC;AAE5C,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAC,cAAc,EAAE,UAAU,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;AAClE,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAE5D;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAE7B,CAAC,EACH,KAAK,EACL,MAAM,EACN,WAAW,EACX,MAAM,EACN,UAAU,EACV,mBAAmB,EACnB,oBAAoB,GACrB,EAAE,EAAE;IACH,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IAClC,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IAClC,MAAM,aAAa,GAAG,OAAO,CAC3B,GAAG,EAAE,CACH,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ;QACxD,CAAC,CAAC,EAAC,CAAC,EAAE,OAAO,EAAE,CA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AAE,iBAAiB,EAChC,WAAW,EAAE,UAAU,GACvB,IACa,CAClB,GACG,GACF,GACe,CACxB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type {FC, PointerEvent as ReactPointerEvent} from 'react';\nimport {useCallback, useEffect, useMemo, useRef, useState} from 'react';\nimport {SpinnerPane} from '@sqlrooms/ui';\nimport {type PlotSize, ResponsivePlot} from '../../../../ResponsivePlot';\nimport type {ChartRendererProps} from '../../base-types';\nimport {\n DRAG_CLICK_THRESHOLD,\n MARGINS,\n type PlotOutlierDatum,\n type PlotSummaryDatum,\n} from './constants';\nimport {createBoxPlotElement} from './plot';\nimport type {BoxPlotChartConfig} from '../schema';\nimport {useBoxPlotClient} from './useBoxPlotClient';\nimport {formatCategory, getYDomain, yPixelToValue} from './utils';\nimport {BoxPlotErrorBoundary} from './BoxPlotErrorBoundary';\n\n/**\n * Custom renderer for box-plot chart type.\n * Uses BoxPlotClient for SQL-based quartile calculations and custom Observable Plot rendering.\n */\nexport const BoxPlotPanelRenderer: FC<\n ChartRendererProps<BoxPlotChartConfig>\n> = ({\n table,\n config,\n coordinator,\n params,\n dataPolicy,\n runtimeIssueContext,\n runtimeIssueReporter,\n}) => {\n const configX = config.settings.x;\n const configY = config.settings.y;\n const boxPlotConfig = useMemo(\n () =>\n typeof configX === 'string' && typeof configY === 'string'\n ? {x: configX, y: configY}\n : null,\n [configX, configY],\n );\n\n const [size, setSize] = useState<PlotSize | null>(null);\n const [drag, setDrag] = useState<{startY: number; currentY: number} | null>(\n null,\n );\n const plotRef = useRef<HTMLDivElement>(null);\n\n const {clientRef, state} = useBoxPlotClient({\n config: boxPlotConfig,\n coordinator,\n dataPolicy,\n params,\n runtimeIssueContext,\n runtimeIssueReporter,\n table,\n });\n\n const summaries = useMemo<PlotSummaryDatum[]>(\n () =>\n state.summaries.map((row) => ({\n ...row,\n categoryLabel: formatCategory(row.category),\n })),\n [state.summaries],\n );\n const outliers = useMemo<PlotOutlierDatum[]>(\n () =>\n state.outliers.map((row) => ({\n ...row,\n categoryLabel: formatCategory(row.category),\n })),\n [state.outliers],\n );\n const yDomain = useMemo(\n () => getYDomain(state.summaries, state.outliers),\n [state.outliers, state.summaries],\n );\n\n useEffect(() => {\n const container = plotRef.current;\n if (!container || !size || !boxPlotConfig) {\n return;\n }\n if (!summaries.length) {\n container.replaceChildren();\n return;\n }\n\n const plot = createBoxPlotElement({\n config: boxPlotConfig,\n domain: yDomain,\n outliers,\n size,\n summaries,\n });\n container.replaceChildren(plot);\n }, [boxPlotConfig, outliers, size, summaries, yDomain]);\n\n const getLocalY = useCallback((event: ReactPointerEvent<HTMLDivElement>) => {\n const rect = event.currentTarget.getBoundingClientRect();\n return event.clientY - rect.top;\n }, []);\n\n const handlePointerDown = useCallback(\n (event: ReactPointerEvent<HTMLDivElement>) => {\n if (!size || !summaries.length) return;\n event.currentTarget.setPointerCapture(event.pointerId);\n const y = getLocalY(event);\n setDrag({currentY: y, startY: y});\n },\n [getLocalY, size, summaries.length],\n );\n\n const handlePointerMove = useCallback(\n (event: ReactPointerEvent<HTMLDivElement>) => {\n if (!drag) return;\n setDrag({...drag, currentY: getLocalY(event)});\n },\n [drag, getLocalY],\n );\n\n const finishDrag = useCallback(\n (event: ReactPointerEvent<HTMLDivElement>) => {\n if (!drag || !size) return;\n event.currentTarget.releasePointerCapture(event.pointerId);\n const currentY = getLocalY(event);\n const pixelDistance = Math.abs(currentY - drag.startY);\n setDrag(null);\n if (pixelDistance < DRAG_CLICK_THRESHOLD) {\n clientRef.current?.updateYBrush();\n return;\n }\n clientRef.current?.updateYBrush([\n yPixelToValue(drag.startY, size, yDomain),\n yPixelToValue(currentY, size, yDomain),\n ]);\n },\n [clientRef, drag, getLocalY, size, yDomain],\n );\n\n const brushStyle = useMemo(() => {\n const extent = drag\n ? [drag.startY, drag.currentY]\n : state.yBrush && size\n ? state.yBrush.map((value) => {\n const plotHeight = Math.max(\n 1,\n size.height - MARGINS.top - MARGINS.bottom,\n );\n const span = yDomain[1] - yDomain[0] || 1;\n const pixelPos =\n MARGINS.top + ((yDomain[1] - value) / span) * plotHeight;\n return Math.max(\n MARGINS.top,\n Math.min(MARGINS.top + plotHeight, pixelPos),\n );\n })\n : null;\n if (!extent) return undefined;\n const top = Math.max(MARGINS.top, Math.min(...extent));\n const bottom = Math.min(\n size?.height ? size.height - MARGINS.bottom : Number.POSITIVE_INFINITY,\n Math.max(...extent),\n );\n return {\n height: `${Math.max(0, bottom - top)}px`,\n left: `${MARGINS.left}px`,\n right: `${MARGINS.right}px`,\n top: `${top}px`,\n };\n }, [drag, size, state.yBrush, yDomain]);\n\n if (!config.settings.x || !config.settings.y) {\n return (\n <div className=\"flex h-full flex-col items-center justify-center\">\n <div className=\"text-center font-medium\">\n Configure chart to display visualization\n </div>\n <div className=\"text-center text-xs\">\n X and Y fields are required for box plot\n </div>\n </div>\n );\n }\n\n return (\n <BoxPlotErrorBoundary>\n <div className=\"h-full min-h-0 overflow-auto p-2\">\n <div className=\"bg-background text-foreground relative flex h-full min-h-[220px] w-full items-center justify-center rounded-md p-2\">\n {state.error ? (\n <div className=\"text-destructive flex h-full items-center justify-center p-4 text-sm\">\n {state.error.message}\n </div>\n ) : state.isLoading && !state.summaries.length ? (\n <SpinnerPane className=\"h-full w-full\" />\n ) : !state.summaries.length ? (\n <div className=\"text-muted-foreground flex h-full items-center justify-center text-sm\">\n No numeric values for this box plot\n </div>\n ) : (\n <ResponsivePlot\n onResize={setSize}\n className=\"relative h-full min-h-[220px] w-full\"\n >\n <div ref={plotRef} className=\"absolute inset-0\" />\n {brushStyle ? (\n <div\n className=\"bg-primary/15 border-primary/60 pointer-events-none absolute border\"\n style={brushStyle}\n />\n ) : null}\n <div\n className=\"absolute inset-0 cursor-crosshair touch-none\"\n onPointerCancel={finishDrag}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={finishDrag}\n />\n </ResponsivePlot>\n )}\n </div>\n </div>\n </BoxPlotErrorBoundary>\n );\n};\n"]}
@@ -1,8 +1,19 @@
1
1
  import { Coordinator } from '@uwdata/mosaic-core';
2
2
  import { BoxPlotClient, type BoxPlotState } from './BoxPlotClient';
3
3
  import type { BrushSelectionParams } from '../../base-types';
4
+ import type { QualifiedTableName } from '@sqlrooms/duckdb';
4
5
  import type { ChartDataPolicy, ChartRuntimeIssueContext, ChartRuntimeIssueReporter } from '../../../../chart-runtime';
5
6
  import { BoxPlotChartSettings } from '../schema';
7
+ /**
8
+ * Creates and connects the Mosaic client used by the box plot renderer.
9
+ *
10
+ * @param args - Hook inputs including chart settings, Mosaic coordinator,
11
+ * optional dashboard services, and the resolved source table.
12
+ * @param args.table - Canonical `QualifiedTableName` for the source table. The
13
+ * hook passes this structured identity through to {@link BoxPlotClient}, where
14
+ * it is converted to a Mosaic SQL table reference at query-build time.
15
+ * @returns The active client ref and normalized renderer state.
16
+ */
6
17
  export declare function useBoxPlotClient(args: {
7
18
  config: BoxPlotChartSettings | null;
8
19
  coordinator: Coordinator;
@@ -10,7 +21,7 @@ export declare function useBoxPlotClient(args: {
10
21
  params?: BrushSelectionParams;
11
22
  runtimeIssueContext?: ChartRuntimeIssueContext;
12
23
  runtimeIssueReporter?: ChartRuntimeIssueReporter;
13
- tableName: string;
24
+ table: QualifiedTableName;
14
25
  }): {
15
26
  clientRef: import("react").RefObject<BoxPlotClient | null>;
16
27
  state: BoxPlotState;
@@ -1 +1 @@
1
- {"version":3,"file":"useBoxPlotClient.d.ts","sourceRoot":"","sources":["../../../../../src/charts/chart-types/box-plot/renderer/useBoxPlotClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAY,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAC,aAAa,EAAE,KAAK,YAAY,EAAC,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,kBAAkB,CAAC;AAC3D,OAAO,KAAK,EACV,eAAe,EACf,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAC,oBAAoB,EAAC,MAAM,WAAW,CAAC;AAE/C,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IACrC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACpC,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IACpC,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,mBAAmB,CAAC,EAAE,wBAAwB,CAAC;IAC/C,oBAAoB,CAAC,EAAE,yBAAyB,CAAC;IACjD,SAAS,EAAE,MAAM,CAAC;CACnB;;;EAyEA"}
1
+ {"version":3,"file":"useBoxPlotClient.d.ts","sourceRoot":"","sources":["../../../../../src/charts/chart-types/box-plot/renderer/useBoxPlotClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAY,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAC,aAAa,EAAE,KAAK,YAAY,EAAC,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,kBAAkB,CAAC;AAC3D,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EACV,eAAe,EACf,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAC,oBAAoB,EAAC,MAAM,WAAW,CAAC;AAE/C;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IACrC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACpC,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IACpC,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,mBAAmB,CAAC,EAAE,wBAAwB,CAAC;IAC/C,oBAAoB,CAAC,EAAE,yBAAyB,CAAC;IACjD,KAAK,EAAE,kBAAkB,CAAC;CAC3B;;;EAyEA"}
@@ -1,8 +1,18 @@
1
1
  import { Selection } from '@uwdata/mosaic-core';
2
2
  import { useEffect, useMemo, useRef, useState } from 'react';
3
3
  import { BoxPlotClient } from './BoxPlotClient';
4
+ /**
5
+ * Creates and connects the Mosaic client used by the box plot renderer.
6
+ *
7
+ * @param args - Hook inputs including chart settings, Mosaic coordinator,
8
+ * optional dashboard services, and the resolved source table.
9
+ * @param args.table - Canonical `QualifiedTableName` for the source table. The
10
+ * hook passes this structured identity through to {@link BoxPlotClient}, where
11
+ * it is converted to a Mosaic SQL table reference at query-build time.
12
+ * @returns The active client ref and normalized renderer state.
13
+ */
4
14
  export function useBoxPlotClient(args) {
5
- const { config, coordinator, dataPolicy, params, runtimeIssueContext, runtimeIssueReporter, tableName, } = args;
15
+ const { config, coordinator, dataPolicy, params, runtimeIssueContext, runtimeIssueReporter, table, } = args;
6
16
  const [state, setState] = useState({
7
17
  isLoading: true,
8
18
  outliers: [],
@@ -30,7 +40,7 @@ export function useBoxPlotClient(args) {
30
40
  runtimeIssueContext,
31
41
  runtimeIssueReporter,
32
42
  selection,
33
- tableName,
43
+ table,
34
44
  x: config.x,
35
45
  y: config.y,
36
46
  });
@@ -49,7 +59,7 @@ export function useBoxPlotClient(args) {
49
59
  runtimeIssueContext,
50
60
  runtimeIssueReporter,
51
61
  selection,
52
- tableName,
62
+ table,
53
63
  ]);
54
64
  const effectiveState = !config || !config.x || !config.y
55
65
  ? {
@@ -1 +1 @@
1
- {"version":3,"file":"useBoxPlotClient.js","sourceRoot":"","sources":["../../../../../src/charts/chart-types/box-plot/renderer/useBoxPlotClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAC,aAAa,EAAoB,MAAM,iBAAiB,CAAC;AASjE,MAAM,UAAU,gBAAgB,CAAC,IAQhC;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AK,MAAM,EAAE,CAAC;gBACjC,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;YAC3B,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE;QACD,MAAM;QACN,WAAW;QACX,UAAU;QACV,mBAAmB;QACnB,oBAAoB;QACpB,SAAS;QACT,SAAS;KACV,CAAC,CAAC;IAEH,MAAM,cAAc,GAClB,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/B,CAAC,CAAC;YACE,SAAS,EAAE,KAAK;YAChB,QAAQ,EAAE,EAAE;YACZ,SAAS,EAAE,EAAE;SACd;QACH,CAAC,CAAC,KAAK,CAAC;IAEZ,OAAO,EAAC,SAAS,EAAE,KAAK,EAAE,cAAc,EAAC,CAAC;AAC5C,CAAC","sourcesContent":["import {Coordinator, Selection} from '@uwdata/mosaic-core';\nimport {useEffect, useMemo, useRef, useState} from 'react';\nimport {BoxPlotClient, type BoxPlotState} from './BoxPlotClient';\nimport type {BrushSelectionParams} from '../../base-types';\nimport type {\n ChartDataPolicy,\n ChartRuntimeIssueContext,\n ChartRuntimeIssueReporter,\n} from '../../../../chart-runtime';\nimport {BoxPlotChartSettings} from '../schema';\n\nexport function useBoxPlotClient(args: {\n config: BoxPlotChartSettings | null;\n coordinator: Coordinator;\n dataPolicy?: ChartDataPolicy | null;\n params?: BrushSelectionParams;\n runtimeIssueContext?: ChartRuntimeIssueContext;\n runtimeIssueReporter?: ChartRuntimeIssueReporter;\n tableName: string;\n}) {\n const {\n config,\n coordinator,\n dataPolicy,\n params,\n runtimeIssueContext,\n runtimeIssueReporter,\n tableName,\n } = args;\n const [state, setState] = useState<BoxPlotState>({\n isLoading: true,\n outliers: [],\n summaries: [],\n });\n const clientRef = useRef<BoxPlotClient | null>(null);\n\n // Get or create the crossfilter selection\n const selection = useMemo(() => {\n // First try to get the brush selection from params (which should be connected to crossfilter)\n const brushSelection = params?.get('brush');\n if (brushSelection) {\n return brushSelection;\n }\n // Fallback: create a new crossfilter selection (shouldn't happen in dashboard context)\n return Selection.crossfilter();\n }, [params]);\n\n useEffect(() => {\n if (!config || !config.x || !config.y) {\n clientRef.current = null;\n return;\n }\n\n const client = new BoxPlotClient({\n dataPolicy,\n onStateChange: setState,\n runtimeIssueContext,\n runtimeIssueReporter,\n selection,\n tableName,\n x: config.x,\n y: config.y,\n });\n clientRef.current = client;\n coordinator.connect(client);\n\n return () => {\n client.destroy();\n if (clientRef.current === client) {\n clientRef.current = null;\n }\n };\n }, [\n config,\n coordinator,\n dataPolicy,\n runtimeIssueContext,\n runtimeIssueReporter,\n selection,\n tableName,\n ]);\n\n const effectiveState =\n !config || !config.x || !config.y\n ? {\n isLoading: false,\n outliers: [],\n summaries: [],\n }\n : state;\n\n return {clientRef, state: effectiveState};\n}\n"]}
1
+ {"version":3,"file":"useBoxPlotClient.js","sourceRoot":"","sources":["../../../../../src/charts/chart-types/box-plot/renderer/useBoxPlotClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAC,aAAa,EAAoB,MAAM,iBAAiB,CAAC;AAUjE;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAQhC;IACC,MAAM,EACJ,MAAM,EACN,WAAW,EACX,UAAU,EACV,MAAM,EACN,mBAAmB,EACnB,oBAAoB,EACpB,KAAK,GACN,GAAG,IAAI,CAAC;IACT,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAe;QAC/C,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,EAAE;KACd,CAAC,CAAC;IACH,MAAM,SAAS,GAAG,MAAM,CAAuB,IAAI,CAAC,CAAC;IAErD,0CAA0C;IAC1C,MAAM,SAAS,GAAG,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,EAAE,EAAE;YACZ,SAAS,EAAE,EAAE;SACd;QACH,CAAC,CAAC,KAAK,CAAC;IAEZ,OAAO,EAAC,SAAS,EAAE,KAAK,EAAE,cAAc,EAAC,CAAC;AAC5C,CAAC","sourcesContent":["import {Coordinator, Selection} from '@uwdata/mosaic-core';\nimport {useEffect, useMemo, useRef, useState} from 'react';\nimport {BoxPlotClient, type BoxPlotState} from './BoxPlotClient';\nimport type {BrushSelectionParams} from '../../base-types';\nimport type {QualifiedTableName} from '@sqlrooms/duckdb';\nimport type {\n ChartDataPolicy,\n ChartRuntimeIssueContext,\n ChartRuntimeIssueReporter,\n} from '../../../../chart-runtime';\nimport {BoxPlotChartSettings} from '../schema';\n\n/**\n * Creates and connects the Mosaic client used by the box plot renderer.\n *\n * @param args - Hook inputs including chart settings, Mosaic coordinator,\n * optional dashboard services, and the resolved source table.\n * @param args.table - Canonical `QualifiedTableName` for the source table. The\n * hook passes this structured identity through to {@link BoxPlotClient}, where\n * it is converted to a Mosaic SQL table reference at query-build time.\n * @returns The active client ref and normalized renderer state.\n */\nexport function useBoxPlotClient(args: {\n config: BoxPlotChartSettings | null;\n coordinator: Coordinator;\n dataPolicy?: ChartDataPolicy | null;\n params?: BrushSelectionParams;\n runtimeIssueContext?: ChartRuntimeIssueContext;\n runtimeIssueReporter?: ChartRuntimeIssueReporter;\n table: QualifiedTableName;\n}) {\n const {\n config,\n coordinator,\n dataPolicy,\n params,\n runtimeIssueContext,\n runtimeIssueReporter,\n table,\n } = args;\n const [state, setState] = useState<BoxPlotState>({\n isLoading: true,\n outliers: [],\n summaries: [],\n });\n const clientRef = useRef<BoxPlotClient | null>(null);\n\n // Get or create the crossfilter selection\n const selection = useMemo(() => {\n // First try to get the brush selection from params (which should be connected to crossfilter)\n const brushSelection = params?.get('brush');\n if (brushSelection) {\n return brushSelection;\n }\n // Fallback: create a new crossfilter selection (shouldn't happen in dashboard context)\n return Selection.crossfilter();\n }, [params]);\n\n useEffect(() => {\n if (!config || !config.x || !config.y) {\n clientRef.current = null;\n return;\n }\n\n const client = new BoxPlotClient({\n dataPolicy,\n onStateChange: setState,\n runtimeIssueContext,\n runtimeIssueReporter,\n selection,\n table,\n x: config.x,\n y: config.y,\n });\n clientRef.current = client;\n coordinator.connect(client);\n\n return () => {\n client.destroy();\n if (clientRef.current === client) {\n clientRef.current = null;\n }\n };\n }, [\n config,\n coordinator,\n dataPolicy,\n runtimeIssueContext,\n runtimeIssueReporter,\n selection,\n table,\n ]);\n\n const effectiveState =\n !config || !config.x || !config.y\n ? {\n isLoading: false,\n outliers: [],\n summaries: [],\n }\n : state;\n\n return {clientRef, state: effectiveState};\n}\n"]}
@@ -1,9 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { type DashboardToolDeps } from '../base-types';
3
- export declare const BoxPlotToolParameters: z.ZodObject<{
4
- artifactId: z.ZodOptional<z.ZodString>;
5
- tableName: z.ZodOptional<z.ZodString>;
6
- createArtifactIfMissing: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2
+ import { ChartToolParams, ChartToolOutput } from '../tool-types';
3
+ export declare const BoxPlotToolInput: z.ZodObject<{
4
+ tableName: z.ZodString;
5
+ title: z.ZodOptional<z.ZodString>;
7
6
  panelId: z.ZodOptional<z.ZodString>;
8
7
  reasoning: z.ZodString;
9
8
  settings: z.ZodObject<{
@@ -11,30 +10,27 @@ export declare const BoxPlotToolParameters: z.ZodObject<{
11
10
  y: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
12
11
  }, z.core.$strip>;
13
12
  }, z.core.$strip>;
14
- export type BoxPlotToolParams = z.infer<typeof BoxPlotToolParameters>;
15
- export declare function createBoxPlotAiTool(deps: DashboardToolDeps): import("ai").Tool<{
16
- createArtifactIfMissing: boolean;
13
+ export type BoxPlotToolInput = z.infer<typeof BoxPlotToolInput>;
14
+ export declare function createBoxPlotAiTool({ databaseAdapter, addChart, }: ChartToolParams): import("ai").Tool<{
15
+ tableName: string;
17
16
  reasoning: string;
18
17
  settings: {
19
18
  x: string;
20
19
  y: string;
21
20
  };
22
- artifactId?: string | undefined;
23
- tableName?: string | undefined;
21
+ title?: string | undefined;
24
22
  panelId?: string | undefined;
25
- }, {
26
- llmResult: {
27
- success: boolean;
28
- details: string;
29
- data: import("..").PanelResult;
30
- errorMessage?: undefined;
31
- };
32
- } | {
33
- llmResult: {
34
- success: boolean;
35
- errorMessage: string;
36
- details?: undefined;
37
- data?: undefined;
23
+ }, ChartToolOutput<{
24
+ chartType: "box-plot";
25
+ settings: {
26
+ x?: string | undefined;
27
+ y?: string | undefined;
38
28
  };
39
- }>;
29
+ settingsOpen?: boolean | undefined;
30
+ dataPolicy?: {
31
+ disabled?: boolean | undefined;
32
+ maxRows?: number | undefined;
33
+ reason?: string | undefined;
34
+ } | undefined;
35
+ }>>;
40
36
  //# sourceMappingURL=tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/box-plot/tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,OAAO,EAAC,KAAK,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAQrD,eAAO,MAAM,qBAAqB;;;;;;;;;;iBAEhC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEtE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;GA4E1D"}
1
+ {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/box-plot/tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAOtB,OAAO,EAAC,eAAe,EAAE,eAAe,EAAC,MAAM,eAAe,CAAC;AAI/D,eAAO,MAAM,gBAAgB;;;;;;;;;iBAE3B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE,wBAAgB,mBAAmB,CAAC,EAClC,eAAe,EACf,QAAQ,GACT,EAAE,eAAe;;;;;;;;;;;;;;;;;;;;;IAmDjB"}
@@ -1,13 +1,13 @@
1
1
  import { tool } from 'ai';
2
2
  import { BoxPlotChartSettings } from './schema';
3
- import { BaseChartToolParameters } from '../../../ai/tool-schemas';
4
- import { validateColumnExists } from '../../../ai/tool-validation';
3
+ import { BaseChartToolInput } from '../../../ai/tool-schemas';
5
4
  import { NUMERIC_COLUMN_TYPES, CATEGORICAL_COLUMN_TYPES, } from '../../../column-types-utils';
6
- import { createOrUpdateChartPanel } from '../../../ai/tool-helpers';
7
- export const BoxPlotToolParameters = BaseChartToolParameters.extend({
5
+ import { validateBoxPlotSettings } from './validation';
6
+ import { ensureTable } from '../../../ai/tool-helpers';
7
+ export const BoxPlotToolInput = BaseChartToolInput.extend({
8
8
  settings: BoxPlotChartSettings.required(),
9
9
  });
10
- export function createBoxPlotAiTool(deps) {
10
+ export function createBoxPlotAiTool({ databaseAdapter, addChart, }) {
11
11
  return tool({
12
12
  description: `Box plot: compares distributions of numeric values across categories. Shows median, quartiles (25th, 75th percentiles), and outliers per group.
13
13
 
@@ -20,45 +20,37 @@ Required:
20
20
 
21
21
  NOTE: Box plots aggregate data by computing quartiles and outliers per group, so they handle large datasets efficiently (no data point limit).
22
22
 
23
- To UPDATE an existing box plot: provide the panelId parameter. Otherwise creates new panel.
24
-
25
23
  Best for: comparing distributions between groups, finding outliers per category, seeing spread and variance differences.
26
24
 
27
25
  Do NOT use for: single distribution (use histogram), time trends (use line-chart), simple counts (use count-plot).`,
28
- inputSchema: BoxPlotToolParameters,
29
- execute: async (params, context) => {
26
+ inputSchema: BoxPlotToolInput,
27
+ execute: async ({ tableName, title, settings, panelId }) => {
30
28
  try {
31
- const artifactId = deps.resolveArtifact(params.artifactId, params.createArtifactIfMissing, context);
32
- const { tableName, columns } = deps.resolveTable(artifactId, params.tableName);
33
- // Validate settings
34
- validateColumnExists(params.settings.x, CATEGORICAL_COLUMN_TYPES, columns, 'x');
35
- validateColumnExists(params.settings.y, NUMERIC_COLUMN_TYPES, columns, 'y');
36
- const result = createOrUpdateChartPanel(deps, {
37
- panelId: params.panelId,
38
- dashboardId: artifactId,
29
+ const dataTable = ensureTable(databaseAdapter, tableName);
30
+ validateBoxPlotSettings({
31
+ dataTable,
32
+ settings,
33
+ });
34
+ const config = {
35
+ chartType: 'box-plot',
36
+ settings,
37
+ };
38
+ await addChart({
39
39
  tableName,
40
- title: `Box plot - ${params.settings.y} by ${params.settings.x}`,
41
- config: {
42
- chartType: 'box-plot',
43
- settings: params.settings,
44
- },
40
+ panelId,
41
+ title,
42
+ config,
45
43
  });
46
44
  return {
47
- llmResult: {
48
- success: true,
49
- details: params.panelId
50
- ? `Updated box plot "${result.title}".`
51
- : `Created box plot "${result.title}".`,
52
- data: result,
53
- },
45
+ success: true,
46
+ details: `Generated box plot configuration.`,
47
+ data: config,
54
48
  };
55
49
  }
56
50
  catch (error) {
57
51
  return {
58
- llmResult: {
59
- success: false,
60
- errorMessage: error instanceof Error ? error.message : String(error),
61
- },
52
+ success: false,
53
+ errorMessage: error instanceof Error ? error.message : String(error),
62
54
  };
63
55
  }
64
56
  },
@@ -1 +1 @@
1
- {"version":3,"file":"tool.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/box-plot/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,IAAI,CAAC;AAExB,OAAO,EAAC,oBAAoB,EAAC,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAC,uBAAuB,EAAC,MAAM,0BAA0B,CAAC;AAEjE,OAAO,EAAC,oBAAoB,EAAC,MAAM,6BAA6B,CAAC;AACjE,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAC,wBAAwB,EAAC,MAAM,0BAA0B,CAAC;AAEl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ACL,SAAS,EAAE;wBACT,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE,MAAM,CAAC,OAAO;4BACrB,CAAC,CAAC,qBAAqB,MAAM,CAAC,KAAK,IAAI;4BACvC,CAAC,CAAC,qBAAqB,MAAM,CAAC,KAAK,IAAI;wBACzC,IAAI,EAAE,MAAM;qBACb;iBACF,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO;oBACL,SAAS,EAAE;wBACT,OAAO,EAAE,KAAK;wBACd,YAAY,EACV,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;qBACzD;iBACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {tool} from 'ai';\nimport {z} from 'zod';\nimport {BoxPlotChartSettings} from './schema';\nimport {BaseChartToolParameters} from '../../../ai/tool-schemas';\nimport {type DashboardToolDeps} from '../base-types';\nimport {validateColumnExists} from '../../../ai/tool-validation';\nimport {\n NUMERIC_COLUMN_TYPES,\n CATEGORICAL_COLUMN_TYPES,\n} from '../../../column-types-utils';\nimport {createOrUpdateChartPanel} from '../../../ai/tool-helpers';\n\nexport const BoxPlotToolParameters = BaseChartToolParameters.extend({\n settings: BoxPlotChartSettings.required(),\n});\n\nexport type BoxPlotToolParams = z.infer<typeof BoxPlotToolParameters>;\n\nexport function createBoxPlotAiTool(deps: DashboardToolDeps) {\n return tool({\n description: `Box plot: compares distributions of numeric values across categories. Shows median, quartiles (25th, 75th percentiles), and outliers per group.\n\nUse when: user asks to \"compare [numeric] across/by [category]\", \"distribution by group\", \"show outliers by\", \"compare ranges\".\nExample queries: \"compare population by administrative region\", \"show elevation distribution by terrain type\", \"parcel area range by zone\", \"compare building heights across districts\", \"temperature by climate zone\".\n\nRequired:\n- x: categorical/grouping column (${CATEGORICAL_COLUMN_TYPES.join(', ')}) - e.g., region, terrain type, zone classification\n- y: numeric (${NUMERIC_COLUMN_TYPES.join(', ')})\n\nNOTE: Box plots aggregate data by computing quartiles and outliers per group, so they handle large datasets efficiently (no data point limit).\n\nTo UPDATE an existing box plot: provide the panelId parameter. Otherwise creates new panel.\n\nBest for: comparing distributions between groups, finding outliers per category, seeing spread and variance differences.\n\nDo NOT use for: single distribution (use histogram), time trends (use line-chart), simple counts (use count-plot).`,\n inputSchema: BoxPlotToolParameters,\n execute: async (params, context) => {\n try {\n const artifactId = deps.resolveArtifact(\n params.artifactId,\n params.createArtifactIfMissing,\n context,\n );\n const {tableName, columns} = deps.resolveTable(\n artifactId,\n params.tableName,\n );\n\n // Validate settings\n validateColumnExists(\n params.settings.x,\n CATEGORICAL_COLUMN_TYPES,\n columns,\n 'x',\n );\n validateColumnExists(\n params.settings.y,\n NUMERIC_COLUMN_TYPES,\n columns,\n 'y',\n );\n\n const result = createOrUpdateChartPanel(deps, {\n panelId: params.panelId,\n dashboardId: artifactId,\n tableName,\n title: `Box plot - ${params.settings.y} by ${params.settings.x}`,\n config: {\n chartType: 'box-plot',\n settings: params.settings,\n },\n });\n\n return {\n llmResult: {\n success: true,\n details: params.panelId\n ? `Updated box plot \"${result.title}\".`\n : `Created box plot \"${result.title}\".`,\n data: result,\n },\n };\n } catch (error) {\n return {\n llmResult: {\n success: false,\n errorMessage:\n error instanceof Error ? error.message : String(error),\n },\n };\n }\n },\n });\n}\n"]}
1
+ {"version":3,"file":"tool.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/box-plot/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,IAAI,CAAC;AAExB,OAAO,EAAqB,oBAAoB,EAAC,MAAM,UAAU,CAAC;AAClE,OAAO,EAAC,kBAAkB,EAAC,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAC,uBAAuB,EAAC,MAAM,cAAc,CAA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ai';\nimport {z} from 'zod';\nimport {BoxPlotChartConfig, BoxPlotChartSettings} from './schema';\nimport {BaseChartToolInput} from '../../../ai/tool-schemas';\nimport {\n NUMERIC_COLUMN_TYPES,\n CATEGORICAL_COLUMN_TYPES,\n} from '../../../column-types-utils';\nimport {ChartToolParams, ChartToolOutput} from '../tool-types';\nimport {validateBoxPlotSettings} from './validation';\nimport {ensureTable} from '../../../ai/tool-helpers';\n\nexport const BoxPlotToolInput = BaseChartToolInput.extend({\n settings: BoxPlotChartSettings.required(),\n});\n\nexport type BoxPlotToolInput = z.infer<typeof BoxPlotToolInput>;\n\nexport function createBoxPlotAiTool({\n databaseAdapter,\n addChart,\n}: ChartToolParams) {\n return tool<BoxPlotToolInput, ChartToolOutput<BoxPlotChartConfig>>({\n description: `Box plot: compares distributions of numeric values across categories. Shows median, quartiles (25th, 75th percentiles), and outliers per group.\n\nUse when: user asks to \"compare [numeric] across/by [category]\", \"distribution by group\", \"show outliers by\", \"compare ranges\".\nExample queries: \"compare population by administrative region\", \"show elevation distribution by terrain type\", \"parcel area range by zone\", \"compare building heights across districts\", \"temperature by climate zone\".\n\nRequired:\n- x: categorical/grouping column (${CATEGORICAL_COLUMN_TYPES.join(', ')}) - e.g., region, terrain type, zone classification\n- y: numeric (${NUMERIC_COLUMN_TYPES.join(', ')})\n\nNOTE: Box plots aggregate data by computing quartiles and outliers per group, so they handle large datasets efficiently (no data point limit).\n\nBest for: comparing distributions between groups, finding outliers per category, seeing spread and variance differences.\n\nDo NOT use for: single distribution (use histogram), time trends (use line-chart), simple counts (use count-plot).`,\n inputSchema: BoxPlotToolInput,\n execute: async ({tableName, title, settings, panelId}) => {\n try {\n const dataTable = ensureTable(databaseAdapter, tableName);\n\n validateBoxPlotSettings({\n dataTable,\n settings,\n });\n\n const config: BoxPlotChartConfig = {\n chartType: 'box-plot' as const,\n settings,\n };\n\n await addChart({\n tableName,\n panelId,\n title,\n config,\n });\n\n return {\n success: true,\n details: `Generated box plot configuration.`,\n data: config,\n };\n } catch (error) {\n return {\n success: false,\n errorMessage: error instanceof Error ? error.message : String(error),\n };\n }\n },\n });\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import { BoxPlotChartSettings } from './schema';
2
+ import { ValidateSpecOptions } from '../base-types';
3
+ import { TableColumn } from '@sqlrooms/duckdb';
4
+ export type ValidatedBoxPlotSettings = {
5
+ xColumn: TableColumn;
6
+ yColumn: TableColumn;
7
+ };
8
+ export declare function validateBoxPlotSettings({ dataTable, settings: { x, y }, }: ValidateSpecOptions<BoxPlotChartSettings>): ValidatedBoxPlotSettings;
9
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/box-plot/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAC,mBAAmB,EAAC,MAAM,eAAe,CAAC;AAOlD,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAE7C,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,EAAE,WAAW,CAAC;IACrB,OAAO,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,EACtC,SAAS,EACT,QAAQ,EAAE,EAAC,CAAC,EAAE,CAAC,EAAC,GACjB,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,GAAG,wBAAwB,CAiCtE"}
@@ -0,0 +1,32 @@
1
+ import { InvalidColumnTypeError, MissingColumnsError, RequiredFieldsError, } from '../errors';
2
+ import { isCategoricalType, isNumericType } from '../../../column-types-utils';
3
+ export function validateBoxPlotSettings({ dataTable, settings: { x, y }, }) {
4
+ // Basic validation for required fields
5
+ if (!x || !y) {
6
+ throw new RequiredFieldsError([
7
+ ...(x ? [] : ['X field (categorical)']),
8
+ ...(y ? [] : ['Y field (numeric)']),
9
+ ]);
10
+ }
11
+ // Validate X and Y field existence
12
+ const xColumn = dataTable.columns.find((col) => col.name === x);
13
+ const yColumn = dataTable.columns.find((col) => col.name === y);
14
+ if (!xColumn || !yColumn) {
15
+ throw new MissingColumnsError([
16
+ ...(xColumn ? [] : [x]),
17
+ ...(yColumn ? [] : [y]),
18
+ ]);
19
+ }
20
+ // Validate X is categorical and Y is numeric
21
+ if (!isCategoricalType(xColumn.type)) {
22
+ throw new InvalidColumnTypeError(xColumn.name, 'categorical');
23
+ }
24
+ if (!isNumericType(yColumn.type)) {
25
+ throw new InvalidColumnTypeError(yColumn.name, 'numeric');
26
+ }
27
+ return {
28
+ xColumn,
29
+ yColumn,
30
+ };
31
+ }
32
+ //# sourceMappingURL=validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/box-plot/validation.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAC,iBAAiB,EAAE,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAQ7E,MAAM,UAAU,uBAAuB,CAAC,EACtC,SAAS,EACT,QAAQ,EAAE,EAAC,CAAC,EAAE,CAAC,EAAC,GAC0B;IAC1C,uCAAuC;IACvC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QACb,MAAM,IAAI,mBAAmB,CAAC;YAC5B,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC;YACvC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC;SACpC,CAAC,CAAC;IACL,CAAC;IAED,mCAAmC;IACnC,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC;IAChE,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC;IAEhE,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;QACzB,MAAM,IAAI,mBAAmB,CAAC;YAC5B,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACvB,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACxB,CAAC,CAAC;IACL,CAAC;IAED,6CAA6C;IAC7C,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,sBAAsB,CAAC,OAAO,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAChE,CAAC;IAED,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,sBAAsB,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO;QACL,OAAO;QACP,OAAO;KACR,CAAC;AACJ,CAAC","sourcesContent":["import {BoxPlotChartSettings} from './schema';\nimport {ValidateSpecOptions} from '../base-types';\nimport {\n InvalidColumnTypeError,\n MissingColumnsError,\n RequiredFieldsError,\n} from '../errors';\nimport {isCategoricalType, isNumericType} from '../../../column-types-utils';\nimport {TableColumn} from '@sqlrooms/duckdb';\n\nexport type ValidatedBoxPlotSettings = {\n xColumn: TableColumn;\n yColumn: TableColumn;\n};\n\nexport function validateBoxPlotSettings({\n dataTable,\n settings: {x, y},\n}: ValidateSpecOptions<BoxPlotChartSettings>): ValidatedBoxPlotSettings {\n // Basic validation for required fields\n if (!x || !y) {\n throw new RequiredFieldsError([\n ...(x ? [] : ['X field (categorical)']),\n ...(y ? [] : ['Y field (numeric)']),\n ]);\n }\n\n // Validate X and Y field existence\n const xColumn = dataTable.columns.find((col) => col.name === x);\n const yColumn = dataTable.columns.find((col) => col.name === y);\n\n if (!xColumn || !yColumn) {\n throw new MissingColumnsError([\n ...(xColumn ? [] : [x]),\n ...(yColumn ? [] : [y]),\n ]);\n }\n\n // Validate X is categorical and Y is numeric\n if (!isCategoricalType(xColumn.type)) {\n throw new InvalidColumnTypeError(xColumn.name, 'categorical');\n }\n\n if (!isNumericType(yColumn.type)) {\n throw new InvalidColumnTypeError(yColumn.name, 'numeric');\n }\n\n return {\n xColumn,\n yColumn,\n };\n}\n"]}
@@ -25,6 +25,7 @@ export declare const ChartConfig: z.ZodUnion<[z.ZodDiscriminatedUnion<readonly [
25
25
  settings: z.ZodObject<{
26
26
  field: z.ZodOptional<z.ZodString>;
27
27
  maxBins: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
28
+ color: z.ZodOptional<z.ZodString>;
28
29
  }, z.core.$strip>;
29
30
  settingsOpen: z.ZodOptional<z.ZodBoolean>;
30
31
  dataPolicy: z.ZodOptional<z.ZodObject<{
@@ -67,6 +68,7 @@ export declare const ChartConfig: z.ZodUnion<[z.ZodDiscriminatedUnion<readonly [
67
68
  avg: "avg";
68
69
  }>>>;
69
70
  }, z.core.$strip>>>;
71
+ showLegend: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
70
72
  }, z.core.$strip>;
71
73
  settingsOpen: z.ZodOptional<z.ZodBoolean>;
72
74
  dataPolicy: z.ZodOptional<z.ZodObject<{
@@ -75,7 +77,7 @@ export declare const ChartConfig: z.ZodUnion<[z.ZodDiscriminatedUnion<readonly [
75
77
  reason: z.ZodOptional<z.ZodString>;
76
78
  }, z.core.$strip>>;
77
79
  }, z.core.$strip>, z.ZodObject<{
78
- chartType: z.ZodLiteral<"bubble-chart">;
80
+ chartType: z.ZodLiteral<"scatter-plot">;
79
81
  settings: z.ZodObject<{
80
82
  x: z.ZodOptional<z.ZodString>;
81
83
  y: z.ZodOptional<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"chart-config.d.ts","sourceRoot":"","sources":["../../../src/charts/chart-types/chart-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAYtB,eAAO,MAAM,mBAAmB,wCAAoC,CAAC;AAErE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAgBtE,eAAO,MAAM,iBAAiB;;;;;;;;;iBAO5B,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAEA,CAAC;AAEzB,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AACpD,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC"}
1
+ {"version":3,"file":"chart-config.d.ts","sourceRoot":"","sources":["../../../src/charts/chart-types/chart-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAYtB,eAAO,MAAM,mBAAmB,wCAAoC,CAAC;AAErE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAgBtE,eAAO,MAAM,iBAAiB;;;;;;;;;iBAO5B,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAEA,CAAC;AAEzB,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AACpD,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC"}
@@ -7,7 +7,7 @@ import { z } from 'zod';
7
7
  import { HistogramChartConfig } from './histogram/schema';
8
8
  import { CountPlotChartConfig } from './count-plot/schema';
9
9
  import { LineChartConfig } from './line-chart/schema';
10
- import { BubbleChartConfig } from './bubble-chart/schema';
10
+ import { ScatterPlotChartConfig } from './scatter-plot/schema';
11
11
  import { HeatmapChartConfig } from './heatmap/schema';
12
12
  import { BoxPlotChartConfig } from './box-plot/schema';
13
13
  import { CustomSpecChartConfig } from './custom-spec/schema';
@@ -17,7 +17,7 @@ const KNOWN_CHART_CONFIGS = [
17
17
  HistogramChartConfig,
18
18
  CountPlotChartConfig,
19
19
  LineChartConfig,
20
- BubbleChartConfig,
20
+ ScatterPlotChartConfig,
21
21
  HeatmapChartConfig,
22
22
  BoxPlotChartConfig,
23
23
  CustomSpecChartConfig,
@@ -1 +1 @@
1
- {"version":3,"file":"chart-config.js","sourceRoot":"","sources":["../../../src/charts/chart-types/chart-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,uDAAuD;AACvD,OAAO,EAAC,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAC,oBAAoB,EAAC,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAC,eAAe,EAAC,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Content":["/**\n * Central ChartConfig discriminated union.\n * Separated from index.ts to avoid circular dependencies with Settings components.\n */\n\nimport {z} from 'zod';\n\n// Import only the Zod schemas (no Settings components)\nimport {HistogramChartConfig} from './histogram/schema';\nimport {CountPlotChartConfig} from './count-plot/schema';\nimport {LineChartConfig} from './line-chart/schema';\nimport {BubbleChartConfig} from './bubble-chart/schema';\nimport {HeatmapChartConfig} from './heatmap/schema';\nimport {BoxPlotChartConfig} from './box-plot/schema';\nimport {CustomSpecChartConfig} from './custom-spec/schema';\nimport {ChartDataPolicyOverrideConfig} from './data-policy-schema';\n\nexport const CustomChartSettings = z.record(z.string(), z.unknown());\n\nexport type CustomChartSettings = z.infer<typeof CustomChartSettings>;\n\nconst KNOWN_CHART_CONFIGS = [\n HistogramChartConfig,\n CountPlotChartConfig,\n LineChartConfig,\n BubbleChartConfig,\n HeatmapChartConfig,\n BoxPlotChartConfig,\n CustomSpecChartConfig,\n] as const;\n\nconst KNOWN_CHART_TYPES: string[] = KNOWN_CHART_CONFIGS.map(\n (config) => config.shape.chartType.value,\n);\n\nexport const CustomChartConfig = z.object({\n chartType: z.string().refine((val) => !KNOWN_CHART_TYPES.includes(val), {\n message: 'Custom chart type cannot use reserved chart type names',\n }),\n settings: CustomChartSettings,\n settingsOpen: z.boolean().optional(),\n dataPolicy: ChartDataPolicyOverrideConfig.optional(),\n});\n\nexport type CustomChartConfig = z.infer<typeof CustomChartConfig>;\n\n/**\n * Discriminated union of all chart configuration types.\n * This schema is used for runtime validation and type inference.\n */\nexport const ChartConfig = z\n .discriminatedUnion('chartType', KNOWN_CHART_CONFIGS)\n .or(CustomChartConfig);\n\nexport type ChartConfig = z.infer<typeof ChartConfig>;\n\nexport type ChartSettings = ChartConfig['settings'];\nexport type ChartType = ChartConfig['chartType'];\n"]}
1
+ {"version":3,"file":"chart-config.js","sourceRoot":"","sources":["../../../src/charts/chart-types/chart-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAC,CAAC,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QAAQ,EAAE;CACrD,CAAC,CAAC;AAIH;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC;KACzB,kBAAkB,CAAC,WAAW,EAAE,mBAAmB,CAAC;KACpD,EAAE,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["/**\n * Central ChartConfig discriminated union.\n * Separated from index.ts to avoid circular dependencies with Settings components.\n */\n\nimport {z} from 'zod';\n\n// Import only the Zod schemas (no Settings components)\nimport {HistogramChartConfig} from './histogram/schema';\nimport {CountPlotChartConfig} from './count-plot/schema';\nimport {LineChartConfig} from './line-chart/schema';\nimport {ScatterPlotChartConfig} from './scatter-plot/schema';\nimport {HeatmapChartConfig} from './heatmap/schema';\nimport {BoxPlotChartConfig} from './box-plot/schema';\nimport {CustomSpecChartConfig} from './custom-spec/schema';\nimport {ChartDataPolicyOverrideConfig} from './data-policy-schema';\n\nexport const CustomChartSettings = z.record(z.string(), z.unknown());\n\nexport type CustomChartSettings = z.infer<typeof CustomChartSettings>;\n\nconst KNOWN_CHART_CONFIGS = [\n HistogramChartConfig,\n CountPlotChartConfig,\n LineChartConfig,\n ScatterPlotChartConfig,\n HeatmapChartConfig,\n BoxPlotChartConfig,\n CustomSpecChartConfig,\n] as const;\n\nconst KNOWN_CHART_TYPES: string[] = KNOWN_CHART_CONFIGS.map(\n (config) => config.shape.chartType.value,\n);\n\nexport const CustomChartConfig = z.object({\n chartType: z.string().refine((val) => !KNOWN_CHART_TYPES.includes(val), {\n message: 'Custom chart type cannot use reserved chart type names',\n }),\n settings: CustomChartSettings,\n settingsOpen: z.boolean().optional(),\n dataPolicy: ChartDataPolicyOverrideConfig.optional(),\n});\n\nexport type CustomChartConfig = z.infer<typeof CustomChartConfig>;\n\n/**\n * Discriminated union of all chart configuration types.\n * This schema is used for runtime validation and type inference.\n */\nexport const ChartConfig = z\n .discriminatedUnion('chartType', KNOWN_CHART_CONFIGS)\n .or(CustomChartConfig);\n\nexport type ChartConfig = z.infer<typeof ChartConfig>;\n\nexport type ChartSettings = ChartConfig['settings'];\nexport type ChartType = ChartConfig['chartType'];\n"]}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Column info passed to chart builder UI
3
+ */
4
+ export interface ChartBuilderColumn {
5
+ name: string;
6
+ type: string;
7
+ }
8
+ //# sourceMappingURL=column-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"column-types.d.ts","sourceRoot":"","sources":["../../../src/charts/chart-types/column-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=column-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"column-types.js","sourceRoot":"","sources":["../../../src/charts/chart-types/column-types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Column info passed to chart builder UI\n */\nexport interface ChartBuilderColumn {\n name: string;\n type: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/count-plot/definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,oBAAoB,EAAyB,MAAM,UAAU,CAAC;AAStE,eAAO,MAAM,kBAAkB,EAAE,uBAAuB,CAAC,oBAAoB,CAW1E,CAAC"}
1
+ {"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/count-plot/definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,oBAAoB,EAAyB,MAAM,UAAU,CAAC;AAStE,eAAO,MAAM,kBAAkB,EAAE,uBAAuB,CAAC,oBAAoB,CAY1E,CAAC"}
@@ -9,6 +9,7 @@ export const countPlotChartType = {
9
9
  id: 'count-plot',
10
10
  label: 'Count Plot',
11
11
  description: DESCRIPTION,
12
+ aiDescription: `${DESCRIPTION} - frequency of categorical values (always safe, aggregates automatically)`,
12
13
  icon: BarChartHorizontal,
13
14
  schema: CountPlotChartSettings,
14
15
  settingsComponent: CountPlotSettingsComponent,
@@ -1 +1 @@
1
- {"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/count-plot/definition.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,sBAAsB,EAAC,MAAM,UAAU,CAAC;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAC,0BAA0B,EAAC,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAC,qBAAqB,EAAC,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAC,kBAAkB,EAAC,MAAM,cAAc,CAAC;AAChD,OAAO,EAAC,mBAAmB,EAAC,MAAM,QAAQ,CAAC;AAE3C,MAAM,WAAW,GAAG,gCAAgC,CAAC;AAErD,MAAM,CAAC,MAAM,kBAAkB,GAC7B;IACE,EAAE,EAAE,YAAY;IAChB,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,WAAW;IACxB,IAAI,EAAE,kBAAkB;IACxB,MAAM,EAAE,sBAAsB;IAC9B,iBAAiB,EAAE,0BAA0B;IAC7C,UAAU,EAAE,oBAAoB,CAAC,WAAW,CAAC;IAC7C,UAAU,EAAE,qBAAqB;IACjC,UAAU,EAAE,mBAAmB;CAChC,CAAC","sourcesContent":["import type {SpecChartTypeDefinition} from '../base-types';\nimport {CountPlotChartConfig, CountPlotChartSettings} from './schema';\nimport {titleFromDescription} from '../../../chart-builders/chartTypeUtils';\nimport {CountPlotSettingsComponent} from './CountPlotSettings';\nimport {createCountPlotAiTool} from './tool';\nimport {BarChartHorizontal} from 'lucide-react';\nimport {createCountPlotSpec} from './spec';\n\nconst DESCRIPTION = 'Create a count plot of a field';\n\nexport const countPlotChartType: SpecChartTypeDefinition<CountPlotChartConfig> =\n {\n id: 'count-plot',\n label: 'Count Plot',\n description: DESCRIPTION,\n icon: BarChartHorizontal,\n schema: CountPlotChartSettings,\n settingsComponent: CountPlotSettingsComponent,\n buildTitle: titleFromDescription(DESCRIPTION),\n createTool: createCountPlotAiTool,\n createSpec: createCountPlotSpec,\n };\n"]}
1
+ {"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../../src/charts/chart-types/count-plot/definition.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,sBAAsB,EAAC,MAAM,UAAU,CAAC;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAC,0BAA0B,EAAC,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAC,qBAAqB,EAAC,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAC,kBAAkB,EAAC,MAAM,cAAc,CAAC;AAChD,OAAO,EAAC,mBAAmB,EAAC,MAAM,QAAQ,CAAC;AAE3C,MAAM,WAAW,GAAG,gCAAgC,CAAC;AAErD,MAAM,CAAC,MAAM,kBAAkB,GAC7B;IACE,EAAE,EAAE,YAAY;IAChB,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,WAAW;IACxB,aAAa,EAAE,GAAG,WAAW,4EAA4E;IACzG,IAAI,EAAE,kBAAkB;IACxB,MAAM,EAAE,sBAAsB;IAC9B,iBAAiB,EAAE,0BAA0B;IAC7C,UAAU,EAAE,oBAAoB,CAAC,WAAW,CAAC;IAC7C,UAAU,EAAE,qBAAqB;IACjC,UAAU,EAAE,mBAAmB;CAChC,CAAC","sourcesContent":["import type {SpecChartTypeDefinition} from '../base-types';\nimport {CountPlotChartConfig, CountPlotChartSettings} from './schema';\nimport {titleFromDescription} from '../../../chart-builders/chartTypeUtils';\nimport {CountPlotSettingsComponent} from './CountPlotSettings';\nimport {createCountPlotAiTool} from './tool';\nimport {BarChartHorizontal} from 'lucide-react';\nimport {createCountPlotSpec} from './spec';\n\nconst DESCRIPTION = 'Create a count plot of a field';\n\nexport const countPlotChartType: SpecChartTypeDefinition<CountPlotChartConfig> =\n {\n id: 'count-plot',\n label: 'Count Plot',\n description: DESCRIPTION,\n aiDescription: `${DESCRIPTION} - frequency of categorical values (always safe, aggregates automatically)`,\n icon: BarChartHorizontal,\n schema: CountPlotChartSettings,\n settingsComponent: CountPlotSettingsComponent,\n buildTitle: titleFromDescription(DESCRIPTION),\n createTool: createCountPlotAiTool,\n createSpec: createCountPlotSpec,\n };\n"]}
@@ -1,4 +1,5 @@
1
1
  import type { Spec } from '@uwdata/mosaic-spec';
2
2
  import { CountPlotChartSettings } from './schema';
3
- export declare function createCountPlotSpec(tableName: string, { field }: CountPlotChartSettings): Spec;
3
+ import { CreateSpecOptions } from '../base-types';
4
+ export declare function createCountPlotSpec(options: CreateSpecOptions<CountPlotChartSettings>): Spec;
4
5
  //# sourceMappingURL=spec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/count-plot/spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAC,sBAAsB,EAAC,MAAM,UAAU,CAAC;AAMhD,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EACjB,EAAC,KAAK,EAAC,EAAE,sBAAsB,GAC9B,IAAI,CA6CN"}
1
+ {"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../../../src/charts/chart-types/count-plot/spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAC,sBAAsB,EAAC,MAAM,UAAU,CAAC;AAChD,OAAO,EAAC,iBAAiB,EAAyB,MAAM,eAAe,CAAC;AAMxE,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,iBAAiB,CAAC,sBAAsB,CAAC,GACjD,IAAI,CA4DN"}