@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.
- package/LICENSE +373 -0
- package/NOTICE +118 -0
- package/README.md +133 -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 +39 -0
- package/dist/components/data_table/data_table.js +415 -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 +22 -0
- package/dist/components/data_table/data_table_cell_data.js +103 -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 +29 -0
- package/dist/components/data_table/data_table_cell_header_plots.js +120 -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_row_detail.d.ts +22 -0
- package/dist/components/data_table/data_table_row_detail.js +68 -0
- package/dist/components/data_table/data_table_row_detail.module.js +7 -0
- package/dist/components/data_table/data_table_sticky_views.d.ts +35 -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 +22 -0
- package/dist/components/data_table/histogram_brush.js +105 -0
- package/dist/components/data_table/histogram_cell.d.ts +17 -0
- package/dist/components/data_table/histogram_cell.js +324 -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 +12 -0
- package/dist/components/name_input.js +63 -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 +31 -0
- package/dist/components/query_history_viewer.js +271 -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 +12 -0
- package/dist/components/query_profile/profile_execution_controller.js +44 -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 +36 -0
- package/dist/components/query_profile/query_profile_view.js +953 -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 +72 -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/sheet.d.ts +11 -0
- package/dist/components/sheet.js +65 -0
- package/dist/components/sheet.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 +16 -0
- package/dist/components/vegalite_chart.js +149 -0
- package/dist/components/vegalite_chart.module.js +3 -0
- package/dist/components/vegalite_view.d.ts +26 -0
- package/dist/components/vegalite_view.js +239 -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 +13 -0
- package/dist/components/visualization/visualization_dispatch.js +40 -0
- package/dist/components/visualization/visualization_panel.d.ts +10 -0
- package/dist/components/visualization/visualization_panel.js +36 -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 +2 -0
- package/dist/dom/app_host.js +7 -0
- package/dist/dom/calm_frames.d.ts +29 -0
- package/dist/dom/calm_frames.js +120 -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 +5 -0
- package/dist/dom/media_query.js +18 -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 +72 -0
- package/dist/hooks.js +305 -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 +13 -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 +59 -0
- package/dist/platform/content_length.d.ts +1 -0
- package/dist/platform/content_length.js +7 -0
- package/dist/platform/core_provider.d.ts +18 -0
- package/dist/platform/core_provider.js +106 -0
- package/dist/platform/embedded_database_provider.d.ts +19 -0
- package/dist/platform/embedded_database_provider.js +53 -0
- package/dist/platform/page_runtime.d.ts +3 -0
- package/dist/platform/page_runtime.js +29 -0
- package/dist/style.css +4386 -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 +14 -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 +23 -0
- package/dist/vegalite/vegalite_theme.d.ts +13 -0
- package/dist/vegalite/vegalite_theme.js +141 -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 +403 -4
- package/styles/colors.css +110 -0
- package/styles/flavors/dbcom.css +48 -0
- package/styles/tokens.css +192 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export declare const VIEWBOX_SIZE = 200;
|
|
2
|
+
export declare const OUTLINE_POINTS = 200;
|
|
3
|
+
type Cubic = [number, number, number, number, number, number, number, number];
|
|
4
|
+
export declare function parseClosedPath(d: string): Cubic[];
|
|
5
|
+
export declare function resampleClosed(poly: ArrayLike<number>, n: number): Float64Array;
|
|
6
|
+
export declare function signedArea(outline: ArrayLike<number>): number;
|
|
7
|
+
export declare function alignmentCost(a: ArrayLike<number>, b: ArrayLike<number>, offset: number): number;
|
|
8
|
+
export declare function alignOutline(a: ArrayLike<number>, b: Float64Array): {
|
|
9
|
+
outline: Float64Array;
|
|
10
|
+
offset: number;
|
|
11
|
+
};
|
|
12
|
+
interface FaceRegion {
|
|
13
|
+
arcs: [number, number][];
|
|
14
|
+
angles: Float64Array;
|
|
15
|
+
chordArc: Int32Array;
|
|
16
|
+
chordT: Float64Array;
|
|
17
|
+
}
|
|
18
|
+
export interface MorphPiece {
|
|
19
|
+
face: FaceRegion;
|
|
20
|
+
faceRest: Float64Array;
|
|
21
|
+
logo: Float64Array;
|
|
22
|
+
logoPath: string;
|
|
23
|
+
travel: Float64Array;
|
|
24
|
+
logoCenter: [number, number];
|
|
25
|
+
}
|
|
26
|
+
export interface BrandCutout {
|
|
27
|
+
d: string;
|
|
28
|
+
transform: string;
|
|
29
|
+
}
|
|
30
|
+
export interface WobbleBrand {
|
|
31
|
+
id: string;
|
|
32
|
+
pieces: readonly MorphPiece[];
|
|
33
|
+
cutouts: readonly BrandCutout[];
|
|
34
|
+
}
|
|
35
|
+
export declare const DASHQL_BRAND: WobbleBrand;
|
|
36
|
+
export declare const DBCOM_BRAND: WobbleBrand;
|
|
37
|
+
export declare const OMEN_BRAND: WobbleBrand;
|
|
38
|
+
export interface MorphFrame {
|
|
39
|
+
progress: number;
|
|
40
|
+
time: number;
|
|
41
|
+
wobble: number;
|
|
42
|
+
lag: number;
|
|
43
|
+
ripple: number;
|
|
44
|
+
}
|
|
45
|
+
export declare function morphPoints(piece: MorphPiece, frame: MorphFrame, out: Float64Array, scratch: Float64Array): void;
|
|
46
|
+
export declare function outlinePath(outline: ArrayLike<number>): string;
|
|
47
|
+
export declare function outlineBounds(outline: ArrayLike<number>): [number, number, number, number];
|
|
48
|
+
export interface Spring {
|
|
49
|
+
value: number;
|
|
50
|
+
velocity: number;
|
|
51
|
+
}
|
|
52
|
+
export declare function stepSpring(spring: Spring, target: number, stiffness: number, damping: number, dt: number): void;
|
|
53
|
+
export declare function springAtRest(spring: Spring, target: number): boolean;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
var VIEWBOX_SIZE = 200;
|
|
2
|
+
var OUTLINE_POINTS = 200;
|
|
3
|
+
var FACE_CENTER = 100;
|
|
4
|
+
var FACE_RADIUS = 70;
|
|
5
|
+
var FACE_SEAM_OVERLAP = 3 * Math.PI / 180;
|
|
6
|
+
var FACE_OVERSHOOT = .3;
|
|
7
|
+
var DASHQL_PIECE_UPPER = {
|
|
8
|
+
d: "M171.857,146.784C172.231,148.654 173.873,150 175.779,150C189.377,150 241.375,150 257.621,150C258.819,150 259.954,149.463 260.714,148.536C261.474,147.609 261.778,146.391 261.543,145.216C259.52,135.099 254.853,111.766 253.143,103.216C252.769,101.346 251.128,100 249.221,100C241.703,100 223.297,100 215.779,100C213.872,100 212.231,98.654 211.857,96.784C210.051,87.756 204.949,62.244 203.143,53.216C202.769,51.346 201.128,50 199.221,50C190.646,50 167.521,50 157.379,50C156.181,50 155.046,50.537 154.286,51.464C153.526,52.391 153.222,53.609 153.457,54.784C156.947,72.235 168.94,132.201 171.857,146.784Z",
|
|
9
|
+
map: (x, y) => dashqlPoint(x, y, -12.5)
|
|
10
|
+
};
|
|
11
|
+
var DASHQL_PIECE_LOWER = {
|
|
12
|
+
d: "M38.457,104.784C38.222,103.609 38.526,102.391 39.286,101.464C40.046,100.537 41.181,100 42.379,100C58.625,100 110.623,100 124.221,100C126.127,100 127.769,101.346 128.143,103.216C131.06,117.799 143.053,177.765 146.543,195.216C146.778,196.391 146.474,197.609 145.714,198.536C144.954,199.463 143.819,200 142.621,200C132.479,200 109.354,200 100.779,200C98.872,200 97.231,198.654 96.857,196.784C95.051,187.756 89.949,162.244 88.143,153.216C87.769,151.346 86.128,150 84.221,150C76.703,150 58.297,150 50.779,150C48.872,150 47.231,148.654 46.857,146.784C45.147,138.234 40.48,114.901 38.457,104.784Z",
|
|
13
|
+
map: (x, y) => dashqlPoint(x, y, 12.5)
|
|
14
|
+
};
|
|
15
|
+
var DASHQL_SCALE = .9;
|
|
16
|
+
function dashqlPoint(x, y, dx) {
|
|
17
|
+
const [px, py] = dashqlFilePoint(x, y, dx);
|
|
18
|
+
const c = 100;
|
|
19
|
+
return [c + (px - c) * DASHQL_SCALE, c + (py - c) * DASHQL_SCALE];
|
|
20
|
+
}
|
|
21
|
+
function dashqlFilePoint(x, y, dx) {
|
|
22
|
+
let px = 1.25 * (x + dx) - 61.401;
|
|
23
|
+
let py = .935 * (y + 25) + 253.25;
|
|
24
|
+
px = .8 * px;
|
|
25
|
+
py = 1.06952 * py - 16.3556;
|
|
26
|
+
return [px, py - 304.5];
|
|
27
|
+
}
|
|
28
|
+
function parseClosedPath(d) {
|
|
29
|
+
const tokens = d.match(/[MCQLZ]|-?\d*\.?\d+(?:e[-+]?\d+)?/gi) ?? [];
|
|
30
|
+
const segments = [];
|
|
31
|
+
let i = 0;
|
|
32
|
+
let command = "";
|
|
33
|
+
let startX = 0, startY = 0, x = 0, y = 0;
|
|
34
|
+
const num = () => Number(tokens[i++]);
|
|
35
|
+
while (i < tokens.length) {
|
|
36
|
+
if (/^[a-z]$/i.test(tokens[i])) command = tokens[i++];
|
|
37
|
+
switch (command) {
|
|
38
|
+
case "M":
|
|
39
|
+
x = startX = num();
|
|
40
|
+
y = startY = num();
|
|
41
|
+
command = "L";
|
|
42
|
+
break;
|
|
43
|
+
case "L": {
|
|
44
|
+
const nx = num(), ny = num();
|
|
45
|
+
segments.push([
|
|
46
|
+
x,
|
|
47
|
+
y,
|
|
48
|
+
x,
|
|
49
|
+
y,
|
|
50
|
+
nx,
|
|
51
|
+
ny,
|
|
52
|
+
nx,
|
|
53
|
+
ny
|
|
54
|
+
]);
|
|
55
|
+
x = nx;
|
|
56
|
+
y = ny;
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
case "C": {
|
|
60
|
+
const c = [
|
|
61
|
+
num(),
|
|
62
|
+
num(),
|
|
63
|
+
num(),
|
|
64
|
+
num(),
|
|
65
|
+
num(),
|
|
66
|
+
num()
|
|
67
|
+
];
|
|
68
|
+
segments.push([
|
|
69
|
+
x,
|
|
70
|
+
y,
|
|
71
|
+
c[0],
|
|
72
|
+
c[1],
|
|
73
|
+
c[2],
|
|
74
|
+
c[3],
|
|
75
|
+
c[4],
|
|
76
|
+
c[5]
|
|
77
|
+
]);
|
|
78
|
+
x = c[4];
|
|
79
|
+
y = c[5];
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
case "Q": {
|
|
83
|
+
const qx = num(), qy = num(), nx = num(), ny = num();
|
|
84
|
+
segments.push([
|
|
85
|
+
x,
|
|
86
|
+
y,
|
|
87
|
+
x + 2 / 3 * (qx - x),
|
|
88
|
+
y + 2 / 3 * (qy - y),
|
|
89
|
+
nx + 2 / 3 * (qx - nx),
|
|
90
|
+
ny + 2 / 3 * (qy - ny),
|
|
91
|
+
nx,
|
|
92
|
+
ny
|
|
93
|
+
]);
|
|
94
|
+
x = nx;
|
|
95
|
+
y = ny;
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
case "Z":
|
|
99
|
+
if (Math.hypot(x - startX, y - startY) > 1e-6) segments.push([
|
|
100
|
+
x,
|
|
101
|
+
y,
|
|
102
|
+
x,
|
|
103
|
+
y,
|
|
104
|
+
startX,
|
|
105
|
+
startY,
|
|
106
|
+
startX,
|
|
107
|
+
startY
|
|
108
|
+
]);
|
|
109
|
+
x = startX;
|
|
110
|
+
y = startY;
|
|
111
|
+
command = "";
|
|
112
|
+
break;
|
|
113
|
+
default: throw new Error(`unsupported path command: ${command} in ${d}`);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return segments;
|
|
117
|
+
}
|
|
118
|
+
function flattenCubics(segments, steps = 48) {
|
|
119
|
+
const out = [];
|
|
120
|
+
for (const [x0, y0, x1, y1, x2, y2, x3, y3] of segments) for (let s = 0; s < steps; ++s) {
|
|
121
|
+
const t = s / steps, u = 1 - t;
|
|
122
|
+
const a = u * u * u, b = 3 * u * u * t, c = 3 * u * t * t, e = t * t * t;
|
|
123
|
+
out.push(a * x0 + b * x1 + c * x2 + e * x3, a * y0 + b * y1 + c * y2 + e * y3);
|
|
124
|
+
}
|
|
125
|
+
return out;
|
|
126
|
+
}
|
|
127
|
+
function resampleClosed(poly, n) {
|
|
128
|
+
const m = poly.length / 2;
|
|
129
|
+
const cumulative = new Float64Array(m + 1);
|
|
130
|
+
for (let i = 0; i < m; ++i) {
|
|
131
|
+
const j = (i + 1) % m;
|
|
132
|
+
cumulative[i + 1] = cumulative[i] + Math.hypot(poly[2 * j] - poly[2 * i], poly[2 * j + 1] - poly[2 * i + 1]);
|
|
133
|
+
}
|
|
134
|
+
const total = cumulative[m];
|
|
135
|
+
const out = new Float64Array(2 * n);
|
|
136
|
+
let k = 0;
|
|
137
|
+
for (let i = 0; i < n; ++i) {
|
|
138
|
+
const s = i * total / n;
|
|
139
|
+
while (k < m - 1 && cumulative[k + 1] <= s) ++k;
|
|
140
|
+
const j = (k + 1) % m;
|
|
141
|
+
const span = cumulative[k + 1] - cumulative[k];
|
|
142
|
+
const t = span > 0 ? (s - cumulative[k]) / span : 0;
|
|
143
|
+
out[2 * i] = poly[2 * k] + (poly[2 * j] - poly[2 * k]) * t;
|
|
144
|
+
out[2 * i + 1] = poly[2 * k + 1] + (poly[2 * j + 1] - poly[2 * k + 1]) * t;
|
|
145
|
+
}
|
|
146
|
+
return out;
|
|
147
|
+
}
|
|
148
|
+
function signedArea(outline) {
|
|
149
|
+
const n = outline.length / 2;
|
|
150
|
+
let area = 0;
|
|
151
|
+
for (let i = 0; i < n; ++i) {
|
|
152
|
+
const j = (i + 1) % n;
|
|
153
|
+
area += outline[2 * i] * outline[2 * j + 1] - outline[2 * j] * outline[2 * i + 1];
|
|
154
|
+
}
|
|
155
|
+
return area / 2;
|
|
156
|
+
}
|
|
157
|
+
function reverseOutline(outline) {
|
|
158
|
+
const n = outline.length / 2;
|
|
159
|
+
const out = new Float64Array(outline.length);
|
|
160
|
+
for (let i = 0; i < n; ++i) {
|
|
161
|
+
out[2 * i] = outline[2 * (n - 1 - i)];
|
|
162
|
+
out[2 * i + 1] = outline[2 * (n - 1 - i) + 1];
|
|
163
|
+
}
|
|
164
|
+
return out;
|
|
165
|
+
}
|
|
166
|
+
function alignmentCost(a, b, offset) {
|
|
167
|
+
const n = a.length / 2;
|
|
168
|
+
let cost = 0;
|
|
169
|
+
for (let i = 0; i < n; ++i) {
|
|
170
|
+
const j = (i + offset) % n;
|
|
171
|
+
const dx = a[2 * i] - b[2 * j], dy = a[2 * i + 1] - b[2 * j + 1];
|
|
172
|
+
cost += dx * dx + dy * dy;
|
|
173
|
+
}
|
|
174
|
+
return cost;
|
|
175
|
+
}
|
|
176
|
+
function alignOutline(a, b) {
|
|
177
|
+
const n = a.length / 2;
|
|
178
|
+
let best = 0, bestCost = Infinity;
|
|
179
|
+
for (let offset = 0; offset < n; ++offset) {
|
|
180
|
+
const cost = alignmentCost(a, b, offset);
|
|
181
|
+
if (cost < bestCost) {
|
|
182
|
+
bestCost = cost;
|
|
183
|
+
best = offset;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
const out = new Float64Array(b.length);
|
|
187
|
+
for (let i = 0; i < n; ++i) {
|
|
188
|
+
const j = (i + best) % n;
|
|
189
|
+
out[2 * i] = b[2 * j];
|
|
190
|
+
out[2 * i + 1] = b[2 * j + 1];
|
|
191
|
+
}
|
|
192
|
+
return {
|
|
193
|
+
outline: out,
|
|
194
|
+
offset: best
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
function sampleFaceRegion(arcs, n) {
|
|
198
|
+
const point = (angle) => [FACE_RADIUS * Math.cos(angle), FACE_RADIUS * Math.sin(angle)];
|
|
199
|
+
const edges = [];
|
|
200
|
+
for (let k = 0; k < arcs.length; ++k) {
|
|
201
|
+
const [from, to] = arcs[k];
|
|
202
|
+
const next = arcs[(k + 1) % arcs.length][0];
|
|
203
|
+
const [x0, y0] = point(to), [x1, y1] = point(next);
|
|
204
|
+
edges.push({
|
|
205
|
+
arc: k,
|
|
206
|
+
chord: false,
|
|
207
|
+
length: FACE_RADIUS * (to - from)
|
|
208
|
+
});
|
|
209
|
+
edges.push({
|
|
210
|
+
arc: k,
|
|
211
|
+
chord: true,
|
|
212
|
+
length: Math.hypot(x1 - x0, y1 - y0)
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
const total = edges.reduce((sum, edge) => sum + edge.length, 0);
|
|
216
|
+
const angles = new Float64Array(n);
|
|
217
|
+
const chordArc = new Int32Array(n);
|
|
218
|
+
const chordT = new Float64Array(n);
|
|
219
|
+
let e = 0, edgeStart = 0;
|
|
220
|
+
for (let i = 0; i < n; ++i) {
|
|
221
|
+
const s = i * total / n;
|
|
222
|
+
while (e < edges.length - 1 && s >= edgeStart + edges[e].length) edgeStart += edges[e++].length;
|
|
223
|
+
const edge = edges[e];
|
|
224
|
+
const t = edge.length > 0 ? (s - edgeStart) / edge.length : 0;
|
|
225
|
+
if (edge.chord) {
|
|
226
|
+
angles[i] = NaN;
|
|
227
|
+
chordArc[i] = edge.arc;
|
|
228
|
+
chordT[i] = t;
|
|
229
|
+
} else {
|
|
230
|
+
const [from, to] = arcs[edge.arc];
|
|
231
|
+
angles[i] = from + (to - from) * t;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return {
|
|
235
|
+
arcs,
|
|
236
|
+
angles,
|
|
237
|
+
chordArc,
|
|
238
|
+
chordT
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
function faceBand(top, bottom) {
|
|
242
|
+
const t = Math.asin(Math.max(-1, Math.min(1, top)));
|
|
243
|
+
const b = Math.asin(Math.max(-1, Math.min(1, bottom)));
|
|
244
|
+
return [[t, b], [Math.PI - b, Math.PI - t]];
|
|
245
|
+
}
|
|
246
|
+
function wobbleRadius(angle, time, amount) {
|
|
247
|
+
if (amount === 0) return FACE_RADIUS;
|
|
248
|
+
return FACE_RADIUS * (1 + amount * (.5 * Math.sin(3 * angle + 1.3 * time) + .3 * Math.sin(2 * angle - .9 * time + 1.7) + .2 * Math.sin(5 * angle + 2.1 * time + .4) + .4 * Math.sin(.8 * time)));
|
|
249
|
+
}
|
|
250
|
+
function faceRegionPoints(region, time, wobble, out) {
|
|
251
|
+
const at = (angle) => {
|
|
252
|
+
const r = wobbleRadius(angle, time, wobble);
|
|
253
|
+
return [FACE_CENTER + r * Math.cos(angle), FACE_CENTER + r * Math.sin(angle)];
|
|
254
|
+
};
|
|
255
|
+
const ends = region.arcs.map(([from, to]) => ({
|
|
256
|
+
from: at(from),
|
|
257
|
+
to: at(to)
|
|
258
|
+
}));
|
|
259
|
+
for (let i = 0; i < region.angles.length; ++i) {
|
|
260
|
+
const angle = region.angles[i];
|
|
261
|
+
if (Number.isNaN(angle)) {
|
|
262
|
+
const k = region.chordArc[i], t = region.chordT[i];
|
|
263
|
+
const [x0, y0] = ends[k].to, [x1, y1] = ends[(k + 1) % ends.length].from;
|
|
264
|
+
out[2 * i] = x0 + (x1 - x0) * t;
|
|
265
|
+
out[2 * i + 1] = y0 + (y1 - y0) * t;
|
|
266
|
+
} else {
|
|
267
|
+
const [x, y] = at(angle);
|
|
268
|
+
out[2 * i] = x;
|
|
269
|
+
out[2 * i + 1] = y;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
function buildLogoPiece(piece, n) {
|
|
274
|
+
const map = piece.map ?? ((x, y) => [x, y]);
|
|
275
|
+
const cubics = parseClosedPath(piece.d).map((c) => {
|
|
276
|
+
const out = [];
|
|
277
|
+
for (let i = 0; i < 8; i += 2) out.push(...map(c[i], c[i + 1]));
|
|
278
|
+
return out;
|
|
279
|
+
});
|
|
280
|
+
let outline = resampleClosed(flattenCubics(cubics), n);
|
|
281
|
+
if (signedArea(outline) < 0) outline = reverseOutline(outline);
|
|
282
|
+
const f = (v) => Number(v.toFixed(3));
|
|
283
|
+
let path = `M${f(cubics[0][0])},${f(cubics[0][1])}`;
|
|
284
|
+
for (const c of cubics) path += `C${f(c[2])},${f(c[3])} ${f(c[4])},${f(c[5])} ${f(c[6])},${f(c[7])}`;
|
|
285
|
+
return {
|
|
286
|
+
outline,
|
|
287
|
+
path: `${path}Z`
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
function buildPiece(arcs, logoPiece, n) {
|
|
291
|
+
const face = sampleFaceRegion(arcs, n);
|
|
292
|
+
const faceRest = new Float64Array(2 * n);
|
|
293
|
+
faceRegionPoints(face, 0, 0, faceRest);
|
|
294
|
+
const built = buildLogoPiece(logoPiece, n);
|
|
295
|
+
const { outline: logo } = alignOutline(faceRest, built.outline);
|
|
296
|
+
const travel = new Float64Array(n);
|
|
297
|
+
let maxTravel = 0, cx = 0, cy = 0;
|
|
298
|
+
for (let i = 0; i < n; ++i) {
|
|
299
|
+
travel[i] = Math.hypot(logo[2 * i] - faceRest[2 * i], logo[2 * i + 1] - faceRest[2 * i + 1]);
|
|
300
|
+
maxTravel = Math.max(maxTravel, travel[i]);
|
|
301
|
+
cx += logo[2 * i] / n;
|
|
302
|
+
cy += logo[2 * i + 1] / n;
|
|
303
|
+
}
|
|
304
|
+
for (let i = 0; i < n; ++i) travel[i] = maxTravel > 0 ? travel[i] / maxTravel : 0;
|
|
305
|
+
return {
|
|
306
|
+
face,
|
|
307
|
+
faceRest,
|
|
308
|
+
logo,
|
|
309
|
+
logoPath: built.path,
|
|
310
|
+
travel,
|
|
311
|
+
logoCenter: [cx, cy]
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
var DASHQL_BRAND = {
|
|
315
|
+
id: "dashql",
|
|
316
|
+
pieces: [buildPiece([[5 * Math.PI / 4 - FACE_SEAM_OVERLAP, 9 * Math.PI / 4 + FACE_SEAM_OVERLAP]], DASHQL_PIECE_UPPER, 200), buildPiece([[Math.PI / 4 - FACE_SEAM_OVERLAP, 5 * Math.PI / 4 + FACE_SEAM_OVERLAP]], DASHQL_PIECE_LOWER, 200)],
|
|
317
|
+
cutouts: []
|
|
318
|
+
};
|
|
319
|
+
var HYPER_SHAPES = [
|
|
320
|
+
"M68.788,44.394C105.304,44.394 134.879,34.691 134.879,22.7C134.879,10.723 105.304,1 68.788,1C32.314,1.014 2.725,10.723 2.725,22.7C2.725,34.691 32.314,44.394 68.788,44.394Z",
|
|
321
|
+
"M134.77,30.012C133.436,41.618 104.459,50.888 68.788,50.888C33.138,50.888 4.181,41.618 2.848,30.026C1.688,32.122 1,34.321 1,36.595L1,57.066C1,72.919 31.366,85.748 68.788,85.748C106.252,85.748 136.611,72.919 136.611,57.066L136.611,36.595C136.611,34.321 135.93,32.122 134.769,30.012Z",
|
|
322
|
+
"M68.788,92.798C36.966,92.798 10.311,83.514 3.04,70.994C1.756,73.2 1,75.481 1,77.859L1,98.357C1,114.189 31.366,127.032 68.788,127.032C106.252,127.032 136.611,114.189 136.611,98.357L136.611,77.859C136.611,75.481 135.855,73.2 134.577,70.994C127.286,83.514 100.645,92.798 68.788,92.798Z",
|
|
323
|
+
"M68.788,134.172C36.966,134.172 10.311,124.888 3.04,112.389C1.756,114.567 1,116.856 1,119.226L1,139.738C1,155.57 31.366,168.399 68.788,168.399C106.252,168.399 136.611,155.57 136.611,139.738L136.611,119.226C136.611,116.856 135.855,114.567 134.577,112.389C127.286,124.888 100.645,134.172 68.788,134.172Z"
|
|
324
|
+
];
|
|
325
|
+
var HYPER_BOUNDS = {
|
|
326
|
+
minX: 1,
|
|
327
|
+
maxX: 136.611,
|
|
328
|
+
minY: 1,
|
|
329
|
+
maxY: 168.399
|
|
330
|
+
};
|
|
331
|
+
var HYPER_SCALE = .84;
|
|
332
|
+
var hyperPoint = (x, y) => [100 + (x - (HYPER_BOUNDS.minX + HYPER_BOUNDS.maxX) / 2) * HYPER_SCALE, 100 + (y - (HYPER_BOUNDS.minY + HYPER_BOUNDS.maxY) / 2) * HYPER_SCALE];
|
|
333
|
+
function dbcomBrand() {
|
|
334
|
+
const centers = HYPER_SHAPES.map((d) => {
|
|
335
|
+
const ys = parseClosedPath(d).flatMap((c) => [c[1], c[7]]);
|
|
336
|
+
return (Math.min(...ys) + Math.max(...ys)) / 2;
|
|
337
|
+
});
|
|
338
|
+
const toFace = (y) => -1 + 2 * (y - HYPER_BOUNDS.minY) / (HYPER_BOUNDS.maxY - HYPER_BOUNDS.minY);
|
|
339
|
+
const bounds = [
|
|
340
|
+
-1,
|
|
341
|
+
...centers.slice(1).map((c, i) => toFace((centers[i] + c) / 2)),
|
|
342
|
+
1
|
|
343
|
+
];
|
|
344
|
+
const overlap = .04;
|
|
345
|
+
return {
|
|
346
|
+
id: "dbcom",
|
|
347
|
+
pieces: HYPER_SHAPES.map((d, i) => buildPiece(faceBand(bounds[i] - (i > 0 ? overlap : 0), bounds[i + 1] + (i < HYPER_SHAPES.length - 1 ? overlap : 0)), {
|
|
348
|
+
d,
|
|
349
|
+
map: hyperPoint
|
|
350
|
+
}, 200)),
|
|
351
|
+
cutouts: []
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
var DBCOM_BRAND = dbcomBrand();
|
|
355
|
+
var OMEN_CRANIUM = "M60,94C42,70 44,18 100,18C156,18 158,70 140,94L130,94C134,62 104,62 106,94L94,94C96,62 66,62 70,94Z";
|
|
356
|
+
var OMEN_JAW = "M60,94L100,94L90,114L110,114L100,94L140,94L134,114L129,130L117,130L117,121L113,121L113,130L109.5,130L109.5,121L105.5,121L105.5,130L102,130L102,121L98,121L98,130L94.5,130L94.5,121L90.5,121L90.5,130L87,130L87,121L83,121L83,130L71,130L66,114Z";
|
|
357
|
+
var omenSkullPoint = (x, y) => [100 + (x - 100) * .68, 8 + (y - 18) * .68];
|
|
358
|
+
var OMEN_STAFF = [
|
|
359
|
+
"M96,85L104,85L104,108L96,108Z",
|
|
360
|
+
"M96,129L104,129L104,176L96,176Z",
|
|
361
|
+
"M96,191.5L104,191.5L104,198L96,198Z"
|
|
362
|
+
];
|
|
363
|
+
var OMEN_BRAND = {
|
|
364
|
+
id: "omen",
|
|
365
|
+
pieces: [
|
|
366
|
+
buildPiece(faceBand(-1, .09), {
|
|
367
|
+
d: OMEN_CRANIUM,
|
|
368
|
+
map: omenSkullPoint
|
|
369
|
+
}, 200),
|
|
370
|
+
buildPiece(faceBand(.01, .39), {
|
|
371
|
+
d: OMEN_JAW,
|
|
372
|
+
map: omenSkullPoint
|
|
373
|
+
}, 200),
|
|
374
|
+
buildPiece(faceBand(.31, .54), { d: OMEN_STAFF[0] }, 200),
|
|
375
|
+
buildPiece(faceBand(.46, .79), { d: OMEN_STAFF[1] }, 200),
|
|
376
|
+
buildPiece(faceBand(.71, 1), { d: OMEN_STAFF[2] }, 200),
|
|
377
|
+
buildPiece(faceBand(.31, .69), { d: "M95,152.5C80,152 67,146 67,135C67,124 86,122 98,114C104,110 112,108 113,103C110,98 110,92 116,90C122,92 126,98 122,103C122,112 116,117 106,122C96,127 78,128 77,135C77,141 85,143 95,143.5Z" }, 200),
|
|
378
|
+
buildPiece(faceBand(.61, 1), { d: "M78,194C95,180 120,176 123,164C123,159 114,155.5 105,154.5L105,145.5C118,147 133,154 133,164C133,184 98,190 78,194Z" }, 200)
|
|
379
|
+
],
|
|
380
|
+
cutouts: []
|
|
381
|
+
};
|
|
382
|
+
function morphPoints(piece, frame, out, scratch) {
|
|
383
|
+
const n = piece.travel.length;
|
|
384
|
+
faceRegionPoints(piece.face, frame.time, frame.wobble, scratch);
|
|
385
|
+
const lag = Math.min(Math.max(frame.lag, 0), .95);
|
|
386
|
+
const x = frame.progress;
|
|
387
|
+
for (let i = 0; i < n; ++i) {
|
|
388
|
+
const delay = lag * (1 - piece.travel[i]);
|
|
389
|
+
const q = x < 0 ? FACE_OVERSHOOT * x : x < delay ? 0 : (x - delay) / (1 - delay);
|
|
390
|
+
let px = scratch[2 * i] + (piece.logo[2 * i] - scratch[2 * i]) * q;
|
|
391
|
+
let py = scratch[2 * i + 1] + (piece.logo[2 * i + 1] - scratch[2 * i + 1]) * q;
|
|
392
|
+
if (frame.ripple !== 0) {
|
|
393
|
+
const transit = Math.sin(Math.PI * Math.min(Math.max(q, 0), 1));
|
|
394
|
+
if (transit > 0) {
|
|
395
|
+
const dx = px - piece.logoCenter[0], dy = py - piece.logoCenter[1];
|
|
396
|
+
const len = Math.hypot(dx, dy) || 1;
|
|
397
|
+
const wave = frame.ripple * transit * Math.sin(6 * Math.PI * i / n + 5 * frame.time);
|
|
398
|
+
px += dx / len * wave;
|
|
399
|
+
py += dy / len * wave;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
out[2 * i] = px;
|
|
403
|
+
out[2 * i + 1] = py;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
function outlinePath(outline) {
|
|
407
|
+
const n = outline.length / 2;
|
|
408
|
+
const parts = new Array(n);
|
|
409
|
+
for (let i = 0; i < n; ++i) parts[i] = `${outline[2 * i].toFixed(2)} ${outline[2 * i + 1].toFixed(2)}`;
|
|
410
|
+
return `M${parts.join("L")}Z`;
|
|
411
|
+
}
|
|
412
|
+
function outlineBounds(outline) {
|
|
413
|
+
let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
|
|
414
|
+
for (let i = 0; i < outline.length; i += 2) {
|
|
415
|
+
minX = Math.min(minX, outline[i]);
|
|
416
|
+
maxX = Math.max(maxX, outline[i]);
|
|
417
|
+
minY = Math.min(minY, outline[i + 1]);
|
|
418
|
+
maxY = Math.max(maxY, outline[i + 1]);
|
|
419
|
+
}
|
|
420
|
+
return [
|
|
421
|
+
minX,
|
|
422
|
+
minY,
|
|
423
|
+
maxX,
|
|
424
|
+
maxY
|
|
425
|
+
];
|
|
426
|
+
}
|
|
427
|
+
function stepSpring(spring, target, stiffness, damping, dt) {
|
|
428
|
+
const steps = Math.max(1, Math.ceil(dt / (1 / 240)));
|
|
429
|
+
const h = dt / steps;
|
|
430
|
+
for (let s = 0; s < steps; ++s) {
|
|
431
|
+
const accel = -stiffness * (spring.value - target) - damping * spring.velocity;
|
|
432
|
+
spring.velocity += accel * h;
|
|
433
|
+
spring.value += spring.velocity * h;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
function springAtRest(spring, target) {
|
|
437
|
+
return Math.abs(spring.value - target) < .001 && Math.abs(spring.velocity) < .01;
|
|
438
|
+
}
|
|
439
|
+
export { DASHQL_BRAND, DBCOM_BRAND, OMEN_BRAND, OUTLINE_POINTS, VIEWBOX_SIZE, alignOutline, alignmentCost, morphPoints, outlineBounds, outlinePath, parseClosedPath, resampleClosed, signedArea, springAtRest, stepSpring };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface ListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children?: React.ReactElement | React.ReactElement[];
|
|
4
|
+
leading?: boolean;
|
|
5
|
+
trailing?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function List(props: ListProps): React.JSX.Element;
|
|
8
|
+
export interface ListItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
9
|
+
children?: React.ReactElement | React.ReactElement[];
|
|
10
|
+
selected?: boolean;
|
|
11
|
+
'data-item'?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const ListItem: React.ForwardRefExoticComponent<ListItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
14
|
+
export interface LeadingProps {
|
|
15
|
+
children?: React.ReactElement | string;
|
|
16
|
+
}
|
|
17
|
+
export declare function Leading(props: LeadingProps): React.JSX.Element;
|
|
18
|
+
export interface TrailingProps {
|
|
19
|
+
children?: React.ReactElement | string;
|
|
20
|
+
}
|
|
21
|
+
export declare function Trailing(props: TrailingProps): React.JSX.Element;
|
|
22
|
+
export interface GroupHeadingProps {
|
|
23
|
+
children?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function GroupHeading(props: GroupHeadingProps): React.JSX.Element;
|
|
26
|
+
export interface ItemTextProps {
|
|
27
|
+
children?: undefined | string | React.ReactElement | (undefined | string | React.ReactElement)[];
|
|
28
|
+
}
|
|
29
|
+
export declare function ItemText(props: ItemTextProps): React.JSX.Element;
|
|
30
|
+
export declare function ItemTextTitle(props: ItemTextProps): React.JSX.Element;
|
|
31
|
+
export declare function ItemTextDescription(props: ItemTextProps): React.JSX.Element;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { disabled, group_heading_container, item_container, leading_container, list_container, selected, text_container, text_description, text_title, trailing_container } from "./action_list.module.js";
|
|
2
|
+
import { classNames } from "../dom/classnames.js";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
function List(props) {
|
|
6
|
+
const { children, className, leading: _leading, trailing: _trailing, ...rest } = props;
|
|
7
|
+
return /* @__PURE__ */ jsx("div", {
|
|
8
|
+
...rest,
|
|
9
|
+
className: classNames(list_container, className),
|
|
10
|
+
children
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
var ListItem = React.forwardRef((props, ref) => {
|
|
14
|
+
const { children, className, selected: selected$1, ...rest } = props;
|
|
15
|
+
return /* @__PURE__ */ jsx("button", {
|
|
16
|
+
...rest,
|
|
17
|
+
ref,
|
|
18
|
+
type: "button",
|
|
19
|
+
className: classNames(item_container, className, {
|
|
20
|
+
[disabled]: props.disabled,
|
|
21
|
+
[selected]: selected$1
|
|
22
|
+
}),
|
|
23
|
+
"aria-selected": selected$1,
|
|
24
|
+
children
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
function Leading(props) {
|
|
28
|
+
return /* @__PURE__ */ jsx("span", {
|
|
29
|
+
className: leading_container,
|
|
30
|
+
children: props.children
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function Trailing(props) {
|
|
34
|
+
return /* @__PURE__ */ jsx("span", {
|
|
35
|
+
className: trailing_container,
|
|
36
|
+
children: props.children
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function GroupHeading(props) {
|
|
40
|
+
return /* @__PURE__ */ jsx("span", {
|
|
41
|
+
className: group_heading_container,
|
|
42
|
+
children: props.children
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function ItemText(props) {
|
|
46
|
+
return /* @__PURE__ */ jsx("span", {
|
|
47
|
+
className: text_container,
|
|
48
|
+
children: props.children
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function ItemTextTitle(props) {
|
|
52
|
+
return /* @__PURE__ */ jsx("span", {
|
|
53
|
+
className: text_title,
|
|
54
|
+
children: props.children
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function ItemTextDescription(props) {
|
|
58
|
+
return /* @__PURE__ */ jsx("span", {
|
|
59
|
+
className: text_description,
|
|
60
|
+
children: props.children
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
export { GroupHeading, ItemText, ItemTextDescription, ItemTextTitle, Leading, List, ListItem, Trailing };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var list_container = "dashql_list_container_MIfwkw";
|
|
2
|
+
var group_heading_container = "dashql_group_heading_container_xX-FTF";
|
|
3
|
+
var item_container = "dashql_item_container_fOyDTe";
|
|
4
|
+
var selected = "dashql_selected_tSVcva";
|
|
5
|
+
var disabled = "dashql_disabled_cAVRYa";
|
|
6
|
+
var leading_container = "dashql_leading_container_LhwWwS";
|
|
7
|
+
var text_container = "dashql_text_container_o2nWiT";
|
|
8
|
+
var text_title = "dashql_text_title_Ch3OtA";
|
|
9
|
+
var text_description = "dashql_text_description_pHH7QP";
|
|
10
|
+
var trailing_container = "dashql_trailing_container_WnNd7h";
|
|
11
|
+
export { disabled, group_heading_container, item_container, leading_container, list_container, selected, text_container, text_description, text_title, trailing_container };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { OverlayProps } from './overlay.js';
|
|
3
|
+
import { FocusTrapHookArgs, FocusZoneHookArgs } from '../dom/focus.js';
|
|
4
|
+
import { PositionSettings } from '../dom/anchored_position.js';
|
|
5
|
+
interface AnchoredOverlayPropsWithAnchor {
|
|
6
|
+
renderAnchor: <T extends React.HTMLAttributes<HTMLElement>>(props: T) => React.ReactElement;
|
|
7
|
+
anchorRef?: React.RefObject<HTMLElement | null>;
|
|
8
|
+
anchorId?: string;
|
|
9
|
+
}
|
|
10
|
+
interface AnchoredOverlayPropsWithoutAnchor {
|
|
11
|
+
renderAnchor: null;
|
|
12
|
+
anchorRef: React.RefObject<Element | null>;
|
|
13
|
+
anchorId?: string;
|
|
14
|
+
}
|
|
15
|
+
interface AnchoredOverlayBaseProps extends Pick<OverlayProps, 'height' | 'width' | 'minWidth' | 'maxWidth' | 'maxHeight'> {
|
|
16
|
+
children?: React.ReactElement;
|
|
17
|
+
open: boolean;
|
|
18
|
+
onOpen?: (gesture: 'anchor-click' | 'anchor-key-press', event?: React.KeyboardEvent<HTMLElement>) => unknown;
|
|
19
|
+
onClose?: (gesture: 'anchor-click' | 'click-outside' | 'escape') => unknown;
|
|
20
|
+
returnFocusRef?: React.RefObject<HTMLElement | null>;
|
|
21
|
+
overlayProps?: Partial<OverlayProps>;
|
|
22
|
+
focusTrapSettings?: Partial<FocusTrapHookArgs>;
|
|
23
|
+
focusZoneSettings?: Partial<FocusZoneHookArgs>;
|
|
24
|
+
positionRevision?: number;
|
|
25
|
+
}
|
|
26
|
+
export type AnchoredOverlayProps = AnchoredOverlayBaseProps & (AnchoredOverlayPropsWithAnchor | AnchoredOverlayPropsWithoutAnchor) & Partial<Pick<PositionSettings, 'align' | 'side' | 'anchorOffset' | 'alignmentOffset'>>;
|
|
27
|
+
export declare function AnchoredOverlay(args: AnchoredOverlayProps): React.JSX.Element;
|
|
28
|
+
export {};
|