@akohn/dashql-react 0.0.0-stage → 0.0.20-dev.1001.g5e5121808

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 (356) hide show
  1. package/LICENSE +373 -0
  2. package/NOTICE +118 -0
  3. package/README.md +133 -2
  4. package/dist/_virtual/_vite/preload-helper.js +100 -0
  5. package/dist/brand/brand.d.ts +13 -0
  6. package/dist/brand/brand.js +14 -0
  7. package/dist/brand/landing_backdrop.d.ts +56 -0
  8. package/dist/brand/landing_backdrop.js +1019 -0
  9. package/dist/brand/wobble_morph.d.ts +54 -0
  10. package/dist/brand/wobble_morph.js +439 -0
  11. package/dist/components/action_list.d.ts +31 -0
  12. package/dist/components/action_list.js +63 -0
  13. package/dist/components/action_list.module.js +11 -0
  14. package/dist/components/anchored_overlay.d.ts +28 -0
  15. package/dist/components/anchored_overlay.js +93 -0
  16. package/dist/components/button.d.ts +42 -0
  17. package/dist/components/button.js +97 -0
  18. package/dist/components/button.module.js +20 -0
  19. package/dist/components/button_group.d.ts +7 -0
  20. package/dist/components/button_group.js +18 -0
  21. package/dist/components/button_group.module.js +3 -0
  22. package/dist/components/card_placeholder.d.ts +9 -0
  23. package/dist/components/card_placeholder.js +39 -0
  24. package/dist/components/card_placeholder.module.js +6 -0
  25. package/dist/components/clipboard.d.ts +19 -0
  26. package/dist/components/clipboard.js +54 -0
  27. package/dist/components/data_table/computation_tables.d.ts +12 -0
  28. package/dist/components/data_table/computation_tables.js +42 -0
  29. package/dist/components/data_table/data_table.d.ts +39 -0
  30. package/dist/components/data_table/data_table.js +415 -0
  31. package/dist/components/data_table/data_table.module.js +41 -0
  32. package/dist/components/data_table/data_table_cell.d.ts +7 -0
  33. package/dist/components/data_table/data_table_cell.js +9 -0
  34. package/dist/components/data_table/data_table_cell_data.d.ts +22 -0
  35. package/dist/components/data_table/data_table_cell_data.js +103 -0
  36. package/dist/components/data_table/data_table_cell_header_name.d.ts +17 -0
  37. package/dist/components/data_table/data_table_cell_header_name.js +73 -0
  38. package/dist/components/data_table/data_table_cell_header_plots.d.ts +29 -0
  39. package/dist/components/data_table/data_table_cell_header_plots.js +120 -0
  40. package/dist/components/data_table/data_table_colors.d.ts +19 -0
  41. package/dist/components/data_table/data_table_colors.js +27 -0
  42. package/dist/components/data_table/data_table_column_resize.d.ts +21 -0
  43. package/dist/components/data_table/data_table_column_resize.js +121 -0
  44. package/dist/components/data_table/data_table_focus.d.ts +15 -0
  45. package/dist/components/data_table/data_table_focus.js +53 -0
  46. package/dist/components/data_table/data_table_layout.d.ts +18 -0
  47. package/dist/components/data_table/data_table_layout.js +103 -0
  48. package/dist/components/data_table/data_table_ordering.d.ts +9 -0
  49. package/dist/components/data_table/data_table_ordering.js +39 -0
  50. package/dist/components/data_table/data_table_portals.d.ts +9 -0
  51. package/dist/components/data_table/data_table_portals.js +29 -0
  52. package/dist/components/data_table/data_table_row_detail.d.ts +22 -0
  53. package/dist/components/data_table/data_table_row_detail.js +68 -0
  54. package/dist/components/data_table/data_table_row_detail.module.js +7 -0
  55. package/dist/components/data_table/data_table_sticky_views.d.ts +35 -0
  56. package/dist/components/data_table/data_table_sticky_views.js +161 -0
  57. package/dist/components/data_table/data_table_window.d.ts +18 -0
  58. package/dist/components/data_table/data_table_window.js +118 -0
  59. package/dist/components/data_table/format_peek.d.ts +2 -0
  60. package/dist/components/data_table/format_peek.js +17 -0
  61. package/dist/components/data_table/histogram_bars.d.ts +36 -0
  62. package/dist/components/data_table/histogram_bars.js +100 -0
  63. package/dist/components/data_table/histogram_brush.d.ts +22 -0
  64. package/dist/components/data_table/histogram_brush.js +105 -0
  65. package/dist/components/data_table/histogram_cell.d.ts +17 -0
  66. package/dist/components/data_table/histogram_cell.js +324 -0
  67. package/dist/components/data_table/histogram_cell.module.js +9 -0
  68. package/dist/components/data_table/histogram_label.d.ts +1 -0
  69. package/dist/components/data_table/histogram_label.js +7 -0
  70. package/dist/components/data_table/memo_props.d.ts +1 -0
  71. package/dist/components/data_table/memo_props.js +17 -0
  72. package/dist/components/data_table/mostfrequent_cell.d.ts +17 -0
  73. package/dist/components/data_table/mostfrequent_cell.js +316 -0
  74. package/dist/components/data_table/mostfrequent_cell.module.js +10 -0
  75. package/dist/components/data_table/use_cross_filters.d.ts +14 -0
  76. package/dist/components/data_table/use_cross_filters.js +47 -0
  77. package/dist/components/deferred.d.ts +11 -0
  78. package/dist/components/deferred.js +41 -0
  79. package/dist/components/deferred.module.js +5 -0
  80. package/dist/components/error_boundary.d.ts +18 -0
  81. package/dist/components/error_boundary.js +15 -0
  82. package/dist/components/graph.module.js +15 -0
  83. package/dist/components/graph_port.d.ts +10 -0
  84. package/dist/components/graph_port.js +34 -0
  85. package/dist/components/inspector_overlay.d.ts +32 -0
  86. package/dist/components/inspector_overlay.js +72 -0
  87. package/dist/components/inspector_overlay.module.js +18 -0
  88. package/dist/components/json/json_arrow_symbol.d.ts +4 -0
  89. package/dist/components/json/json_arrow_symbol.js +25 -0
  90. package/dist/components/json/json_copy_button.d.ts +11 -0
  91. package/dist/components/json/json_copy_button.js +61 -0
  92. package/dist/components/json/json_ellipsis_symbol.d.ts +7 -0
  93. package/dist/components/json/json_ellipsis_symbol.js +11 -0
  94. package/dist/components/json/json_item_count.d.ts +5 -0
  95. package/dist/components/json/json_item_count.js +12 -0
  96. package/dist/components/json/json_key_name.d.ts +6 -0
  97. package/dist/components/json/json_key_name.js +40 -0
  98. package/dist/components/json/json_key_values.d.ts +12 -0
  99. package/dist/components/json/json_key_values.js +99 -0
  100. package/dist/components/json/json_literal.d.ts +8 -0
  101. package/dist/components/json/json_literal.js +140 -0
  102. package/dist/components/json/json_nested_close.d.ts +11 -0
  103. package/dist/components/json/json_nested_close.js +31 -0
  104. package/dist/components/json/json_nested_open.d.ts +18 -0
  105. package/dist/components/json/json_nested_open.js +150 -0
  106. package/dist/components/json/json_nested_state.d.ts +14 -0
  107. package/dist/components/json/json_nested_state.js +28 -0
  108. package/dist/components/json/json_tool_state.d.ts +18 -0
  109. package/dist/components/json/json_tool_state.js +46 -0
  110. package/dist/components/json/json_value.d.ts +10 -0
  111. package/dist/components/json/json_value.js +46 -0
  112. package/dist/components/json/json_view.d.ts +14 -0
  113. package/dist/components/json/json_view.js +37 -0
  114. package/dist/components/json/json_view.module.js +41 -0
  115. package/dist/components/json/json_view_state.d.ts +14 -0
  116. package/dist/components/json/json_view_state.js +32 -0
  117. package/dist/components/json/unique_key.d.ts +1 -0
  118. package/dist/components/json/unique_key.js +8 -0
  119. package/dist/components/keyvalue_list.d.ts +25 -0
  120. package/dist/components/keyvalue_list.js +106 -0
  121. package/dist/components/keyvalue_list.module.js +15 -0
  122. package/dist/components/name_input.d.ts +12 -0
  123. package/dist/components/name_input.js +63 -0
  124. package/dist/components/overlay.d.ts +53 -0
  125. package/dist/components/overlay.js +183 -0
  126. package/dist/components/overlay.module.js +32 -0
  127. package/dist/components/panel_resize_handle.d.ts +12 -0
  128. package/dist/components/panel_resize_handle.js +39 -0
  129. package/dist/components/portal.d.ts +8 -0
  130. package/dist/components/portal.js +53 -0
  131. package/dist/components/progress_bar.d.ts +7 -0
  132. package/dist/components/progress_bar.js +21 -0
  133. package/dist/components/progress_bar.module.js +3 -0
  134. package/dist/components/query_history_viewer.d.ts +31 -0
  135. package/dist/components/query_history_viewer.js +271 -0
  136. package/dist/components/query_history_viewer.module.js +7 -0
  137. package/dist/components/query_profile/engine_profile_view.d.ts +19 -0
  138. package/dist/components/query_profile/engine_profile_view.js +94 -0
  139. package/dist/components/query_profile/numeric_limits.d.ts +1 -0
  140. package/dist/components/query_profile/numeric_limits.js +2 -0
  141. package/dist/components/query_profile/profile_execution_controller.d.ts +12 -0
  142. package/dist/components/query_profile/profile_execution_controller.js +44 -0
  143. package/dist/components/query_profile/profile_fit.d.ts +24 -0
  144. package/dist/components/query_profile/profile_fit.js +22 -0
  145. package/dist/components/query_profile/profile_navigation.d.ts +3 -0
  146. package/dist/components/query_profile/profile_navigation.js +34 -0
  147. package/dist/components/query_profile/profile_scene.d.ts +64 -0
  148. package/dist/components/query_profile/profile_scene.js +422 -0
  149. package/dist/components/query_profile/query_profile_view.d.ts +36 -0
  150. package/dist/components/query_profile/query_profile_view.js +953 -0
  151. package/dist/components/query_profile/query_profile_view.module.js +23 -0
  152. package/dist/components/query_progress/query_profile_overlay.d.ts +7 -0
  153. package/dist/components/query_progress/query_profile_overlay.js +67 -0
  154. package/dist/components/query_progress/query_profile_overlay.module.js +6 -0
  155. package/dist/components/query_progress/query_progress_panel.d.ts +14 -0
  156. package/dist/components/query_progress/query_progress_panel.js +255 -0
  157. package/dist/components/query_progress/query_progress_panel.module.js +10 -0
  158. package/dist/components/query_result/cell_detail_overlay.d.ts +34 -0
  159. package/dist/components/query_result/cell_detail_overlay.js +277 -0
  160. package/dist/components/query_result/cell_detail_overlay.module.js +21 -0
  161. package/dist/components/query_result/query_result_action_menu.d.ts +12 -0
  162. package/dist/components/query_result/query_result_action_menu.js +62 -0
  163. package/dist/components/query_result/query_result_action_menu.module.js +2 -0
  164. package/dist/components/query_result/query_result_details.d.ts +17 -0
  165. package/dist/components/query_result/query_result_details.js +46 -0
  166. package/dist/components/query_result/query_result_details.module.js +5 -0
  167. package/dist/components/query_result/query_result_download_button.d.ts +8 -0
  168. package/dist/components/query_result/query_result_download_button.js +38 -0
  169. package/dist/components/query_result/query_result_header.d.ts +21 -0
  170. package/dist/components/query_result/query_result_header.js +72 -0
  171. package/dist/components/query_result/query_result_header.module.js +3 -0
  172. package/dist/components/query_result/query_result_search_controls.d.ts +12 -0
  173. package/dist/components/query_result/query_result_search_controls.js +141 -0
  174. package/dist/components/query_result/query_result_search_controls.module.js +7 -0
  175. package/dist/components/query_result/query_result_toolbar.d.ts +21 -0
  176. package/dist/components/query_result/query_result_toolbar.js +74 -0
  177. package/dist/components/query_result/result_table_overlay.d.ts +9 -0
  178. package/dist/components/query_result/result_table_overlay.js +73 -0
  179. package/dist/components/query_result/result_table_overlay.module.js +6 -0
  180. package/dist/components/query_result/use_query_result_search.d.ts +8 -0
  181. package/dist/components/query_result/use_query_result_search.js +28 -0
  182. package/dist/components/segmented_control.d.ts +58 -0
  183. package/dist/components/segmented_control.js +116 -0
  184. package/dist/components/segmented_control.module.js +17 -0
  185. package/dist/components/separator.d.ts +21 -0
  186. package/dist/components/separator.js +79 -0
  187. package/dist/components/separator.module.js +7 -0
  188. package/dist/components/sheet.d.ts +11 -0
  189. package/dist/components/sheet.js +65 -0
  190. package/dist/components/sheet.module.js +7 -0
  191. package/dist/components/size_observer.d.ts +7 -0
  192. package/dist/components/size_observer.js +57 -0
  193. package/dist/components/skeleton.d.ts +2 -0
  194. package/dist/components/skeleton.js +14 -0
  195. package/dist/components/skeleton.module.js +2 -0
  196. package/dist/components/spinners.d.ts +8 -0
  197. package/dist/components/spinners.js +33 -0
  198. package/dist/components/spinners.module.js +8 -0
  199. package/dist/components/status_indicator.d.ts +36 -0
  200. package/dist/components/status_indicator.js +182 -0
  201. package/dist/components/status_indicator.module.js +3 -0
  202. package/dist/components/symbol_icon.d.ts +65 -0
  203. package/dist/components/symbol_icon.js +213 -0
  204. package/dist/components/tab_header.d.ts +11 -0
  205. package/dist/components/tab_header.js +55 -0
  206. package/dist/components/tab_header.module.js +7 -0
  207. package/dist/components/tag.d.ts +10 -0
  208. package/dist/components/tag.js +17 -0
  209. package/dist/components/tag.module.js +4 -0
  210. package/dist/components/text_field.d.ts +44 -0
  211. package/dist/components/text_field.js +159 -0
  212. package/dist/components/text_field.module.js +15 -0
  213. package/dist/components/text_input.d.ts +25 -0
  214. package/dist/components/text_input.js +90 -0
  215. package/dist/components/text_input.module.js +13 -0
  216. package/dist/components/text_input_action.d.ts +19 -0
  217. package/dist/components/text_input_action.js +33 -0
  218. package/dist/components/text_input_action.module.js +2 -0
  219. package/dist/components/toggle_switch.d.ts +7 -0
  220. package/dist/components/toggle_switch.js +22 -0
  221. package/dist/components/toggle_switch.module.js +6 -0
  222. package/dist/components/tooltip.d.ts +22 -0
  223. package/dist/components/tooltip.js +139 -0
  224. package/dist/components/tooltip.module.js +2 -0
  225. package/dist/components/tree_entry.d.ts +17 -0
  226. package/dist/components/tree_entry.js +48 -0
  227. package/dist/components/tree_entry.module.js +9 -0
  228. package/dist/components/value_list.d.ts +17 -0
  229. package/dist/components/value_list.js +70 -0
  230. package/dist/components/value_list.module.js +8 -0
  231. package/dist/components/vegalite_chart.d.ts +16 -0
  232. package/dist/components/vegalite_chart.js +149 -0
  233. package/dist/components/vegalite_chart.module.js +3 -0
  234. package/dist/components/vegalite_view.d.ts +26 -0
  235. package/dist/components/vegalite_view.js +239 -0
  236. package/dist/components/vegalite_view.module.js +5 -0
  237. package/dist/components/vertical_scroll_shadows.d.ts +14 -0
  238. package/dist/components/vertical_scroll_shadows.js +55 -0
  239. package/dist/components/vertical_scroll_shadows.module.js +5 -0
  240. package/dist/components/vertical_split.d.ts +15 -0
  241. package/dist/components/vertical_split.js +112 -0
  242. package/dist/components/vertical_split.module.js +5 -0
  243. package/dist/components/vertical_tabs.d.ts +36 -0
  244. package/dist/components/vertical_tabs.js +169 -0
  245. package/dist/components/vertical_tabs.module.js +23 -0
  246. package/dist/components/visualization/capped_rows.d.ts +9 -0
  247. package/dist/components/visualization/capped_rows.js +23 -0
  248. package/dist/components/visualization/capped_rows.module.js +3 -0
  249. package/dist/components/visualization/chart_download_button.d.ts +12 -0
  250. package/dist/components/visualization/chart_download_button.js +41 -0
  251. package/dist/components/visualization/kpi_view.d.ts +10 -0
  252. package/dist/components/visualization/kpi_view.js +215 -0
  253. package/dist/components/visualization/kpi_view.module.js +17 -0
  254. package/dist/components/visualization/markdown_view.d.ts +17 -0
  255. package/dist/components/visualization/markdown_view.js +154 -0
  256. package/dist/components/visualization/markdown_view.module.js +4 -0
  257. package/dist/components/visualization/result_rows.d.ts +17 -0
  258. package/dist/components/visualization/result_rows.js +82 -0
  259. package/dist/components/visualization/vegalite_preview.d.ts +8 -0
  260. package/dist/components/visualization/vegalite_preview.js +17 -0
  261. package/dist/components/visualization/vegalite_preview.module.js +2 -0
  262. package/dist/components/visualization/visualization_dispatch.d.ts +13 -0
  263. package/dist/components/visualization/visualization_dispatch.js +40 -0
  264. package/dist/components/visualization/visualization_panel.d.ts +10 -0
  265. package/dist/components/visualization/visualization_panel.js +36 -0
  266. package/dist/components/visualization/visualization_panel.module.js +3 -0
  267. package/dist/dom/anchored_position.d.ts +42 -0
  268. package/dist/dom/anchored_position.js +255 -0
  269. package/dist/dom/app_host.d.ts +2 -0
  270. package/dist/dom/app_host.js +7 -0
  271. package/dist/dom/calm_frames.d.ts +29 -0
  272. package/dist/dom/calm_frames.js +120 -0
  273. package/dist/dom/classnames.d.ts +8 -0
  274. package/dist/dom/classnames.js +20 -0
  275. package/dist/dom/download_file.d.ts +1 -0
  276. package/dist/dom/download_file.js +12 -0
  277. package/dist/dom/focus.d.ts +29 -0
  278. package/dist/dom/focus.js +84 -0
  279. package/dist/dom/graph_edges.d.ts +53 -0
  280. package/dist/dom/graph_edges.js +450 -0
  281. package/dist/dom/key_events.d.ts +9 -0
  282. package/dist/dom/key_events.js +33 -0
  283. package/dist/dom/media_query.d.ts +5 -0
  284. package/dist/dom/media_query.js +18 -0
  285. package/dist/dom/outside_click.d.ts +8 -0
  286. package/dist/dom/outside_click.js +32 -0
  287. package/dist/dom/rerender_ref.d.ts +2 -0
  288. package/dist/dom/rerender_ref.js +11 -0
  289. package/dist/dom/row_context_menu.d.ts +7 -0
  290. package/dist/dom/row_context_menu.js +32 -0
  291. package/dist/dom/scrollbar.d.ts +3 -0
  292. package/dist/dom/scrollbar.js +23 -0
  293. package/dist/format/format.d.ts +11 -0
  294. package/dist/format/format.js +72 -0
  295. package/dist/format/query_progress_format.d.ts +17 -0
  296. package/dist/format/query_progress_format.js +69 -0
  297. package/dist/format/time_format.d.ts +5 -0
  298. package/dist/format/time_format.js +45 -0
  299. package/dist/hooks.d.ts +72 -0
  300. package/dist/hooks.js +305 -0
  301. package/dist/host.d.ts +10 -0
  302. package/dist/host.js +12 -0
  303. package/dist/logger.d.ts +4 -0
  304. package/dist/logger.js +13 -0
  305. package/dist/models/computation_model.d.ts +14 -0
  306. package/dist/models/computation_model.js +27 -0
  307. package/dist/models/query_model.d.ts +12 -0
  308. package/dist/models/query_model.js +27 -0
  309. package/dist/models/script_model.d.ts +17 -0
  310. package/dist/models/script_model.js +59 -0
  311. package/dist/platform/content_length.d.ts +1 -0
  312. package/dist/platform/content_length.js +7 -0
  313. package/dist/platform/core_provider.d.ts +18 -0
  314. package/dist/platform/core_provider.js +106 -0
  315. package/dist/platform/embedded_database_provider.d.ts +19 -0
  316. package/dist/platform/embedded_database_provider.js +53 -0
  317. package/dist/platform/page_runtime.d.ts +3 -0
  318. package/dist/platform/page_runtime.js +29 -0
  319. package/dist/style.css +4386 -0
  320. package/dist/svg_symbols.d.ts +2 -0
  321. package/dist/svg_symbols.js +2 -0
  322. package/dist/symbols.svg +1197 -0
  323. package/dist/theme/color_scheme.d.ts +4 -0
  324. package/dist/theme/color_scheme.js +28 -0
  325. package/dist/theme/xcode_palette.d.ts +22 -0
  326. package/dist/theme/xcode_palette.js +4 -0
  327. package/dist/theme/xcode_palettes.js +41 -0
  328. package/dist/utils/plan_engine.d.ts +2 -0
  329. package/dist/utils/plan_engine.js +13 -0
  330. package/dist/vegalite/vegalite_check.d.ts +1 -0
  331. package/dist/vegalite/vegalite_check.js +7 -0
  332. package/dist/vegalite/vegalite_crossfilter.d.ts +54 -0
  333. package/dist/vegalite/vegalite_crossfilter.js +187 -0
  334. package/dist/vegalite/vegalite_image.d.ts +14 -0
  335. package/dist/vegalite/vegalite_image.js +28 -0
  336. package/dist/vegalite/vegalite_loader.d.ts +7 -0
  337. package/dist/vegalite/vegalite_loader.js +15 -0
  338. package/dist/vegalite/vegalite_rows.d.ts +3 -0
  339. package/dist/vegalite/vegalite_rows.js +23 -0
  340. package/dist/vegalite/vegalite_theme.d.ts +13 -0
  341. package/dist/vegalite/vegalite_theme.js +141 -0
  342. package/fonts/InstrumentSans-Bold.ttf +0 -0
  343. package/fonts/InstrumentSans-Medium.ttf +0 -0
  344. package/fonts/InstrumentSans-OFL.txt +93 -0
  345. package/fonts/InstrumentSans-Regular.ttf +0 -0
  346. package/fonts/InstrumentSans-SemiBold.ttf +0 -0
  347. package/fonts/JetBrainsMono-Bold.ttf +0 -0
  348. package/fonts/JetBrainsMono-Medium.ttf +0 -0
  349. package/fonts/JetBrainsMono-OFL.txt +93 -0
  350. package/fonts/JetBrainsMono-Regular.ttf +0 -0
  351. package/fonts/JetBrainsMono-SemiBold.ttf +0 -0
  352. package/fonts/fonts.css +61 -0
  353. package/package.json +403 -4
  354. package/styles/colors.css +110 -0
  355. package/styles/flavors/dbcom.css +48 -0
  356. package/styles/tokens.css +192 -0
@@ -0,0 +1,29 @@
1
+ import { sticky_column_portal, sticky_header_portal } from "./data_table.module.js";
2
+ import * as React from "react";
3
+ function useDataTablePortalContainers(gridApi) {
4
+ const [containers, setContainers] = React.useState(null);
5
+ React.useEffect(() => {
6
+ const gridElement = gridApi?.element;
7
+ if (!gridElement) {
8
+ setContainers(null);
9
+ return;
10
+ }
11
+ const header = document.createElement("div");
12
+ header.className = sticky_header_portal;
13
+ gridElement.prepend(header);
14
+ const data = document.createElement("div");
15
+ data.className = sticky_column_portal;
16
+ gridElement.appendChild(data);
17
+ setContainers({
18
+ header,
19
+ data
20
+ });
21
+ return () => {
22
+ header.remove();
23
+ data.remove();
24
+ setContainers(null);
25
+ };
26
+ }, [gridApi]);
27
+ return containers;
28
+ }
29
+ export { useDataTablePortalContainers };
@@ -0,0 +1,22 @@
1
+ import * as arrow from 'apache-arrow';
2
+ import * as React from 'react';
3
+ import { type ArrowTableFormatter } from '@akohn/dashql/platform/compute/arrow_formatter';
4
+ import type { DataTableLayout } from './data_table_layout.js';
5
+ export interface RowDetailField {
6
+ name: string;
7
+ type: string;
8
+ value: string | null;
9
+ }
10
+ export interface RowDetail {
11
+ visibleRow: number;
12
+ fields: RowDetailField[];
13
+ }
14
+ export declare function rowDetailOf(table: arrow.Table, formatter: ArrowTableFormatter, layout: DataTableLayout, row: number, visibleRow: number): RowDetail | null;
15
+ interface Props {
16
+ detail: RowDetail;
17
+ rowCount: number;
18
+ onNavigate: (delta: number) => void;
19
+ onClose: () => void;
20
+ }
21
+ export declare function DataTableRowDetail(props: Props): React.ReactElement;
22
+ export {};
@@ -0,0 +1,68 @@
1
+ import { field, fields, name, type, value, value_null } from "./data_table_row_detail.module.js";
2
+ import { ButtonSize, ButtonVariant, IconButton } from "../button.js";
3
+ import { Sheet } from "../sheet.js";
4
+ import { ChevronDownIcon, ChevronUpIcon } from "../symbol_icon.js";
5
+ import "react";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ import { dataTypeToString } from "@akohn/dashql/platform/compute/arrow_formatter";
8
+ function rowDetailOf(table, formatter, layout, row, visibleRow) {
9
+ if (row < 0 || row >= table.numRows) return null;
10
+ const fields = [];
11
+ for (let column = 1; column < layout.arrowFieldByColumnIndex.length; ++column) {
12
+ const fieldId = layout.arrowFieldByColumnIndex[column];
13
+ const field = table.schema.fields[fieldId];
14
+ if (field == null) continue;
15
+ fields.push({
16
+ name: field.name,
17
+ type: dataTypeToString(field.type),
18
+ value: formatter.getValue(row, fieldId)
19
+ });
20
+ }
21
+ return {
22
+ visibleRow,
23
+ fields
24
+ };
25
+ }
26
+ function DataTableRowDetail(props) {
27
+ const { detail, rowCount, onNavigate } = props;
28
+ return /* @__PURE__ */ jsx(Sheet, {
29
+ title: `Row ${detail.visibleRow + 1} of ${rowCount}`,
30
+ onClose: props.onClose,
31
+ "data-testid": "data-table-row-detail",
32
+ actions: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(IconButton, {
33
+ size: ButtonSize.Small,
34
+ variant: ButtonVariant.Invisible,
35
+ "aria-label": "Previous row",
36
+ "data-testid": "data-table-row-previous",
37
+ disabled: detail.visibleRow <= 0,
38
+ onClick: () => onNavigate(-1),
39
+ children: /* @__PURE__ */ jsx(ChevronUpIcon, { size: 16 })
40
+ }), /* @__PURE__ */ jsx(IconButton, {
41
+ size: ButtonSize.Small,
42
+ variant: ButtonVariant.Invisible,
43
+ "aria-label": "Next row",
44
+ "data-testid": "data-table-row-next",
45
+ disabled: detail.visibleRow >= rowCount - 1,
46
+ onClick: () => onNavigate(1),
47
+ children: /* @__PURE__ */ jsx(ChevronDownIcon, { size: 16 })
48
+ })] }),
49
+ children: /* @__PURE__ */ jsx("dl", {
50
+ className: fields,
51
+ children: detail.fields.map((field$1, index) => /* @__PURE__ */ jsxs("div", {
52
+ className: field,
53
+ "data-testid": "data-table-row-field",
54
+ children: [/* @__PURE__ */ jsxs("dt", {
55
+ className: name,
56
+ children: [field$1.name, /* @__PURE__ */ jsx("span", {
57
+ className: type,
58
+ children: field$1.type
59
+ })]
60
+ }), /* @__PURE__ */ jsx("dd", {
61
+ className: field$1.value == null ? `${value} ${value_null}` : value,
62
+ children: field$1.value ?? "null"
63
+ })]
64
+ }, index))
65
+ })
66
+ });
67
+ }
68
+ export { DataTableRowDetail, rowDetailOf };
@@ -0,0 +1,7 @@
1
+ var fields = "dashql_fields_jOg5bq";
2
+ var field = "dashql_field_D9hR7-";
3
+ var name = "dashql_name_GCEkkk";
4
+ var type = "dashql_type_9zm-Uu";
5
+ var value = "dashql_value_ZkMNpe";
6
+ var value_null = "dashql_value_null_Ypwy0D";
7
+ export { field, fields, name, type, value, value_null };
@@ -0,0 +1,35 @@
1
+ import * as React from 'react';
2
+ import type { DataCellData, HeaderNameCellProps, HeaderPlotsCellProps } from './data_table_cell.js';
3
+ import { TableColumnHeader } from './data_table_cell.js';
4
+ import type { DataTablePortalContainers } from './data_table_portals.js';
5
+ interface StickyHeadersProps {
6
+ container: DataTablePortalContainers['header'] | null;
7
+ totalWidth: number;
8
+ headerHeight: number;
9
+ firstColumnWidth: number;
10
+ leftSpacerWidth: number;
11
+ rightSpacerWidth: number;
12
+ firstRenderedColumn: number;
13
+ renderedColumnCount: number;
14
+ getColumnWidth: (columnIndex: number) => number;
15
+ columnHeader: TableColumnHeader;
16
+ plotsHeight: number;
17
+ plotsCollapsed: boolean;
18
+ onTogglePlots: () => void;
19
+ nameCellProps: Omit<HeaderNameCellProps, 'columnIndex' | 'style' | 'sortAscending'> & {
20
+ getSortDirection: (fieldId: number) => boolean | null;
21
+ };
22
+ plotCellProps: Omit<HeaderPlotsCellProps, 'columnIndex' | 'style'>;
23
+ }
24
+ export declare const DataTableStickyHeaders: React.MemoExoticComponent<(props: StickyHeadersProps) => React.ReactPortal | null>;
25
+ interface StickyColumnProps {
26
+ container: DataTablePortalContainers['data'] | null;
27
+ firstColumnWidth: number;
28
+ rowHeight: number;
29
+ totalDataHeight: number;
30
+ startRow: number;
31
+ stopRow: number;
32
+ gridData: DataCellData;
33
+ }
34
+ export declare const DataTableStickyColumn: React.MemoExoticComponent<(props: StickyColumnProps) => React.ReactPortal | null>;
35
+ export {};
@@ -0,0 +1,161 @@
1
+ import { sticky_column_container, sticky_header_container, sticky_header_row } from "./data_table.module.js";
2
+ import { TableColumnHeader } from "./data_table_cell.js";
3
+ import { ChevronDownIcon, ChevronUpIcon } from "../symbol_icon.js";
4
+ import { HeaderNameCell } from "./data_table_cell_header_name.js";
5
+ import { HeaderPlotsCell } from "./data_table_cell_header_plots.js";
6
+ import { DataCell } from "./data_table_cell_data.js";
7
+ import { arePropsEqualWithStyle } from "./memo_props.js";
8
+ import * as React from "react";
9
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
+ import * as ReactDOM from "react-dom";
11
+ var StickyRowHeaderCell = React.memo(DataCell, arePropsEqualWithStyle);
12
+ var STICKY_ROW_HEADER_ARIA = {
13
+ "aria-colindex": 1,
14
+ role: "gridcell"
15
+ };
16
+ var DataTableStickyHeaders = React.memo((props) => {
17
+ if (props.container == null) return null;
18
+ const renderNameCell = (columnIndex, sticky) => /* @__PURE__ */ jsx(HeaderNameCell, {
19
+ columnIndex,
20
+ style: {
21
+ width: props.getColumnWidth(columnIndex),
22
+ height: 32,
23
+ ...!sticky ? { flexShrink: 0 } : {}
24
+ },
25
+ table: props.nameCellProps.table,
26
+ gridLayout: props.nameCellProps.gridLayout,
27
+ dataFrame: props.nameCellProps.dataFrame,
28
+ rightmostVisibleColumn: props.nameCellProps.rightmostVisibleColumn,
29
+ sortAscending: props.nameCellProps.getSortDirection(props.nameCellProps.gridLayout.arrowFieldByColumnIndex[columnIndex]),
30
+ onOrderByColumn: props.nameCellProps.onOrderByColumn,
31
+ onShowTable: props.nameCellProps.onShowTable
32
+ }, `header-0-${columnIndex}`);
33
+ const renderPlotCell = (columnIndex, sticky) => /* @__PURE__ */ jsx(HeaderPlotsCell, {
34
+ ...props.plotCellProps,
35
+ columnIndex,
36
+ style: {
37
+ width: props.getColumnWidth(columnIndex),
38
+ height: props.plotsHeight,
39
+ ...!sticky ? { flexShrink: 0 } : {}
40
+ }
41
+ }, `header-1-${columnIndex}`);
42
+ const PlotsChevron = props.plotsCollapsed ? ChevronDownIcon : ChevronUpIcon;
43
+ return ReactDOM.createPortal(/* @__PURE__ */ jsxs("div", {
44
+ className: sticky_header_container,
45
+ style: {
46
+ position: "sticky",
47
+ top: 0,
48
+ zIndex: 10,
49
+ width: props.totalWidth,
50
+ height: props.headerHeight
51
+ },
52
+ children: [/* @__PURE__ */ jsxs("div", {
53
+ className: sticky_header_row,
54
+ style: {
55
+ display: "flex",
56
+ height: 32
57
+ },
58
+ children: [
59
+ /* @__PURE__ */ jsx("div", {
60
+ style: {
61
+ position: "sticky",
62
+ left: 0,
63
+ zIndex: 11,
64
+ flexShrink: 0
65
+ },
66
+ children: renderNameCell(0, true)
67
+ }),
68
+ props.leftSpacerWidth > 0 && /* @__PURE__ */ jsx("div", { style: {
69
+ width: props.leftSpacerWidth,
70
+ flexShrink: 0
71
+ } }),
72
+ Array.from({ length: props.renderedColumnCount }, (_, index) => renderNameCell(props.firstRenderedColumn + index, false)),
73
+ props.rightSpacerWidth > 0 && /* @__PURE__ */ jsx("div", { style: {
74
+ width: props.rightSpacerWidth,
75
+ flexShrink: 0
76
+ } })
77
+ ]
78
+ }), props.columnHeader === TableColumnHeader.WithColumnPlots && /* @__PURE__ */ jsxs("div", {
79
+ className: "dashql_sticky_header_row_k4jXSK",
80
+ style: {
81
+ display: "flex",
82
+ height: props.plotsHeight
83
+ },
84
+ children: [/* @__PURE__ */ jsx("div", {
85
+ style: {
86
+ position: "sticky",
87
+ left: 0,
88
+ zIndex: 11,
89
+ flexShrink: 0
90
+ },
91
+ children: /* @__PURE__ */ jsx("button", {
92
+ type: "button",
93
+ className: "dashql_plots_toggle_3vXAdD",
94
+ style: {
95
+ width: props.firstColumnWidth,
96
+ height: props.plotsHeight
97
+ },
98
+ "aria-label": props.plotsCollapsed ? "Show column plots" : "Hide column plots",
99
+ "aria-expanded": !props.plotsCollapsed,
100
+ title: props.plotsCollapsed ? "Show column plots" : "Hide column plots",
101
+ onClick: props.onTogglePlots,
102
+ children: /* @__PURE__ */ jsx(PlotsChevron, { size: props.plotsCollapsed ? 12 : 16 })
103
+ })
104
+ }), props.plotsCollapsed ? /* @__PURE__ */ jsx("div", {
105
+ className: "dashql_plots_collapsed_cell_Zb3ndp",
106
+ style: { width: props.totalWidth - props.firstColumnWidth }
107
+ }) : /* @__PURE__ */ jsxs(Fragment, { children: [
108
+ props.leftSpacerWidth > 0 && /* @__PURE__ */ jsx("div", { style: {
109
+ width: props.leftSpacerWidth,
110
+ flexShrink: 0
111
+ } }),
112
+ Array.from({ length: props.renderedColumnCount }, (_, index) => renderPlotCell(props.firstRenderedColumn + index, false)),
113
+ props.rightSpacerWidth > 0 && /* @__PURE__ */ jsx("div", { style: {
114
+ width: props.rightSpacerWidth,
115
+ flexShrink: 0
116
+ } })
117
+ ] })]
118
+ })]
119
+ }), props.container);
120
+ });
121
+ var DataTableStickyColumn = React.memo((props) => {
122
+ if (props.container == null) return null;
123
+ const visibleCount = Math.max(0, props.stopRow - props.startRow + 1);
124
+ return ReactDOM.createPortal(/* @__PURE__ */ jsx("div", {
125
+ className: sticky_column_container,
126
+ style: {
127
+ position: "sticky",
128
+ left: 0,
129
+ width: props.firstColumnWidth,
130
+ height: props.totalDataHeight,
131
+ marginTop: -props.totalDataHeight,
132
+ zIndex: 5,
133
+ pointerEvents: "none"
134
+ },
135
+ children: Array.from({ length: visibleCount }, (_, index) => {
136
+ const rowIndex = props.startRow + index;
137
+ return /* @__PURE__ */ jsx("div", {
138
+ style: {
139
+ position: "absolute",
140
+ top: rowIndex * props.rowHeight,
141
+ left: 0,
142
+ width: props.firstColumnWidth,
143
+ height: props.rowHeight,
144
+ pointerEvents: "auto"
145
+ },
146
+ children: /* @__PURE__ */ jsx(StickyRowHeaderCell, {
147
+ ariaAttributes: STICKY_ROW_HEADER_ARIA,
148
+ rowIndex,
149
+ columnIndex: 0,
150
+ style: {
151
+ width: props.firstColumnWidth,
152
+ height: props.rowHeight
153
+ },
154
+ ...props.gridData,
155
+ hideRowHeader: false
156
+ })
157
+ }, `col0-${rowIndex}`);
158
+ })
159
+ }), props.container);
160
+ });
161
+ export { DataTableStickyColumn, DataTableStickyHeaders };
@@ -0,0 +1,18 @@
1
+ import * as arrow from 'apache-arrow';
2
+ import { ArrowTableFormatter } from '@akohn/dashql/platform/compute/arrow_formatter';
3
+ import type { ComputationModel } from '../../models/computation_model.js';
4
+ export declare const WINDOW_MARGIN_ROWS = 100;
5
+ export interface DataTableWindow {
6
+ offset: number;
7
+ table: arrow.Table;
8
+ formatter: ArrowTableFormatter;
9
+ dataRows: Int32Array;
10
+ }
11
+ export interface DataTableRows {
12
+ window: DataTableWindow | null;
13
+ rows: number;
14
+ error: string | null;
15
+ retry: () => void;
16
+ }
17
+ export declare function forEachIntegerValue(column: arrow.Vector, visit: (value: number, index: number) => void): void;
18
+ export declare function useDataTableWindow(model: ComputationModel, start: number, stop: number): DataTableRows;
@@ -0,0 +1,118 @@
1
+ import { useLogger } from "../../logger.js";
2
+ import * as React from "react";
3
+ import { stringifyError } from "@akohn/dashql/platform/logger/logger";
4
+ import * as arrow from "apache-arrow";
5
+ import { ArrowTableFormatter } from "@akohn/dashql/platform/compute/arrow_formatter";
6
+ var WINDOW_MARGIN_ROWS = 100;
7
+ function forEachIntegerValue(column, visit) {
8
+ if (column.type.typeId !== arrow.Type.Int) {
9
+ for (let i = 0; i < column.length; ++i) visit(Number(column.get(i)), i);
10
+ return;
11
+ }
12
+ let index = 0;
13
+ for (const chunk of column.data) {
14
+ const values = chunk.values;
15
+ if (chunk.nullCount === 0) for (let i = 0; i < chunk.length; ++i) visit(Number(values[i]), index++);
16
+ else for (let i = 0; i < chunk.length; ++i) visit(chunk.getValid(i) ? Number(values[i]) : 0, index++);
17
+ }
18
+ }
19
+ function dataRowsOf(table) {
20
+ const out = new Int32Array(table.numRows);
21
+ const column = table.numCols === 0 ? null : table.getChildAt(table.numCols - 1);
22
+ if (column == null) return out;
23
+ forEachIntegerValue(column, (rowNumber, index) => {
24
+ out[index] = rowNumber - 1;
25
+ });
26
+ return out;
27
+ }
28
+ function rowsOfView(view) {
29
+ return view.orderingTable?.rows ?? view.filterTable?.rows ?? view.dataSearchTable?.rows ?? view.dataTableRows;
30
+ }
31
+ function tableKey(view) {
32
+ return `${view.tableId}:${view.dataTable}`;
33
+ }
34
+ function selectionKey(view) {
35
+ return [
36
+ tableKey(view),
37
+ view.dataFrame,
38
+ view.filterTable?.dataTable,
39
+ view.orderingTable?.dataTable,
40
+ view.dataSearchTable?.dataTable
41
+ ].join(":");
42
+ }
43
+ function holds(offset, length, rows, start, stop) {
44
+ return start >= offset && (stop < offset + length || offset + length >= rows);
45
+ }
46
+ function useDataTableWindow(model, start, stop) {
47
+ const logger = useLogger();
48
+ const view = model.computation;
49
+ const key = selectionKey(view);
50
+ const table = tableKey(view);
51
+ const [state, setState] = React.useState(null);
52
+ const [failed, setFailed] = React.useState(null);
53
+ const readRows = React.useRef(model.readRows);
54
+ readRows.current = model.readRows;
55
+ const pending = React.useRef(null);
56
+ React.useEffect(() => {
57
+ const current = state?.key === key ? state : null;
58
+ if (current != null && holds(current.window.offset, current.window.table.numRows, current.rows, start, stop)) return;
59
+ const running = pending.current;
60
+ if (running != null && running.key === key && holds(running.offset, running.limit, Number.POSITIVE_INFINITY, start, stop)) return;
61
+ if (failed != null && failed.key === key && holds(failed.offset, failed.limit, Number.POSITIVE_INFINITY, start, stop)) return;
62
+ const offset = Math.max(0, start - 100);
63
+ const limit = Math.max(0, stop - start + 1) + 200;
64
+ const read = {
65
+ key,
66
+ offset,
67
+ limit
68
+ };
69
+ pending.current = read;
70
+ readRows.current(offset, limit).then((result) => {
71
+ if (pending.current !== read) return;
72
+ pending.current = null;
73
+ const formatter = new ArrowTableFormatter(result.table.schema, result.table.batches, logger);
74
+ const window = {
75
+ offset: result.offset,
76
+ table: result.table,
77
+ formatter,
78
+ dataRows: dataRowsOf(result.table)
79
+ };
80
+ setFailed(null);
81
+ setState({
82
+ key,
83
+ table,
84
+ rows: result.rows,
85
+ window
86
+ });
87
+ }, (error) => {
88
+ if (pending.current !== read) return;
89
+ pending.current = null;
90
+ const message = stringifyError(error);
91
+ logger.warn("Failed to read the rows of a table", { error: message }, "data_table");
92
+ setFailed({
93
+ key,
94
+ offset,
95
+ limit,
96
+ error: message
97
+ });
98
+ });
99
+ }, [
100
+ key,
101
+ table,
102
+ start,
103
+ stop,
104
+ state,
105
+ failed,
106
+ logger
107
+ ]);
108
+ const retry = React.useCallback(() => setFailed(null), []);
109
+ const shown = state?.table === table ? state : null;
110
+ const error = failed != null && failed.key === key && (shown == null || shown.key !== key || !holds(shown.window.offset, shown.window.table.numRows, shown.rows, start, stop)) ? failed.error : null;
111
+ return {
112
+ window: shown?.window ?? null,
113
+ rows: shown?.rows ?? rowsOfView(view),
114
+ error,
115
+ retry
116
+ };
117
+ }
118
+ export { WINDOW_MARGIN_ROWS, forEachIntegerValue, useDataTableWindow };
@@ -0,0 +1,2 @@
1
+ export type FormatHint = 'array' | 'struct' | 'json' | 'sql' | 'plan' | null;
2
+ export declare function peekFormat(value: string | null): FormatHint;
@@ -0,0 +1,17 @@
1
+ import { detectPlanEngine } from "../../utils/plan_engine.js";
2
+ var PEEK_WINDOW = 4096;
3
+ var SQL_RE = /^\s*(SELECT|INSERT|UPDATE|DELETE|CREATE|ALTER|DROP|WITH|EXPLAIN|COPY|SET|BEGIN|COMMIT|ROLLBACK)\b/i;
4
+ function peekFormat(value) {
5
+ if (value == null || value.length < 2) return null;
6
+ const head = value.slice(0, PEEK_WINDOW).trimStart();
7
+ const tail = value.slice(-4096).trimEnd();
8
+ const first = head.length > 0 ? head[0] : null;
9
+ const last = tail.length > 0 ? tail[tail.length - 1] : null;
10
+ if ((first === "{" || first === "[") && (last === "}" || last === "]")) {
11
+ if (detectPlanEngine(value) != null) return "plan";
12
+ return "json";
13
+ }
14
+ if (SQL_RE.test(head)) return "sql";
15
+ return null;
16
+ }
17
+ export { peekFormat };
@@ -0,0 +1,36 @@
1
+ import * as React from 'react';
2
+ import * as d3 from 'd3';
3
+ export declare const NULL_SYMBOL = "\u2205";
4
+ interface HistogramBarsProps {
5
+ binCounts: BigInt64Array;
6
+ filteredBinCounts: BigInt64Array | null;
7
+ focusedBin: number | null;
8
+ xScale: d3.ScaleBand<string>;
9
+ yScale: d3.ScaleLinear<number, number>;
10
+ height: number;
11
+ totalBarColor: string;
12
+ totalBarFocusedColor: string;
13
+ filteredBarColor: string;
14
+ filteredBarFocusedColor: string;
15
+ }
16
+ declare function HistogramBarsImpl(props: HistogramBarsProps): React.ReactElement;
17
+ export declare const HistogramBars: React.MemoExoticComponent<typeof HistogramBarsImpl>;
18
+ interface HistogramNullBarProps {
19
+ countNull: number;
20
+ filteredNullCount: number | null;
21
+ focused: boolean | null;
22
+ xScale: d3.ScaleBand<string>;
23
+ yScale: d3.ScaleLinear<number, number>;
24
+ xWidth: number;
25
+ height: number;
26
+ bottomMargin: number;
27
+ transformX: number;
28
+ totalBarColor: string;
29
+ totalBarFocusedColor: string;
30
+ filteredBarColor: string;
31
+ filteredBarFocusedColor: string;
32
+ onPointerOver: React.MouseEventHandler<SVGGElement>;
33
+ onPointerOut: React.MouseEventHandler<SVGGElement>;
34
+ }
35
+ export declare function HistogramNullBar(props: HistogramNullBarProps): React.ReactElement | null;
36
+ export {};
@@ -0,0 +1,100 @@
1
+ import { COLUMN_SUMMARY_BASELINE_COLOR } from "./data_table_colors.js";
2
+ import * as React from "react";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ var NULL_SYMBOL = "∅";
5
+ function getBarGeometry(bin, count, xScale, yScale, height) {
6
+ const x = xScale(bin.toString());
7
+ const y = yScale(Number(count));
8
+ const width = xScale.bandwidth();
9
+ const barHeight = height - y;
10
+ if (x == null || isNaN(y) || isNaN(width) || isNaN(barHeight)) return null;
11
+ return {
12
+ x,
13
+ y,
14
+ width,
15
+ height: barHeight
16
+ };
17
+ }
18
+ function HistogramBarsImpl(props) {
19
+ const filteredBinCounts = props.filteredBinCounts;
20
+ const totalBars = Array.from({ length: props.binCounts.length }, (_, bin) => {
21
+ const geometry = getBarGeometry(bin, props.binCounts[bin], props.xScale, props.yScale, props.height);
22
+ return geometry == null ? null : /* @__PURE__ */ jsx("rect", {
23
+ ...geometry,
24
+ style: { fill: props.totalBarColor }
25
+ }, bin);
26
+ });
27
+ const focusedTotalGeometry = props.focusedBin == null ? null : getBarGeometry(props.focusedBin, props.binCounts[props.focusedBin], props.xScale, props.yScale, props.height);
28
+ const filteredBars = filteredBinCounts == null ? null : Array.from({ length: filteredBinCounts.length }, (_, bin) => {
29
+ const geometry = getBarGeometry(bin, filteredBinCounts[bin], props.xScale, props.yScale, props.height);
30
+ return geometry == null ? null : /* @__PURE__ */ jsx("rect", {
31
+ ...geometry,
32
+ style: { fill: props.filteredBarColor }
33
+ }, `filtered-${bin}`);
34
+ });
35
+ const focusedFilteredGeometry = props.focusedBin == null || filteredBinCounts == null ? null : getBarGeometry(props.focusedBin, filteredBinCounts[props.focusedBin], props.xScale, props.yScale, props.height);
36
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
37
+ totalBars,
38
+ focusedTotalGeometry != null && /* @__PURE__ */ jsx("rect", {
39
+ "data-part": "focus",
40
+ ...focusedTotalGeometry,
41
+ style: { fill: props.totalBarFocusedColor }
42
+ }, `focused-${props.focusedBin}`),
43
+ filteredBars,
44
+ focusedFilteredGeometry != null && /* @__PURE__ */ jsx("rect", {
45
+ ...focusedFilteredGeometry,
46
+ style: { fill: props.filteredBarFocusedColor }
47
+ }, `focused-filtered-${props.focusedBin}`)
48
+ ] });
49
+ }
50
+ var HistogramBars = React.memo(HistogramBarsImpl);
51
+ function HistogramNullBar(props) {
52
+ const nullX = props.xScale("∅");
53
+ const nullY = props.yScale(props.countNull);
54
+ const nullWidth = props.xScale.bandwidth();
55
+ const nullHeight = props.height - nullY;
56
+ if (nullX == null || isNaN(nullY) || isNaN(nullWidth) || isNaN(nullHeight)) return null;
57
+ const filteredNullY = props.filteredNullCount == null ? null : props.yScale(props.filteredNullCount);
58
+ const filteredNullHeight = filteredNullY == null ? null : props.height - filteredNullY;
59
+ const hasValidFilteredBar = filteredNullY != null && filteredNullHeight != null && !isNaN(filteredNullY) && !isNaN(filteredNullHeight);
60
+ return /* @__PURE__ */ jsxs("g", {
61
+ "data-part": "null",
62
+ transform: `translate(${props.transformX}, 0)`,
63
+ onPointerOver: props.onPointerOver,
64
+ onPointerMove: props.onPointerOver,
65
+ onPointerOut: props.onPointerOut,
66
+ children: [
67
+ /* @__PURE__ */ jsx("rect", {
68
+ x: nullX,
69
+ y: nullY,
70
+ width: nullWidth,
71
+ height: nullHeight,
72
+ style: { fill: props.focused ? props.totalBarFocusedColor : props.totalBarColor }
73
+ }),
74
+ hasValidFilteredBar && /* @__PURE__ */ jsx("rect", {
75
+ x: nullX,
76
+ y: filteredNullY,
77
+ width: nullWidth,
78
+ height: filteredNullHeight,
79
+ style: { fill: props.focused ? props.filteredBarFocusedColor : props.filteredBarColor }
80
+ }),
81
+ /* @__PURE__ */ jsxs("g", {
82
+ transform: `translate(0, ${props.height})`,
83
+ children: [/* @__PURE__ */ jsx("line", {
84
+ x1: 0,
85
+ y1: 1,
86
+ x2: props.xWidth,
87
+ y2: 1,
88
+ style: { stroke: COLUMN_SUMMARY_BASELINE_COLOR }
89
+ }), /* @__PURE__ */ jsx("rect", {
90
+ x: nullX,
91
+ y: 0,
92
+ width: nullWidth,
93
+ height: props.bottomMargin,
94
+ fillOpacity: 0
95
+ })]
96
+ })
97
+ ]
98
+ });
99
+ }
100
+ export { HistogramBars, HistogramNullBar, NULL_SYMBOL };
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+ import * as d3 from 'd3';
3
+ export declare const BRUSH_SETTLE_DELAY_MS = 120;
4
+ export declare class SettledBrushUpdates<T> {
5
+ private timeout;
6
+ private pending;
7
+ schedule(event: T, callback: (event: T) => void): void;
8
+ flush(event: T, callback: (event: T) => void): void;
9
+ cancel(): void;
10
+ }
11
+ interface HistogramBrushOptions {
12
+ xScale: d3.ScaleBand<string>;
13
+ height: number;
14
+ selection: [number, number] | null;
15
+ onBrushUpdate: (event: d3.D3BrushEvent<unknown>) => void;
16
+ onClear: () => void;
17
+ }
18
+ export declare function useHistogramBrush(options: HistogramBrushOptions): {
19
+ brushContainer: React.RefObject<SVGGElement | null>;
20
+ clearBrush: () => void;
21
+ };
22
+ export {};