@perspective-dev/viewer 5.3.1 → 5.4.0
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/dist/cdn/perspective-viewer.js +6 -6
- package/dist/cdn/perspective-viewer.js.map +2 -2
- package/dist/css/blueprint.css +1 -1
- package/dist/css/botanical.css +1 -1
- package/dist/css/dracula.css +1 -1
- package/dist/css/eggplant.css +1 -1
- package/dist/css/gruvbox-dark.css +1 -1
- package/dist/css/gruvbox.css +1 -1
- package/dist/css/icons.css +1 -1
- package/dist/css/intl/ar.css +1 -0
- package/dist/css/intl/de.css +1 -1
- package/dist/css/intl/es.css +1 -1
- package/dist/css/intl/fr.css +1 -1
- package/dist/css/intl/ja.css +1 -1
- package/dist/css/intl/pt.css +1 -1
- package/dist/css/intl/zh.css +1 -1
- package/dist/css/intl.css +1 -1
- package/dist/css/ledger.css +1 -1
- package/dist/css/monokai.css +1 -1
- package/dist/css/nord.css +1 -1
- package/dist/css/phosphor.css +1 -1
- package/dist/css/pro-dark.css +1 -1
- package/dist/css/pro.css +1 -1
- package/dist/css/solarized-dark.css +1 -1
- package/dist/css/solarized.css +1 -1
- package/dist/css/themes.css +1 -1
- package/dist/css/vaporwave.css +1 -1
- package/dist/css/velvet.css +1 -1
- package/dist/docs/perspective-docs.json +1 -1
- package/dist/esm/extensions.d.ts +0 -5
- package/dist/esm/perspective-viewer.inline.js +9 -9
- package/dist/esm/perspective-viewer.inline.js.map +3 -3
- package/dist/esm/perspective-viewer.js +5 -5
- package/dist/esm/perspective-viewer.js.map +2 -2
- package/dist/esm/ts-rs/ViewOnUpdateResp.d.ts +1 -1
- package/dist/wasm/perspective-viewer.d.ts +62 -73
- package/dist/wasm/perspective-viewer.js +226 -238
- package/dist/wasm/perspective-viewer.wasm +0 -0
- package/dist/wasm/perspective-viewer.wasm.d.ts +18 -28
- package/package.json +7 -7
- package/src/css/_context_menu.css +1 -1
- package/src/css/_dropdown_menu.css +1 -1
- package/src/css/_viewer_bundle.css +7 -8
- package/src/css/column-dropdown.css +0 -3
- package/src/css/column-selector.css +8 -5
- package/src/css/column-settings-panel.css +0 -225
- package/src/css/column-style.css +13 -0
- package/src/css/config-selector.css +18 -10
- package/src/css/filter-dropdown.css +5 -5
- package/src/css/form/debug.css +28 -4
- package/src/css/function-dropdown.css +5 -5
- package/src/css/panel-tab.css +23 -0
- package/src/css/plugin-selector.css +5 -5
- package/src/css/render-warning.css +1 -1
- package/src/css/status-bar.css +52 -21
- package/src/css/type-icon.css +1 -3
- package/src/css/{containers → ui/containers}/context-menu.css +22 -16
- package/src/css/ui/containers/dropdown-menu-items.css +66 -0
- package/src/css/{containers → ui/containers}/dropdown-menu.css +8 -53
- package/src/css/viewer.css +32 -26
- package/src/rust/components/chat_panel.rs +1 -1
- package/src/rust/components/{form/code_editor.rs → code_editor.rs} +4 -2
- package/src/rust/components/column_dropdown.rs +2 -2
- package/src/rust/components/column_selector/active_column.rs +15 -9
- package/src/rust/components/column_selector/aggregate_selector.rs +1 -1
- package/src/rust/components/column_selector/config_selector.rs +2 -2
- package/src/rust/components/column_selector/filter_column.rs +8 -5
- package/src/rust/components/column_selector/inactive_column.rs +4 -2
- package/src/rust/components/column_selector/pivot_column.rs +4 -3
- package/src/rust/components/column_selector/sort_column.rs +7 -4
- package/src/rust/components/column_selector.rs +3 -3
- package/src/rust/components/column_settings_sidebar/style_tab/agg_depth_selector.rs +1 -1
- package/src/rust/components/column_settings_sidebar/style_tab/primitive_field.rs +15 -17
- package/src/rust/components/column_settings_sidebar/style_tab/symbol/symbol_selector.rs +1 -1
- package/src/rust/components/column_settings_sidebar/style_tab.rs +4 -5
- package/src/rust/components/column_settings_sidebar.rs +3 -4
- package/src/rust/components/copy_dropdown.rs +1 -1
- package/src/rust/components/datetime_column_style/custom.rs +1 -3
- package/src/rust/components/datetime_column_style/simple.rs +1 -2
- package/src/rust/components/datetime_column_style.rs +1 -2
- package/src/rust/components/{form/debug.rs → debug_panel.rs} +5 -5
- package/src/rust/components/{containers/dragdrop_list.rs → dragdrop_list.rs} +2 -10
- package/src/rust/components/export_dropdown.rs +1 -1
- package/src/rust/components/expression_editor.rs +1 -1
- package/src/rust/components/filter_dropdown.rs +2 -2
- package/src/rust/components/function_dropdown.rs +2 -2
- package/src/rust/components/main_panel/frame_theme.rs +3 -59
- package/src/rust/components/main_panel/reconcile.rs +9 -4
- package/src/rust/components/main_panel/render.rs +62 -11
- package/src/rust/components/main_panel/update.rs +39 -10
- package/src/rust/components/main_panel.rs +26 -2
- package/src/rust/components/mod.rs +5 -7
- package/src/rust/components/new_panel_menu.rs +97 -0
- package/src/rust/components/number_series_style.rs +2 -3
- package/src/rust/components/panel_menu.rs +61 -87
- package/src/rust/components/panel_tab.rs +100 -43
- package/src/rust/components/plugin_tab.rs +1 -1
- package/src/rust/components/render_warning.rs +2 -2
- package/src/rust/components/{status_bar_counter.rs → rows_counter.rs} +10 -10
- package/src/rust/components/settings_panel.rs +2 -2
- package/src/rust/components/status_bar.rs +113 -19
- package/src/rust/components/status_indicator.rs +5 -14
- package/src/rust/components/string_column_style.rs +1 -2
- package/src/rust/components/{style/mod.rs → style.rs} +32 -15
- package/src/rust/components/style_controls/number_string_format/digits_section.rs +3 -5
- package/src/rust/components/style_controls/number_string_format/misc_section.rs +1 -1
- package/src/rust/components/style_controls/number_string_format/style_section.rs +1 -1
- package/src/rust/components/viewer/msg.rs +43 -30
- package/src/rust/components/viewer/panels.rs +50 -19
- package/src/rust/components/viewer/render.rs +15 -13
- package/src/rust/components/viewer/settings.rs +137 -68
- package/src/rust/components/viewer/snapshots.rs +5 -10
- package/src/rust/components/viewer/wiring.rs +1 -21
- package/src/rust/components/viewer.rs +15 -10
- package/src/rust/components/window_editor.rs +8 -9
- package/src/rust/config/column_config_schema.rs +2 -27
- package/src/rust/config/mod.rs +0 -2
- package/src/rust/config/workspace_config.rs +2 -1
- package/src/rust/custom_elements/debug_plugin.rs +1 -10
- package/src/rust/custom_elements/mod.rs +0 -3
- package/src/rust/custom_elements/viewer.rs +0 -18
- package/src/rust/js/plugin.rs +0 -86
- package/src/rust/lib.rs +12 -15
- package/src/rust/presentation/column_locator.rs +3 -7
- package/src/rust/presentation.rs +68 -38
- package/src/rust/queries/hosted_tables.rs +38 -0
- package/src/rust/queries/mod.rs +2 -0
- package/src/rust/queries/palette_set.rs +1 -1
- package/src/rust/renderer/activate.rs +1 -3
- package/src/rust/renderer/dispatch.rs +83 -22
- package/src/rust/renderer/limits.rs +24 -5
- package/src/rust/renderer/plugin_config.rs +1 -0
- package/src/rust/renderer/props.rs +2 -1
- package/src/rust/renderer.rs +14 -27
- package/src/rust/session/props.rs +4 -3
- package/src/rust/session/view_subscription.rs +19 -6
- package/src/rust/session.rs +38 -70
- package/src/rust/tasks/create_panel.rs +1 -1
- package/src/rust/tasks/dismiss_render_warning.rs +1 -1
- package/src/rust/tasks/eject.rs +1 -0
- package/src/rust/tasks/pipeline.rs +0 -60
- package/src/rust/tasks/presize_panels.rs +24 -1
- package/src/rust/tasks/restore_and_render.rs +0 -17
- package/src/rust/tasks/send_column_config.rs +1 -1
- package/src/rust/tasks/send_plugin_config.rs +1 -1
- package/src/rust/tasks/set_edit_mode.rs +1 -1
- package/src/rust/{components → ui}/containers/control_group.rs +25 -3
- package/src/rust/{components → ui}/containers/dropdown_menu.rs +5 -2
- package/src/rust/{components → ui}/containers/mod.rs +0 -4
- package/src/rust/{components → ui}/containers/scroll_panel.rs +0 -22
- package/src/rust/{components → ui}/containers/scroll_panel_item.rs +0 -13
- package/src/rust/{components → ui}/containers/select.rs +0 -6
- package/src/rust/{components → ui}/containers/sidebar.rs +5 -32
- package/src/rust/{components → ui}/containers/split_panel.rs +8 -80
- package/src/rust/{components → ui}/containers/tab_list.rs +15 -9
- package/src/rust/{components → ui}/context_menu.rs +8 -13
- package/src/rust/{presentation/drag_helpers.rs → ui/dragdrop.rs} +26 -31
- package/src/rust/{components → ui}/font_loader.rs +0 -26
- package/src/rust/{components → ui}/form/color_selector.rs +4 -2
- package/src/rust/ui/form/intl_label.rs +81 -0
- package/src/rust/{components → ui}/form/mirrored_textarea.rs +0 -53
- package/src/rust/{components → ui}/form/mod.rs +1 -10
- package/src/rust/{components → ui}/form/multi_stop_gradient_selector.rs +4 -5
- package/src/rust/{components → ui}/form/named_value_picker.rs +1 -6
- package/src/rust/{components → ui}/form/number_field.rs +1 -1
- package/src/rust/{components → ui}/form/number_range_field.rs +1 -1
- package/src/rust/{components → ui}/form/optional_field.rs +3 -1
- package/src/rust/{components → ui}/form/palette_selector.rs +4 -5
- package/src/rust/{components → ui}/form/select_enum_field.rs +2 -2
- package/src/rust/{components → ui}/form/select_value_field.rs +2 -2
- package/src/rust/ui/mod.rs +56 -0
- package/src/rust/ui/modal.rs +61 -0
- package/src/rust/{components → ui}/portal.rs +174 -79
- package/src/rust/{components/style/style_provider.rs → ui/style.rs} +4 -34
- package/src/rust/utils/completion.rs +0 -6
- package/src/rust/{config/css_scale.rs → utils/css.rs} +38 -35
- package/src/rust/utils/mod.rs +2 -0
- package/src/rust/workspace.rs +35 -0
- package/src/svg/boolean-type.svg +3 -2
- package/src/svg/checkbox-checked-icon.svg +4 -7
- package/src/svg/checkbox-hover.svg +3 -3
- package/src/svg/checkbox-off.svg +2 -3
- package/src/svg/checkbox-on.svg +3 -3
- package/src/svg/checkbox-unchecked-icon.svg +3 -3
- package/src/svg/datagrid-select-column.svg +8 -15
- package/src/svg/datagrid-select-region.svg +8 -15
- package/src/svg/datagrid-select-row-tree.svg +7 -12
- package/src/svg/datagrid-select-row.svg +8 -13
- package/src/svg/date-type.svg +4 -23
- package/src/svg/drawer-tab-hover.svg +4 -6
- package/src/svg/drawer-tab-invert-hover.svg +5 -5
- package/src/svg/drawer-tab-invert.svg +3 -5
- package/src/svg/drawer-tab.svg +5 -5
- package/src/svg/mega-menu-icons-candlestick.svg +5 -37
- package/src/svg/mega-menu-icons-ohlc.svg +4 -39
- package/src/svg/mega-menu-icons-sunburst.svg +4 -38
- package/src/svg/mega-menu-icons-treemap.svg +3 -43
- package/src/svg/mega-menu-icons-y-scatter.svg +12 -72
- package/src/svg/new-panel-icon.svg +4 -0
- package/src/svg/number-type.svg +3 -3
- package/src/svg/radio-hover.svg +3 -3
- package/src/svg/radio-off.svg +3 -3
- package/src/svg/radio-on.svg +3 -3
- package/src/svg/status_ok.svg +3 -26
- package/src/svg/string-type.svg +4 -8
- package/src/svg/theme-icon.svg +5 -5
- package/src/themes/blueprint.css +0 -57
- package/src/themes/botanical.css +0 -36
- package/src/themes/defaults.css +1 -24
- package/src/themes/dracula.css +0 -58
- package/src/themes/eggplant.css +0 -58
- package/src/themes/gruvbox-dark.css +0 -65
- package/src/themes/gruvbox.css +1 -39
- package/src/themes/icons.css +1 -8
- package/src/themes/intl/ar.css +185 -0
- package/src/themes/intl/de.css +45 -35
- package/src/themes/intl/es.css +40 -30
- package/src/themes/intl/fr.css +39 -29
- package/src/themes/intl/ja.css +41 -31
- package/src/themes/intl/pt.css +37 -27
- package/src/themes/intl/zh.css +47 -37
- package/src/themes/intl.css +16 -3
- package/src/themes/ledger.css +1 -59
- package/src/themes/monokai.css +0 -51
- package/src/themes/nord.css +0 -55
- package/src/themes/phosphor.css +0 -48
- package/src/themes/pro-dark.css +0 -37
- package/src/themes/pro.css +3 -23
- package/src/themes/solarized-dark.css +0 -31
- package/src/themes/solarized.css +1 -24
- package/src/themes/vaporwave.css +0 -44
- package/src/themes/velvet.css +0 -60
- package/src/ts/extensions.ts +0 -13
- package/src/ts/ts-rs/ViewOnUpdateResp.ts +1 -1
- package/src/css/plugin-settings-panel.css +0 -171
- package/src/rust/components/modal.rs +0 -177
- package/src/rust/custom_elements/copy_dropdown.rs +0 -219
- package/src/rust/custom_elements/export_dropdown.rs +0 -216
- package/src/rust/custom_elements/modal.rs +0 -299
- /package/dist/wasm/snippets/{perspective-viewer-87bd21b215d0631a → perspective-viewer-adc6f3f79141112b}/inline0.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-87bd21b215d0631a → perspective-viewer-adc6f3f79141112b}/inline1.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-87bd21b215d0631a → perspective-viewer-adc6f3f79141112b}/inline2.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-87bd21b215d0631a → perspective-viewer-adc6f3f79141112b}/inline3.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-87bd21b215d0631a → perspective-viewer-adc6f3f79141112b}/inline4.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-87bd21b215d0631a → perspective-viewer-adc6f3f79141112b}/inline5.js +0 -0
- /package/src/css/{containers → ui/containers}/scroll-panel.css +0 -0
- /package/src/css/{containers → ui/containers}/split-panel.css +0 -0
- /package/src/css/{containers → ui/containers}/tabs.css +0 -0
- /package/src/css/{dom → ui/dom}/checkbox.css +0 -0
- /package/src/css/{dom → ui/dom}/scrollbar.css +0 -0
- /package/src/css/{dom → ui/dom}/select.css +0 -0
- /package/src/css/{form → ui/form}/mirrored-textarea.css +0 -0
- /package/src/rust/components/{form → code_editor}/highlight.rs +0 -0
- /package/src/rust/{components → ui}/containers/sidebar_close_button.rs +0 -0
- /package/src/rust/{components → ui}/form/number_input.rs +0 -0
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
/* ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
|
2
|
-
* ┃ ██████ ██████ ██████ █ █ █ █ █ █▄ ▀███ █ ┃
|
|
3
|
-
* ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█ ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄ ▀█ █ ▀▀▀▀▀ ┃
|
|
4
|
-
* ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄ █ ▄▄▄▄▄ ┃
|
|
5
|
-
* ┃ █ ██████ █ ▀█▄ █ ██████ █ ███▌▐███ ███████▄ █ ┃
|
|
6
|
-
* ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
|
|
7
|
-
* ┃ Copyright (c) 2017, the Perspective Authors. ┃
|
|
8
|
-
* ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃
|
|
9
|
-
* ┃ This file is part of the Perspective library, distributed under the terms ┃
|
|
10
|
-
* ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
|
|
11
|
-
* ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
:host {
|
|
15
|
-
label#edit_mode-label:before {
|
|
16
|
-
content: var(--psp-label--edit-mode--content);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
label#scroll_lock-label:before {
|
|
20
|
-
content: var(--psp-label--scroll-lock--content);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
label#chart_type-label:before {
|
|
24
|
-
content: var(--psp-label--chart-type--content);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/* viewer-charts plugin_config controls */
|
|
28
|
-
label#auto_alt_y_axis-label:before {
|
|
29
|
-
content: var(--psp-label--auto-alt-y-axis--content);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
label#facet_mode-label:before {
|
|
33
|
-
content: var(--psp-label--facet-mode--content);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
label#facet_zoom_mode-label:before {
|
|
37
|
-
content: var(--psp-label--facet-zoom-mode--content);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
label#series_zoom_mode-label:before {
|
|
41
|
-
content: var(--psp-label--series-zoom-mode--content);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
label#line_width_px-label:before {
|
|
45
|
-
content: var(--psp-label--line-width-px--content);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
label#point_size_px-label:before {
|
|
49
|
-
content: var(--psp-label--point-size-px--content);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
label#band_inner_frac-label:before {
|
|
53
|
-
content: var(--psp-label--band-inner-frac--content);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
label#bar_inner_pad-label:before {
|
|
57
|
-
content: var(--psp-label--bar-inner-pad--content);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
label#wick_width_px-label:before {
|
|
61
|
-
content: var(--psp-label--wick-width-px--content);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
label#ohlc_line_width_px-label:before {
|
|
65
|
-
content: var(--psp-label--ohlc-line-width-px--content);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
label#include_zero-label:before {
|
|
69
|
-
content: var(--psp-label--include-zero--content);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
label#domain_mode-label:before {
|
|
73
|
-
content: var(--psp-label--domain-mode--content);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
label#gradient_color_mode-label:before {
|
|
77
|
-
content: var(--psp-label--gradient-color-mode--content);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
label#gradient_radius_px-label:before {
|
|
81
|
-
content: var(--psp-label--gradient-radius-px--content);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
label#gradient_intensity-label:before {
|
|
85
|
-
content: var(--psp-label--gradient-intensity--content);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
label#gradient_heat_max-label:before {
|
|
89
|
-
content: var(--psp-label--gradient-heat-max--content);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
label#map_tile_provider-label:before {
|
|
93
|
-
content: var(--psp-label--map-tile-provider--content);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
label#map_tile_alpha-label:before {
|
|
97
|
-
content: var(--psp-label--map-tile-alpha--content);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
label#numeric_axes-label:before {
|
|
101
|
-
content: var(--psp-label--numeric-axes--content);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
label#legend_mode-label:before {
|
|
105
|
-
content: var(--psp-label--legend-mode--content);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
label#legend_size_mode-label:before {
|
|
109
|
-
content: var(--psp-label--legend-size-mode--content);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
label#legend_width_px-label:before {
|
|
113
|
-
content: var(--psp-label--legend-width-px--content);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
label#legend_height_px-label:before {
|
|
117
|
-
content: var(--psp-label--legend-height-px--content);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
label#legend_anchor-label:before {
|
|
121
|
-
content: var(--psp-label--legend-anchor--content);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
label#legend_x-label:before {
|
|
125
|
-
content: var(--psp-label--legend-x--content);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
label#legend_y-label:before {
|
|
129
|
-
content: var(--psp-label--legend-y--content);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
label#legend_opacity-label:before {
|
|
133
|
-
content: var(--psp-label--legend-opacity--content);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
label#tooltip_max_column_px-label:before {
|
|
137
|
-
content: var(--psp-label--tooltip-max-column-px--content);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
label#tooltip_opacity-label:before {
|
|
141
|
-
content: var(--psp-label--tooltip-opacity--content);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
label#axes-group-label:before {
|
|
145
|
-
content: var(--psp-label--group-axes--content, "Axes");
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
label#facets-group-label:before {
|
|
149
|
-
content: var(--psp-label--group-facets--content, "Facets");
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
label#glyph-group-label:before {
|
|
153
|
-
content: var(--psp-label--group-glyph--content, "Glyphs");
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
label#density-group-label:before {
|
|
157
|
-
content: var(--psp-label--group-density--content, "Density");
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
label#basemap-group-label:before {
|
|
161
|
-
content: var(--psp-label--group-basemap--content, "Basemap");
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
label#legend-group-label:before {
|
|
165
|
-
content: var(--psp-label--group-legend--content, "Legend");
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
label#tooltip-group-label:before {
|
|
169
|
-
content: var(--psp-label--group-tooltip--content, "Tooltips");
|
|
170
|
-
}
|
|
171
|
-
}
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
|
2
|
-
// ┃ ██████ ██████ ██████ █ █ █ █ █ █▄ ▀███ █ ┃
|
|
3
|
-
// ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█ ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄ ▀█ █ ▀▀▀▀▀ ┃
|
|
4
|
-
// ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄ █ ▄▄▄▄▄ ┃
|
|
5
|
-
// ┃ █ ██████ █ ▀█▄ █ ██████ █ ███▌▐███ ███████▄ █ ┃
|
|
6
|
-
// ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
|
|
7
|
-
// ┃ Copyright (c) 2017, the Perspective Authors. ┃
|
|
8
|
-
// ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃
|
|
9
|
-
// ┃ This file is part of the Perspective library, distributed under the terms ┃
|
|
10
|
-
// ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
|
|
11
|
-
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
|
12
|
-
|
|
13
|
-
use std::cell::Cell;
|
|
14
|
-
use std::marker::PhantomData;
|
|
15
|
-
use std::rc::Rc;
|
|
16
|
-
|
|
17
|
-
use derivative::Derivative;
|
|
18
|
-
use yew::html::*;
|
|
19
|
-
use yew::prelude::*;
|
|
20
|
-
use yew::virtual_dom::VChild;
|
|
21
|
-
|
|
22
|
-
use crate::utils::WeakScope;
|
|
23
|
-
|
|
24
|
-
#[derive(Properties, Derivative)]
|
|
25
|
-
#[derivative(PartialEq(bound = ""))]
|
|
26
|
-
pub struct ModalProps<T>
|
|
27
|
-
where
|
|
28
|
-
T: Component,
|
|
29
|
-
T::Properties: ModalLink<T>,
|
|
30
|
-
{
|
|
31
|
-
pub child: Option<VChild<T>>,
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
#[derive(Debug)]
|
|
35
|
-
pub enum ModalMsg<T>
|
|
36
|
-
where
|
|
37
|
-
T: Component,
|
|
38
|
-
{
|
|
39
|
-
SetPos {
|
|
40
|
-
top: f64,
|
|
41
|
-
left: f64,
|
|
42
|
-
visible: bool,
|
|
43
|
-
rev_vert: bool,
|
|
44
|
-
},
|
|
45
|
-
SubMsg(T::Message),
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
#[derive(Default)]
|
|
49
|
-
pub struct Modal<T> {
|
|
50
|
-
css: String,
|
|
51
|
-
rev_vert: ModalOrientation,
|
|
52
|
-
_comp: PhantomData<T>,
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
impl<T> Component for Modal<T>
|
|
56
|
-
where
|
|
57
|
-
T: Component,
|
|
58
|
-
T::Properties: ModalLink<T>,
|
|
59
|
-
{
|
|
60
|
-
type Message = ModalMsg<T>;
|
|
61
|
-
type Properties = ModalProps<T>;
|
|
62
|
-
|
|
63
|
-
fn create(_ctx: &Context<Self>) -> Self {
|
|
64
|
-
Self {
|
|
65
|
-
css: ":host{{top:0px;left:0px;opacity:0}}".to_owned(),
|
|
66
|
-
rev_vert: Default::default(),
|
|
67
|
-
_comp: PhantomData,
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
fn update(&mut self, ctx: &Context<Self>, msg: ModalMsg<T>) -> bool {
|
|
72
|
-
match msg {
|
|
73
|
-
ModalMsg::SetPos {
|
|
74
|
-
top,
|
|
75
|
-
left,
|
|
76
|
-
visible,
|
|
77
|
-
rev_vert,
|
|
78
|
-
} => {
|
|
79
|
-
let opacity = if visible { "" } else { ";opacity:0" };
|
|
80
|
-
self.css = format!(":host{{top:{top}px;left:{left}px{opacity}}}");
|
|
81
|
-
self.rev_vert.set(rev_vert);
|
|
82
|
-
true
|
|
83
|
-
},
|
|
84
|
-
ModalMsg::SubMsg(msg) => {
|
|
85
|
-
if let Some(child) = &ctx.props().child
|
|
86
|
-
&& let Some(link) = child.props.weak_link().borrow().as_ref()
|
|
87
|
-
{
|
|
88
|
-
link.send_message(msg);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
false
|
|
92
|
-
},
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
fn view(&self, ctx: &Context<Self>) -> Html {
|
|
97
|
-
let child = ctx
|
|
98
|
-
.props()
|
|
99
|
-
.child
|
|
100
|
-
.clone()
|
|
101
|
-
.map(Html::from)
|
|
102
|
-
.unwrap_or_default();
|
|
103
|
-
|
|
104
|
-
html! {
|
|
105
|
-
<>
|
|
106
|
-
<style>{ self.css.to_owned() }</style>
|
|
107
|
-
<ContextProvider<ModalOrientation> context={&self.rev_vert}>
|
|
108
|
-
<NoRender>{ child }</NoRender>
|
|
109
|
-
</ContextProvider<ModalOrientation>>
|
|
110
|
-
</>
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
#[derive(Clone, Default, Eq, PartialEq)]
|
|
116
|
-
pub struct ModalOrientation(Rc<Cell<bool>>);
|
|
117
|
-
|
|
118
|
-
impl ImplicitClone for ModalOrientation {}
|
|
119
|
-
|
|
120
|
-
impl ModalOrientation {
|
|
121
|
-
pub fn set(&self, value: bool) {
|
|
122
|
-
self.0.set(value);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
impl From<ModalOrientation> for bool {
|
|
127
|
-
fn from(x: ModalOrientation) -> Self {
|
|
128
|
-
x.0.get()
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
pub trait ModalLink<T>
|
|
133
|
-
where
|
|
134
|
-
T: Component,
|
|
135
|
-
{
|
|
136
|
-
fn weak_link(&self) -> &'_ WeakScope<T>;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
pub trait SetModalLink {
|
|
140
|
-
fn set_modal_link(&self);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
impl<T> SetModalLink for &Context<T>
|
|
144
|
-
where
|
|
145
|
-
T: Component,
|
|
146
|
-
T::Properties: ModalLink<T>,
|
|
147
|
-
{
|
|
148
|
-
fn set_modal_link(&self) {
|
|
149
|
-
*self.props().weak_link().borrow_mut() = Some(self.link().clone());
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
#[derive(Properties, Clone)]
|
|
154
|
-
struct NoRenderProps {
|
|
155
|
-
pub children: Children,
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
impl PartialEq for NoRenderProps {
|
|
159
|
-
fn eq(&self, _other: &Self) -> bool {
|
|
160
|
-
true
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
struct NoRender {}
|
|
165
|
-
|
|
166
|
-
impl Component for NoRender {
|
|
167
|
-
type Message = ();
|
|
168
|
-
type Properties = NoRenderProps;
|
|
169
|
-
|
|
170
|
-
fn create(_ctx: &Context<Self>) -> Self {
|
|
171
|
-
Self {}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
fn view(&self, ctx: &Context<Self>) -> Html {
|
|
175
|
-
html! { { ctx.props().children.iter().collect::<Html>() } }
|
|
176
|
-
}
|
|
177
|
-
}
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
|
2
|
-
// ┃ ██████ ██████ ██████ █ █ █ █ █ █▄ ▀███ █ ┃
|
|
3
|
-
// ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█ ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄ ▀█ █ ▀▀▀▀▀ ┃
|
|
4
|
-
// ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄ █ ▄▄▄▄▄ ┃
|
|
5
|
-
// ┃ █ ██████ █ ▀█▄ █ ██████ █ ███▌▐███ ███████▄ █ ┃
|
|
6
|
-
// ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
|
|
7
|
-
// ┃ Copyright (c) 2017, the Perspective Authors. ┃
|
|
8
|
-
// ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃
|
|
9
|
-
// ┃ This file is part of the Perspective library, distributed under the terms ┃
|
|
10
|
-
// ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
|
|
11
|
-
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
|
12
|
-
|
|
13
|
-
use std::cell::RefCell;
|
|
14
|
-
use std::rc::Rc;
|
|
15
|
-
|
|
16
|
-
use perspective_js::utils::global;
|
|
17
|
-
use wasm_bindgen::prelude::*;
|
|
18
|
-
use wasm_bindgen_futures::spawn_local;
|
|
19
|
-
use web_sys::*;
|
|
20
|
-
use yew::prelude::*;
|
|
21
|
-
|
|
22
|
-
use super::viewer::PerspectiveViewerElement;
|
|
23
|
-
use crate::components::copy_dropdown::CopyDropDownMenu;
|
|
24
|
-
use crate::components::portal::PortalModal;
|
|
25
|
-
use crate::components::style::{StyleProvider, StyleSurface};
|
|
26
|
-
use crate::config::*;
|
|
27
|
-
use crate::js::*;
|
|
28
|
-
use crate::presentation::Presentation;
|
|
29
|
-
use crate::renderer::*;
|
|
30
|
-
use crate::session::Session;
|
|
31
|
-
use crate::tasks::*;
|
|
32
|
-
use crate::utils::*;
|
|
33
|
-
use crate::*;
|
|
34
|
-
|
|
35
|
-
type TargetState = Rc<RefCell<Option<HtmlElement>>>;
|
|
36
|
-
|
|
37
|
-
#[derive(Properties, PartialEq)]
|
|
38
|
-
struct CopyDropDownWrapperProps {
|
|
39
|
-
renderer: Renderer,
|
|
40
|
-
callback: Callback<ExportFile>,
|
|
41
|
-
target: TargetState,
|
|
42
|
-
custom_element: HtmlElement,
|
|
43
|
-
#[prop_or_default]
|
|
44
|
-
theme: String,
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
enum CopyDropDownWrapperMsg {
|
|
48
|
-
Open,
|
|
49
|
-
Close,
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
struct CopyDropDownWrapper {
|
|
53
|
-
target: Option<HtmlElement>,
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
impl Component for CopyDropDownWrapper {
|
|
57
|
-
type Message = CopyDropDownWrapperMsg;
|
|
58
|
-
type Properties = CopyDropDownWrapperProps;
|
|
59
|
-
|
|
60
|
-
fn create(_ctx: &Context<Self>) -> Self {
|
|
61
|
-
Self { target: None }
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
fn update(&mut self, ctx: &Context<Self>, msg: Self::Message) -> bool {
|
|
65
|
-
match msg {
|
|
66
|
-
CopyDropDownWrapperMsg::Open => {
|
|
67
|
-
self.target = ctx.props().target.borrow().clone();
|
|
68
|
-
true
|
|
69
|
-
},
|
|
70
|
-
CopyDropDownWrapperMsg::Close => {
|
|
71
|
-
self.target = None;
|
|
72
|
-
true
|
|
73
|
-
},
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
fn view(&self, ctx: &Context<Self>) -> Html {
|
|
78
|
-
let on_close = ctx.link().callback(|_| CopyDropDownWrapperMsg::Close);
|
|
79
|
-
html! {
|
|
80
|
-
<StyleProvider
|
|
81
|
-
root={ctx.props().custom_element.clone()}
|
|
82
|
-
surface={StyleSurface::DropdownMenu}
|
|
83
|
-
>
|
|
84
|
-
<PortalModal
|
|
85
|
-
tag_name="perspective-copy-menu"
|
|
86
|
-
surface={StyleSurface::DropdownMenu}
|
|
87
|
-
target={self.target.clone()}
|
|
88
|
-
own_focus=true
|
|
89
|
-
{on_close}
|
|
90
|
-
theme={ctx.props().theme.clone()}
|
|
91
|
-
>
|
|
92
|
-
<CopyDropDownMenu
|
|
93
|
-
renderer={ctx.props().renderer.clone()}
|
|
94
|
-
callback={ctx.props().callback.clone()}
|
|
95
|
-
/>
|
|
96
|
-
</PortalModal>
|
|
97
|
-
</StyleProvider>
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
#[wasm_bindgen]
|
|
103
|
-
#[derive(Clone)]
|
|
104
|
-
pub struct CopyDropDownMenuElement {
|
|
105
|
-
elem: HtmlElement,
|
|
106
|
-
target: TargetState,
|
|
107
|
-
root: Rc<RefCell<Option<AppHandle<CopyDropDownWrapper>>>>,
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
impl CustomElementMetadata for CopyDropDownMenuElement {
|
|
111
|
-
const CUSTOM_ELEMENT_NAME: &'static str = "perspective-copy-menu";
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
#[wasm_bindgen]
|
|
115
|
-
impl CopyDropDownMenuElement {
|
|
116
|
-
#[wasm_bindgen(constructor)]
|
|
117
|
-
pub fn new(elem: HtmlElement) -> Self {
|
|
118
|
-
Self {
|
|
119
|
-
elem,
|
|
120
|
-
target: Default::default(),
|
|
121
|
-
root: Default::default(),
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
pub fn open(&self, target: HtmlElement) {
|
|
126
|
-
*self.target.borrow_mut() = Some(target);
|
|
127
|
-
if let Some(root) = self.root.borrow().as_ref() {
|
|
128
|
-
root.send_message(CopyDropDownWrapperMsg::Open);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
pub fn hide(&self) -> ApiResult<()> {
|
|
133
|
-
if let Some(root) = self.root.borrow().as_ref() {
|
|
134
|
-
root.send_message(CopyDropDownWrapperMsg::Close);
|
|
135
|
-
}
|
|
136
|
-
Ok(())
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
pub fn __set_model(&self, parent: &PerspectiveViewerElement) {
|
|
140
|
-
if let Some(panel) = parent.workspace.active_panel() {
|
|
141
|
-
self.set_config_model(&panel.session, &panel.renderer, &parent.presentation);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
pub fn connected_callback(&self) {}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
impl CopyDropDownMenuElement {
|
|
149
|
-
pub fn new_from_model(
|
|
150
|
-
session: &Session,
|
|
151
|
-
renderer: &Renderer,
|
|
152
|
-
presentation: &Presentation,
|
|
153
|
-
) -> Self {
|
|
154
|
-
let dropdown = global::document()
|
|
155
|
-
.create_element("perspective-copy-menu")
|
|
156
|
-
.unwrap()
|
|
157
|
-
.unchecked_into::<HtmlElement>();
|
|
158
|
-
|
|
159
|
-
let elem = Self::new(dropdown);
|
|
160
|
-
elem.set_config_model(session, renderer, presentation);
|
|
161
|
-
elem
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
pub fn set_config_model(
|
|
165
|
-
&self,
|
|
166
|
-
session: &Session,
|
|
167
|
-
renderer: &Renderer,
|
|
168
|
-
presentation: &Presentation,
|
|
169
|
-
) {
|
|
170
|
-
let callback = Callback::from({
|
|
171
|
-
let session = session.clone();
|
|
172
|
-
let renderer = renderer.clone();
|
|
173
|
-
let presentation = presentation.clone();
|
|
174
|
-
let target = self.target.clone();
|
|
175
|
-
let root = self.root.clone();
|
|
176
|
-
move |x: ExportFile| {
|
|
177
|
-
let session = session.clone();
|
|
178
|
-
let renderer = renderer.clone();
|
|
179
|
-
let presentation = presentation.clone();
|
|
180
|
-
let target = target.clone();
|
|
181
|
-
let root = root.clone();
|
|
182
|
-
spawn_local(async move {
|
|
183
|
-
let mime = x.method.mimetype(x.is_chart);
|
|
184
|
-
let task = export_method_to_blob(&session, &renderer, &presentation, x.method);
|
|
185
|
-
let result = copy_to_clipboard(task, mime).await;
|
|
186
|
-
let r = (|| -> ApiResult<()> {
|
|
187
|
-
result?;
|
|
188
|
-
*target.borrow_mut() = None;
|
|
189
|
-
if let Some(root) = root.borrow().as_ref() {
|
|
190
|
-
root.send_message(CopyDropDownWrapperMsg::Close);
|
|
191
|
-
}
|
|
192
|
-
Ok(())
|
|
193
|
-
})();
|
|
194
|
-
if let Err(e) = r {
|
|
195
|
-
web_sys::console::warn_1(&e.into());
|
|
196
|
-
}
|
|
197
|
-
})
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
let renderer = renderer.clone();
|
|
202
|
-
let init = ShadowRootInit::new(ShadowRootMode::Open);
|
|
203
|
-
let shadow_root = self
|
|
204
|
-
.elem
|
|
205
|
-
.attach_shadow(&init)
|
|
206
|
-
.unwrap()
|
|
207
|
-
.unchecked_into::<Element>();
|
|
208
|
-
|
|
209
|
-
let props = yew::props!(CopyDropDownWrapperProps {
|
|
210
|
-
renderer,
|
|
211
|
-
callback,
|
|
212
|
-
target: self.target.clone(),
|
|
213
|
-
custom_element: self.elem.clone()
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
let handle = yew::Renderer::with_root_and_props(shadow_root, props).render();
|
|
217
|
-
*self.root.borrow_mut() = Some(handle);
|
|
218
|
-
}
|
|
219
|
-
}
|