@perspective-dev/viewer 5.2.0 → 5.3.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 +8 -8
- package/dist/cdn/perspective-viewer.js.map +3 -3
- package/dist/css/blueprint.css +1 -0
- package/dist/css/botanical.css +1 -1
- package/dist/css/dracula.css +1 -1
- package/dist/css/eggplant.css +1 -0
- 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/ledger.css +1 -0
- package/dist/css/monokai.css +1 -1
- package/dist/css/nord.css +1 -0
- 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 -0
- package/dist/docs/perspective-docs.json +1 -1
- package/dist/esm/column-format.d.ts +16 -3
- package/dist/esm/perspective-viewer.d.ts +1 -0
- 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 +8 -8
- package/dist/esm/perspective-viewer.js.map +3 -3
- package/dist/esm/plugin.d.ts +10 -0
- package/dist/esm/ts-rs/PanelViewerConfig.d.ts +1 -1
- package/dist/esm/ts-rs/SaveWorkspaceOptions.d.ts +10 -0
- package/dist/esm/ts-rs/ViewerConfig.d.ts +1 -1
- package/dist/esm/ts-rs/WorkspaceConfig.d.ts +9 -1
- package/dist/esm/ts-rs/WorkspaceConfigUpdate.d.ts +13 -3
- package/dist/wasm/perspective-viewer.d.ts +43 -36
- package/dist/wasm/perspective-viewer.js +198 -136
- package/dist/wasm/perspective-viewer.wasm +0 -0
- package/dist/wasm/perspective-viewer.wasm.d.ts +19 -17
- package/package.json +1 -1
- package/src/css/column-settings-panel.css +28 -5
- package/src/css/column-style.css +291 -31
- package/src/css/containers/tabs.css +13 -3
- package/src/css/dom/select.css +21 -9
- package/src/css/form/code-editor.css +4 -4
- package/src/css/plugin-selector.css +1 -0
- package/src/css/plugin-settings-panel.css +72 -0
- package/src/css/viewer.css +0 -5
- package/src/rust/agent/tools.rs +53 -19
- package/src/rust/components/column_selector/active_column.rs +2 -2
- package/src/rust/components/column_selector/add_expression_button.rs +3 -3
- package/src/rust/components/column_selector/aggregate_selector.rs +2 -3
- package/src/rust/components/column_selector/config_selector.rs +8 -0
- package/src/rust/components/column_selector/expr_edit_button.rs +4 -10
- package/src/rust/components/column_selector/inactive_column.rs +2 -2
- package/src/rust/components/column_selector.rs +48 -4
- package/src/rust/components/column_settings_sidebar/style_tab/primitive_field.rs +293 -126
- package/src/rust/components/column_settings_sidebar/style_tab.rs +330 -234
- package/src/rust/components/column_settings_sidebar.rs +88 -69
- package/src/rust/components/containers/control_group.rs +91 -0
- package/src/rust/components/containers/mod.rs +1 -0
- package/src/rust/components/containers/select.rs +8 -2
- package/src/rust/components/datetime_column_style/simple.rs +15 -4
- package/src/rust/components/datetime_column_style.rs +50 -10
- package/src/rust/components/editable_header.rs +85 -144
- package/src/rust/components/expression_editor.rs +9 -16
- package/src/rust/components/form/code_editor.rs +16 -6
- package/src/rust/components/form/debug.rs +1 -0
- package/src/rust/components/form/mod.rs +3 -1
- package/src/rust/components/form/multi_stop_gradient_selector.rs +476 -0
- package/src/rust/components/form/named_value_picker.rs +86 -0
- package/src/rust/components/form/palette_selector.rs +440 -0
- package/src/rust/components/main_panel/msg.rs +2 -2
- package/src/rust/components/main_panel/reconcile.rs +4 -4
- package/src/rust/components/plugin_tab.rs +126 -112
- package/src/rust/components/settings_panel.rs +26 -20
- package/src/rust/components/status_bar.rs +0 -1
- package/src/rust/components/style_controls/number_string_format/digits_section.rs +22 -10
- package/src/rust/components/style_controls/number_string_format/misc_section.rs +6 -2
- package/src/rust/components/style_controls/number_string_format/style_section.rs +1 -0
- package/src/rust/components/style_controls/number_string_format/types.rs +24 -0
- package/src/rust/components/style_controls/number_string_format.rs +37 -14
- package/src/rust/components/viewer/msg.rs +46 -7
- package/src/rust/components/viewer/panels.rs +11 -9
- package/src/rust/components/viewer/render.rs +8 -3
- package/src/rust/components/viewer/settings.rs +163 -23
- package/src/rust/components/viewer/snapshots.rs +46 -21
- package/src/rust/components/viewer/wiring.rs +14 -25
- package/src/rust/components/viewer.rs +12 -8
- package/src/rust/config/column_config_schema.rs +435 -45
- package/src/rust/config/css_scale.rs +882 -0
- package/src/rust/config/datetime_column_style.rs +4 -21
- package/src/rust/config/mod.rs +2 -0
- package/src/rust/config/number_string_format.rs +211 -18
- package/src/rust/config/options.rs +10 -0
- package/src/rust/config/viewer_config.rs +49 -55
- package/src/rust/config/workspace_config.rs +132 -5
- package/src/rust/custom_elements/viewer.rs +214 -155
- package/src/rust/custom_events.rs +14 -1
- package/src/rust/js/regular_layout.rs +3 -3
- package/src/rust/lib.rs +2 -0
- package/src/rust/presentation/column_locator.rs +19 -5
- package/src/rust/presentation.rs +209 -36
- package/src/rust/queries/column_locator.rs +74 -44
- package/src/rust/queries/get_viewer_config.rs +0 -3
- package/src/rust/queries/mod.rs +2 -0
- package/src/rust/queries/palette_set.rs +82 -0
- package/src/rust/queries/plugin_column_styles.rs +6 -2
- package/src/rust/renderer/dispatch.rs +50 -12
- package/src/rust/renderer/plugin_config.rs +362 -53
- package/src/rust/renderer.rs +15 -42
- package/src/rust/session/column_defaults_update.rs +15 -8
- package/src/rust/session/metadata.rs +5 -1
- package/src/rust/session/props.rs +1 -0
- package/src/rust/session.rs +9 -6
- package/src/rust/tasks/create_panel.rs +44 -57
- package/src/rust/tasks/edit_expression.rs +19 -23
- package/src/rust/tasks/edit_window.rs +8 -10
- package/src/rust/tasks/eject.rs +4 -1
- package/src/rust/tasks/pipeline.rs +2 -2
- package/src/rust/tasks/presize_panels.rs +44 -5
- package/src/rust/tasks/reset_all.rs +4 -4
- package/src/rust/tasks/restore_and_render.rs +17 -44
- package/src/rust/tasks/restore_panel.rs +11 -13
- package/src/rust/tasks/set_edit_mode.rs +3 -1
- package/src/rust/tasks/sync_update_panels.rs +11 -1
- package/src/rust/tasks/update_theme.rs +23 -18
- package/src/rust/utils/css_vars.rs +26 -0
- package/src/rust/utils/mod.rs +2 -0
- package/src/rust/utils/spawn.rs +1 -1
- package/src/rust/workspace.rs +435 -272
- package/src/svg/lock.svg +7 -0
- package/src/themes/blueprint.css +190 -0
- package/src/themes/botanical.css +14 -17
- package/src/themes/defaults.css +4 -110
- package/src/themes/dracula.css +19 -14
- package/src/themes/eggplant.css +189 -0
- package/src/themes/gruvbox-dark.css +23 -15
- package/src/themes/gruvbox.css +11 -1
- package/src/themes/icons.css +2 -2
- package/src/themes/intl/de.css +23 -1
- package/src/themes/intl/es.css +23 -1
- package/src/themes/intl/fr.css +23 -1
- package/src/themes/intl/ja.css +23 -1
- package/src/themes/intl/pt.css +23 -1
- package/src/themes/intl/zh.css +23 -1
- package/src/themes/intl.css +26 -4
- package/src/themes/ledger.css +195 -0
- package/src/themes/monokai.css +24 -14
- package/src/themes/nord.css +186 -0
- package/src/themes/phosphor.css +7 -14
- package/src/themes/pro-dark.css +12 -16
- package/src/themes/pro.css +118 -0
- package/src/themes/solarized-dark.css +9 -16
- package/src/themes/solarized.css +7 -0
- package/src/themes/themes.css +10 -5
- package/src/themes/vaporwave.css +22 -14
- package/src/themes/velvet.css +192 -0
- package/src/ts/column-format.ts +52 -2
- package/src/ts/perspective-viewer.ts +1 -0
- package/src/ts/plugin.ts +14 -0
- package/src/ts/ts-rs/PanelViewerConfig.ts +1 -1
- package/src/ts/ts-rs/SaveWorkspaceOptions.ts +11 -0
- package/src/ts/ts-rs/ViewerConfig.ts +1 -1
- package/src/ts/ts-rs/WorkspaceConfig.ts +8 -2
- package/src/ts/ts-rs/WorkspaceConfigUpdate.ts +11 -3
- package/src/rust/components/form/color_range_selector.rs +0 -137
- package/src/svg/dropdown-selector-light.svg +0 -3
- /package/dist/wasm/snippets/{perspective-viewer-02e461f3d7062b26 → perspective-viewer-87bd21b215d0631a}/inline0.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-02e461f3d7062b26 → perspective-viewer-87bd21b215d0631a}/inline1.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-02e461f3d7062b26 → perspective-viewer-87bd21b215d0631a}/inline2.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-02e461f3d7062b26 → perspective-viewer-87bd21b215d0631a}/inline3.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-02e461f3d7062b26 → perspective-viewer-87bd21b215d0631a}/inline4.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-02e461f3d7062b26 → perspective-viewer-87bd21b215d0631a}/inline5.js +0 -0
|
@@ -4,7 +4,7 @@ import type { Layout } from "./Layout.js";
|
|
|
4
4
|
import type { ViewerConfigInitial } from "./ViewerConfigInitial.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* The parse target of a
|
|
7
|
+
* The parse target of a workspace config in
|
|
8
8
|
* [`PerspectiveViewerElement::restoreWorkspace`]. Mirrors
|
|
9
9
|
* [`WorkspaceConfig`], but `panels` entries are [`ViewerConfigInitial`]s —
|
|
10
10
|
* every entry creates a NEW panel, so `table` is required by type (a
|
|
@@ -16,10 +16,18 @@ export type WorkspaceConfigUpdate = { active?: string, layout?: Layout, panels:
|
|
|
16
16
|
* The element-level global (master/detail cross-) filters to re-apply as
|
|
17
17
|
* a transient overlay on every DETAIL panel. Restored as one
|
|
18
18
|
* unattributed bucket: the next selection on any master replaces it.
|
|
19
|
+
* `Option` so an explicit `undefined` property deserializes as
|
|
20
|
+
* `None` like an absent key (also `masters` / `palette` below).
|
|
19
21
|
*/
|
|
20
|
-
global_filters?: Array<Filter
|
|
22
|
+
global_filters?: Array<Filter> | null,
|
|
21
23
|
/**
|
|
22
24
|
* The master (filter-source) panels, by saved `panels` key. An id not in
|
|
23
25
|
* `panels` warns and is dropped.
|
|
24
26
|
*/
|
|
25
|
-
masters?: Array<string
|
|
27
|
+
masters?: Array<string> | null,
|
|
28
|
+
/**
|
|
29
|
+
* Named color-scale definitions to apply to the host (see
|
|
30
|
+
* [`WorkspaceConfig::palette`]), replacing any previously restored
|
|
31
|
+
* palette.
|
|
32
|
+
*/
|
|
33
|
+
palette?: { [key in string]?: string } | null, };
|
|
@@ -1,137 +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 wasm_bindgen::JsCast;
|
|
14
|
-
use web_sys::*;
|
|
15
|
-
use yew::prelude::*;
|
|
16
|
-
|
|
17
|
-
#[derive(Properties, PartialEq, Clone)]
|
|
18
|
-
pub struct ColorRangeProps {
|
|
19
|
-
/// Extra class appended to the positive input's `class` attribute,
|
|
20
|
-
/// so callers can target the pos / neg sides independently from CSS.
|
|
21
|
-
/// Paired with `neg_class`; both default to empty.
|
|
22
|
-
#[prop_or_default]
|
|
23
|
-
pub pos_class: Classes,
|
|
24
|
-
#[prop_or_default]
|
|
25
|
-
pub neg_class: Classes,
|
|
26
|
-
pub pos_color: String,
|
|
27
|
-
pub neg_color: String,
|
|
28
|
-
pub is_gradient: bool,
|
|
29
|
-
pub on_pos_color: Callback<String>,
|
|
30
|
-
pub on_neg_color: Callback<String>,
|
|
31
|
-
pub on_reset: Callback<()>,
|
|
32
|
-
pub is_modified: bool,
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
#[function_component(ColorRangeSelector)]
|
|
36
|
-
pub fn color_chooser_component(props: &ColorRangeProps) -> Html {
|
|
37
|
-
let on_pos_color = use_callback(
|
|
38
|
-
props.on_pos_color.clone(),
|
|
39
|
-
|event: InputEvent, on_pos_color| {
|
|
40
|
-
let color = event
|
|
41
|
-
.target()
|
|
42
|
-
.unwrap()
|
|
43
|
-
.unchecked_into::<HtmlInputElement>()
|
|
44
|
-
.value();
|
|
45
|
-
on_pos_color.emit(color);
|
|
46
|
-
},
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
let on_neg_color = use_callback(
|
|
50
|
-
props.on_neg_color.clone(),
|
|
51
|
-
|event: InputEvent, on_neg_color| {
|
|
52
|
-
let color = event
|
|
53
|
-
.target()
|
|
54
|
-
.unwrap()
|
|
55
|
-
.unchecked_into::<HtmlInputElement>()
|
|
56
|
-
.value();
|
|
57
|
-
on_neg_color.emit(color);
|
|
58
|
-
},
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
let fg_pos = infer_fg(&props.pos_color);
|
|
62
|
-
let fg_neg = infer_fg(&props.neg_color);
|
|
63
|
-
let style = if props.is_gradient {
|
|
64
|
-
format!(
|
|
65
|
-
"background:linear-gradient(to right, {} 0%, transparent 50%, {} 100%)",
|
|
66
|
-
props.pos_color, props.neg_color
|
|
67
|
-
)
|
|
68
|
-
} else {
|
|
69
|
-
format!(
|
|
70
|
-
"background:linear-gradient(to right, {} 0%, {} 50%, {} 50%, {} 100%)",
|
|
71
|
-
props.pos_color, props.pos_color, props.neg_color, props.neg_color
|
|
72
|
-
)
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
let on_reset = use_callback(props.clone(), |_: MouseEvent, deps| deps.on_reset.emit(()));
|
|
76
|
-
|
|
77
|
-
let pos_class = classes!("parameter", "pos-color-param", props.pos_class.clone());
|
|
78
|
-
let neg_class = classes!("parameter", "neg-color-param", props.neg_class.clone());
|
|
79
|
-
|
|
80
|
-
html! {
|
|
81
|
-
<>
|
|
82
|
-
<label id="color-range-label" />
|
|
83
|
-
<div class="color-gradient-container">
|
|
84
|
-
<div style={fg_pos} class="color-selector">
|
|
85
|
-
<input
|
|
86
|
-
class={pos_class}
|
|
87
|
-
type="color"
|
|
88
|
-
value={props.pos_color.to_owned()}
|
|
89
|
-
data-value={props.pos_color.to_owned()}
|
|
90
|
-
oninput={on_pos_color}
|
|
91
|
-
/>
|
|
92
|
-
<label class="color-label">{ "+" }</label>
|
|
93
|
-
</div>
|
|
94
|
-
<div class="color-thermometer" {style} />
|
|
95
|
-
<div style={fg_neg} class="color-selector">
|
|
96
|
-
<input
|
|
97
|
-
class={neg_class}
|
|
98
|
-
type="color"
|
|
99
|
-
value={props.neg_color.to_owned()}
|
|
100
|
-
data-value={props.neg_color.to_owned()}
|
|
101
|
-
oninput={on_neg_color}
|
|
102
|
-
/>
|
|
103
|
-
<label class="color-label">{ "-" }</label>
|
|
104
|
-
</div>
|
|
105
|
-
if props.is_modified {
|
|
106
|
-
<span class="reset-default-style" onclick={on_reset} />
|
|
107
|
-
} else {
|
|
108
|
-
<span class="reset-default-style-disabled" />
|
|
109
|
-
}
|
|
110
|
-
</div>
|
|
111
|
-
</>
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
fn infer_fg(color: &str) -> &'static str {
|
|
116
|
-
if color.len() >= 7 {
|
|
117
|
-
let r = i32::from_str_radix(&color[1..3], 16).unwrap_or(255) as f64;
|
|
118
|
-
let g = i32::from_str_radix(&color[3..5], 16).unwrap_or(0) as f64;
|
|
119
|
-
let b = i32::from_str_radix(&color[5..7], 16).unwrap_or(0) as f64;
|
|
120
|
-
if (r * r * 0.299 + g * g * 0.587 + b * b * 0.114).sqrt() > 130.0 {
|
|
121
|
-
"--sign--color:var(--psp--color)"
|
|
122
|
-
} else {
|
|
123
|
-
"--sign--color:var(--psp--background-color)"
|
|
124
|
-
}
|
|
125
|
-
} else if color.len() == 4 {
|
|
126
|
-
let r = i32::from_str_radix(&color[1..2], 16).unwrap_or(15) as f64;
|
|
127
|
-
let g = i32::from_str_radix(&color[2..3], 16).unwrap_or(0) as f64;
|
|
128
|
-
let b = i32::from_str_radix(&color[3..4], 16).unwrap_or(0) as f64;
|
|
129
|
-
if (r * r * 0.299 + g * g * 0.587 + b * b * 0.114).sqrt() > 8.0 {
|
|
130
|
-
"--sign--color:var(--psp--color)"
|
|
131
|
-
} else {
|
|
132
|
-
"--sign--color:var(--psp--background-color)"
|
|
133
|
-
}
|
|
134
|
-
} else {
|
|
135
|
-
"--sign--color:var(--psp--color)"
|
|
136
|
-
}
|
|
137
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|