@sqlrooms/mosaic 0.29.0-rc.4 → 0.29.0-rc.6

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 (334) hide show
  1. package/README.md +43 -39
  2. package/dist/DataPointLimitError.d.ts +9 -0
  3. package/dist/DataPointLimitError.d.ts.map +1 -0
  4. package/dist/DataPointLimitError.js +14 -0
  5. package/dist/DataPointLimitError.js.map +1 -0
  6. package/dist/MosaicSlice.d.ts.map +1 -1
  7. package/dist/MosaicSlice.js +3 -3
  8. package/dist/MosaicSlice.js.map +1 -1
  9. package/dist/VgPlotChart.d.ts +8 -11
  10. package/dist/VgPlotChart.d.ts.map +1 -1
  11. package/dist/VgPlotChart.js +74 -90
  12. package/dist/VgPlotChart.js.map +1 -1
  13. package/dist/VgPlotChartError.d.ts +7 -0
  14. package/dist/VgPlotChartError.d.ts.map +1 -0
  15. package/dist/VgPlotChartError.js +9 -0
  16. package/dist/VgPlotChartError.js.map +1 -0
  17. package/dist/ai.d.ts +103 -0
  18. package/dist/ai.d.ts.map +1 -0
  19. package/dist/ai.js +445 -0
  20. package/dist/ai.js.map +1 -0
  21. package/dist/boxplot/BoxPlotClient.d.ts +7 -0
  22. package/dist/boxplot/BoxPlotClient.d.ts.map +1 -1
  23. package/dist/boxplot/BoxPlotClient.js +22 -0
  24. package/dist/boxplot/BoxPlotClient.js.map +1 -1
  25. package/dist/chart/ChartRuntimeIssuePanel.d.ts +7 -0
  26. package/dist/chart/ChartRuntimeIssuePanel.d.ts.map +1 -0
  27. package/dist/chart/ChartRuntimeIssuePanel.js +10 -0
  28. package/dist/chart/ChartRuntimeIssuePanel.js.map +1 -0
  29. package/dist/chart/MosaicDashboardChart.d.ts +1 -1
  30. package/dist/chart/MosaicDashboardChart.d.ts.map +1 -1
  31. package/dist/chart/MosaicDashboardChart.js +1 -1
  32. package/dist/chart/MosaicDashboardChart.js.map +1 -1
  33. package/dist/chart/MosaicDashboardChartContent.d.ts +1 -1
  34. package/dist/chart/MosaicDashboardChartContent.d.ts.map +1 -1
  35. package/dist/chart/MosaicDashboardChartContent.js +29 -2
  36. package/dist/chart/MosaicDashboardChartContent.js.map +1 -1
  37. package/dist/chart/MosaicDashboardChartRenderer.d.ts +2 -1
  38. package/dist/chart/MosaicDashboardChartRenderer.d.ts.map +1 -1
  39. package/dist/chart/MosaicDashboardChartRenderer.js +2 -2
  40. package/dist/chart/MosaicDashboardChartRenderer.js.map +1 -1
  41. package/dist/chart/MosaicDashboardComponentChart.d.ts +5 -1
  42. package/dist/chart/MosaicDashboardComponentChart.d.ts.map +1 -1
  43. package/dist/chart/MosaicDashboardComponentChart.js +4 -1
  44. package/dist/chart/MosaicDashboardComponentChart.js.map +1 -1
  45. package/dist/chart/MosaicDashboardVgPlotChart.d.ts +4 -0
  46. package/dist/chart/MosaicDashboardVgPlotChart.d.ts.map +1 -1
  47. package/dist/chart/MosaicDashboardVgPlotChart.js +2 -2
  48. package/dist/chart/MosaicDashboardVgPlotChart.js.map +1 -1
  49. package/dist/chart/addChartPanelAction.d.ts +3 -0
  50. package/dist/chart/addChartPanelAction.d.ts.map +1 -0
  51. package/dist/chart/addChartPanelAction.js +14 -0
  52. package/dist/chart/addChartPanelAction.js.map +1 -0
  53. package/dist/chart/chart-settings/ChartSettings.d.ts.map +1 -1
  54. package/dist/chart/chart-settings/ChartSettings.js +7 -4
  55. package/dist/chart/chart-settings/ChartSettings.js.map +1 -1
  56. package/dist/chart/chart-settings/ChartSettingsContent.d.ts +1 -1
  57. package/dist/chart/chart-settings/ChartSettingsContent.d.ts.map +1 -1
  58. package/dist/chart/chart-settings/ChartSettingsContent.js.map +1 -1
  59. package/dist/chart/chart-settings/ChartSettingsContext.d.ts +0 -2
  60. package/dist/chart/chart-settings/ChartSettingsContext.d.ts.map +1 -1
  61. package/dist/chart/chart-settings/ChartSettingsContext.js +6 -7
  62. package/dist/chart/chart-settings/ChartSettingsContext.js.map +1 -1
  63. package/dist/chart/chart-settings/ChartSettingsPanel.d.ts +1 -1
  64. package/dist/chart/chart-settings/ChartSettingsPanel.d.ts.map +1 -1
  65. package/dist/chart/chart-settings/ChartSettingsPanel.js +1 -1
  66. package/dist/chart/chart-settings/ChartSettingsPanel.js.map +1 -1
  67. package/dist/chart/chart-settings/ChartTypeSelector.d.ts.map +1 -1
  68. package/dist/chart/chart-settings/ChartTypeSelector.js +5 -5
  69. package/dist/chart/chart-settings/ChartTypeSelector.js.map +1 -1
  70. package/dist/chart-builders/ColumnSelector.d.ts +0 -2
  71. package/dist/chart-builders/ColumnSelector.d.ts.map +1 -1
  72. package/dist/chart-builders/ColumnSelector.js +4 -5
  73. package/dist/chart-builders/ColumnSelector.js.map +1 -1
  74. package/dist/chart-builders/ColumnsContext.d.ts +13 -0
  75. package/dist/chart-builders/ColumnsContext.d.ts.map +1 -0
  76. package/dist/chart-builders/ColumnsContext.js +15 -0
  77. package/dist/chart-builders/ColumnsContext.js.map +1 -0
  78. package/dist/chart-builders/MultiFieldSelector.js +4 -4
  79. package/dist/chart-builders/MultiFieldSelector.js.map +1 -1
  80. package/dist/chart-builders/TableSelector.d.ts +14 -0
  81. package/dist/chart-builders/TableSelector.d.ts.map +1 -0
  82. package/dist/chart-builders/TableSelector.js +23 -0
  83. package/dist/chart-builders/TableSelector.js.map +1 -0
  84. package/dist/chart-runtime.d.ts +50 -0
  85. package/dist/chart-runtime.d.ts.map +1 -0
  86. package/dist/chart-runtime.js +76 -0
  87. package/dist/chart-runtime.js.map +1 -0
  88. package/dist/chart-types/base-types.d.ts +45 -25
  89. package/dist/chart-types/base-types.d.ts.map +1 -1
  90. package/dist/chart-types/base-types.js.map +1 -1
  91. package/dist/chart-types/box-plot/definition.d.ts.map +1 -1
  92. package/dist/chart-types/box-plot/definition.js +5 -0
  93. package/dist/chart-types/box-plot/definition.js.map +1 -1
  94. package/dist/chart-types/box-plot/renderer/BoxPlotPanelRenderer.d.ts.map +1 -1
  95. package/dist/chart-types/box-plot/renderer/BoxPlotPanelRenderer.js +4 -1
  96. package/dist/chart-types/box-plot/renderer/BoxPlotPanelRenderer.js.map +1 -1
  97. package/dist/chart-types/box-plot/renderer/useBoxPlotClient.d.ts +4 -0
  98. package/dist/chart-types/box-plot/renderer/useBoxPlotClient.d.ts.map +1 -1
  99. package/dist/chart-types/box-plot/renderer/useBoxPlotClient.js +13 -2
  100. package/dist/chart-types/box-plot/renderer/useBoxPlotClient.js.map +1 -1
  101. package/dist/chart-types/box-plot/schema.d.ts +5 -0
  102. package/dist/chart-types/box-plot/schema.d.ts.map +1 -1
  103. package/dist/chart-types/box-plot/schema.js +2 -0
  104. package/dist/chart-types/box-plot/schema.js.map +1 -1
  105. package/dist/chart-types/box-plot/tool.d.ts +5 -9
  106. package/dist/chart-types/box-plot/tool.d.ts.map +1 -1
  107. package/dist/chart-types/box-plot/tool.js +14 -6
  108. package/dist/chart-types/box-plot/tool.js.map +1 -1
  109. package/dist/chart-types/bubble-chart/definition.d.ts.map +1 -1
  110. package/dist/chart-types/bubble-chart/definition.js +5 -0
  111. package/dist/chart-types/bubble-chart/definition.js.map +1 -1
  112. package/dist/chart-types/bubble-chart/schema.d.ts +5 -0
  113. package/dist/chart-types/bubble-chart/schema.d.ts.map +1 -1
  114. package/dist/chart-types/bubble-chart/schema.js +2 -0
  115. package/dist/chart-types/bubble-chart/schema.js.map +1 -1
  116. package/dist/chart-types/bubble-chart/tool.d.ts +5 -9
  117. package/dist/chart-types/bubble-chart/tool.d.ts.map +1 -1
  118. package/dist/chart-types/bubble-chart/tool.js +17 -9
  119. package/dist/chart-types/bubble-chart/tool.js.map +1 -1
  120. package/dist/chart-types/chart-config.d.ts +46 -0
  121. package/dist/chart-types/chart-config.d.ts.map +1 -1
  122. package/dist/chart-types/chart-config.js +2 -0
  123. package/dist/chart-types/chart-config.js.map +1 -1
  124. package/dist/chart-types/count-plot/schema.d.ts +5 -0
  125. package/dist/chart-types/count-plot/schema.d.ts.map +1 -1
  126. package/dist/chart-types/count-plot/schema.js +2 -0
  127. package/dist/chart-types/count-plot/schema.js.map +1 -1
  128. package/dist/chart-types/count-plot/tool.d.ts +5 -9
  129. package/dist/chart-types/count-plot/tool.d.ts.map +1 -1
  130. package/dist/chart-types/count-plot/tool.js +14 -6
  131. package/dist/chart-types/count-plot/tool.js.map +1 -1
  132. package/dist/chart-types/custom-spec/definition.d.ts.map +1 -1
  133. package/dist/chart-types/custom-spec/definition.js +5 -0
  134. package/dist/chart-types/custom-spec/definition.js.map +1 -1
  135. package/dist/chart-types/custom-spec/schema.d.ts +5 -0
  136. package/dist/chart-types/custom-spec/schema.d.ts.map +1 -1
  137. package/dist/chart-types/custom-spec/schema.js +2 -0
  138. package/dist/chart-types/custom-spec/schema.js.map +1 -1
  139. package/dist/chart-types/data-policy-schema.d.ts +8 -0
  140. package/dist/chart-types/data-policy-schema.d.ts.map +1 -0
  141. package/dist/chart-types/data-policy-schema.js +7 -0
  142. package/dist/chart-types/data-policy-schema.js.map +1 -0
  143. package/dist/chart-types/heatmap/schema.d.ts +5 -0
  144. package/dist/chart-types/heatmap/schema.d.ts.map +1 -1
  145. package/dist/chart-types/heatmap/schema.js +2 -0
  146. package/dist/chart-types/heatmap/schema.js.map +1 -1
  147. package/dist/chart-types/heatmap/tool.d.ts +5 -9
  148. package/dist/chart-types/heatmap/tool.d.ts.map +1 -1
  149. package/dist/chart-types/heatmap/tool.js +16 -8
  150. package/dist/chart-types/heatmap/tool.js.map +1 -1
  151. package/dist/chart-types/histogram/HistogramSettings.d.ts.map +1 -1
  152. package/dist/chart-types/histogram/HistogramSettings.js +4 -2
  153. package/dist/chart-types/histogram/HistogramSettings.js.map +1 -1
  154. package/dist/chart-types/histogram/schema.d.ts +10 -0
  155. package/dist/chart-types/histogram/schema.d.ts.map +1 -1
  156. package/dist/chart-types/histogram/schema.js +13 -0
  157. package/dist/chart-types/histogram/schema.js.map +1 -1
  158. package/dist/chart-types/histogram/spec.d.ts +1 -1
  159. package/dist/chart-types/histogram/spec.d.ts.map +1 -1
  160. package/dist/chart-types/histogram/spec.js +4 -3
  161. package/dist/chart-types/histogram/spec.js.map +1 -1
  162. package/dist/chart-types/histogram/tool.d.ts +7 -9
  163. package/dist/chart-types/histogram/tool.d.ts.map +1 -1
  164. package/dist/chart-types/histogram/tool.js +17 -7
  165. package/dist/chart-types/histogram/tool.js.map +1 -1
  166. package/dist/chart-types/index.d.ts +45 -3
  167. package/dist/chart-types/index.d.ts.map +1 -1
  168. package/dist/chart-types/index.js +8 -2
  169. package/dist/chart-types/index.js.map +1 -1
  170. package/dist/chart-types/line-chart/LineChartSettings.d.ts.map +1 -1
  171. package/dist/chart-types/line-chart/LineChartSettings.js +3 -1
  172. package/dist/chart-types/line-chart/LineChartSettings.js.map +1 -1
  173. package/dist/chart-types/line-chart/definition.d.ts.map +1 -1
  174. package/dist/chart-types/line-chart/definition.js +7 -0
  175. package/dist/chart-types/line-chart/definition.js.map +1 -1
  176. package/dist/chart-types/line-chart/schema.d.ts +5 -0
  177. package/dist/chart-types/line-chart/schema.d.ts.map +1 -1
  178. package/dist/chart-types/line-chart/schema.js +2 -0
  179. package/dist/chart-types/line-chart/schema.js.map +1 -1
  180. package/dist/chart-types/line-chart/tool.d.ts +5 -9
  181. package/dist/chart-types/line-chart/tool.d.ts.map +1 -1
  182. package/dist/chart-types/line-chart/tool.js +16 -8
  183. package/dist/chart-types/line-chart/tool.js.map +1 -1
  184. package/dist/chart-types/list-panels-tool.d.ts +35 -0
  185. package/dist/chart-types/list-panels-tool.d.ts.map +1 -0
  186. package/dist/chart-types/list-panels-tool.js +66 -0
  187. package/dist/chart-types/list-panels-tool.js.map +1 -0
  188. package/dist/chart-types/profiler-tool.d.ts +40 -0
  189. package/dist/chart-types/profiler-tool.d.ts.map +1 -0
  190. package/dist/chart-types/profiler-tool.js +73 -0
  191. package/dist/chart-types/profiler-tool.js.map +1 -0
  192. package/dist/chart-types/remove-panel-tool.d.ts +31 -0
  193. package/dist/chart-types/remove-panel-tool.d.ts.map +1 -0
  194. package/dist/chart-types/remove-panel-tool.js +55 -0
  195. package/dist/chart-types/remove-panel-tool.js.map +1 -0
  196. package/dist/chart-types/text-panel-tool.d.ts +42 -0
  197. package/dist/chart-types/text-panel-tool.d.ts.map +1 -0
  198. package/dist/chart-types/text-panel-tool.js +71 -0
  199. package/dist/chart-types/text-panel-tool.js.map +1 -0
  200. package/dist/chart-types/tool-helpers.d.ts +44 -0
  201. package/dist/chart-types/tool-helpers.d.ts.map +1 -0
  202. package/dist/chart-types/tool-helpers.js +129 -0
  203. package/dist/chart-types/tool-helpers.js.map +1 -0
  204. package/dist/chart-types/tool-schemas.d.ts +1 -0
  205. package/dist/chart-types/tool-schemas.d.ts.map +1 -1
  206. package/dist/chart-types/tool-schemas.js +5 -1
  207. package/dist/chart-types/tool-schemas.js.map +1 -1
  208. package/dist/dashboard/MosaicDashboard.d.ts +5 -2
  209. package/dist/dashboard/MosaicDashboard.d.ts.map +1 -1
  210. package/dist/dashboard/MosaicDashboard.js +20 -39
  211. package/dist/dashboard/MosaicDashboard.js.map +1 -1
  212. package/dist/dashboard/MosaicDashboardContext.d.ts +2 -0
  213. package/dist/dashboard/MosaicDashboardContext.d.ts.map +1 -1
  214. package/dist/dashboard/MosaicDashboardContext.js.map +1 -1
  215. package/dist/dashboard/MosaicDashboardEmptyState.d.ts.map +1 -1
  216. package/dist/dashboard/MosaicDashboardEmptyState.js +8 -44
  217. package/dist/dashboard/MosaicDashboardEmptyState.js.map +1 -1
  218. package/dist/dashboard/MosaicDashboardPanel.d.ts.map +1 -1
  219. package/dist/dashboard/MosaicDashboardPanel.js +2 -5
  220. package/dist/dashboard/MosaicDashboardPanel.js.map +1 -1
  221. package/dist/dashboard/MosaicDashboardPanelHeader.d.ts +2 -2
  222. package/dist/dashboard/MosaicDashboardPanelHeader.d.ts.map +1 -1
  223. package/dist/dashboard/MosaicDashboardPanelHeader.js +2 -2
  224. package/dist/dashboard/MosaicDashboardPanelHeader.js.map +1 -1
  225. package/dist/dashboard/MosaicDashboardPanels.d.ts.map +1 -1
  226. package/dist/dashboard/MosaicDashboardPanels.js +3 -2
  227. package/dist/dashboard/MosaicDashboardPanels.js.map +1 -1
  228. package/dist/dashboard/MosaicDashboardSlice.d.ts +185 -107
  229. package/dist/dashboard/MosaicDashboardSlice.d.ts.map +1 -1
  230. package/dist/dashboard/MosaicDashboardSlice.js +80 -57
  231. package/dist/dashboard/MosaicDashboardSlice.js.map +1 -1
  232. package/dist/dashboard/action-types.d.ts +25 -0
  233. package/dist/dashboard/action-types.d.ts.map +1 -0
  234. package/dist/dashboard/action-types.js +5 -0
  235. package/dist/dashboard/action-types.js.map +1 -0
  236. package/dist/dashboard/core-types.d.ts +26 -0
  237. package/dist/dashboard/core-types.d.ts.map +1 -0
  238. package/dist/dashboard/core-types.js +21 -0
  239. package/dist/dashboard/core-types.js.map +1 -0
  240. package/dist/dashboard/dashboard-types.d.ts +491 -0
  241. package/dist/dashboard/dashboard-types.d.ts.map +1 -0
  242. package/dist/dashboard/dashboard-types.js +54 -0
  243. package/dist/dashboard/dashboard-types.js.map +1 -0
  244. package/dist/dashboard/defaultPanelActions.d.ts +3 -0
  245. package/dist/dashboard/defaultPanelActions.d.ts.map +1 -0
  246. package/dist/dashboard/defaultPanelActions.js +9 -0
  247. package/dist/dashboard/defaultPanelActions.js.map +1 -0
  248. package/dist/dashboard/defaultPanelRenderers.d.ts.map +1 -1
  249. package/dist/dashboard/defaultPanelRenderers.js +1 -1
  250. package/dist/dashboard/defaultPanelRenderers.js.map +1 -1
  251. package/dist/dashboard/initial-state/BuildDashboardManuallyPanel.d.ts +6 -0
  252. package/dist/dashboard/initial-state/BuildDashboardManuallyPanel.d.ts.map +1 -0
  253. package/dist/dashboard/initial-state/BuildDashboardManuallyPanel.js +46 -0
  254. package/dist/dashboard/initial-state/BuildDashboardManuallyPanel.js.map +1 -0
  255. package/dist/dashboard/initial-state/BuildDashboardWithAIPanel.d.ts +7 -0
  256. package/dist/dashboard/initial-state/BuildDashboardWithAIPanel.d.ts.map +1 -0
  257. package/dist/dashboard/initial-state/BuildDashboardWithAIPanel.js +29 -0
  258. package/dist/dashboard/initial-state/BuildDashboardWithAIPanel.js.map +1 -0
  259. package/dist/dashboard/initial-state/MosaicDashboardInitialState.d.ts +6 -0
  260. package/dist/dashboard/initial-state/MosaicDashboardInitialState.d.ts.map +1 -0
  261. package/dist/dashboard/initial-state/MosaicDashboardInitialState.js +9 -0
  262. package/dist/dashboard/initial-state/MosaicDashboardInitialState.js.map +1 -0
  263. package/dist/dashboard/toolbar/MosaicDashboardAddPanelDropdown.d.ts +7 -0
  264. package/dist/dashboard/toolbar/MosaicDashboardAddPanelDropdown.d.ts.map +1 -0
  265. package/dist/dashboard/toolbar/MosaicDashboardAddPanelDropdown.js +12 -0
  266. package/dist/dashboard/toolbar/MosaicDashboardAddPanelDropdown.js.map +1 -0
  267. package/dist/dashboard/toolbar/MosaicDashboardResetFiltersButton.d.ts +7 -0
  268. package/dist/dashboard/toolbar/MosaicDashboardResetFiltersButton.d.ts.map +1 -0
  269. package/dist/dashboard/toolbar/MosaicDashboardResetFiltersButton.js +36 -0
  270. package/dist/dashboard/toolbar/MosaicDashboardResetFiltersButton.js.map +1 -0
  271. package/dist/dashboard/toolbar/MosaicDashboardToolbar.d.ts.map +1 -0
  272. package/dist/dashboard/toolbar/MosaicDashboardToolbar.js +15 -0
  273. package/dist/dashboard/toolbar/MosaicDashboardToolbar.js.map +1 -0
  274. package/dist/dashboard/useAddPanelActions.d.ts +10 -0
  275. package/dist/dashboard/useAddPanelActions.d.ts.map +1 -0
  276. package/dist/dashboard/useAddPanelActions.js +26 -0
  277. package/dist/dashboard/useAddPanelActions.js.map +1 -0
  278. package/dist/dashboard/useMosaicDashboardAddPanelActionContext.d.ts +3 -0
  279. package/dist/dashboard/useMosaicDashboardAddPanelActionContext.d.ts.map +1 -0
  280. package/dist/dashboard/useMosaicDashboardAddPanelActionContext.js +18 -0
  281. package/dist/dashboard/useMosaicDashboardAddPanelActionContext.js.map +1 -0
  282. package/dist/dashboard/useSelectedOrFirstTable.d.ts +10 -0
  283. package/dist/dashboard/useSelectedOrFirstTable.d.ts.map +1 -0
  284. package/dist/dashboard/useSelectedOrFirstTable.js +25 -0
  285. package/dist/dashboard/useSelectedOrFirstTable.js.map +1 -0
  286. package/dist/dashboard/useTablesWithColumns.d.ts +9 -0
  287. package/dist/dashboard/useTablesWithColumns.d.ts.map +1 -0
  288. package/dist/dashboard/useTablesWithColumns.js +13 -0
  289. package/dist/dashboard/useTablesWithColumns.js.map +1 -0
  290. package/dist/index.d.ts +25 -4
  291. package/dist/index.d.ts.map +1 -1
  292. package/dist/index.js +22 -2
  293. package/dist/index.js.map +1 -1
  294. package/dist/profiler/MosaicDashboardProfilerPanelRenderer.d.ts +2 -1
  295. package/dist/profiler/MosaicDashboardProfilerPanelRenderer.d.ts.map +1 -1
  296. package/dist/profiler/MosaicDashboardProfilerPanelRenderer.js +3 -3
  297. package/dist/profiler/MosaicDashboardProfilerPanelRenderer.js.map +1 -1
  298. package/dist/profiler/addProfilerPanelAction.d.ts +3 -0
  299. package/dist/profiler/addProfilerPanelAction.d.ts.map +1 -0
  300. package/dist/profiler/addProfilerPanelAction.js +9 -0
  301. package/dist/profiler/addProfilerPanelAction.js.map +1 -0
  302. package/dist/text/MosaicDashboardTextRenderer.d.ts +2 -1
  303. package/dist/text/MosaicDashboardTextRenderer.d.ts.map +1 -1
  304. package/dist/text/MosaicDashboardTextRenderer.js +4 -4
  305. package/dist/text/MosaicDashboardTextRenderer.js.map +1 -1
  306. package/dist/text/addTextPanelAction.d.ts +3 -0
  307. package/dist/text/addTextPanelAction.d.ts.map +1 -0
  308. package/dist/text/addTextPanelAction.js +9 -0
  309. package/dist/text/addTextPanelAction.js.map +1 -0
  310. package/dist/useMosaicClient.d.ts +4 -0
  311. package/dist/useMosaicClient.d.ts.map +1 -1
  312. package/dist/useMosaicClient.js +33 -3
  313. package/dist/useMosaicClient.js.map +1 -1
  314. package/dist/useVgPlotChartError.d.ts +13 -0
  315. package/dist/useVgPlotChartError.d.ts.map +1 -0
  316. package/dist/useVgPlotChartError.js +18 -0
  317. package/dist/useVgPlotChartError.js.map +1 -0
  318. package/dist/useVgPlotChartRender.d.ts +24 -0
  319. package/dist/useVgPlotChartRender.d.ts.map +1 -0
  320. package/dist/useVgPlotChartRender.js +152 -0
  321. package/dist/useVgPlotChartRender.js.map +1 -0
  322. package/dist/useVgPlotChartRetention.d.ts +21 -0
  323. package/dist/useVgPlotChartRetention.d.ts.map +1 -0
  324. package/dist/useVgPlotChartRetention.js +63 -0
  325. package/dist/useVgPlotChartRetention.js.map +1 -0
  326. package/dist/wrapCoordinatorWithValidation.d.ts +11 -0
  327. package/dist/wrapCoordinatorWithValidation.d.ts.map +1 -0
  328. package/dist/wrapCoordinatorWithValidation.js +23 -0
  329. package/dist/wrapCoordinatorWithValidation.js.map +1 -0
  330. package/package.json +31 -13
  331. package/dist/dashboard/MosaicDashboardToolbar.d.ts.map +0 -1
  332. package/dist/dashboard/MosaicDashboardToolbar.js +0 -86
  333. package/dist/dashboard/MosaicDashboardToolbar.js.map +0 -1
  334. /package/dist/dashboard/{MosaicDashboardToolbar.d.ts → toolbar/MosaicDashboardToolbar.d.ts} +0 -0
@@ -3,6 +3,7 @@ import { titleFromDescription } from '../../chart-builders/chartTypeUtils';
3
3
  import { CustomSpecSettingsComponent } from './CustomSpecSettings';
4
4
  import { Code } from 'lucide-react';
5
5
  import { createCustomSpec } from './spec';
6
+ import { DEFAULT_CHART_MAX_DATA_POINTS } from '../../chart-runtime';
6
7
  const DESCRIPTION = 'Create a chart with custom spec';
7
8
  export const customSpecChartType = {
8
9
  id: 'custom-spec',
@@ -12,6 +13,10 @@ export const customSpecChartType = {
12
13
  schema: CustomSpecChartSettings,
13
14
  settingsComponent: CustomSpecSettingsComponent,
14
15
  buildTitle: titleFromDescription(DESCRIPTION),
16
+ getDataPolicy: () => ({
17
+ maxRows: DEFAULT_CHART_MAX_DATA_POINTS,
18
+ reason: 'Custom specs are validated conservatively because SQLRooms cannot infer whether each mark is aggregated.',
19
+ }),
15
20
  createSpec: createCustomSpec,
16
21
  };
17
22
  //# sourceMappingURL=definition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../src/chart-types/custom-spec/definition.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,uBAAuB,EAAC,MAAM,UAAU,CAAC;AACxE,OAAO,EAAC,oBAAoB,EAAC,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAC,2BAA2B,EAAC,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAC,IAAI,EAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,gBAAgB,EAAC,MAAM,QAAQ,CAAC;AAExC,MAAM,WAAW,GAAG,iCAAiC,CAAC;AAEtD,MAAM,CAAC,MAAM,mBAAmB,GAC9B;IACE,EAAE,EAAE,aAAa;IACjB,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,WAAW;IACxB,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,uBAAuB;IAC/B,iBAAiB,EAAE,2BAA2B;IAC9C,UAAU,EAAE,oBAAoB,CAAC,WAAW,CAAC;IAC7C,UAAU,EAAE,gBAAgB;CAC7B,CAAC","sourcesContent":["import type {SpecChartTypeDefinition} from '../base-types';\nimport {CustomSpecChartConfig, CustomSpecChartSettings} from './schema';\nimport {titleFromDescription} from '../../chart-builders/chartTypeUtils';\nimport {CustomSpecSettingsComponent} from './CustomSpecSettings';\nimport {Code} from 'lucide-react';\nimport {createCustomSpec} from './spec';\n\nconst DESCRIPTION = 'Create a chart with custom spec';\n\nexport const customSpecChartType: SpecChartTypeDefinition<CustomSpecChartConfig> =\n {\n id: 'custom-spec',\n label: 'Custom Spec',\n description: DESCRIPTION,\n icon: Code,\n schema: CustomSpecChartSettings,\n settingsComponent: CustomSpecSettingsComponent,\n buildTitle: titleFromDescription(DESCRIPTION),\n createSpec: createCustomSpec,\n };\n"]}
1
+ {"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../src/chart-types/custom-spec/definition.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,uBAAuB,EAAC,MAAM,UAAU,CAAC;AACxE,OAAO,EAAC,oBAAoB,EAAC,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAC,2BAA2B,EAAC,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAC,IAAI,EAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAC,gBAAgB,EAAC,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAC,6BAA6B,EAAC,MAAM,qBAAqB,CAAC;AAElE,MAAM,WAAW,GAAG,iCAAiC,CAAC;AAEtD,MAAM,CAAC,MAAM,mBAAmB,GAC9B;IACE,EAAE,EAAE,aAAa;IACjB,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,WAAW;IACxB,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,uBAAuB;IAC/B,iBAAiB,EAAE,2BAA2B;IAC9C,UAAU,EAAE,oBAAoB,CAAC,WAAW,CAAC;IAC7C,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC;QACpB,OAAO,EAAE,6BAA6B;QACtC,MAAM,EACJ,0GAA0G;KAC7G,CAAC;IACF,UAAU,EAAE,gBAAgB;CAC7B,CAAC","sourcesContent":["import type {SpecChartTypeDefinition} from '../base-types';\nimport {CustomSpecChartConfig, CustomSpecChartSettings} from './schema';\nimport {titleFromDescription} from '../../chart-builders/chartTypeUtils';\nimport {CustomSpecSettingsComponent} from './CustomSpecSettings';\nimport {Code} from 'lucide-react';\nimport {createCustomSpec} from './spec';\nimport {DEFAULT_CHART_MAX_DATA_POINTS} from '../../chart-runtime';\n\nconst DESCRIPTION = 'Create a chart with custom spec';\n\nexport const customSpecChartType: SpecChartTypeDefinition<CustomSpecChartConfig> =\n {\n id: 'custom-spec',\n label: 'Custom Spec',\n description: DESCRIPTION,\n icon: Code,\n schema: CustomSpecChartSettings,\n settingsComponent: CustomSpecSettingsComponent,\n buildTitle: titleFromDescription(DESCRIPTION),\n getDataPolicy: () => ({\n maxRows: DEFAULT_CHART_MAX_DATA_POINTS,\n reason:\n 'Custom specs are validated conservatively because SQLRooms cannot infer whether each mark is aggregated.',\n }),\n createSpec: createCustomSpec,\n };\n"]}
@@ -9,6 +9,11 @@ export declare const CustomSpecChartConfig: z.ZodObject<{
9
9
  settings: z.ZodObject<{
10
10
  vgPlotSpec: z.ZodOptional<z.ZodUnknown>;
11
11
  }, z.core.$strip>;
12
+ dataPolicy: z.ZodOptional<z.ZodObject<{
13
+ disabled: z.ZodOptional<z.ZodBoolean>;
14
+ maxRows: z.ZodOptional<z.ZodNumber>;
15
+ reason: z.ZodOptional<z.ZodString>;
16
+ }, z.core.$strip>>;
12
17
  }, z.core.$strip>;
13
18
  export type CustomSpecChartConfig = z.infer<typeof CustomSpecChartConfig>;
14
19
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/chart-types/custom-spec/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE9E,eAAO,MAAM,qBAAqB;;;;;;iBAIhC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/chart-types/custom-spec/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE9E,eAAO,MAAM,qBAAqB;;;;;;;;;;;iBAKhC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { ChartDataPolicyOverrideConfig } from '../data-policy-schema';
2
3
  export const CustomSpecChartSettings = z.object({
3
4
  vgPlotSpec: z.unknown().optional(),
4
5
  });
@@ -6,5 +7,6 @@ export const CustomSpecChartConfig = z.object({
6
7
  chartType: z.literal('custom-spec'),
7
8
  settingsOpen: z.boolean().optional(),
8
9
  settings: CustomSpecChartSettings,
10
+ dataPolicy: ChartDataPolicyOverrideConfig.optional(),
9
11
  });
10
12
  //# sourceMappingURL=schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/chart-types/custom-spec/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IACnC,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACpC,QAAQ,EAAE,uBAAuB;CAClC,CAAC,CAAC","sourcesContent":["import {z} from 'zod';\n\nexport const CustomSpecChartSettings = z.object({\n vgPlotSpec: z.unknown().optional(),\n});\n\nexport type CustomSpecChartSettings = z.infer<typeof CustomSpecChartSettings>;\n\nexport const CustomSpecChartConfig = z.object({\n chartType: z.literal('custom-spec'),\n settingsOpen: z.boolean().optional(),\n settings: CustomSpecChartSettings,\n});\n\nexport type CustomSpecChartConfig = z.infer<typeof CustomSpecChartConfig>;\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/chart-types/custom-spec/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,EAAC,6BAA6B,EAAC,MAAM,uBAAuB,CAAC;AAEpE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IACnC,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACpC,QAAQ,EAAE,uBAAuB;IACjC,UAAU,EAAE,6BAA6B,CAAC,QAAQ,EAAE;CACrD,CAAC,CAAC","sourcesContent":["import {z} from 'zod';\nimport {ChartDataPolicyOverrideConfig} from '../data-policy-schema';\n\nexport const CustomSpecChartSettings = z.object({\n vgPlotSpec: z.unknown().optional(),\n});\n\nexport type CustomSpecChartSettings = z.infer<typeof CustomSpecChartSettings>;\n\nexport const CustomSpecChartConfig = z.object({\n chartType: z.literal('custom-spec'),\n settingsOpen: z.boolean().optional(),\n settings: CustomSpecChartSettings,\n dataPolicy: ChartDataPolicyOverrideConfig.optional(),\n});\n\nexport type CustomSpecChartConfig = z.infer<typeof CustomSpecChartConfig>;\n"]}
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ export declare const ChartDataPolicyOverrideConfig: z.ZodObject<{
3
+ disabled: z.ZodOptional<z.ZodBoolean>;
4
+ maxRows: z.ZodOptional<z.ZodNumber>;
5
+ reason: z.ZodOptional<z.ZodString>;
6
+ }, z.core.$strip>;
7
+ export type ChartDataPolicyOverrideConfig = z.infer<typeof ChartDataPolicyOverrideConfig>;
8
+ //# sourceMappingURL=data-policy-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-policy-schema.d.ts","sourceRoot":"","sources":["../../src/chart-types/data-policy-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,6BAA6B;;;;iBAIxC,CAAC;AAEH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CACjD,OAAO,6BAA6B,CACrC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ export const ChartDataPolicyOverrideConfig = z.object({
3
+ disabled: z.boolean().optional(),
4
+ maxRows: z.number().int().min(1).optional(),
5
+ reason: z.string().optional(),
6
+ });
7
+ //# sourceMappingURL=data-policy-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-policy-schema.js","sourceRoot":"","sources":["../../src/chart-types/data-policy-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAChC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC3C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC","sourcesContent":["import {z} from 'zod';\n\nexport const ChartDataPolicyOverrideConfig = z.object({\n disabled: z.boolean().optional(),\n maxRows: z.number().int().min(1).optional(),\n reason: z.string().optional(),\n});\n\nexport type ChartDataPolicyOverrideConfig = z.infer<\n typeof ChartDataPolicyOverrideConfig\n>;\n"]}
@@ -11,6 +11,11 @@ export declare const HeatmapChartConfig: z.ZodObject<{
11
11
  y: z.ZodOptional<z.ZodString>;
12
12
  }, z.core.$strip>;
13
13
  settingsOpen: z.ZodOptional<z.ZodBoolean>;
14
+ dataPolicy: z.ZodOptional<z.ZodObject<{
15
+ disabled: z.ZodOptional<z.ZodBoolean>;
16
+ maxRows: z.ZodOptional<z.ZodNumber>;
17
+ reason: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>>;
14
19
  }, z.core.$strip>;
15
20
  export type HeatmapChartConfig = z.infer<typeof HeatmapChartConfig>;
16
21
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/chart-types/heatmap/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,oBAAoB;;;iBAG/B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,eAAO,MAAM,kBAAkB;;;;;;;iBAI7B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/chart-types/heatmap/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,eAAO,MAAM,oBAAoB;;;iBAG/B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;iBAK7B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { ChartDataPolicyOverrideConfig } from '../data-policy-schema';
2
3
  export const HeatmapChartSettings = z.object({
3
4
  x: z.string().optional().describe('Column for X axis'),
4
5
  y: z.string().optional().describe('Column for Y axis'),
@@ -7,5 +8,6 @@ export const HeatmapChartConfig = z.object({
7
8
  chartType: z.literal('heatmap'),
8
9
  settings: HeatmapChartSettings,
9
10
  settingsOpen: z.boolean().optional(),
11
+ dataPolicy: ChartDataPolicyOverrideConfig.optional(),
10
12
  });
11
13
  //# sourceMappingURL=schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/chart-types/heatmap/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IACtD,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;CACvD,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAC/B,QAAQ,EAAE,oBAAoB;IAC9B,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC","sourcesContent":["import {z} from 'zod';\n\nexport const HeatmapChartSettings = z.object({\n x: z.string().optional().describe('Column for X axis'),\n y: z.string().optional().describe('Column for Y axis'),\n});\n\nexport type HeatmapChartSettings = z.infer<typeof HeatmapChartSettings>;\n\nexport const HeatmapChartConfig = z.object({\n chartType: z.literal('heatmap'),\n settings: HeatmapChartSettings,\n settingsOpen: z.boolean().optional(),\n});\n\nexport type HeatmapChartConfig = z.infer<typeof HeatmapChartConfig>;\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/chart-types/heatmap/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,EAAC,6BAA6B,EAAC,MAAM,uBAAuB,CAAC;AAEpE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IACtD,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;CACvD,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAC/B,QAAQ,EAAE,oBAAoB;IAC9B,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACpC,UAAU,EAAE,6BAA6B,CAAC,QAAQ,EAAE;CACrD,CAAC,CAAC","sourcesContent":["import {z} from 'zod';\nimport {ChartDataPolicyOverrideConfig} from '../data-policy-schema';\n\nexport const HeatmapChartSettings = z.object({\n x: z.string().optional().describe('Column for X axis'),\n y: z.string().optional().describe('Column for Y axis'),\n});\n\nexport type HeatmapChartSettings = z.infer<typeof HeatmapChartSettings>;\n\nexport const HeatmapChartConfig = z.object({\n chartType: z.literal('heatmap'),\n settings: HeatmapChartSettings,\n settingsOpen: z.boolean().optional(),\n dataPolicy: ChartDataPolicyOverrideConfig.optional(),\n});\n\nexport type HeatmapChartConfig = z.infer<typeof HeatmapChartConfig>;\n"]}
@@ -1,9 +1,10 @@
1
1
  import { z } from 'zod';
2
- import { type ChartToolDeps } from '../base-types';
2
+ import { type DashboardToolDeps } from '../base-types';
3
3
  export declare const HeatmapToolParameters: z.ZodObject<{
4
4
  artifactId: z.ZodOptional<z.ZodString>;
5
5
  tableName: z.ZodOptional<z.ZodString>;
6
6
  createArtifactIfMissing: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
7
+ panelId: z.ZodOptional<z.ZodString>;
7
8
  reasoning: z.ZodString;
8
9
  settings: z.ZodObject<{
9
10
  x: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
@@ -11,7 +12,7 @@ export declare const HeatmapToolParameters: z.ZodObject<{
11
12
  }, z.core.$strip>;
12
13
  }, z.core.$strip>;
13
14
  export type HeatmapToolParams = z.infer<typeof HeatmapToolParameters>;
14
- export declare function createHeatmapAiTool(deps: ChartToolDeps): import("ai").Tool<{
15
+ export declare function createHeatmapAiTool(deps: DashboardToolDeps): import("ai").Tool<{
15
16
  createArtifactIfMissing: boolean;
16
17
  reasoning: string;
17
18
  settings: {
@@ -20,17 +21,12 @@ export declare function createHeatmapAiTool(deps: ChartToolDeps): import("ai").T
20
21
  };
21
22
  artifactId?: string | undefined;
22
23
  tableName?: string | undefined;
24
+ panelId?: string | undefined;
23
25
  }, {
24
26
  llmResult: {
25
27
  success: boolean;
26
28
  details: string;
27
- data: {
28
- panelId: string;
29
- artifactId: string;
30
- tableName: string;
31
- title: string;
32
- config: any;
33
- };
29
+ data: import("..").PanelResult;
34
30
  errorMessage?: undefined;
35
31
  };
36
32
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../src/chart-types/heatmap/tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,OAAO,EAAC,KAAK,aAAa,EAAC,MAAM,eAAe,CAAC;AAIjD,eAAO,MAAM,qBAAqB;;;;;;;;;iBAEhC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEtE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEtD"}
1
+ {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../src/chart-types/heatmap/tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,OAAO,EAAC,KAAK,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAKrD,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;;;;;;;;;;;;;;;;;;;;;;;;GA+E1D"}
@@ -3,6 +3,7 @@ import { HeatmapChartSettings } from './schema';
3
3
  import { BaseChartToolParameters } from '../tool-schemas';
4
4
  import { validateColumnExists } from '../tool-validation';
5
5
  import { NUMERIC_COLUMN_TYPES } from '../../chart-builders/constants';
6
+ import { createOrUpdateChartPanel } from '../tool-helpers';
6
7
  export const HeatmapToolParameters = BaseChartToolParameters.extend({
7
8
  settings: HeatmapChartSettings.required(),
8
9
  });
@@ -15,32 +16,39 @@ Example queries: "heatmap of population density by latitude and longitude", "tem
15
16
 
16
17
  Required: x and y should be numeric (${NUMERIC_COLUMN_TYPES.join(', ')}) for creating the grid.
17
18
 
19
+ NOTE: Heatmaps aggregate data into grid cells and compute density/counts, so they handle large datasets efficiently (no data point limit). Heatmaps are a good alternative when bubble charts would exceed ${deps.maxDataPoints.toLocaleString()} rows.
20
+
21
+ To UPDATE an existing heatmap: provide the panelId parameter. Otherwise creates new panel.
22
+
18
23
  Best for: large datasets with overlapping points, finding patterns/hotspots in 2D space, temporal patterns (hour×day), spatial density visualization.
19
24
 
20
25
  Do NOT use for: individual point plots (use bubble-chart), single variable distribution (use histogram), time trends (use line-chart).`,
21
26
  inputSchema: HeatmapToolParameters,
22
27
  execute: async (params, context) => {
23
28
  try {
24
- const { artifactId, tableName, columns } = deps.resolveResources(params, context);
29
+ const artifactId = deps.resolveArtifact(params.artifactId, params.createArtifactIfMissing, context);
30
+ const { tableName, columns } = deps.resolveTable(artifactId, params.tableName);
25
31
  // Validate settings
26
32
  validateColumnExists(params.settings.x, NUMERIC_COLUMN_TYPES, columns, 'x');
27
33
  validateColumnExists(params.settings.y, NUMERIC_COLUMN_TYPES, columns, 'y');
28
- const title = params.settings.x && params.settings.y
29
- ? `Heatmap - ${params.settings.x} vs ${params.settings.y}`
30
- : 'Heatmap';
31
- const result = deps.createChart({
32
- artifactId,
34
+ const result = createOrUpdateChartPanel(deps, {
35
+ panelId: params.panelId,
36
+ dashboardId: artifactId,
33
37
  tableName,
38
+ title: params.settings.x && params.settings.y
39
+ ? `Heatmap - ${params.settings.x} vs ${params.settings.y}`
40
+ : 'Heatmap',
34
41
  config: {
35
42
  chartType: 'heatmap',
36
43
  settings: params.settings,
37
44
  },
38
- title,
39
45
  });
40
46
  return {
41
47
  llmResult: {
42
48
  success: true,
43
- details: `Created heatmap "${result.title}".`,
49
+ details: params.panelId
50
+ ? `Updated heatmap "${result.title}".`
51
+ : `Created heatmap "${result.title}".`,
44
52
  data: result,
45
53
  },
46
54
  };
@@ -1 +1 @@
1
- {"version":3,"file":"tool.js","sourceRoot":"","sources":["../../../src/chart-types/heatmap/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,iBAAiB,CAAC;AAExD,OAAO,EAAC,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAEpE,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC,MAAM,CAAC;IAClE,QAAQ,EAAE,oBAAoB,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC;AAIH,MAAM,UAAU,mBAAmB,CAAC,IAAmB;IACrD,OAAO,IAAI,CAAC;QACV,WAAW,EAAE;;;;;uCAKsB,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC;;;;uIAIiE;QACnI,WAAW,EAAE,qBAAqB;QAClC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;YACjC,IAAI,CAAC;gBACH,MAAM,EAAC,UAAU,EAAE,SAAS,EAAE,OAAO,EAAC,GAAG,IAAI,CAAC,gBAAgB,CAC5D,MAAM,EACN,OAAO,CACR,CAAC;gBAEF,oBAAoB;gBAEpB,oBAAoB,CAClB,MAAM,CAAC,QAAQ,CAAC,CAAC,EACjB,oBAAoB,EACpB,OAAO,EACP,GAAG,CACJ,CAAC;gBAEF,oBAAoB,CAClB,MAAM,CAAC,QAAQ,CAAC,CAAC,EACjB,oBAAoB,EACpB,OAAO,EACP,GAAG,CACJ,CAAC;gBAEF,MAAM,KAAK,GACT,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC;oBACpC,CAAC,CAAC,aAAa,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE;oBAC1D,CAAC,CAAC,SAAS,CAAC;gBAEhB,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC;oBAC9B,UAAU;oBACV,SAAS;oBACT,MAAM,EAAE;wBACN,SAAS,EAAE,SAAS;wBACpB,QAAQ,EAAE,MAAM,CAAC,QAAQ;qBAC1B;oBACD,KAAK;iBACN,CAAC,CAAC;gBAEH,OAAO;oBACL,SAAS,EAAE;wBACT,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE,oBAAoB,MAAM,CAAC,KAAK,IAAI;wBAC7C,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 {HeatmapChartSettings} from './schema';\nimport {BaseChartToolParameters} from '../tool-schemas';\nimport {type ChartToolDeps} from '../base-types';\nimport {validateColumnExists} from '../tool-validation';\nimport {NUMERIC_COLUMN_TYPES} from '../../chart-builders/constants';\n\nexport const HeatmapToolParameters = BaseChartToolParameters.extend({\n settings: HeatmapChartSettings.required(),\n});\n\nexport type HeatmapToolParams = z.infer<typeof HeatmapToolParameters>;\n\nexport function createHeatmapAiTool(deps: ChartToolDeps) {\n return tool({\n description: `Heatmap: visualizes density or aggregated values across two dimensions using color intensity in a grid. Each cell color shows count/sum at that x,y position.\n\nUse when: user asks about \"heatmap\", \"density by X and Y\", \"activity by [category] and [category]\", \"intensity\", \"patterns across two dimensions\".\nExample queries: \"heatmap of population density by latitude and longitude\", \"temperature by elevation and month\", \"show building density by coordinates\", \"land use intensity by region and type\", \"feature distribution by grid cell\".\n\nRequired: x and y should be numeric (${NUMERIC_COLUMN_TYPES.join(', ')}) for creating the grid.\n\nBest for: large datasets with overlapping points, finding patterns/hotspots in 2D space, temporal patterns (hour×day), spatial density visualization.\n\nDo NOT use for: individual point plots (use bubble-chart), single variable distribution (use histogram), time trends (use line-chart).`,\n inputSchema: HeatmapToolParameters,\n execute: async (params, context) => {\n try {\n const {artifactId, tableName, columns} = deps.resolveResources(\n params,\n context,\n );\n\n // Validate settings\n\n validateColumnExists(\n params.settings.x,\n NUMERIC_COLUMN_TYPES,\n columns,\n 'x',\n );\n\n validateColumnExists(\n params.settings.y,\n NUMERIC_COLUMN_TYPES,\n columns,\n 'y',\n );\n\n const title =\n params.settings.x && params.settings.y\n ? `Heatmap - ${params.settings.x} vs ${params.settings.y}`\n : 'Heatmap';\n\n const result = deps.createChart({\n artifactId,\n tableName,\n config: {\n chartType: 'heatmap',\n settings: params.settings,\n },\n title,\n });\n\n return {\n llmResult: {\n success: true,\n details: `Created heatmap \"${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/chart-types/heatmap/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,iBAAiB,CAAC;AAExD,OAAO,EAAC,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,wBAAwB,EAAC,MAAM,iBAAiB,CAAC;AAEzD,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC,MAAM,CAAC;IAClE,QAAQ,EAAE,oBAAoB,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC;AAIH,MAAM,UAAU,mBAAmB,CAAC,IAAuB;IACzD,OAAO,IAAI,CAAC;QACV,WAAW,EAAE;;;;;uCAKsB,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC;;6MAEuI,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE;;;;;;uIAMzG;QACnI,WAAW,EAAE,qBAAqB;QAClC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;YACjC,IAAI,CAAC;gBACH,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,CACrC,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,uBAAuB,EAC9B,OAAO,CACR,CAAC;gBACF,MAAM,EAAC,SAAS,EAAE,OAAO,EAAC,GAAG,IAAI,CAAC,YAAY,CAC5C,UAAU,EACV,MAAM,CAAC,SAAS,CACjB,CAAC;gBAEF,oBAAoB;gBAEpB,oBAAoB,CAClB,MAAM,CAAC,QAAQ,CAAC,CAAC,EACjB,oBAAoB,EACpB,OAAO,EACP,GAAG,CACJ,CAAC;gBAEF,oBAAoB,CAClB,MAAM,CAAC,QAAQ,CAAC,CAAC,EACjB,oBAAoB,EACpB,OAAO,EACP,GAAG,CACJ,CAAC;gBAEF,MAAM,MAAM,GAAG,wBAAwB,CAAC,IAAI,EAAE;oBAC5C,OAAO,EAAE,MAAM,CAAC,OAAO;oBACvB,WAAW,EAAE,UAAU;oBACvB,SAAS;oBACT,KAAK,EACH,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC;wBACpC,CAAC,CAAC,aAAa,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE;wBAC1D,CAAC,CAAC,SAAS;oBACf,MAAM,EAAE;wBACN,SAAS,EAAE,SAAS;wBACpB,QAAQ,EAAE,MAAM,CAAC,QAAQ;qBAC1B;iBACF,CAAC,CAAC;gBAEH,OAAO;oBACL,SAAS,EAAE;wBACT,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE,MAAM,CAAC,OAAO;4BACrB,CAAC,CAAC,oBAAoB,MAAM,CAAC,KAAK,IAAI;4BACtC,CAAC,CAAC,oBAAoB,MAAM,CAAC,KAAK,IAAI;wBACxC,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 {HeatmapChartSettings} from './schema';\nimport {BaseChartToolParameters} from '../tool-schemas';\nimport {type DashboardToolDeps} from '../base-types';\nimport {validateColumnExists} from '../tool-validation';\nimport {NUMERIC_COLUMN_TYPES} from '../../chart-builders/constants';\nimport {createOrUpdateChartPanel} from '../tool-helpers';\n\nexport const HeatmapToolParameters = BaseChartToolParameters.extend({\n settings: HeatmapChartSettings.required(),\n});\n\nexport type HeatmapToolParams = z.infer<typeof HeatmapToolParameters>;\n\nexport function createHeatmapAiTool(deps: DashboardToolDeps) {\n return tool({\n description: `Heatmap: visualizes density or aggregated values across two dimensions using color intensity in a grid. Each cell color shows count/sum at that x,y position.\n\nUse when: user asks about \"heatmap\", \"density by X and Y\", \"activity by [category] and [category]\", \"intensity\", \"patterns across two dimensions\".\nExample queries: \"heatmap of population density by latitude and longitude\", \"temperature by elevation and month\", \"show building density by coordinates\", \"land use intensity by region and type\", \"feature distribution by grid cell\".\n\nRequired: x and y should be numeric (${NUMERIC_COLUMN_TYPES.join(', ')}) for creating the grid.\n\nNOTE: Heatmaps aggregate data into grid cells and compute density/counts, so they handle large datasets efficiently (no data point limit). Heatmaps are a good alternative when bubble charts would exceed ${deps.maxDataPoints.toLocaleString()} rows.\n\nTo UPDATE an existing heatmap: provide the panelId parameter. Otherwise creates new panel.\n\nBest for: large datasets with overlapping points, finding patterns/hotspots in 2D space, temporal patterns (hour×day), spatial density visualization.\n\nDo NOT use for: individual point plots (use bubble-chart), single variable distribution (use histogram), time trends (use line-chart).`,\n inputSchema: HeatmapToolParameters,\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\n validateColumnExists(\n params.settings.x,\n NUMERIC_COLUMN_TYPES,\n columns,\n 'x',\n );\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:\n params.settings.x && params.settings.y\n ? `Heatmap - ${params.settings.x} vs ${params.settings.y}`\n : 'Heatmap',\n config: {\n chartType: 'heatmap',\n settings: params.settings,\n },\n });\n\n return {\n llmResult: {\n success: true,\n details: params.panelId\n ? `Updated heatmap \"${result.title}\".`\n : `Created heatmap \"${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 +1 @@
1
- {"version":3,"file":"HistogramSettings.d.ts","sourceRoot":"","sources":["../../../src/chart-types/histogram/HistogramSettings.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,EAAC,MAAM,OAAO,CAAC;AAK9B,eAAO,MAAM,0BAA0B,EAAE,EAaxC,CAAC"}
1
+ {"version":3,"file":"HistogramSettings.d.ts","sourceRoot":"","sources":["../../../src/chart-types/histogram/HistogramSettings.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,EAAC,MAAM,OAAO,CAAC;AAO9B,eAAO,MAAM,0BAA0B,EAAE,EA0BxC,CAAC"}
@@ -1,9 +1,11 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Input } from '@sqlrooms/ui';
2
3
  import { Field } from '../../chart-builders/Field';
3
4
  import { ColumnSelector } from '../../chart-builders/ColumnSelector';
4
5
  import { useChartSettingsContext } from '../../chart/chart-settings/ChartSettingsContext';
6
+ import { MIN_BINS_COUNT, MAX_BINS_COUNT, DEFAULT_BINS_COUNT } from './schema';
5
7
  export const HistogramSettingsComponent = () => {
6
8
  const { onChangeConfig, config } = useChartSettingsContext('histogram');
7
- return (_jsx("div", { className: "space-y-4", children: _jsx(Field, { label: "Field", required: true, children: _jsx(ColumnSelector.Quantitative, { value: config.settings.field, onChange: (field) => onChangeConfig('field', field) }) }) }));
9
+ return (_jsxs("div", { className: "space-y-4", children: [_jsx(Field, { label: "Field", required: true, children: _jsx(ColumnSelector.Quantitative, { value: config.settings.field, onChange: (field) => onChangeConfig('field', field) }) }), _jsx(Field, { label: "Max Bins", children: _jsx(Input, { type: "number", min: MIN_BINS_COUNT, max: MAX_BINS_COUNT, value: config.settings.maxBins ?? DEFAULT_BINS_COUNT, className: "no-spinner", onChange: (e) => onChangeConfig('maxBins', parseInt(e.target.value, 10)), placeholder: String(DEFAULT_BINS_COUNT) }) })] }));
8
10
  };
9
11
  //# sourceMappingURL=HistogramSettings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HistogramSettings.js","sourceRoot":"","sources":["../../../src/chart-types/histogram/HistogramSettings.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,KAAK,EAAC,MAAM,4BAA4B,CAAC;AACjD,OAAO,EAAC,cAAc,EAAC,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAC,uBAAuB,EAAC,MAAM,iDAAiD,CAAC;AAExF,MAAM,CAAC,MAAM,0BAA0B,GAAO,GAAG,EAAE;IACjD,MAAM,EAAC,cAAc,EAAE,MAAM,EAAC,GAAG,uBAAuB,CAAC,WAAW,CAAC,CAAC;IAEtE,OAAO,CACL,cAAK,SAAS,EAAC,WAAW,YACxB,KAAC,KAAK,IAAC,KAAK,EAAC,OAAO,EAAC,QAAQ,kBAC3B,KAAC,cAAc,CAAC,YAAY,IAC1B,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,EAC5B,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,GACnD,GACI,GACJ,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {type FC} from 'react';\nimport {Field} from '../../chart-builders/Field';\nimport {ColumnSelector} from '../../chart-builders/ColumnSelector';\nimport {useChartSettingsContext} from '../../chart/chart-settings/ChartSettingsContext';\n\nexport const HistogramSettingsComponent: FC = () => {\n const {onChangeConfig, config} = useChartSettingsContext('histogram');\n\n return (\n <div className=\"space-y-4\">\n <Field label=\"Field\" required>\n <ColumnSelector.Quantitative\n value={config.settings.field}\n onChange={(field) => onChangeConfig('field', field)}\n />\n </Field>\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"HistogramSettings.js","sourceRoot":"","sources":["../../../src/chart-types/histogram/HistogramSettings.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AACnC,OAAO,EAAC,KAAK,EAAC,MAAM,4BAA4B,CAAC;AACjD,OAAO,EAAC,cAAc,EAAC,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAC,uBAAuB,EAAC,MAAM,iDAAiD,CAAC;AACxF,OAAO,EAAC,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAAC,MAAM,UAAU,CAAC;AAE5E,MAAM,CAAC,MAAM,0BAA0B,GAAO,GAAG,EAAE;IACjD,MAAM,EAAC,cAAc,EAAE,MAAM,EAAC,GAAG,uBAAuB,CAAC,WAAW,CAAC,CAAC;IAEtE,OAAO,CACL,eAAK,SAAS,EAAC,WAAW,aACxB,KAAC,KAAK,IAAC,KAAK,EAAC,OAAO,EAAC,QAAQ,kBAC3B,KAAC,cAAc,CAAC,YAAY,IAC1B,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,EAC5B,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,GACnD,GACI,EACR,KAAC,KAAK,IAAC,KAAK,EAAC,UAAU,YACrB,KAAC,KAAK,IACJ,IAAI,EAAC,QAAQ,EACb,GAAG,EAAE,cAAc,EACnB,GAAG,EAAE,cAAc,EACnB,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,IAAI,kBAAkB,EACpD,SAAS,EAAC,YAAY,EACtB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CACd,cAAc,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAEzD,WAAW,EAAE,MAAM,CAAC,kBAAkB,CAAC,GACvC,GACI,IACJ,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {type FC} from 'react';\nimport {Input} from '@sqlrooms/ui';\nimport {Field} from '../../chart-builders/Field';\nimport {ColumnSelector} from '../../chart-builders/ColumnSelector';\nimport {useChartSettingsContext} from '../../chart/chart-settings/ChartSettingsContext';\nimport {MIN_BINS_COUNT, MAX_BINS_COUNT, DEFAULT_BINS_COUNT} from './schema';\n\nexport const HistogramSettingsComponent: FC = () => {\n const {onChangeConfig, config} = useChartSettingsContext('histogram');\n\n return (\n <div className=\"space-y-4\">\n <Field label=\"Field\" required>\n <ColumnSelector.Quantitative\n value={config.settings.field}\n onChange={(field) => onChangeConfig('field', field)}\n />\n </Field>\n <Field label=\"Max Bins\">\n <Input\n type=\"number\"\n min={MIN_BINS_COUNT}\n max={MAX_BINS_COUNT}\n value={config.settings.maxBins ?? DEFAULT_BINS_COUNT}\n className=\"no-spinner\"\n onChange={(e) =>\n onChangeConfig('maxBins', parseInt(e.target.value, 10))\n }\n placeholder={String(DEFAULT_BINS_COUNT)}\n />\n </Field>\n </div>\n );\n};\n"]}
@@ -1,14 +1,24 @@
1
1
  import { z } from 'zod';
2
+ export declare const MIN_BINS_COUNT = 1;
3
+ export declare const MAX_BINS_COUNT = 1000;
4
+ export declare const DEFAULT_BINS_COUNT = 20;
2
5
  export declare const HistogramChartSettings: z.ZodObject<{
3
6
  field: z.ZodOptional<z.ZodString>;
7
+ maxBins: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
4
8
  }, z.core.$strip>;
5
9
  export type HistogramChartSettings = z.infer<typeof HistogramChartSettings>;
6
10
  export declare const HistogramChartConfig: z.ZodObject<{
7
11
  chartType: z.ZodLiteral<"histogram">;
8
12
  settings: z.ZodObject<{
9
13
  field: z.ZodOptional<z.ZodString>;
14
+ maxBins: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
10
15
  }, z.core.$strip>;
11
16
  settingsOpen: z.ZodOptional<z.ZodBoolean>;
17
+ dataPolicy: z.ZodOptional<z.ZodObject<{
18
+ disabled: z.ZodOptional<z.ZodBoolean>;
19
+ maxRows: z.ZodOptional<z.ZodNumber>;
20
+ reason: z.ZodOptional<z.ZodString>;
21
+ }, z.core.$strip>>;
12
22
  }, z.core.$strip>;
13
23
  export type HistogramChartConfig = z.infer<typeof HistogramChartConfig>;
14
24
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/chart-types/histogram/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,sBAAsB;;iBAKjC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E,eAAO,MAAM,oBAAoB;;;;;;iBAI/B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/chart-types/histogram/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,eAAO,MAAM,cAAc,IAAI,CAAC;AAChC,eAAO,MAAM,cAAc,OAAO,CAAC;AACnC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,eAAO,MAAM,sBAAsB;;;iBAejC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E,eAAO,MAAM,oBAAoB;;;;;;;;;;;;iBAK/B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -1,13 +1,26 @@
1
1
  import { z } from 'zod';
2
+ import { ChartDataPolicyOverrideConfig } from '../data-policy-schema';
3
+ export const MIN_BINS_COUNT = 1;
4
+ export const MAX_BINS_COUNT = 1000;
5
+ export const DEFAULT_BINS_COUNT = 20;
2
6
  export const HistogramChartSettings = z.object({
3
7
  field: z
4
8
  .string()
5
9
  .optional()
6
10
  .describe('Numeric column to create histogram distribution for'),
11
+ maxBins: z
12
+ .number()
13
+ .int()
14
+ .min(MIN_BINS_COUNT)
15
+ .max(MAX_BINS_COUNT)
16
+ .default(DEFAULT_BINS_COUNT)
17
+ .optional()
18
+ .describe(`Maximum number of bins for the histogram (default: ${DEFAULT_BINS_COUNT})`),
7
19
  });
8
20
  export const HistogramChartConfig = z.object({
9
21
  chartType: z.literal('histogram'),
10
22
  settings: HistogramChartSettings,
11
23
  settingsOpen: z.boolean().optional(),
24
+ dataPolicy: ChartDataPolicyOverrideConfig.optional(),
12
25
  });
13
26
  //# sourceMappingURL=schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/chart-types/histogram/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,qDAAqD,CAAC;CACnE,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;IACjC,QAAQ,EAAE,sBAAsB;IAChC,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC","sourcesContent":["import {z} from 'zod';\n\nexport const HistogramChartSettings = z.object({\n field: z\n .string()\n .optional()\n .describe('Numeric column to create histogram distribution for'),\n});\n\nexport type HistogramChartSettings = z.infer<typeof HistogramChartSettings>;\n\nexport const HistogramChartConfig = z.object({\n chartType: z.literal('histogram'),\n settings: HistogramChartSettings,\n settingsOpen: z.boolean().optional(),\n});\n\nexport type HistogramChartConfig = z.infer<typeof HistogramChartConfig>;\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/chart-types/histogram/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,EAAC,6BAA6B,EAAC,MAAM,uBAAuB,CAAC;AAEpE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC;AAChC,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC;AACnC,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAErC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,qDAAqD,CAAC;IAClE,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,cAAc,CAAC;SACnB,GAAG,CAAC,cAAc,CAAC;SACnB,OAAO,CAAC,kBAAkB,CAAC;SAC3B,QAAQ,EAAE;SACV,QAAQ,CACP,sDAAsD,kBAAkB,GAAG,CAC5E;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;IACjC,QAAQ,EAAE,sBAAsB;IAChC,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACpC,UAAU,EAAE,6BAA6B,CAAC,QAAQ,EAAE;CACrD,CAAC,CAAC","sourcesContent":["import {z} from 'zod';\nimport {ChartDataPolicyOverrideConfig} from '../data-policy-schema';\n\nexport const MIN_BINS_COUNT = 1;\nexport const MAX_BINS_COUNT = 1000;\nexport const DEFAULT_BINS_COUNT = 20;\n\nexport const HistogramChartSettings = z.object({\n field: z\n .string()\n .optional()\n .describe('Numeric column to create histogram distribution for'),\n maxBins: z\n .number()\n .int()\n .min(MIN_BINS_COUNT)\n .max(MAX_BINS_COUNT)\n .default(DEFAULT_BINS_COUNT)\n .optional()\n .describe(\n `Maximum number of bins for the histogram (default: ${DEFAULT_BINS_COUNT})`,\n ),\n});\n\nexport type HistogramChartSettings = z.infer<typeof HistogramChartSettings>;\n\nexport const HistogramChartConfig = z.object({\n chartType: z.literal('histogram'),\n settings: HistogramChartSettings,\n settingsOpen: z.boolean().optional(),\n dataPolicy: ChartDataPolicyOverrideConfig.optional(),\n});\n\nexport type HistogramChartConfig = z.infer<typeof HistogramChartConfig>;\n"]}
@@ -1,4 +1,4 @@
1
1
  import type { Spec } from '@uwdata/mosaic-spec';
2
2
  import { HistogramChartSettings } from './schema';
3
- export declare function createHistogramSpec(tableName: string, { field }: HistogramChartSettings): Spec;
3
+ export declare function createHistogramSpec(tableName: string, { field, maxBins }: HistogramChartSettings): Spec;
4
4
  //# sourceMappingURL=spec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../../src/chart-types/histogram/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,CAgCN"}
1
+ {"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../../src/chart-types/histogram/spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAC,sBAAsB,EAAqB,MAAM,UAAU,CAAC;AAMpE,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EACjB,EAAC,KAAK,EAAE,OAA4B,EAAC,EAAE,sBAAsB,GAC5D,IAAI,CAgCN"}
@@ -1,7 +1,8 @@
1
+ import { DEFAULT_BINS_COUNT } from './schema';
1
2
  import { SpecGenerationError } from '../errors';
2
3
  const BG_COLOR = 'var(--color-chart-overlay)';
3
4
  const FG_COLOR = 'var(--color-chart-1)';
4
- export function createHistogramSpec(tableName, { field }) {
5
+ export function createHistogramSpec(tableName, { field, maxBins = DEFAULT_BINS_COUNT }) {
5
6
  if (!field) {
6
7
  throw new SpecGenerationError('Field is required for histogram');
7
8
  }
@@ -10,7 +11,7 @@ export function createHistogramSpec(tableName, { field }) {
10
11
  {
11
12
  mark: 'rectY',
12
13
  data: { from: tableName },
13
- x: { bin: field, maxbins: 40 },
14
+ x: { bin: field, steps: maxBins },
14
15
  y: { count: null },
15
16
  fill: BG_COLOR,
16
17
  inset: 0.5,
@@ -18,7 +19,7 @@ export function createHistogramSpec(tableName, { field }) {
18
19
  {
19
20
  mark: 'rectY',
20
21
  data: { from: tableName, filterBy: '$brush' },
21
- x: { bin: field, maxbins: 40 },
22
+ x: { bin: field, steps: maxBins },
22
23
  y: { count: null },
23
24
  fill: FG_COLOR,
24
25
  inset: 0.5,
@@ -1 +1 @@
1
- {"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../src/chart-types/histogram/spec.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,mBAAmB,EAAC,MAAM,WAAW,CAAC;AAE9C,MAAM,QAAQ,GAAG,4BAA4B,CAAC;AAC9C,MAAM,QAAQ,GAAG,sBAAsB,CAAC;AAExC,MAAM,UAAU,mBAAmB,CACjC,SAAiB,EACjB,EAAC,KAAK,EAAyB;IAE/B,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,mBAAmB,CAAC,iCAAiC,CAAC,CAAC;IACnE,CAAC;IAED,OAAO;QACL,IAAI,EAAE;YACJ;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,EAAC,IAAI,EAAE,SAAS,EAAC;gBACvB,CAAC,EAAE,EAAC,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAC;gBAC5B,CAAC,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC;gBAChB,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,GAAG;aACX;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,EAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAC;gBAC3C,CAAC,EAAE,EAAC,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAC;gBAC5B,CAAC,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC;gBAChB,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,GAAG;aACX;YACD,EAAC,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAC;SACpC;QACD,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,OAAO;QACf,MAAM,EAAE,GAAG;QACX,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,EAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAC;QACnD,MAAM,EAAE,EAAC,KAAK,EAAE,EAAC,MAAM,EAAE,aAAa,EAAC,EAAC;KACjC,CAAC;AACZ,CAAC","sourcesContent":["import type {Spec} from '@uwdata/mosaic-spec';\nimport {HistogramChartSettings} from './schema';\nimport {SpecGenerationError} from '../errors';\n\nconst BG_COLOR = 'var(--color-chart-overlay)';\nconst FG_COLOR = 'var(--color-chart-1)';\n\nexport function createHistogramSpec(\n tableName: string,\n {field}: HistogramChartSettings,\n): Spec {\n if (!field) {\n throw new SpecGenerationError('Field is required for histogram');\n }\n\n return {\n plot: [\n {\n mark: 'rectY',\n data: {from: tableName},\n x: {bin: field, maxbins: 40},\n y: {count: null},\n fill: BG_COLOR,\n inset: 0.5,\n },\n {\n mark: 'rectY',\n data: {from: tableName, filterBy: '$brush'},\n x: {bin: field, maxbins: 40},\n y: {count: null},\n fill: FG_COLOR,\n inset: 0.5,\n },\n {select: 'intervalX', as: '$brush'},\n ],\n xLabel: field,\n yLabel: 'Count',\n height: 200,\n width: 380,\n margins: {left: 50, right: 20, top: 20, bottom: 50},\n params: {brush: {select: 'crossfilter'}},\n } as Spec;\n}\n"]}
1
+ {"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../src/chart-types/histogram/spec.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,kBAAkB,EAAC,MAAM,UAAU,CAAC;AACpE,OAAO,EAAC,mBAAmB,EAAC,MAAM,WAAW,CAAC;AAE9C,MAAM,QAAQ,GAAG,4BAA4B,CAAC;AAC9C,MAAM,QAAQ,GAAG,sBAAsB,CAAC;AAExC,MAAM,UAAU,mBAAmB,CACjC,SAAiB,EACjB,EAAC,KAAK,EAAE,OAAO,GAAG,kBAAkB,EAAyB;IAE7D,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,mBAAmB,CAAC,iCAAiC,CAAC,CAAC;IACnE,CAAC;IAED,OAAO;QACL,IAAI,EAAE;YACJ;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,EAAC,IAAI,EAAE,SAAS,EAAC;gBACvB,CAAC,EAAE,EAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAC;gBAC/B,CAAC,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC;gBAChB,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,GAAG;aACX;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,EAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAC;gBAC3C,CAAC,EAAE,EAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAC;gBAC/B,CAAC,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC;gBAChB,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,GAAG;aACX;YACD,EAAC,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAC;SACpC;QACD,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,OAAO;QACf,MAAM,EAAE,GAAG;QACX,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,EAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAC;QACnD,MAAM,EAAE,EAAC,KAAK,EAAE,EAAC,MAAM,EAAE,aAAa,EAAC,EAAC;KACjC,CAAC;AACZ,CAAC","sourcesContent":["import type {Spec} from '@uwdata/mosaic-spec';\nimport {HistogramChartSettings, DEFAULT_BINS_COUNT} from './schema';\nimport {SpecGenerationError} from '../errors';\n\nconst BG_COLOR = 'var(--color-chart-overlay)';\nconst FG_COLOR = 'var(--color-chart-1)';\n\nexport function createHistogramSpec(\n tableName: string,\n {field, maxBins = DEFAULT_BINS_COUNT}: HistogramChartSettings,\n): Spec {\n if (!field) {\n throw new SpecGenerationError('Field is required for histogram');\n }\n\n return {\n plot: [\n {\n mark: 'rectY',\n data: {from: tableName},\n x: {bin: field, steps: maxBins},\n y: {count: null},\n fill: BG_COLOR,\n inset: 0.5,\n },\n {\n mark: 'rectY',\n data: {from: tableName, filterBy: '$brush'},\n x: {bin: field, steps: maxBins},\n y: {count: null},\n fill: FG_COLOR,\n inset: 0.5,\n },\n {select: 'intervalX', as: '$brush'},\n ],\n xLabel: field,\n yLabel: 'Count',\n height: 200,\n width: 380,\n margins: {left: 50, right: 20, top: 20, bottom: 50},\n params: {brush: {select: 'crossfilter'}},\n } as Spec;\n}\n"]}
@@ -1,34 +1,32 @@
1
1
  import { z } from 'zod';
2
- import type { ChartToolDeps } from '../base-types';
2
+ import type { DashboardToolDeps } from '../base-types';
3
3
  export declare const HistogramToolParameters: z.ZodObject<{
4
4
  artifactId: z.ZodOptional<z.ZodString>;
5
5
  tableName: z.ZodOptional<z.ZodString>;
6
6
  createArtifactIfMissing: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
7
+ panelId: z.ZodOptional<z.ZodString>;
7
8
  reasoning: z.ZodString;
8
9
  settings: z.ZodObject<{
9
10
  field: z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
11
+ maxBins: z.ZodNonOptional<z.ZodOptional<z.ZodDefault<z.ZodNumber>>>;
10
12
  }, z.core.$strip>;
11
13
  }, z.core.$strip>;
12
14
  export type HistogramToolParams = z.infer<typeof HistogramToolParameters>;
13
- export declare function createHistogramAiTool(deps: ChartToolDeps): import("ai").Tool<{
15
+ export declare function createHistogramAiTool(deps: DashboardToolDeps): import("ai").Tool<{
14
16
  createArtifactIfMissing: boolean;
15
17
  reasoning: string;
16
18
  settings: {
17
19
  field: string;
20
+ maxBins: number;
18
21
  };
19
22
  artifactId?: string | undefined;
20
23
  tableName?: string | undefined;
24
+ panelId?: string | undefined;
21
25
  }, {
22
26
  llmResult: {
23
27
  success: boolean;
24
28
  details: string;
25
- data: {
26
- panelId: string;
27
- artifactId: string;
28
- tableName: string;
29
- title: string;
30
- config: any;
31
- };
29
+ data: import("..").PanelResult;
32
30
  errorMessage?: undefined;
33
31
  };
34
32
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../src/chart-types/histogram/tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,eAAe,CAAC;AAIjD,eAAO,MAAM,uBAAuB;;;;;;;;iBAElC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE1E,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDxD"}
1
+ {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../src/chart-types/histogram/tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAQtB,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAKrD,eAAO,MAAM,uBAAuB;;;;;;;;;;iBAElC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE1E,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;GAqE5D"}
@@ -1,8 +1,9 @@
1
1
  import { tool } from 'ai';
2
- import { HistogramChartSettings } from './schema';
2
+ import { HistogramChartSettings, MIN_BINS_COUNT, MAX_BINS_COUNT, DEFAULT_BINS_COUNT, } from './schema';
3
3
  import { BaseChartToolParameters } from '../tool-schemas';
4
4
  import { validateColumnExists } from '../tool-validation';
5
5
  import { QUANTITATIVE_COLUMN_TYPES } from '../../chart-builders/constants';
6
+ import { createOrUpdateChartPanel } from '../tool-helpers';
6
7
  export const HistogramToolParameters = BaseChartToolParameters.extend({
7
8
  settings: HistogramChartSettings.required(),
8
9
  });
@@ -15,28 +16,37 @@ Example queries: "distribution of population density", "show elevation distribut
15
16
 
16
17
  Required: field must be quantitative not text/categorical: (${QUANTITATIVE_COLUMN_TYPES.join(', ')}).
17
18
 
19
+ NOTE: Histograms automatically bin data into ranges and aggregate counts, so they handle large datasets efficiently (no data point limit).
20
+
21
+ To UPDATE an existing histogram: provide the panelId parameter. Otherwise creates new panel.
22
+
23
+ Optional: maxBins (${MIN_BINS_COUNT}-${MAX_BINS_COUNT}, default ${DEFAULT_BINS_COUNT}) controls the number of bins/bars in the histogram. Use fewer bins for coarse overview, more bins for detailed distribution.
24
+
18
25
  CRITICAL: Only for quantitative continuous data to see distribution shape, outliers, skewness.
19
26
  Do NOT use for: categorical data (use count-plot), relationships between columns (use bubble-chart), time series trends (use line-chart).`,
20
27
  inputSchema: HistogramToolParameters,
21
28
  execute: async (params, context) => {
22
29
  try {
23
- const { artifactId, tableName, columns } = deps.resolveResources(params, context);
30
+ const artifactId = deps.resolveArtifact(params.artifactId, params.createArtifactIfMissing, context);
31
+ const { tableName, columns } = deps.resolveTable(artifactId, params.tableName);
24
32
  // Validate settings
25
33
  validateColumnExists(params.settings.field, QUANTITATIVE_COLUMN_TYPES, columns, 'field');
26
- const title = `Histogram of ${params.settings.field}`;
27
- const result = deps.createChart({
28
- artifactId,
34
+ const result = createOrUpdateChartPanel(deps, {
35
+ panelId: params.panelId,
36
+ dashboardId: artifactId,
29
37
  tableName,
38
+ title: `Histogram of ${params.settings.field}`,
30
39
  config: {
31
40
  chartType: 'histogram',
32
41
  settings: params.settings,
33
42
  },
34
- title,
35
43
  });
36
44
  return {
37
45
  llmResult: {
38
46
  success: true,
39
- details: `Created histogram "${result.title}".`,
47
+ details: params.panelId
48
+ ? `Updated histogram "${result.title}".`
49
+ : `Created histogram "${result.title}".`,
40
50
  data: result,
41
51
  },
42
52
  };
@@ -1 +1 @@
1
- {"version":3,"file":"tool.js","sourceRoot":"","sources":["../../../src/chart-types/histogram/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,IAAI,CAAC;AAExB,OAAO,EAAC,sBAAsB,EAAC,MAAM,UAAU,CAAC;AAChD,OAAO,EAAC,uBAAuB,EAAC,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAC,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAC,yBAAyB,EAAC,MAAM,gCAAgC,CAAC;AAEzE,MAAM,CAAC,MAAM,uBAAuB,GAAG,uBAAuB,CAAC,MAAM,CAAC;IACpE,QAAQ,EAAE,sBAAsB,CAAC,QAAQ,EAAE;CAC5C,CAAC,CAAC;AAIH,MAAM,UAAU,qBAAqB,CAAC,IAAmB;IACvD,OAAO,IAAI,CAAC;QACV,WAAW,EAAE;;;;;8DAK6C,yBAAyB,CAAC,IAAI,CAAC,IAAI,CAAC;;;0IAGwC;QACtI,WAAW,EAAE,uBAAuB;QACpC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;YACjC,IAAI,CAAC;gBACH,MAAM,EAAC,UAAU,EAAE,SAAS,EAAE,OAAO,EAAC,GAAG,IAAI,CAAC,gBAAgB,CAC5D,MAAM,EACN,OAAO,CACR,CAAC;gBAEF,oBAAoB;gBACpB,oBAAoB,CAClB,MAAM,CAAC,QAAQ,CAAC,KAAK,EACrB,yBAAyB,EACzB,OAAO,EACP,OAAO,CACR,CAAC;gBAEF,MAAM,KAAK,GAAG,gBAAgB,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;gBAEtD,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC;oBAC9B,UAAU;oBACV,SAAS;oBACT,MAAM,EAAE;wBACN,SAAS,EAAE,WAAW;wBACtB,QAAQ,EAAE,MAAM,CAAC,QAAQ;qBAC1B;oBACD,KAAK;iBACN,CAAC,CAAC;gBAEH,OAAO;oBACL,SAAS,EAAE;wBACT,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE,sBAAsB,MAAM,CAAC,KAAK,IAAI;wBAC/C,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 {HistogramChartSettings} from './schema';\nimport {BaseChartToolParameters} from '../tool-schemas';\nimport type {ChartToolDeps} from '../base-types';\nimport {validateColumnExists} from '../tool-validation';\nimport {QUANTITATIVE_COLUMN_TYPES} from '../../chart-builders/constants';\n\nexport const HistogramToolParameters = BaseChartToolParameters.extend({\n settings: HistogramChartSettings.required(),\n});\n\nexport type HistogramToolParams = z.infer<typeof HistogramToolParameters>;\n\nexport function createHistogramAiTool(deps: ChartToolDeps) {\n return tool({\n description: `Histogram: shows distribution of numeric values by automatically grouping data into bins/ranges.\n\nUse when: user asks about \"distribution of [numeric column]\", \"spread of\", \"range of\", \"how values are distributed\", \"show histogram\".\nExample queries: \"distribution of population density\", \"show elevation distribution\", \"histogram of parcel areas\", \"how are building heights spread\", \"temperature range distribution\".\n\nRequired: field must be quantitative not text/categorical: (${QUANTITATIVE_COLUMN_TYPES.join(', ')}).\n\nCRITICAL: Only for quantitative continuous data to see distribution shape, outliers, skewness.\nDo NOT use for: categorical data (use count-plot), relationships between columns (use bubble-chart), time series trends (use line-chart).`,\n inputSchema: HistogramToolParameters,\n execute: async (params, context) => {\n try {\n const {artifactId, tableName, columns} = deps.resolveResources(\n params,\n context,\n );\n\n // Validate settings\n validateColumnExists(\n params.settings.field,\n QUANTITATIVE_COLUMN_TYPES,\n columns,\n 'field',\n );\n\n const title = `Histogram of ${params.settings.field}`;\n\n const result = deps.createChart({\n artifactId,\n tableName,\n config: {\n chartType: 'histogram',\n settings: params.settings,\n },\n title,\n });\n\n return {\n llmResult: {\n success: true,\n details: `Created histogram \"${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/chart-types/histogram/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,IAAI,CAAC;AAExB,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,cAAc,EACd,kBAAkB,GACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAC,uBAAuB,EAAC,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAC,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAC,yBAAyB,EAAC,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAC,wBAAwB,EAAC,MAAM,iBAAiB,CAAC;AAEzD,MAAM,CAAC,MAAM,uBAAuB,GAAG,uBAAuB,CAAC,MAAM,CAAC;IACpE,QAAQ,EAAE,sBAAsB,CAAC,QAAQ,EAAE;CAC5C,CAAC,CAAC;AAIH,MAAM,UAAU,qBAAqB,CAAC,IAAuB;IAC3D,OAAO,IAAI,CAAC;QACV,WAAW,EAAE;;;;;8DAK6C,yBAAyB,CAAC,IAAI,CAAC,IAAI,CAAC;;;;;;qBAM7E,cAAc,IAAI,cAAc,aAAa,kBAAkB;;;0IAGsD;QACtI,WAAW,EAAE,uBAAuB;QACpC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;YACjC,IAAI,CAAC;gBACH,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,CACrC,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,uBAAuB,EAC9B,OAAO,CACR,CAAC;gBACF,MAAM,EAAC,SAAS,EAAE,OAAO,EAAC,GAAG,IAAI,CAAC,YAAY,CAC5C,UAAU,EACV,MAAM,CAAC,SAAS,CACjB,CAAC;gBAEF,oBAAoB;gBACpB,oBAAoB,CAClB,MAAM,CAAC,QAAQ,CAAC,KAAK,EACrB,yBAAyB,EACzB,OAAO,EACP,OAAO,CACR,CAAC;gBAEF,MAAM,MAAM,GAAG,wBAAwB,CAAC,IAAI,EAAE;oBAC5C,OAAO,EAAE,MAAM,CAAC,OAAO;oBACvB,WAAW,EAAE,UAAU;oBACvB,SAAS;oBACT,KAAK,EAAE,gBAAgB,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE;oBAC9C,MAAM,EAAE;wBACN,SAAS,EAAE,WAAW;wBACtB,QAAQ,EAAE,MAAM,CAAC,QAAQ;qBAC1B;iBACF,CAAC,CAAC;gBAEH,OAAO;oBACL,SAAS,EAAE;wBACT,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE,MAAM,CAAC,OAAO;4BACrB,CAAC,CAAC,sBAAsB,MAAM,CAAC,KAAK,IAAI;4BACxC,CAAC,CAAC,sBAAsB,MAAM,CAAC,KAAK,IAAI;wBAC1C,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 {\n HistogramChartSettings,\n MIN_BINS_COUNT,\n MAX_BINS_COUNT,\n DEFAULT_BINS_COUNT,\n} from './schema';\nimport {BaseChartToolParameters} from '../tool-schemas';\nimport type {DashboardToolDeps} from '../base-types';\nimport {validateColumnExists} from '../tool-validation';\nimport {QUANTITATIVE_COLUMN_TYPES} from '../../chart-builders/constants';\nimport {createOrUpdateChartPanel} from '../tool-helpers';\n\nexport const HistogramToolParameters = BaseChartToolParameters.extend({\n settings: HistogramChartSettings.required(),\n});\n\nexport type HistogramToolParams = z.infer<typeof HistogramToolParameters>;\n\nexport function createHistogramAiTool(deps: DashboardToolDeps) {\n return tool({\n description: `Histogram: shows distribution of numeric values by automatically grouping data into bins/ranges.\n\nUse when: user asks about \"distribution of [numeric column]\", \"spread of\", \"range of\", \"how values are distributed\", \"show histogram\".\nExample queries: \"distribution of population density\", \"show elevation distribution\", \"histogram of parcel areas\", \"how are building heights spread\", \"temperature range distribution\".\n\nRequired: field must be quantitative not text/categorical: (${QUANTITATIVE_COLUMN_TYPES.join(', ')}).\n\nNOTE: Histograms automatically bin data into ranges and aggregate counts, so they handle large datasets efficiently (no data point limit).\n\nTo UPDATE an existing histogram: provide the panelId parameter. Otherwise creates new panel.\n\nOptional: maxBins (${MIN_BINS_COUNT}-${MAX_BINS_COUNT}, default ${DEFAULT_BINS_COUNT}) controls the number of bins/bars in the histogram. Use fewer bins for coarse overview, more bins for detailed distribution.\n\nCRITICAL: Only for quantitative continuous data to see distribution shape, outliers, skewness.\nDo NOT use for: categorical data (use count-plot), relationships between columns (use bubble-chart), time series trends (use line-chart).`,\n inputSchema: HistogramToolParameters,\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.field,\n QUANTITATIVE_COLUMN_TYPES,\n columns,\n 'field',\n );\n\n const result = createOrUpdateChartPanel(deps, {\n panelId: params.panelId,\n dashboardId: artifactId,\n tableName,\n title: `Histogram of ${params.settings.field}`,\n config: {\n chartType: 'histogram',\n settings: params.settings,\n },\n });\n\n return {\n llmResult: {\n success: true,\n details: params.panelId\n ? `Updated histogram \"${result.title}\".`\n : `Created histogram \"${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"]}