@akohn/dashql-react 0.0.0-stage → 0.0.20-dev.661.gda3ac9a7e
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.
- package/LICENSE +373 -0
- package/NOTICE +66 -0
- package/README.md +46 -2
- package/dist/_virtual/_vite/preload-helper.js +100 -0
- package/dist/brand/brand.d.ts +13 -0
- package/dist/brand/brand.js +14 -0
- package/dist/brand/landing_backdrop.d.ts +56 -0
- package/dist/brand/landing_backdrop.js +1019 -0
- package/dist/brand/wobble_morph.d.ts +54 -0
- package/dist/brand/wobble_morph.js +439 -0
- package/dist/components/action_list.d.ts +31 -0
- package/dist/components/action_list.js +63 -0
- package/dist/components/action_list.module.js +11 -0
- package/dist/components/anchored_overlay.d.ts +28 -0
- package/dist/components/anchored_overlay.js +93 -0
- package/dist/components/button.d.ts +42 -0
- package/dist/components/button.js +97 -0
- package/dist/components/button.module.js +20 -0
- package/dist/components/button_group.d.ts +7 -0
- package/dist/components/button_group.js +18 -0
- package/dist/components/button_group.module.js +3 -0
- package/dist/components/card_placeholder.d.ts +9 -0
- package/dist/components/card_placeholder.js +39 -0
- package/dist/components/card_placeholder.module.js +6 -0
- package/dist/components/clipboard.d.ts +19 -0
- package/dist/components/clipboard.js +54 -0
- package/dist/components/data_table/computation_tables.d.ts +12 -0
- package/dist/components/data_table/computation_tables.js +42 -0
- package/dist/components/data_table/data_table.d.ts +38 -0
- package/dist/components/data_table/data_table.js +378 -0
- package/dist/components/data_table/data_table.module.js +41 -0
- package/dist/components/data_table/data_table_cell.d.ts +7 -0
- package/dist/components/data_table/data_table_cell.js +9 -0
- package/dist/components/data_table/data_table_cell_data.d.ts +21 -0
- package/dist/components/data_table/data_table_cell_data.js +99 -0
- package/dist/components/data_table/data_table_cell_header_name.d.ts +17 -0
- package/dist/components/data_table/data_table_cell_header_name.js +73 -0
- package/dist/components/data_table/data_table_cell_header_plots.d.ts +31 -0
- package/dist/components/data_table/data_table_cell_header_plots.js +122 -0
- package/dist/components/data_table/data_table_colors.d.ts +19 -0
- package/dist/components/data_table/data_table_colors.js +27 -0
- package/dist/components/data_table/data_table_column_resize.d.ts +21 -0
- package/dist/components/data_table/data_table_column_resize.js +121 -0
- package/dist/components/data_table/data_table_focus.d.ts +15 -0
- package/dist/components/data_table/data_table_focus.js +53 -0
- package/dist/components/data_table/data_table_layout.d.ts +18 -0
- package/dist/components/data_table/data_table_layout.js +103 -0
- package/dist/components/data_table/data_table_ordering.d.ts +9 -0
- package/dist/components/data_table/data_table_ordering.js +39 -0
- package/dist/components/data_table/data_table_portals.d.ts +9 -0
- package/dist/components/data_table/data_table_portals.js +29 -0
- package/dist/components/data_table/data_table_sticky_views.d.ts +34 -0
- package/dist/components/data_table/data_table_sticky_views.js +161 -0
- package/dist/components/data_table/data_table_window.d.ts +18 -0
- package/dist/components/data_table/data_table_window.js +118 -0
- package/dist/components/data_table/format_peek.d.ts +2 -0
- package/dist/components/data_table/format_peek.js +17 -0
- package/dist/components/data_table/histogram_bars.d.ts +36 -0
- package/dist/components/data_table/histogram_bars.js +100 -0
- package/dist/components/data_table/histogram_brush.d.ts +23 -0
- package/dist/components/data_table/histogram_brush.js +107 -0
- package/dist/components/data_table/histogram_cell.d.ts +19 -0
- package/dist/components/data_table/histogram_cell.js +325 -0
- package/dist/components/data_table/histogram_cell.module.js +9 -0
- package/dist/components/data_table/histogram_label.d.ts +1 -0
- package/dist/components/data_table/histogram_label.js +7 -0
- package/dist/components/data_table/memo_props.d.ts +1 -0
- package/dist/components/data_table/memo_props.js +17 -0
- package/dist/components/data_table/mostfrequent_cell.d.ts +17 -0
- package/dist/components/data_table/mostfrequent_cell.js +316 -0
- package/dist/components/data_table/mostfrequent_cell.module.js +10 -0
- package/dist/components/data_table/use_cross_filters.d.ts +14 -0
- package/dist/components/data_table/use_cross_filters.js +47 -0
- package/dist/components/deferred.d.ts +11 -0
- package/dist/components/deferred.js +41 -0
- package/dist/components/deferred.module.js +5 -0
- package/dist/components/error_boundary.d.ts +18 -0
- package/dist/components/error_boundary.js +15 -0
- package/dist/components/graph.module.js +15 -0
- package/dist/components/graph_port.d.ts +10 -0
- package/dist/components/graph_port.js +34 -0
- package/dist/components/inspector_overlay.d.ts +32 -0
- package/dist/components/inspector_overlay.js +72 -0
- package/dist/components/inspector_overlay.module.js +18 -0
- package/dist/components/json/json_arrow_symbol.d.ts +4 -0
- package/dist/components/json/json_arrow_symbol.js +25 -0
- package/dist/components/json/json_copy_button.d.ts +11 -0
- package/dist/components/json/json_copy_button.js +61 -0
- package/dist/components/json/json_ellipsis_symbol.d.ts +7 -0
- package/dist/components/json/json_ellipsis_symbol.js +11 -0
- package/dist/components/json/json_item_count.d.ts +5 -0
- package/dist/components/json/json_item_count.js +12 -0
- package/dist/components/json/json_key_name.d.ts +6 -0
- package/dist/components/json/json_key_name.js +40 -0
- package/dist/components/json/json_key_values.d.ts +12 -0
- package/dist/components/json/json_key_values.js +99 -0
- package/dist/components/json/json_literal.d.ts +8 -0
- package/dist/components/json/json_literal.js +140 -0
- package/dist/components/json/json_nested_close.d.ts +11 -0
- package/dist/components/json/json_nested_close.js +31 -0
- package/dist/components/json/json_nested_open.d.ts +18 -0
- package/dist/components/json/json_nested_open.js +150 -0
- package/dist/components/json/json_nested_state.d.ts +14 -0
- package/dist/components/json/json_nested_state.js +28 -0
- package/dist/components/json/json_tool_state.d.ts +18 -0
- package/dist/components/json/json_tool_state.js +46 -0
- package/dist/components/json/json_value.d.ts +10 -0
- package/dist/components/json/json_value.js +46 -0
- package/dist/components/json/json_view.d.ts +14 -0
- package/dist/components/json/json_view.js +37 -0
- package/dist/components/json/json_view.module.js +41 -0
- package/dist/components/json/json_view_state.d.ts +14 -0
- package/dist/components/json/json_view_state.js +32 -0
- package/dist/components/json/unique_key.d.ts +1 -0
- package/dist/components/json/unique_key.js +8 -0
- package/dist/components/keyvalue_list.d.ts +25 -0
- package/dist/components/keyvalue_list.js +106 -0
- package/dist/components/keyvalue_list.module.js +15 -0
- package/dist/components/name_input.d.ts +11 -0
- package/dist/components/name_input.js +51 -0
- package/dist/components/overlay.d.ts +53 -0
- package/dist/components/overlay.js +183 -0
- package/dist/components/overlay.module.js +32 -0
- package/dist/components/panel_resize_handle.d.ts +12 -0
- package/dist/components/panel_resize_handle.js +39 -0
- package/dist/components/portal.d.ts +8 -0
- package/dist/components/portal.js +53 -0
- package/dist/components/progress_bar.d.ts +7 -0
- package/dist/components/progress_bar.js +21 -0
- package/dist/components/progress_bar.module.js +3 -0
- package/dist/components/query_history_viewer.d.ts +33 -0
- package/dist/components/query_history_viewer.js +268 -0
- package/dist/components/query_history_viewer.module.js +7 -0
- package/dist/components/query_profile/engine_profile_view.d.ts +19 -0
- package/dist/components/query_profile/engine_profile_view.js +94 -0
- package/dist/components/query_profile/numeric_limits.d.ts +1 -0
- package/dist/components/query_profile/numeric_limits.js +2 -0
- package/dist/components/query_profile/profile_execution_controller.d.ts +14 -0
- package/dist/components/query_profile/profile_execution_controller.js +56 -0
- package/dist/components/query_profile/profile_fit.d.ts +24 -0
- package/dist/components/query_profile/profile_fit.js +22 -0
- package/dist/components/query_profile/profile_navigation.d.ts +3 -0
- package/dist/components/query_profile/profile_navigation.js +34 -0
- package/dist/components/query_profile/profile_scene.d.ts +64 -0
- package/dist/components/query_profile/profile_scene.js +422 -0
- package/dist/components/query_profile/query_profile_view.d.ts +44 -0
- package/dist/components/query_profile/query_profile_view.js +961 -0
- package/dist/components/query_profile/query_profile_view.module.js +23 -0
- package/dist/components/query_progress/query_profile_overlay.d.ts +7 -0
- package/dist/components/query_progress/query_profile_overlay.js +67 -0
- package/dist/components/query_progress/query_profile_overlay.module.js +6 -0
- package/dist/components/query_progress/query_progress_panel.d.ts +14 -0
- package/dist/components/query_progress/query_progress_panel.js +255 -0
- package/dist/components/query_progress/query_progress_panel.module.js +10 -0
- package/dist/components/query_result/cell_detail_overlay.d.ts +34 -0
- package/dist/components/query_result/cell_detail_overlay.js +277 -0
- package/dist/components/query_result/cell_detail_overlay.module.js +21 -0
- package/dist/components/query_result/query_result_action_menu.d.ts +12 -0
- package/dist/components/query_result/query_result_action_menu.js +62 -0
- package/dist/components/query_result/query_result_action_menu.module.js +2 -0
- package/dist/components/query_result/query_result_details.d.ts +17 -0
- package/dist/components/query_result/query_result_details.js +46 -0
- package/dist/components/query_result/query_result_details.module.js +5 -0
- package/dist/components/query_result/query_result_download_button.d.ts +8 -0
- package/dist/components/query_result/query_result_download_button.js +38 -0
- package/dist/components/query_result/query_result_header.d.ts +21 -0
- package/dist/components/query_result/query_result_header.js +71 -0
- package/dist/components/query_result/query_result_header.module.js +3 -0
- package/dist/components/query_result/query_result_search_controls.d.ts +12 -0
- package/dist/components/query_result/query_result_search_controls.js +141 -0
- package/dist/components/query_result/query_result_search_controls.module.js +7 -0
- package/dist/components/query_result/query_result_toolbar.d.ts +21 -0
- package/dist/components/query_result/query_result_toolbar.js +74 -0
- package/dist/components/query_result/result_table_overlay.d.ts +9 -0
- package/dist/components/query_result/result_table_overlay.js +73 -0
- package/dist/components/query_result/result_table_overlay.module.js +6 -0
- package/dist/components/query_result/use_query_result_search.d.ts +8 -0
- package/dist/components/query_result/use_query_result_search.js +28 -0
- package/dist/components/segmented_control.d.ts +58 -0
- package/dist/components/segmented_control.js +116 -0
- package/dist/components/segmented_control.module.js +17 -0
- package/dist/components/separator.d.ts +21 -0
- package/dist/components/separator.js +79 -0
- package/dist/components/separator.module.js +7 -0
- package/dist/components/size_observer.d.ts +7 -0
- package/dist/components/size_observer.js +57 -0
- package/dist/components/skeleton.d.ts +2 -0
- package/dist/components/skeleton.js +14 -0
- package/dist/components/skeleton.module.js +2 -0
- package/dist/components/spinners.d.ts +8 -0
- package/dist/components/spinners.js +33 -0
- package/dist/components/spinners.module.js +8 -0
- package/dist/components/status_indicator.d.ts +36 -0
- package/dist/components/status_indicator.js +182 -0
- package/dist/components/status_indicator.module.js +3 -0
- package/dist/components/symbol_icon.d.ts +65 -0
- package/dist/components/symbol_icon.js +213 -0
- package/dist/components/tab_header.d.ts +11 -0
- package/dist/components/tab_header.js +55 -0
- package/dist/components/tab_header.module.js +7 -0
- package/dist/components/tag.d.ts +10 -0
- package/dist/components/tag.js +17 -0
- package/dist/components/tag.module.js +4 -0
- package/dist/components/text_field.d.ts +44 -0
- package/dist/components/text_field.js +159 -0
- package/dist/components/text_field.module.js +15 -0
- package/dist/components/text_input.d.ts +25 -0
- package/dist/components/text_input.js +90 -0
- package/dist/components/text_input.module.js +13 -0
- package/dist/components/text_input_action.d.ts +19 -0
- package/dist/components/text_input_action.js +33 -0
- package/dist/components/text_input_action.module.js +2 -0
- package/dist/components/toggle_switch.d.ts +7 -0
- package/dist/components/toggle_switch.js +22 -0
- package/dist/components/toggle_switch.module.js +6 -0
- package/dist/components/tooltip.d.ts +22 -0
- package/dist/components/tooltip.js +139 -0
- package/dist/components/tooltip.module.js +2 -0
- package/dist/components/tree_entry.d.ts +17 -0
- package/dist/components/tree_entry.js +48 -0
- package/dist/components/tree_entry.module.js +9 -0
- package/dist/components/value_list.d.ts +17 -0
- package/dist/components/value_list.js +70 -0
- package/dist/components/value_list.module.js +8 -0
- package/dist/components/vegalite_chart.d.ts +18 -0
- package/dist/components/vegalite_chart.js +151 -0
- package/dist/components/vegalite_chart.module.js +3 -0
- package/dist/components/vegalite_view.d.ts +27 -0
- package/dist/components/vegalite_view.js +248 -0
- package/dist/components/vegalite_view.module.js +5 -0
- package/dist/components/vertical_scroll_shadows.d.ts +14 -0
- package/dist/components/vertical_scroll_shadows.js +55 -0
- package/dist/components/vertical_scroll_shadows.module.js +5 -0
- package/dist/components/vertical_split.d.ts +15 -0
- package/dist/components/vertical_split.js +112 -0
- package/dist/components/vertical_split.module.js +5 -0
- package/dist/components/vertical_tabs.d.ts +36 -0
- package/dist/components/vertical_tabs.js +169 -0
- package/dist/components/vertical_tabs.module.js +23 -0
- package/dist/components/visualization/capped_rows.d.ts +9 -0
- package/dist/components/visualization/capped_rows.js +23 -0
- package/dist/components/visualization/capped_rows.module.js +3 -0
- package/dist/components/visualization/chart_download_button.d.ts +12 -0
- package/dist/components/visualization/chart_download_button.js +41 -0
- package/dist/components/visualization/kpi_view.d.ts +10 -0
- package/dist/components/visualization/kpi_view.js +215 -0
- package/dist/components/visualization/kpi_view.module.js +17 -0
- package/dist/components/visualization/markdown_view.d.ts +17 -0
- package/dist/components/visualization/markdown_view.js +154 -0
- package/dist/components/visualization/markdown_view.module.js +4 -0
- package/dist/components/visualization/result_rows.d.ts +17 -0
- package/dist/components/visualization/result_rows.js +82 -0
- package/dist/components/visualization/vegalite_preview.d.ts +8 -0
- package/dist/components/visualization/vegalite_preview.js +17 -0
- package/dist/components/visualization/vegalite_preview.module.js +2 -0
- package/dist/components/visualization/visualization_dispatch.d.ts +14 -0
- package/dist/components/visualization/visualization_dispatch.js +41 -0
- package/dist/components/visualization/visualization_panel.d.ts +10 -0
- package/dist/components/visualization/visualization_panel.js +37 -0
- package/dist/components/visualization/visualization_panel.module.js +3 -0
- package/dist/dom/anchored_position.d.ts +42 -0
- package/dist/dom/anchored_position.js +255 -0
- package/dist/dom/app_host.d.ts +6 -0
- package/dist/dom/app_host.js +13 -0
- package/dist/dom/calm_frames.d.ts +24 -0
- package/dist/dom/calm_frames.js +96 -0
- package/dist/dom/classnames.d.ts +8 -0
- package/dist/dom/classnames.js +20 -0
- package/dist/dom/download_file.d.ts +1 -0
- package/dist/dom/download_file.js +12 -0
- package/dist/dom/focus.d.ts +29 -0
- package/dist/dom/focus.js +84 -0
- package/dist/dom/graph_edges.d.ts +53 -0
- package/dist/dom/graph_edges.js +450 -0
- package/dist/dom/key_events.d.ts +9 -0
- package/dist/dom/key_events.js +33 -0
- package/dist/dom/media_query.d.ts +2 -0
- package/dist/dom/media_query.js +15 -0
- package/dist/dom/outside_click.d.ts +8 -0
- package/dist/dom/outside_click.js +32 -0
- package/dist/dom/rerender_ref.d.ts +2 -0
- package/dist/dom/rerender_ref.js +11 -0
- package/dist/dom/row_context_menu.d.ts +7 -0
- package/dist/dom/row_context_menu.js +32 -0
- package/dist/dom/scrollbar.d.ts +3 -0
- package/dist/dom/scrollbar.js +23 -0
- package/dist/format/format.d.ts +11 -0
- package/dist/format/format.js +72 -0
- package/dist/format/query_progress_format.d.ts +17 -0
- package/dist/format/query_progress_format.js +69 -0
- package/dist/format/time_format.d.ts +5 -0
- package/dist/format/time_format.js +45 -0
- package/dist/hooks.d.ts +71 -0
- package/dist/hooks.js +302 -0
- package/dist/host.d.ts +10 -0
- package/dist/host.js +12 -0
- package/dist/logger.d.ts +4 -0
- package/dist/logger.js +6 -0
- package/dist/models/computation_model.d.ts +14 -0
- package/dist/models/computation_model.js +27 -0
- package/dist/models/query_model.d.ts +12 -0
- package/dist/models/query_model.js +27 -0
- package/dist/models/script_model.d.ts +17 -0
- package/dist/models/script_model.js +69 -0
- package/dist/style.css +4226 -0
- package/dist/svg_symbols.d.ts +2 -0
- package/dist/svg_symbols.js +2 -0
- package/dist/symbols.svg +1197 -0
- package/dist/theme/color_scheme.d.ts +4 -0
- package/dist/theme/color_scheme.js +28 -0
- package/dist/theme/xcode_palette.d.ts +22 -0
- package/dist/theme/xcode_palette.js +4 -0
- package/dist/theme/xcode_palettes.js +41 -0
- package/dist/utils/plan_engine.d.ts +2 -0
- package/dist/utils/plan_engine.js +13 -0
- package/dist/vegalite/vegalite_check.d.ts +1 -0
- package/dist/vegalite/vegalite_check.js +7 -0
- package/dist/vegalite/vegalite_crossfilter.d.ts +54 -0
- package/dist/vegalite/vegalite_crossfilter.js +187 -0
- package/dist/vegalite/vegalite_image.d.ts +16 -0
- package/dist/vegalite/vegalite_image.js +28 -0
- package/dist/vegalite/vegalite_loader.d.ts +7 -0
- package/dist/vegalite/vegalite_loader.js +15 -0
- package/dist/vegalite/vegalite_rows.d.ts +3 -0
- package/dist/vegalite/vegalite_rows.js +17 -0
- package/dist/vegalite/vegalite_theme.d.ts +11 -0
- package/dist/vegalite/vegalite_theme.js +125 -0
- package/fonts/InstrumentSans-Bold.ttf +0 -0
- package/fonts/InstrumentSans-Medium.ttf +0 -0
- package/fonts/InstrumentSans-OFL.txt +93 -0
- package/fonts/InstrumentSans-Regular.ttf +0 -0
- package/fonts/InstrumentSans-SemiBold.ttf +0 -0
- package/fonts/JetBrainsMono-Bold.ttf +0 -0
- package/fonts/JetBrainsMono-Medium.ttf +0 -0
- package/fonts/JetBrainsMono-OFL.txt +93 -0
- package/fonts/JetBrainsMono-Regular.ttf +0 -0
- package/fonts/JetBrainsMono-SemiBold.ttf +0 -0
- package/fonts/fonts.css +61 -0
- package/package.json +43 -4
- package/styles/colors.css +110 -0
- package/styles/flavors/dbcom.css +48 -0
- package/styles/tokens.css +192 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { tooltip } from "./tooltip.module.js";
|
|
2
|
+
import { useKeyEvents } from "../dom/key_events.js";
|
|
3
|
+
import { AnchorAlignment, AnchorSide, getAnchoredPosition } from "../dom/anchored_position.js";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var directionToPosition = {
|
|
7
|
+
nw: {
|
|
8
|
+
side: AnchorSide.OutsideTop,
|
|
9
|
+
align: AnchorAlignment.Start
|
|
10
|
+
},
|
|
11
|
+
n: {
|
|
12
|
+
side: AnchorSide.OutsideTop,
|
|
13
|
+
align: AnchorAlignment.Center
|
|
14
|
+
},
|
|
15
|
+
ne: {
|
|
16
|
+
side: AnchorSide.OutsideTop,
|
|
17
|
+
align: AnchorAlignment.End
|
|
18
|
+
},
|
|
19
|
+
e: {
|
|
20
|
+
side: AnchorSide.OutsideRight,
|
|
21
|
+
align: AnchorAlignment.Center
|
|
22
|
+
},
|
|
23
|
+
se: {
|
|
24
|
+
side: AnchorSide.OutsideBottom,
|
|
25
|
+
align: AnchorAlignment.End
|
|
26
|
+
},
|
|
27
|
+
s: {
|
|
28
|
+
side: AnchorSide.OutsideBottom,
|
|
29
|
+
align: AnchorAlignment.Center
|
|
30
|
+
},
|
|
31
|
+
sw: {
|
|
32
|
+
side: AnchorSide.OutsideBottom,
|
|
33
|
+
align: AnchorAlignment.Start
|
|
34
|
+
},
|
|
35
|
+
w: {
|
|
36
|
+
side: AnchorSide.OutsideLeft,
|
|
37
|
+
align: AnchorAlignment.Center
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var positionToDirection = {
|
|
41
|
+
[AnchorSide.OutsideTop << 3 | AnchorAlignment.Start]: "nw",
|
|
42
|
+
[AnchorSide.OutsideTop << 3 | AnchorAlignment.Center]: "n",
|
|
43
|
+
[AnchorSide.OutsideTop << 3 | AnchorAlignment.End]: "ne",
|
|
44
|
+
[AnchorSide.OutsideRight << 3 | AnchorAlignment.Center]: "e",
|
|
45
|
+
[AnchorSide.OutsideBottom << 3 | AnchorAlignment.End]: "se",
|
|
46
|
+
[AnchorSide.OutsideBottom << 3 | AnchorAlignment.Center]: "s",
|
|
47
|
+
[AnchorSide.OutsideBottom << 3 | AnchorAlignment.Start]: "sw",
|
|
48
|
+
[AnchorSide.OutsideLeft << 3 | AnchorAlignment.Center]: "w"
|
|
49
|
+
};
|
|
50
|
+
var TooltipContext = React.createContext({});
|
|
51
|
+
function Tooltip(props) {
|
|
52
|
+
const tooltipId = React.useId();
|
|
53
|
+
const triggerRef = React.useRef(null);
|
|
54
|
+
const tooltipElRef = React.useRef(null);
|
|
55
|
+
const [calculatedDirection, setCalculatedDirection] = React.useState(props.direction);
|
|
56
|
+
const child = props.children;
|
|
57
|
+
const setTriggerRef = React.useCallback((element) => {
|
|
58
|
+
triggerRef.current = element;
|
|
59
|
+
const childRef = child?.props?.ref;
|
|
60
|
+
if (typeof childRef === "function") childRef(element);
|
|
61
|
+
else if (childRef && typeof childRef === "object") childRef.current = element;
|
|
62
|
+
}, [child]);
|
|
63
|
+
const openTooltip = () => {
|
|
64
|
+
if (tooltipElRef.current && triggerRef.current && tooltipElRef.current.hasAttribute("popover") && !tooltipElRef.current.matches(":popover-open")) {
|
|
65
|
+
const tooltip = tooltipElRef.current;
|
|
66
|
+
const trigger = triggerRef.current;
|
|
67
|
+
tooltip.showPopover();
|
|
68
|
+
const settings = props.direction ? directionToPosition[props.direction] : void 0;
|
|
69
|
+
const { top, left, anchorAlign, anchorSide } = getAnchoredPosition(tooltip, trigger, settings);
|
|
70
|
+
const calculatedDirection = positionToDirection[anchorSide << 3 | anchorAlign];
|
|
71
|
+
setCalculatedDirection(calculatedDirection);
|
|
72
|
+
tooltip.style.top = `${top}px`;
|
|
73
|
+
tooltip.style.left = `${left}px`;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
const closeTooltip = () => {
|
|
77
|
+
if (tooltipElRef.current && triggerRef.current && tooltipElRef.current.hasAttribute("popover") && tooltipElRef.current.matches(":popover-open")) tooltipElRef.current.hidePopover();
|
|
78
|
+
};
|
|
79
|
+
const value = React.useMemo(() => ({ tooltipId }), [tooltipId]);
|
|
80
|
+
React.useEffect(() => {
|
|
81
|
+
if (!tooltipElRef.current || !triggerRef.current) return;
|
|
82
|
+
tooltipElRef.current.setAttribute("popover", "auto");
|
|
83
|
+
}, [
|
|
84
|
+
tooltipElRef,
|
|
85
|
+
triggerRef,
|
|
86
|
+
props.direction,
|
|
87
|
+
props.type
|
|
88
|
+
]);
|
|
89
|
+
const keyEvents = React.useMemo(() => [{
|
|
90
|
+
key: "Escape",
|
|
91
|
+
ctrlKey: false,
|
|
92
|
+
callback: (event) => {
|
|
93
|
+
if (tooltipElRef.current?.matches(":popover-open")) {
|
|
94
|
+
event.stopImmediatePropagation();
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
closeTooltip();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}], []);
|
|
100
|
+
useKeyEvents(keyEvents);
|
|
101
|
+
return /* @__PURE__ */ jsx(TooltipContext.Provider, {
|
|
102
|
+
value,
|
|
103
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [child && React.cloneElement(child, {
|
|
104
|
+
ref: setTriggerRef,
|
|
105
|
+
"aria-describedby": props.type === "description" ? tooltipId : child.props ? child.props["aria-describedby"] : void 0,
|
|
106
|
+
"aria-labelledby": props.type === "label" && child.props?.["aria-label"] == null ? tooltipId : child.props?.["aria-labelledby"],
|
|
107
|
+
onBlur: (event) => {
|
|
108
|
+
closeTooltip();
|
|
109
|
+
child.props?.onBlur?.(event);
|
|
110
|
+
},
|
|
111
|
+
onFocus: (event) => {
|
|
112
|
+
try {
|
|
113
|
+
if (!event.target.matches(":focus-visible")) return;
|
|
114
|
+
} catch {}
|
|
115
|
+
openTooltip();
|
|
116
|
+
child.props?.onFocus?.(event);
|
|
117
|
+
},
|
|
118
|
+
onMouseEnter: (event) => {
|
|
119
|
+
openTooltip();
|
|
120
|
+
child.props?.onMouseEnter?.(event);
|
|
121
|
+
},
|
|
122
|
+
onMouseLeave: (event) => {
|
|
123
|
+
closeTooltip();
|
|
124
|
+
child.props?.onMouseLeave?.(event);
|
|
125
|
+
}
|
|
126
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
127
|
+
className: tooltip,
|
|
128
|
+
ref: tooltipElRef,
|
|
129
|
+
"data-direction": calculatedDirection,
|
|
130
|
+
role: props.type === "description" ? "tooltip" : void 0,
|
|
131
|
+
"aria-hidden": props.type === "label" ? true : void 0,
|
|
132
|
+
id: tooltipId,
|
|
133
|
+
onMouseEnter: openTooltip,
|
|
134
|
+
onMouseLeave: closeTooltip,
|
|
135
|
+
children: props.text
|
|
136
|
+
})] })
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
export { Tooltip, TooltipContext };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const TREE_ENTRY_INDENT_PX = 16;
|
|
3
|
+
export interface TreeEntryProps extends Omit<React.HTMLAttributes<HTMLElement>, 'className' | 'style'> {
|
|
4
|
+
depth: number;
|
|
5
|
+
expanded?: boolean;
|
|
6
|
+
icon?: React.ReactElement | null;
|
|
7
|
+
label: React.ReactNode;
|
|
8
|
+
selected?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare function TreeEntry({ depth, expanded, icon, label, selected, className, children, ...attributes }: TreeEntryProps): React.ReactElement;
|
|
13
|
+
export interface TreeEntryNameProps {
|
|
14
|
+
children: string;
|
|
15
|
+
title?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function TreeEntryName(props: TreeEntryNameProps): React.ReactElement;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ChevronDownIcon, ChevronRightIcon } from "./symbol_icon.js";
|
|
2
|
+
import { classNames } from "../dom/classnames.js";
|
|
3
|
+
import { caret, cell_name, entry, name } from "./tree_entry.module.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var TREE_ENTRY_INDENT_PX = 16;
|
|
7
|
+
var TREE_ENTRY_PADDING_PX = 8;
|
|
8
|
+
function TreeEntry({ depth, expanded, icon: icon$1, label, selected, className, children, ...attributes }) {
|
|
9
|
+
const Caret = expanded == null ? null : expanded ? ChevronDownIcon : ChevronRightIcon;
|
|
10
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("span", {
|
|
11
|
+
className: classNames(cell_name, icon$1 == null && "dashql_cell_name_without_icon_r8_YiX"),
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ jsx("span", {
|
|
14
|
+
className: caret,
|
|
15
|
+
children: Caret && /* @__PURE__ */ jsx(Caret, { size: 12 })
|
|
16
|
+
}),
|
|
17
|
+
icon$1 != null && /* @__PURE__ */ jsx("span", {
|
|
18
|
+
className: "dashql_icon_7SZW_-",
|
|
19
|
+
"aria-hidden": "true",
|
|
20
|
+
children: icon$1
|
|
21
|
+
}),
|
|
22
|
+
label
|
|
23
|
+
]
|
|
24
|
+
}), children] });
|
|
25
|
+
const props = {
|
|
26
|
+
...attributes,
|
|
27
|
+
"data-depth": depth,
|
|
28
|
+
className: classNames(entry, attributes.onClick != null && "dashql_entry_interactive_s7-WLU", selected && "dashql_entry_selected_PTT72t", className),
|
|
29
|
+
style: { paddingLeft: TREE_ENTRY_PADDING_PX + depth * 16 }
|
|
30
|
+
};
|
|
31
|
+
return attributes.onClick == null ? /* @__PURE__ */ jsx("div", {
|
|
32
|
+
...props,
|
|
33
|
+
children: content
|
|
34
|
+
}) : /* @__PURE__ */ jsx("button", {
|
|
35
|
+
type: "button",
|
|
36
|
+
"aria-expanded": expanded,
|
|
37
|
+
...props,
|
|
38
|
+
children: content
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function TreeEntryName(props) {
|
|
42
|
+
return /* @__PURE__ */ jsx("span", {
|
|
43
|
+
className: name,
|
|
44
|
+
title: props.title ?? props.children,
|
|
45
|
+
children: props.children
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
export { TREE_ENTRY_INDENT_PX, TreeEntry, TreeEntryName };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var entry = "dashql_entry_glG-hM";
|
|
2
|
+
var entry_interactive = "dashql_entry_interactive_s7-WLU";
|
|
3
|
+
var entry_selected = "dashql_entry_selected_PTT72t";
|
|
4
|
+
var cell_name = "dashql_cell_name_JRny8y";
|
|
5
|
+
var cell_name_without_icon = "dashql_cell_name_without_icon_r8_YiX";
|
|
6
|
+
var caret = "dashql_caret_5Ieh2s";
|
|
7
|
+
var icon = "dashql_icon_7SZW_-";
|
|
8
|
+
var name = "dashql_name_xJlLtA";
|
|
9
|
+
export { caret, cell_name, cell_name_without_icon, entry, entry_interactive, entry_selected, icon, name };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Dispatch } from '@akohn/dashql/platform/utils/variant';
|
|
3
|
+
export type ValueListElement = string;
|
|
4
|
+
export type UpdateValueList = (prev: ValueListElement[]) => ValueListElement[];
|
|
5
|
+
interface Props {
|
|
6
|
+
className?: string;
|
|
7
|
+
title: string;
|
|
8
|
+
caption?: string;
|
|
9
|
+
valueIcon?: React.ElementType;
|
|
10
|
+
addButtonLabel: string;
|
|
11
|
+
elements: ValueListElement[];
|
|
12
|
+
modifyElements: Dispatch<UpdateValueList>;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
readOnly?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const ValueListBuilder: React.FC<Props>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { add_button, element, list, list_elements, list_name, path } from "./value_list.module.js";
|
|
2
|
+
import { PlusIcon, XIcon } from "./symbol_icon.js";
|
|
3
|
+
import { classNames } from "../dom/classnames.js";
|
|
4
|
+
import { TextInput } from "./text_input.js";
|
|
5
|
+
import { TextInputAction } from "./text_input_action.js";
|
|
6
|
+
import { ButtonSize, IconButton } from "./button.js";
|
|
7
|
+
import "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var ValueListBuilder = (props) => {
|
|
10
|
+
const appendElement = () => props.modifyElements((list) => {
|
|
11
|
+
const copy = [...list];
|
|
12
|
+
copy.push("");
|
|
13
|
+
return copy;
|
|
14
|
+
});
|
|
15
|
+
const deleteIndex = (index) => props.modifyElements((list) => {
|
|
16
|
+
const copy = [...list];
|
|
17
|
+
copy.splice(index, 1);
|
|
18
|
+
return copy;
|
|
19
|
+
});
|
|
20
|
+
const modifyElement = (index, value) => props.modifyElements((list) => {
|
|
21
|
+
const copy = [...list];
|
|
22
|
+
copy[index] = value;
|
|
23
|
+
return copy;
|
|
24
|
+
});
|
|
25
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
26
|
+
className: classNames(props.className, list),
|
|
27
|
+
role: "group",
|
|
28
|
+
"aria-label": props.title,
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsx("div", {
|
|
31
|
+
className: list_name,
|
|
32
|
+
children: props.title
|
|
33
|
+
}),
|
|
34
|
+
props.caption && /* @__PURE__ */ jsx("div", {
|
|
35
|
+
className: "dashql_list_caption_MNvVNj",
|
|
36
|
+
children: props.caption
|
|
37
|
+
}),
|
|
38
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
39
|
+
className: add_button,
|
|
40
|
+
"aria-label": "Add Entry",
|
|
41
|
+
onClick: appendElement,
|
|
42
|
+
disabled: props.disabled,
|
|
43
|
+
size: ButtonSize.Small,
|
|
44
|
+
children: /* @__PURE__ */ jsx(PlusIcon, {})
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ jsx("div", {
|
|
47
|
+
className: list_elements,
|
|
48
|
+
children: props.elements.map((elem, i) => /* @__PURE__ */ jsx("div", {
|
|
49
|
+
className: element,
|
|
50
|
+
children: /* @__PURE__ */ jsx(TextInput, {
|
|
51
|
+
block: true,
|
|
52
|
+
className: path,
|
|
53
|
+
value: elem,
|
|
54
|
+
onChange: (ev) => modifyElement(i, ev.target.value),
|
|
55
|
+
leadingVisual: props.valueIcon,
|
|
56
|
+
trailingAction: /* @__PURE__ */ jsx(TextInputAction, {
|
|
57
|
+
"aria-label": "Clear input",
|
|
58
|
+
"aria-labelledby": "",
|
|
59
|
+
onClick: () => deleteIndex(i),
|
|
60
|
+
children: /* @__PURE__ */ jsx(XIcon, {})
|
|
61
|
+
}),
|
|
62
|
+
disabled: props.disabled,
|
|
63
|
+
readOnly: props.disabled
|
|
64
|
+
})
|
|
65
|
+
}, i))
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
export { ValueListBuilder };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var list = "dashql_list_nUlbEH";
|
|
2
|
+
var list_name = "dashql_list_name_fy6kr6";
|
|
3
|
+
var list_caption = "dashql_list_caption_MNvVNj";
|
|
4
|
+
var add_button = "dashql_add_button_k9-xRx";
|
|
5
|
+
var list_elements = "dashql_list_elements_VDWjza";
|
|
6
|
+
var element = "dashql_element_M5CY0d";
|
|
7
|
+
var path = "dashql_path_ONGlsm";
|
|
8
|
+
export { add_button, element, list, list_caption, list_elements, list_name, path };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { TopLevelSpec } from 'vega-lite';
|
|
3
|
+
import type { View } from 'vega';
|
|
4
|
+
import { type VegaModules } from '../vegalite/vegalite_loader.js';
|
|
5
|
+
import { type ChartColors } from '../vegalite/vegalite_theme.js';
|
|
6
|
+
export type VegaDatasets = Readonly<Record<string, readonly object[]>>;
|
|
7
|
+
export type VegaSignals = Readonly<Record<string, unknown>>;
|
|
8
|
+
interface Props {
|
|
9
|
+
spec: TopLevelSpec | ((colors: ChartColors) => TopLevelSpec);
|
|
10
|
+
datasets: VegaDatasets;
|
|
11
|
+
signals?: VegaSignals;
|
|
12
|
+
className?: string;
|
|
13
|
+
onView?: (view: View | null) => void;
|
|
14
|
+
loader?: () => Promise<VegaModules>;
|
|
15
|
+
'data-testid'?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function VegaLiteChart(props: Props): React.ReactElement;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { useObservedSize } from "./size_observer.js";
|
|
2
|
+
import { loadVega } from "../vegalite/vegalite_loader.js";
|
|
3
|
+
import { createEmbedOptions, resolveChartColors } from "../vegalite/vegalite_theme.js";
|
|
4
|
+
import { useColorScheme } from "../theme/color_scheme.js";
|
|
5
|
+
import { useBrand } from "../brand/brand.js";
|
|
6
|
+
import { chart } from "./vegalite_chart.module.js";
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { withViewEncodings } from "@akohn/dashql/platform/workbook/chart_config";
|
|
10
|
+
function applyUpdates(vega, view, applied, appliedSignals, datasets, signals) {
|
|
11
|
+
let changed = false;
|
|
12
|
+
for (const [name, items] of Object.entries(datasets)) {
|
|
13
|
+
let state = applied.get(name);
|
|
14
|
+
if (state?.items === items) continue;
|
|
15
|
+
state ??= {
|
|
16
|
+
items: [],
|
|
17
|
+
rows: /* @__PURE__ */ new WeakMap()
|
|
18
|
+
};
|
|
19
|
+
const previous = new Set(state.items);
|
|
20
|
+
const next = new Set(items);
|
|
21
|
+
const rowOf = (item) => {
|
|
22
|
+
let row = state.rows.get(item);
|
|
23
|
+
if (row == null) {
|
|
24
|
+
row = { ...item };
|
|
25
|
+
state.rows.set(item, row);
|
|
26
|
+
}
|
|
27
|
+
return row;
|
|
28
|
+
};
|
|
29
|
+
const removed = state.items.filter((item) => !next.has(item)).map(rowOf);
|
|
30
|
+
const inserted = items.filter((item) => !previous.has(item)).map(rowOf);
|
|
31
|
+
view.change(name, vega.changeset().remove(removed).insert(inserted));
|
|
32
|
+
applied.set(name, {
|
|
33
|
+
items,
|
|
34
|
+
rows: state.rows
|
|
35
|
+
});
|
|
36
|
+
changed = true;
|
|
37
|
+
}
|
|
38
|
+
for (const [name, value] of Object.entries(signals)) {
|
|
39
|
+
if (appliedSignals.has(name) && Object.is(appliedSignals.get(name), value)) continue;
|
|
40
|
+
view.signal(name, value);
|
|
41
|
+
appliedSignals.set(name, value);
|
|
42
|
+
changed = true;
|
|
43
|
+
}
|
|
44
|
+
return changed;
|
|
45
|
+
}
|
|
46
|
+
var NO_SIGNALS = {};
|
|
47
|
+
function VegaLiteChart(props) {
|
|
48
|
+
const container = React.useRef(null);
|
|
49
|
+
const size = useObservedSize(container);
|
|
50
|
+
const [error$1, setError] = React.useState(null);
|
|
51
|
+
const [ready, setReady] = React.useState(false);
|
|
52
|
+
const viewRef = React.useRef(null);
|
|
53
|
+
const applied = React.useRef(/* @__PURE__ */ new Map());
|
|
54
|
+
const appliedSignals = React.useRef(/* @__PURE__ */ new Map());
|
|
55
|
+
const signals = props.signals ?? NO_SIGNALS;
|
|
56
|
+
const latest = React.useRef({
|
|
57
|
+
datasets: props.datasets,
|
|
58
|
+
signals
|
|
59
|
+
});
|
|
60
|
+
latest.current = {
|
|
61
|
+
datasets: props.datasets,
|
|
62
|
+
signals
|
|
63
|
+
};
|
|
64
|
+
const onView = React.useRef(props.onView);
|
|
65
|
+
onView.current = props.onView;
|
|
66
|
+
const loader = props.loader ?? loadVega;
|
|
67
|
+
const colorScheme = useColorScheme();
|
|
68
|
+
const flavorId = useBrand().id;
|
|
69
|
+
const datasetSizes = Object.fromEntries(Object.entries(props.datasets).map(([name, items]) => [`data-dataset-${name}`, items.length]));
|
|
70
|
+
const spec = props.spec;
|
|
71
|
+
React.useEffect(() => {
|
|
72
|
+
const element = container.current;
|
|
73
|
+
if (element == null) return;
|
|
74
|
+
let disposed = false;
|
|
75
|
+
let view = null;
|
|
76
|
+
setReady(false);
|
|
77
|
+
loader().then(async ({ embed, vega, expressionInterpreter }) => {
|
|
78
|
+
if (disposed) return;
|
|
79
|
+
const colors = resolveChartColors();
|
|
80
|
+
const runtimeSpec = {
|
|
81
|
+
...withViewEncodings(typeof spec === "function" ? spec(colors) : spec),
|
|
82
|
+
width: "container",
|
|
83
|
+
height: "container",
|
|
84
|
+
autosize: {
|
|
85
|
+
type: "fit",
|
|
86
|
+
contains: "padding",
|
|
87
|
+
resize: false
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
const result = await embed(element, runtimeSpec, createEmbedOptions(colors, expressionInterpreter));
|
|
91
|
+
if (disposed) {
|
|
92
|
+
result.view.finalize();
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
view = result.view;
|
|
96
|
+
applied.current = /* @__PURE__ */ new Map();
|
|
97
|
+
appliedSignals.current = /* @__PURE__ */ new Map();
|
|
98
|
+
applyUpdates(vega, view, applied.current, appliedSignals.current, latest.current.datasets, latest.current.signals);
|
|
99
|
+
await view.resize().runAsync();
|
|
100
|
+
viewRef.current = {
|
|
101
|
+
view,
|
|
102
|
+
vega
|
|
103
|
+
};
|
|
104
|
+
onView.current?.(view);
|
|
105
|
+
setError(null);
|
|
106
|
+
setReady(true);
|
|
107
|
+
}).catch((e) => {
|
|
108
|
+
if (!disposed) setError(e instanceof Error ? e.message : String(e));
|
|
109
|
+
});
|
|
110
|
+
return () => {
|
|
111
|
+
disposed = true;
|
|
112
|
+
viewRef.current = null;
|
|
113
|
+
if (view != null) {
|
|
114
|
+
onView.current?.(null);
|
|
115
|
+
view.finalize();
|
|
116
|
+
}
|
|
117
|
+
element.replaceChildren();
|
|
118
|
+
};
|
|
119
|
+
}, [
|
|
120
|
+
spec,
|
|
121
|
+
loader,
|
|
122
|
+
colorScheme,
|
|
123
|
+
flavorId
|
|
124
|
+
]);
|
|
125
|
+
React.useEffect(() => {
|
|
126
|
+
const current = viewRef.current;
|
|
127
|
+
if (current == null || !ready) return;
|
|
128
|
+
if (applyUpdates(current.vega, current.view, applied.current, appliedSignals.current, props.datasets, signals)) current.view.resize().runAsync().catch((e) => setError(e instanceof Error ? e.message : String(e)));
|
|
129
|
+
}, [
|
|
130
|
+
ready,
|
|
131
|
+
props.datasets,
|
|
132
|
+
signals
|
|
133
|
+
]);
|
|
134
|
+
React.useEffect(() => {
|
|
135
|
+
viewRef.current?.view.resize().runAsync().catch(() => {});
|
|
136
|
+
}, [size?.width, size?.height]);
|
|
137
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
138
|
+
className: props.className,
|
|
139
|
+
"data-testid": props["data-testid"],
|
|
140
|
+
"data-state": error$1 != null ? "error" : ready ? "ready" : "loading",
|
|
141
|
+
...datasetSizes,
|
|
142
|
+
children: [error$1 != null && /* @__PURE__ */ jsx("div", {
|
|
143
|
+
className: "dashql_error_xeWDyI",
|
|
144
|
+
children: error$1
|
|
145
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
146
|
+
ref: container,
|
|
147
|
+
className: chart
|
|
148
|
+
})]
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
export { VegaLiteChart };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { Config, TopLevelSpec } from 'vega-lite';
|
|
3
|
+
import { type ChartColors } from '../vegalite/vegalite_theme.js';
|
|
4
|
+
import type { QueryModel } from '../models/query_model.js';
|
|
5
|
+
type VegaEmbed = typeof import('vega-embed').default;
|
|
6
|
+
type VegaExpressionInterpreter = typeof import('vega-interpreter').expressionInterpreter;
|
|
7
|
+
export interface VegaLiteViewDependencies {
|
|
8
|
+
loadVega(): Promise<{
|
|
9
|
+
embed: VegaEmbed;
|
|
10
|
+
expressionInterpreter: VegaExpressionInterpreter;
|
|
11
|
+
}>;
|
|
12
|
+
useNearViewport(ref: React.RefObject<HTMLElement | null>, mounted: boolean): boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function useNearViewport(ref: React.RefObject<HTMLElement | null>, mounted: boolean): boolean;
|
|
15
|
+
export interface VegaLiteViewProps {
|
|
16
|
+
model: QueryModel | null;
|
|
17
|
+
vegaLiteSpec: TopLevelSpec | null;
|
|
18
|
+
width?: number;
|
|
19
|
+
height?: number;
|
|
20
|
+
scale?: number;
|
|
21
|
+
hideLegend?: boolean;
|
|
22
|
+
config?: (colors: ChartColors) => Config;
|
|
23
|
+
className?: string;
|
|
24
|
+
dependencies?: VegaLiteViewDependencies;
|
|
25
|
+
}
|
|
26
|
+
export declare function VegaLiteView(props: VegaLiteViewProps): React.ReactElement;
|
|
27
|
+
export {};
|