@perspective-dev/viewer 4.4.1 → 4.5.1
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 +1 -2
- package/dist/cdn/perspective-viewer.js.map +4 -4
- package/dist/css/botanical.css +1 -1
- package/dist/css/dracula.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/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/monokai.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/esm/bootstrap.d.ts +2 -1
- package/dist/esm/column-format.d.ts +51 -0
- package/dist/esm/extensions.d.ts +2 -0
- package/dist/esm/perspective-viewer.d.ts +3 -1
- package/dist/esm/perspective-viewer.inline.js +1 -2
- package/dist/esm/perspective-viewer.inline.js.map +4 -4
- package/dist/esm/perspective-viewer.js +1 -2
- package/dist/esm/perspective-viewer.js.map +4 -4
- package/dist/esm/perspective-viewer.worker.d.ts +2 -0
- package/dist/esm/plugin.d.ts +16 -72
- package/dist/esm/ts-rs/ColumnSelectMode.d.ts +1 -0
- package/dist/esm/ts-rs/PluginStaticConfig.d.ts +77 -0
- package/dist/esm/ts-rs/ViewerConfig.d.ts +6 -3
- package/dist/esm/ts-rs/ViewerConfigUpdate.d.ts +7 -4
- package/dist/wasm/perspective-viewer.d.ts +77 -18
- package/dist/wasm/perspective-viewer.js +302 -148
- package/dist/wasm/perspective-viewer.wasm +0 -0
- package/dist/wasm/perspective-viewer.wasm.d.ts +20 -15
- package/package.json +24 -2
- package/src/css/column-selector.css +3 -2
- package/src/css/column-settings-panel.css +44 -9
- package/src/css/column-style.css +35 -2
- package/src/css/containers/scroll-panel.css +2 -1
- package/src/css/containers/tabs.css +8 -52
- package/src/css/dom/checkbox.css +2 -6
- package/src/css/form/code-editor.css +1 -0
- package/src/css/form/debug.css +3 -10
- package/src/css/plugin-selector.css +33 -0
- package/src/css/plugin-settings-panel.css +99 -0
- package/src/css/viewer.css +143 -3
- package/src/rust/components/column_dropdown.rs +3 -1
- package/src/rust/components/column_selector/active_column.rs +16 -19
- package/src/rust/components/column_selector/config_selector.rs +20 -20
- package/src/rust/components/column_selector/filter_column.rs +14 -14
- package/src/rust/components/column_selector/inactive_column.rs +10 -15
- package/src/rust/components/column_selector/pivot_column.rs +7 -7
- package/src/rust/components/column_selector/sort_column.rs +7 -7
- package/src/rust/components/column_selector.rs +55 -37
- package/src/rust/components/column_settings_sidebar/style_tab/agg_depth_selector.rs +15 -7
- package/src/rust/components/column_settings_sidebar/style_tab/primitive_field.rs +395 -0
- package/src/rust/components/column_settings_sidebar/style_tab/symbol.rs +15 -6
- package/src/rust/components/column_settings_sidebar/style_tab.rs +267 -136
- package/src/rust/components/column_settings_sidebar.rs +44 -49
- package/src/rust/components/containers/dragdrop_list.rs +32 -5
- package/src/rust/components/containers/mod.rs +0 -1
- package/src/rust/components/containers/scroll_panel.rs +21 -7
- package/src/rust/components/containers/sidebar.rs +8 -6
- package/src/rust/components/containers/split_panel.rs +3 -3
- package/src/rust/components/containers/tab_list.rs +3 -9
- package/src/rust/components/copy_dropdown.rs +2 -3
- package/src/rust/components/datetime_column_style.rs +19 -81
- package/src/rust/components/editable_header.rs +17 -3
- package/src/rust/components/export_dropdown.rs +2 -3
- package/src/rust/components/expression_editor.rs +29 -17
- package/src/rust/components/filter_dropdown.rs +2 -1
- package/src/rust/components/form/color_range_selector.rs +14 -7
- package/src/rust/components/form/debug.rs +47 -37
- package/src/rust/components/main_panel.rs +24 -65
- package/src/rust/components/mod.rs +2 -1
- package/src/rust/components/number_series_style.rs +161 -0
- package/src/rust/components/plugin_tab.rs +221 -0
- package/src/rust/components/settings_panel.rs +181 -59
- package/src/rust/components/status_bar.rs +141 -174
- package/src/rust/components/status_indicator.rs +15 -22
- package/src/rust/components/string_column_style.rs +20 -82
- package/src/rust/components/style_controls/number_string_format.rs +14 -30
- package/src/rust/components/viewer.rs +169 -132
- package/src/rust/config/column_config_schema.rs +195 -0
- package/src/rust/config/columns_config.rs +4 -97
- package/src/rust/config/datetime_column_style.rs +0 -5
- package/src/rust/config/mod.rs +8 -2
- package/src/rust/config/number_series_style.rs +79 -0
- package/src/rust/config/plugin_static_config.rs +144 -0
- package/src/rust/config/string_column_style.rs +0 -5
- package/src/rust/config/viewer_config.rs +5 -6
- package/src/rust/custom_elements/copy_dropdown.rs +30 -18
- package/src/rust/custom_elements/debug_plugin.rs +1 -3
- package/src/rust/custom_elements/export_dropdown.rs +26 -18
- package/src/rust/custom_elements/viewer.rs +62 -73
- package/src/rust/custom_events.rs +181 -224
- package/src/rust/js/plugin.rs +45 -117
- package/src/rust/lib.rs +34 -5
- package/src/rust/presentation/drag_helpers.rs +206 -0
- package/src/rust/presentation/props.rs +8 -0
- package/src/rust/presentation.rs +256 -41
- package/src/rust/{tasks → queries}/column_locator.rs +17 -73
- package/src/rust/queries/column_values.rs +59 -0
- package/src/rust/{tasks → queries}/columns_iter_set.rs +11 -18
- package/src/rust/queries/exports.rs +96 -0
- package/src/rust/queries/fetch_column_stats.rs +94 -0
- package/src/rust/queries/get_viewer_config.rs +54 -0
- package/src/rust/queries/mod.rs +44 -0
- package/src/rust/queries/plugin_column_styles.rs +101 -0
- package/src/rust/{engines.rs → queries/validate_expression.rs} +26 -15
- package/src/rust/renderer/activate.rs +1 -0
- package/src/rust/renderer/limits.rs +9 -4
- package/src/rust/renderer/plugin_store.rs +12 -0
- package/src/rust/renderer/props.rs +28 -3
- package/src/rust/renderer/registry.rs +40 -15
- package/src/rust/renderer.rs +703 -60
- package/src/rust/session/column_defaults_update.rs +20 -28
- package/src/rust/session/drag_drop_update.rs +10 -10
- package/src/rust/session/metadata.rs +31 -16
- package/src/rust/session/props.rs +15 -6
- package/src/rust/session/view_subscription.rs +10 -0
- package/src/rust/session.rs +109 -147
- package/src/rust/tasks/copy_export.rs +178 -158
- package/src/rust/tasks/{structural.rs → dismiss_render_warning.rs} +20 -40
- package/src/rust/tasks/edit_expression.rs +68 -88
- package/src/rust/tasks/eject.rs +25 -22
- package/src/rust/tasks/intersection_observer.rs +8 -21
- package/src/rust/tasks/mod.rs +19 -21
- package/src/rust/tasks/reset_all.rs +98 -0
- package/src/rust/tasks/resize_observer.rs +11 -33
- package/src/rust/tasks/restore_and_render.rs +128 -90
- package/src/rust/tasks/{get_viewer_config.rs → send_column_config.rs} +39 -35
- package/src/rust/tasks/send_plugin_config.rs +33 -33
- package/src/rust/tasks/update_and_render.rs +75 -49
- package/src/rust/{components/containers/trap_door_panel.rs → tasks/update_theme.rs} +34 -33
- package/src/rust/tasks/validate_expression.rs +61 -0
- package/src/rust/utils/browser/selection.rs +4 -4
- package/src/rust/utils/mod.rs +0 -63
- package/src/svg/checkbox-checked-icon.svg +1 -1
- package/src/svg/checkbox-unchecked-icon.svg +1 -1
- package/src/svg/mega-menu-icons-density.svg +23 -0
- package/src/svg/mega-menu-icons-map-density.svg +24 -0
- package/src/svg/mega-menu-icons-map-line.svg +19 -0
- package/src/themes/botanical.css +27 -53
- package/src/themes/defaults.css +24 -36
- package/src/themes/dracula.css +36 -54
- package/src/themes/gruvbox-dark.css +39 -59
- package/src/themes/gruvbox.css +16 -28
- package/src/themes/icons.css +5 -0
- package/src/themes/intl/de.css +43 -6
- package/src/themes/intl/es.css +43 -6
- package/src/themes/intl/fr.css +43 -6
- package/src/themes/intl/ja.css +43 -6
- package/src/themes/intl/pt.css +43 -6
- package/src/themes/intl/zh.css +43 -6
- package/src/themes/intl.css +38 -4
- package/src/themes/monokai.css +45 -61
- package/src/themes/phosphor.css +20 -29
- package/src/themes/pro-dark.css +25 -34
- package/src/themes/solarized-dark.css +21 -36
- package/src/themes/solarized.css +13 -23
- package/src/themes/vaporwave.css +40 -74
- package/src/ts/bootstrap.ts +14 -3
- package/src/ts/column-format.ts +162 -0
- package/src/ts/extensions.ts +4 -0
- package/src/ts/perspective-viewer.ts +9 -1
- package/src/{rust/components/column_settings_sidebar/style_tab/stub.rs → ts/perspective-viewer.worker.ts} +2 -22
- package/src/ts/plugin.ts +25 -101
- package/src/ts/ts-rs/{FormatUnit.ts → ColumnSelectMode.ts} +1 -1
- package/src/ts/ts-rs/PluginStaticConfig.ts +78 -0
- package/src/ts/ts-rs/ViewerConfig.ts +1 -2
- package/src/ts/ts-rs/ViewerConfigUpdate.ts +2 -3
- package/dist/esm/ts-rs/ColumnConfigValues.d.ts +0 -31
- package/dist/esm/ts-rs/CustomDatetimeFormat.d.ts +0 -1
- package/dist/esm/ts-rs/CustomDatetimeStyleConfig.d.ts +0 -15
- package/dist/esm/ts-rs/CustomNumberFormatConfig.d.ts +0 -18
- package/dist/esm/ts-rs/DatetimeColorMode.d.ts +0 -1
- package/dist/esm/ts-rs/DatetimeFormatType.d.ts +0 -6
- package/dist/esm/ts-rs/FormatMode.d.ts +0 -1
- package/dist/esm/ts-rs/FormatUnit.d.ts +0 -1
- package/dist/esm/ts-rs/NumberBackgroundMode.d.ts +0 -1
- package/dist/esm/ts-rs/NumberForegroundMode.d.ts +0 -1
- package/dist/esm/ts-rs/PluginConfig.d.ts +0 -2
- package/dist/esm/ts-rs/RoundingMode.d.ts +0 -1
- package/dist/esm/ts-rs/RoundingPriority.d.ts +0 -1
- package/dist/esm/ts-rs/SignDisplay.d.ts +0 -1
- package/dist/esm/ts-rs/SimpleDatetimeFormat.d.ts +0 -1
- package/dist/esm/ts-rs/SimpleDatetimeStyleConfig.d.ts +0 -6
- package/dist/esm/ts-rs/StringColorMode.d.ts +0 -1
- package/dist/esm/ts-rs/TrailingZeroDisplay.d.ts +0 -1
- package/dist/esm/ts-rs/UseGrouping.d.ts +0 -1
- package/src/rust/components/number_column_style.rs +0 -491
- package/src/rust/config/number_column_style.rs +0 -136
- package/src/rust/dragdrop.rs +0 -481
- package/src/rust/tasks/plugin_column_styles.rs +0 -98
- package/src/ts/ts-rs/ColumnConfigValues.ts +0 -14
- package/src/ts/ts-rs/CustomDatetimeFormat.ts +0 -3
- package/src/ts/ts-rs/CustomDatetimeStyleConfig.ts +0 -5
- package/src/ts/ts-rs/CustomNumberFormatConfig.ts +0 -8
- package/src/ts/ts-rs/DatetimeColorMode.ts +0 -3
- package/src/ts/ts-rs/DatetimeFormatType.ts +0 -8
- package/src/ts/ts-rs/FormatMode.ts +0 -3
- package/src/ts/ts-rs/NumberBackgroundMode.ts +0 -3
- package/src/ts/ts-rs/NumberForegroundMode.ts +0 -3
- package/src/ts/ts-rs/PluginConfig.ts +0 -4
- package/src/ts/ts-rs/RoundingMode.ts +0 -3
- package/src/ts/ts-rs/RoundingPriority.ts +0 -3
- package/src/ts/ts-rs/SignDisplay.ts +0 -3
- package/src/ts/ts-rs/SimpleDatetimeFormat.ts +0 -3
- package/src/ts/ts-rs/SimpleDatetimeStyleConfig.ts +0 -4
- package/src/ts/ts-rs/StringColorMode.ts +0 -3
- package/src/ts/ts-rs/TrailingZeroDisplay.ts +0 -3
- package/src/ts/ts-rs/UseGrouping.ts +0 -3
- /package/dist/wasm/snippets/{perspective-viewer-d924246f0b4a3dce → perspective-viewer-3cd58f0374935772}/inline0.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-d924246f0b4a3dce → perspective-viewer-3cd58f0374935772}/inline1.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-d924246f0b4a3dce → perspective-viewer-3cd58f0374935772}/inline2.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-d924246f0b4a3dce → perspective-viewer-3cd58f0374935772}/inline3.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-d924246f0b4a3dce → perspective-viewer-3cd58f0374935772}/inline4.js +0 -0
- /package/src/rust/{tasks → config}/export_method.rs +0 -0
- /package/src/rust/{tasks → queries}/export_app.rs +0 -0
- /package/src/rust/{tasks → queries}/is_invalid_drop.rs +0 -0
package/dist/esm/plugin.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { View } from "@perspective-dev/client";
|
|
2
|
+
import { PluginStaticConfig } from "./ts-rs/PluginStaticConfig.js";
|
|
2
3
|
/**
|
|
3
4
|
* The `IPerspectiveViewerPlugin` interface defines the necessary API for a
|
|
4
5
|
* `<perspective-viewer>` plugin, which also must be an `HTMLElement` via the
|
|
@@ -6,7 +7,8 @@ import type { View } from "@perspective-dev/client";
|
|
|
6
7
|
* scratch however, the simplest way is to inherit from
|
|
7
8
|
* `<perspective-viewer-plugin>`, which implements `IPerspectiveViewerPlugin`
|
|
8
9
|
* with non-offensive default implementations, where only the `draw()` and
|
|
9
|
-
* `
|
|
10
|
+
* `get_static_config()` methods need be overridden to get started with a
|
|
11
|
+
* simple plugin.
|
|
10
12
|
*
|
|
11
13
|
* Note that plugins are frozen once a `<perspective-viewer>` has been
|
|
12
14
|
* instantiated, so generally new plugin code must be executed at the module
|
|
@@ -17,8 +19,8 @@ import type { View } from "@perspective-dev/client";
|
|
|
17
19
|
* ```javascript
|
|
18
20
|
* const BasePlugin = customElements.get("perspective-viewer-plugin");
|
|
19
21
|
* class MyPlugin extends BasePlugin {
|
|
20
|
-
*
|
|
21
|
-
* return "My Plugin";
|
|
22
|
+
* get_static_config() {
|
|
23
|
+
* return { name: "My Plugin", config_column_names: [] };
|
|
22
24
|
* }
|
|
23
25
|
* async draw(view) {
|
|
24
26
|
* const count = await view.num_rows();
|
|
@@ -34,57 +36,16 @@ import type { View } from "@perspective-dev/client";
|
|
|
34
36
|
*/
|
|
35
37
|
export interface IPerspectiveViewerPlugin {
|
|
36
38
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
39
|
+
* Static plugin configuration. Called exactly once per plugin at
|
|
40
|
+
* registration time and cached; the result must be stable for the
|
|
41
|
+
* lifetime of the application.
|
|
40
42
|
*/
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Select mode determines how column add/remove buttons behave for this
|
|
44
|
-
* plugin. `"select"` mode exclusively selects the added column, removing
|
|
45
|
-
* other columns. `"toggle"` mode toggles the column on or off (dependent
|
|
46
|
-
* on column state), leaving existing columns alone.
|
|
47
|
-
*/
|
|
48
|
-
get select_mode(): string | undefined;
|
|
49
|
-
/**
|
|
50
|
-
* The minimum number of columns required for this plugin to operate.
|
|
51
|
-
* This mostly affects drag/drop and column remove button behavior,
|
|
52
|
-
* preventing the use from applying configs which violate this min.
|
|
53
|
-
*
|
|
54
|
-
* While this option can technically be `undefined` (as in the case of
|
|
55
|
-
* `@perspective-dev/viewer-datagrid`), doing so currently has nearly
|
|
56
|
-
* identical behavior to 1.
|
|
57
|
-
*/
|
|
58
|
-
get min_config_columns(): number | undefined;
|
|
59
|
-
/**
|
|
60
|
-
* The named column labels, if desired. Named columns behave differently
|
|
61
|
-
* in drag/drop mode than unnamed columns, having replace/swap behavior
|
|
62
|
-
* rather than insert. If provided, the length of `config_column_names`
|
|
63
|
-
* _must_ be `>= min_config_columns`, as this is assumed by the drag/drop
|
|
64
|
-
* logic.
|
|
65
|
-
*/
|
|
66
|
-
get config_column_names(): string[] | undefined;
|
|
67
|
-
/**
|
|
68
|
-
* The load priority of the plugin. If the plugin shares priority with another,
|
|
69
|
-
* the first to load has a higher priority.
|
|
70
|
-
*
|
|
71
|
-
* A larger number has a higher priority.
|
|
72
|
-
*
|
|
73
|
-
* The plugin with the highest priority will be loaded by default by the Perspective viewer.
|
|
74
|
-
* If you would like to instead begin with a lower priority plugin, choose it explicitly with
|
|
75
|
-
* a `HTMLPerspectiveViewerPluginElement.restore` call.
|
|
76
|
-
*/
|
|
77
|
-
get priority(): number | undefined;
|
|
78
|
-
/**
|
|
79
|
-
* Given a column's grouping (determined by indexing it in `plugin.config_column_names`)
|
|
80
|
-
* and its view type, determines whether or not to render column styles in the settings sidebar.
|
|
81
|
-
* Implementing this function and `column_style_config` allows the plugin to interface with the viewer's column configuration API.
|
|
82
|
-
*/
|
|
83
|
-
can_render_column_styles?: (view_type: string, group: string) => boolean;
|
|
43
|
+
get_static_config(): PluginStaticConfig;
|
|
84
44
|
/**
|
|
85
45
|
* Determines which column configuration controls are populated in the viewer.
|
|
86
|
-
* Corresponds to the data the plugin will recieve on save.
|
|
87
|
-
*
|
|
46
|
+
* Corresponds to the data the plugin will recieve on save. Only
|
|
47
|
+
* invoked when `can_render_column_styles` is `true` in the static
|
|
48
|
+
* config.
|
|
88
49
|
*/
|
|
89
50
|
column_style_config?: (view_type: string, group: string) => any;
|
|
90
51
|
/**
|
|
@@ -137,19 +98,7 @@ export interface IPerspectiveViewerPlugin {
|
|
|
137
98
|
* Notify the plugin that the style environment has changed. Useful for
|
|
138
99
|
* plugins which read CSS styles via `window.getComputedStyle()`.
|
|
139
100
|
*/
|
|
140
|
-
restyle(
|
|
141
|
-
/**
|
|
142
|
-
* Save this plugin's state to a JSON-serializable value. While this value
|
|
143
|
-
* can be anything, it should work reciprocally with `restore()` to return
|
|
144
|
-
* this plugin's renderer to the same state, though potentially with a
|
|
145
|
-
* different `View`.
|
|
146
|
-
*
|
|
147
|
-
* `save()` should be used for user-persistent settings that are
|
|
148
|
-
* data-agnostic, so the user can have persistent view during refresh or
|
|
149
|
-
* reload. For example, `@perspective-dev/viewer-d3fc` uses
|
|
150
|
-
* `plugin_config` to remember the user-repositionable legend coordinates.
|
|
151
|
-
*/
|
|
152
|
-
save(): any;
|
|
101
|
+
restyle(): void;
|
|
153
102
|
/**
|
|
154
103
|
* Restore this plugin to a state previously returned by `save()`.
|
|
155
104
|
*/
|
|
@@ -177,19 +126,14 @@ export interface IPerspectiveViewerPlugin {
|
|
|
177
126
|
*/
|
|
178
127
|
export declare class HTMLPerspectiveViewerPluginElement extends HTMLElement implements IPerspectiveViewerPlugin {
|
|
179
128
|
constructor();
|
|
180
|
-
|
|
181
|
-
get select_mode(): "select" | "toggle";
|
|
182
|
-
get min_config_columns(): number | undefined;
|
|
183
|
-
get config_column_names(): string[] | undefined;
|
|
184
|
-
get priority(): number;
|
|
185
|
-
can_render_column_styles(): boolean;
|
|
129
|
+
get_static_config(): PluginStaticConfig;
|
|
186
130
|
column_style_config(): any;
|
|
187
131
|
update(view: View): Promise<void>;
|
|
188
132
|
draw(view: View): Promise<void>;
|
|
189
133
|
clear(): Promise<void>;
|
|
190
134
|
resize(view: View): Promise<void>;
|
|
191
|
-
restyle(
|
|
192
|
-
save(): any;
|
|
135
|
+
restyle(): void;
|
|
193
136
|
restore(): void;
|
|
194
137
|
delete(): Promise<void>;
|
|
138
|
+
get supports_streaming(): boolean;
|
|
195
139
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ColumnSelectMode = "toggle" | "select";
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { ColumnSelectMode } from "./ColumnSelectMode.js";
|
|
2
|
+
import type { GroupRollupMode } from "./GroupRollupMode.js";
|
|
3
|
+
/**
|
|
4
|
+
* Static, immutable configuration for a plugin.
|
|
5
|
+
*
|
|
6
|
+
* Returned once per plugin from `get_static_config()` at registration
|
|
7
|
+
* time and cached in [`crate::renderer::PluginRecord`]. Consumers
|
|
8
|
+
* (renderer, session, queries, components) read these fields off the
|
|
9
|
+
* renderer's active-plugin metadata rather than calling back into JS.
|
|
10
|
+
*
|
|
11
|
+
* `<perspective-viewer>` reads this exactly once per plugin (at
|
|
12
|
+
* `registerPlugin` time) and caches it for the lifetime of the
|
|
13
|
+
* application. The result must be stable; do not mutate any field
|
|
14
|
+
* after registration.
|
|
15
|
+
*/
|
|
16
|
+
export type PluginStaticConfig = {
|
|
17
|
+
/**
|
|
18
|
+
* The unique key for this plugin. Used as the `plugin` field in a
|
|
19
|
+
* `ViewerConfig` and as the display name key in the
|
|
20
|
+
* `<perspective-viewer>` UI.
|
|
21
|
+
*/
|
|
22
|
+
name: string;
|
|
23
|
+
/**
|
|
24
|
+
* Category in the plugin picker menu.
|
|
25
|
+
*/
|
|
26
|
+
category?: string | null;
|
|
27
|
+
/**
|
|
28
|
+
* Soft limit on the number of columns the plugin will render.
|
|
29
|
+
* Triggers the "Rendering N of M" warning when the view exceeds
|
|
30
|
+
* this value (until dismissed).
|
|
31
|
+
*/
|
|
32
|
+
max_columns?: number | null;
|
|
33
|
+
/**
|
|
34
|
+
* Soft limit on the number of cells (rows × columns) the plugin
|
|
35
|
+
* will render. Triggers the "Rendering N of M" warning when the view
|
|
36
|
+
* exceeds this value (until dismissed).
|
|
37
|
+
*/
|
|
38
|
+
max_cells?: number | null;
|
|
39
|
+
/**
|
|
40
|
+
* Column add/remove behavior. `"select"` exclusively selects the
|
|
41
|
+
* added column, removing other columns. `"toggle"` toggles the
|
|
42
|
+
* column on or off based on its current state, leaving other
|
|
43
|
+
* columns alone.
|
|
44
|
+
*/
|
|
45
|
+
select_mode?: ColumnSelectMode;
|
|
46
|
+
/**
|
|
47
|
+
* Minimum number of columns the plugin requires to render. Mostly
|
|
48
|
+
* affects drag/drop and column-remove button behavior. `undefined`
|
|
49
|
+
* is treated identically to `1`.
|
|
50
|
+
*/
|
|
51
|
+
min_config_columns?: number | null;
|
|
52
|
+
/**
|
|
53
|
+
* Named column slots. Named columns have replace/swap behavior in
|
|
54
|
+
* drag/drop rather than insert. The length must be at least
|
|
55
|
+
* `min_config_columns`.
|
|
56
|
+
*/
|
|
57
|
+
config_column_names?: Array<string>;
|
|
58
|
+
/**
|
|
59
|
+
* Group-rollup modes the plugin accepts, in preference order.
|
|
60
|
+
* The first entry that matches a feature flag becomes the default.
|
|
61
|
+
*/
|
|
62
|
+
group_rollup_modes?: Array<GroupRollupMode> | null;
|
|
63
|
+
/**
|
|
64
|
+
* Plugin load priority. Higher numbers win; ties resolve in
|
|
65
|
+
* registration order. The highest-priority plugin is loaded by
|
|
66
|
+
* default unless `restore({ plugin })` overrides it.
|
|
67
|
+
*/
|
|
68
|
+
priority?: number | null;
|
|
69
|
+
/**
|
|
70
|
+
* Whether this plugin opts into per-column style controls in the
|
|
71
|
+
* settings sidebar. When `true`, the StyleTab is shown for active
|
|
72
|
+
* columns and the plugin's `column_config_schema` is queried for
|
|
73
|
+
* the per-column field set. When `false` or omitted, no StyleTab
|
|
74
|
+
* is shown.
|
|
75
|
+
*/
|
|
76
|
+
can_render_column_styles?: boolean;
|
|
77
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Aggregate } from "./Aggregate.js";
|
|
2
|
-
import type { ColumnConfigValues } from "./ColumnConfigValues.js";
|
|
3
2
|
import type { Expressions } from "./Expressions.js";
|
|
4
3
|
import type { Filter } from "./Filter.js";
|
|
5
4
|
import type { FilterReducer } from "./FilterReducer.js";
|
|
@@ -13,10 +12,14 @@ import type { JsonValue } from "./serde_json/JsonValue.js";
|
|
|
13
12
|
export type ViewerConfig<V = string> = {
|
|
14
13
|
version: V;
|
|
15
14
|
columns_config: {
|
|
16
|
-
[key in string]?:
|
|
15
|
+
[key in string]?: {
|
|
16
|
+
[key in string]?: JsonValue;
|
|
17
|
+
};
|
|
17
18
|
};
|
|
18
19
|
plugin: string;
|
|
19
|
-
plugin_config:
|
|
20
|
+
plugin_config: {
|
|
21
|
+
[key in string]?: JsonValue;
|
|
22
|
+
};
|
|
20
23
|
settings: boolean;
|
|
21
24
|
table: string | null;
|
|
22
25
|
theme: string | null;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { Aggregate } from "./Aggregate.js";
|
|
2
|
-
import type { ColumnConfigValues } from "./ColumnConfigValues.js";
|
|
3
2
|
import type { Expressions } from "./Expressions.js";
|
|
4
3
|
import type { Filter } from "./Filter.js";
|
|
5
4
|
import type { FilterReducer } from "./FilterReducer.js";
|
|
6
5
|
import type { GroupRollupMode } from "./GroupRollupMode.js";
|
|
7
6
|
import type { OptionalUpdate } from "./OptionalUpdate.js";
|
|
8
|
-
import type { PluginConfig } from "./PluginConfig.js";
|
|
9
7
|
import type { Sort } from "./Sort.js";
|
|
8
|
+
import type { JsonValue } from "./serde_json/JsonValue.js";
|
|
10
9
|
export type ViewerConfigUpdate = {
|
|
11
10
|
version?: OptionalUpdate<string>;
|
|
12
11
|
plugin?: OptionalUpdate<string>;
|
|
@@ -14,9 +13,13 @@ export type ViewerConfigUpdate = {
|
|
|
14
13
|
table?: OptionalUpdate<string>;
|
|
15
14
|
theme?: OptionalUpdate<string>;
|
|
16
15
|
settings?: OptionalUpdate<boolean>;
|
|
17
|
-
plugin_config?:
|
|
16
|
+
plugin_config?: OptionalUpdate<{
|
|
17
|
+
[key in string]?: JsonValue;
|
|
18
|
+
}>;
|
|
18
19
|
columns_config?: OptionalUpdate<{
|
|
19
|
-
[key in string]?:
|
|
20
|
+
[key in string]?: {
|
|
21
|
+
[key in string]?: JsonValue;
|
|
22
|
+
};
|
|
20
23
|
}>;
|
|
21
24
|
/**
|
|
22
25
|
* A group by _groups_ the dataset by the unique values of each column used
|
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
TableInitOptions,
|
|
7
7
|
ColumnWindow,
|
|
8
8
|
ViewWindow,
|
|
9
|
+
TypedArrayWindow,
|
|
9
10
|
OnUpdateOptions,
|
|
10
11
|
JoinOptions,
|
|
11
12
|
UpdateOptions,
|
|
@@ -16,6 +17,7 @@ import type {
|
|
|
16
17
|
|
|
17
18
|
export type * from "../../src/ts/ts-rs/ViewerConfig.d.ts";
|
|
18
19
|
export type * from "../../src/ts/ts-rs/ViewerConfigUpdate.d.ts";
|
|
20
|
+
export type * from "../../src/ts/ts-rs/PluginStaticConfig.d.ts";
|
|
19
21
|
import type {ViewerConfig} from "../../src/ts/ts-rs/ViewerConfig.d.ts";
|
|
20
22
|
import type {ViewerConfigUpdate} from "../../src/ts/ts-rs/ViewerConfigUpdate.d.ts";
|
|
21
23
|
|
|
@@ -63,6 +65,29 @@ export class Client {
|
|
|
63
65
|
free(): void;
|
|
64
66
|
[Symbol.dispose](): void;
|
|
65
67
|
__getClassname(): string;
|
|
68
|
+
/**
|
|
69
|
+
* Unsafely gets a [`View`] by raw ID, useful for JavaScript multi-threaded
|
|
70
|
+
* (via Web Worker) context where a standard `View` cannot otherwise be
|
|
71
|
+
* shared because its wrapper is not serializable.
|
|
72
|
+
*
|
|
73
|
+
* # Safety
|
|
74
|
+
*
|
|
75
|
+
* This method is unsafe because the lifetime of a [`View`] is bound to
|
|
76
|
+
* the [`Client`] which created it.
|
|
77
|
+
*
|
|
78
|
+
* The caller must guarantee that `entity_id` corresponds to a live
|
|
79
|
+
* [`crate::View`] on the connected server (obtained from another
|
|
80
|
+
* [`Client`]'s [`crate::View::get_name`] and forwarded across the
|
|
81
|
+
* serialization boundary).
|
|
82
|
+
*
|
|
83
|
+
* # JavaScript Examples
|
|
84
|
+
*
|
|
85
|
+
* ```javascript
|
|
86
|
+
* const view = client.__unsafe_open_view(name_from_main_thread);
|
|
87
|
+
* const cols = await view.to_columns();
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
__unsafe_open_view(entity_id: string): View;
|
|
66
91
|
/**
|
|
67
92
|
* Retrieves the names of all tables that this client has access to.
|
|
68
93
|
*
|
|
@@ -345,7 +370,7 @@ export class PerspectiveDebugPluginElement {
|
|
|
345
370
|
constructor(elem: HTMLElement);
|
|
346
371
|
resize(): Promise<any>;
|
|
347
372
|
restore(_config?: any | null): void;
|
|
348
|
-
restyle():
|
|
373
|
+
restyle(): void;
|
|
349
374
|
save(): any;
|
|
350
375
|
update(view: View): Promise<any>;
|
|
351
376
|
readonly config_column_names: any;
|
|
@@ -463,7 +488,7 @@ export class PerspectiveViewerElement {
|
|
|
463
488
|
*
|
|
464
489
|
* This method is only really useful for the `"plugin"` method, which
|
|
465
490
|
* will use the configured plugin's export (e.g. PNG for
|
|
466
|
-
* `@perspective-dev/viewer-
|
|
491
|
+
* `@perspective-dev/viewer-charts`). Otherwise, prefer to call the
|
|
467
492
|
* equivalent method on the underlying [`View`] directly.
|
|
468
493
|
*
|
|
469
494
|
* # Arguments
|
|
@@ -600,6 +625,13 @@ export class PerspectiveViewerElement {
|
|
|
600
625
|
* [`PerspectiveViewerElement::save`]), and also makes no API calls to the
|
|
601
626
|
* server (unlike [`PerspectiveViewerElement::getView`] followed by
|
|
602
627
|
* [`View::get_config`])
|
|
628
|
+
*
|
|
629
|
+
* Returns the [`ViewConfig`] the currently-bound `View` was constructed
|
|
630
|
+
* from, so the value is consistent with what the active plugin is
|
|
631
|
+
* rendering even if a queued [`Self::restore`]/`update_and_render` has
|
|
632
|
+
* already mutated the live config in anticipation of the next draw.
|
|
633
|
+
* Falls back to the live session config when no `View` has yet been
|
|
634
|
+
* created (e.g., after `load` but before the first render).
|
|
603
635
|
*/
|
|
604
636
|
getViewConfig(): Promise<any>;
|
|
605
637
|
/**
|
|
@@ -1147,6 +1179,7 @@ export class View {
|
|
|
1147
1179
|
free(): void;
|
|
1148
1180
|
[Symbol.dispose](): void;
|
|
1149
1181
|
__get_model(): View;
|
|
1182
|
+
__unsafe_get_name(): string;
|
|
1150
1183
|
/**
|
|
1151
1184
|
* Collapses the `group_by` row at `row_index`.
|
|
1152
1185
|
*/
|
|
@@ -1321,6 +1354,23 @@ export class View {
|
|
|
1321
1354
|
* formatted [`String`].
|
|
1322
1355
|
*/
|
|
1323
1356
|
to_ndjson(window?: ViewWindow | null): Promise<string>;
|
|
1357
|
+
/**
|
|
1358
|
+
* Fetches columns from the [`View`] in Arrow format, decodes them, and
|
|
1359
|
+
* passes typed array views to `callback`. All arrays are only valid for
|
|
1360
|
+
* the duration of the callback — if `callback` returns a `Promise`, it
|
|
1361
|
+
* is awaited before the backing Arrow buffer is released, so async
|
|
1362
|
+
* callbacks may use the views for the full duration of the awaited
|
|
1363
|
+
* work (e.g. across an `await requestAnimationFrame`-backed promise).
|
|
1364
|
+
*
|
|
1365
|
+
* # Arguments
|
|
1366
|
+
*
|
|
1367
|
+
* - `window` - Optional [`TypedArrayWindow`] controlling row/column
|
|
1368
|
+
* windowing and output options (e.g., `float32` mode).
|
|
1369
|
+
* - `callback` - A JS function called with `(names: string[], values:
|
|
1370
|
+
* TypedArray[], validities: (Uint8Array|null)[], dictionaries:
|
|
1371
|
+
* (string[]|null)[]) => void | Promise<void>`.
|
|
1372
|
+
*/
|
|
1373
|
+
with_typed_arrays(window: TypedArrayWindow | null | undefined, callback: Function): Promise<void>;
|
|
1324
1374
|
}
|
|
1325
1375
|
|
|
1326
1376
|
export class VirtualDataSlice {
|
|
@@ -1343,6 +1393,10 @@ export class VirtualServer {
|
|
|
1343
1393
|
constructor(handler: object);
|
|
1344
1394
|
}
|
|
1345
1395
|
|
|
1396
|
+
export function get_wasm_module(): WebAssembly.Module;
|
|
1397
|
+
|
|
1398
|
+
export function get_worker_url(): URL;
|
|
1399
|
+
|
|
1346
1400
|
/**
|
|
1347
1401
|
* Register this crate's Custom Elements in the browser's current session.
|
|
1348
1402
|
*
|
|
@@ -1351,7 +1405,7 @@ export class VirtualServer {
|
|
|
1351
1405
|
* By default, this crate does not register `PerspectiveViewerElement` (as to
|
|
1352
1406
|
* preserve backwards-compatible synchronous API).
|
|
1353
1407
|
*/
|
|
1354
|
-
export function init(): void;
|
|
1408
|
+
export function init(module: WebAssembly.Module, url: URL): void;
|
|
1355
1409
|
|
|
1356
1410
|
/**
|
|
1357
1411
|
* Register a plugin globally.
|
|
@@ -1373,7 +1427,9 @@ export interface InitOutput {
|
|
|
1373
1427
|
readonly exportdropdownmenuelement___set_model: (a: number, b: number) => void;
|
|
1374
1428
|
readonly exportdropdownmenuelement_hide: (a: number, b: number) => void;
|
|
1375
1429
|
readonly exportdropdownmenuelement_open: (a: number, b: number) => void;
|
|
1376
|
-
readonly
|
|
1430
|
+
readonly get_wasm_module: (a: number) => void;
|
|
1431
|
+
readonly get_worker_url: (a: number) => void;
|
|
1432
|
+
readonly init: (a: number, b: number) => void;
|
|
1377
1433
|
readonly perspectivedebugpluginelement_clear: (a: number) => number;
|
|
1378
1434
|
readonly perspectivedebugpluginelement_config_column_names: (a: number) => number;
|
|
1379
1435
|
readonly perspectivedebugpluginelement_connectedCallback: (a: number) => void;
|
|
@@ -1419,9 +1475,9 @@ export interface InitOutput {
|
|
|
1419
1475
|
readonly registerPlugin: (a: number, b: number) => void;
|
|
1420
1476
|
readonly perspectivedebugpluginelement_update: (a: number, b: number) => number;
|
|
1421
1477
|
readonly perspectivedebugpluginelement_min_config_columns: (a: number) => number;
|
|
1478
|
+
readonly perspectivedebugpluginelement_restyle: (a: number) => void;
|
|
1422
1479
|
readonly perspectivedebugpluginelement_delete: (a: number) => number;
|
|
1423
1480
|
readonly perspectivedebugpluginelement_resize: (a: number) => number;
|
|
1424
|
-
readonly perspectivedebugpluginelement_restyle: (a: number) => number;
|
|
1425
1481
|
readonly exportdropdownmenuelement_new: (a: number) => number;
|
|
1426
1482
|
readonly __wbg_exportdropdownmenuelement_free: (a: number, b: number) => void;
|
|
1427
1483
|
readonly exportdropdownmenuelement_connected_callback: (a: number) => void;
|
|
@@ -1433,6 +1489,7 @@ export interface InitOutput {
|
|
|
1433
1489
|
readonly __wbg_virtualdataslice_free: (a: number, b: number) => void;
|
|
1434
1490
|
readonly __wbg_virtualserver_free: (a: number, b: number) => void;
|
|
1435
1491
|
readonly client___getClassname: (a: number, b: number) => void;
|
|
1492
|
+
readonly client___unsafe_open_view: (a: number, b: number, c: number) => number;
|
|
1436
1493
|
readonly client_get_hosted_table_names: (a: number) => number;
|
|
1437
1494
|
readonly client_handle_error: (a: number, b: number, c: number, d: number) => number;
|
|
1438
1495
|
readonly client_handle_response: (a: number, b: number) => number;
|
|
@@ -1480,6 +1537,7 @@ export interface InitOutput {
|
|
|
1480
1537
|
readonly table_validate_expressions: (a: number, b: number) => number;
|
|
1481
1538
|
readonly table_view: (a: number, b: number) => number;
|
|
1482
1539
|
readonly view___get_model: (a: number) => number;
|
|
1540
|
+
readonly view___unsafe_get_name: (a: number, b: number) => void;
|
|
1483
1541
|
readonly view_collapse: (a: number, b: number) => number;
|
|
1484
1542
|
readonly view_column_paths: (a: number, b: number) => number;
|
|
1485
1543
|
readonly view_delete: (a: number) => number;
|
|
@@ -1503,6 +1561,7 @@ export interface InitOutput {
|
|
|
1503
1561
|
readonly view_to_json: (a: number, b: number) => number;
|
|
1504
1562
|
readonly view_to_json_string: (a: number, b: number) => number;
|
|
1505
1563
|
readonly view_to_ndjson: (a: number, b: number) => number;
|
|
1564
|
+
readonly view_with_typed_arrays: (a: number, b: number, c: number) => number;
|
|
1506
1565
|
readonly virtualdataslice_fromArrowIpc: (a: number, b: number, c: number) => void;
|
|
1507
1566
|
readonly virtualdataslice_new: (a: number) => number;
|
|
1508
1567
|
readonly virtualdataslice_setBooleanCol: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
@@ -1513,19 +1572,19 @@ export interface InitOutput {
|
|
|
1513
1572
|
readonly virtualdataslice_setStringCol: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
1514
1573
|
readonly virtualserver_handleRequest: (a: number, b: number, c: number) => number;
|
|
1515
1574
|
readonly virtualserver_new: (a: number, b: number) => void;
|
|
1516
|
-
readonly
|
|
1517
|
-
readonly
|
|
1518
|
-
readonly
|
|
1519
|
-
readonly
|
|
1520
|
-
readonly
|
|
1521
|
-
readonly
|
|
1522
|
-
readonly
|
|
1523
|
-
readonly
|
|
1524
|
-
readonly
|
|
1525
|
-
readonly
|
|
1526
|
-
readonly
|
|
1527
|
-
readonly
|
|
1528
|
-
readonly
|
|
1575
|
+
readonly __wasm_bindgen_func_elem_3150: (a: number, b: number) => void;
|
|
1576
|
+
readonly __wasm_bindgen_func_elem_13605: (a: number, b: number) => void;
|
|
1577
|
+
readonly __wasm_bindgen_func_elem_16753: (a: number, b: number) => void;
|
|
1578
|
+
readonly __wasm_bindgen_func_elem_17412: (a: number, b: number) => void;
|
|
1579
|
+
readonly __wasm_bindgen_func_elem_17437: (a: number, b: number) => void;
|
|
1580
|
+
readonly __wasm_bindgen_func_elem_24661: (a: number, b: number, c: number, d: number) => void;
|
|
1581
|
+
readonly __wasm_bindgen_func_elem_5312: (a: number, b: number, c: number) => void;
|
|
1582
|
+
readonly __wasm_bindgen_func_elem_5313: (a: number, b: number, c: number) => void;
|
|
1583
|
+
readonly __wasm_bindgen_func_elem_5310: (a: number, b: number, c: number) => void;
|
|
1584
|
+
readonly __wasm_bindgen_func_elem_16872: (a: number, b: number, c: number) => void;
|
|
1585
|
+
readonly __wasm_bindgen_func_elem_17454: (a: number, b: number, c: number) => void;
|
|
1586
|
+
readonly __wasm_bindgen_func_elem_14526: (a: number, b: number) => number;
|
|
1587
|
+
readonly __wasm_bindgen_func_elem_17415: (a: number, b: number) => void;
|
|
1529
1588
|
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
1530
1589
|
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
1531
1590
|
readonly __wbindgen_export3: (a: number) => void;
|