@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.
Files changed (179) hide show
  1. package/dist/cdn/perspective-viewer.js +8 -8
  2. package/dist/cdn/perspective-viewer.js.map +3 -3
  3. package/dist/css/blueprint.css +1 -0
  4. package/dist/css/botanical.css +1 -1
  5. package/dist/css/dracula.css +1 -1
  6. package/dist/css/eggplant.css +1 -0
  7. package/dist/css/gruvbox-dark.css +1 -1
  8. package/dist/css/gruvbox.css +1 -1
  9. package/dist/css/icons.css +1 -1
  10. package/dist/css/intl/de.css +1 -1
  11. package/dist/css/intl/es.css +1 -1
  12. package/dist/css/intl/fr.css +1 -1
  13. package/dist/css/intl/ja.css +1 -1
  14. package/dist/css/intl/pt.css +1 -1
  15. package/dist/css/intl/zh.css +1 -1
  16. package/dist/css/intl.css +1 -1
  17. package/dist/css/ledger.css +1 -0
  18. package/dist/css/monokai.css +1 -1
  19. package/dist/css/nord.css +1 -0
  20. package/dist/css/phosphor.css +1 -1
  21. package/dist/css/pro-dark.css +1 -1
  22. package/dist/css/pro.css +1 -1
  23. package/dist/css/solarized-dark.css +1 -1
  24. package/dist/css/solarized.css +1 -1
  25. package/dist/css/themes.css +1 -1
  26. package/dist/css/vaporwave.css +1 -1
  27. package/dist/css/velvet.css +1 -0
  28. package/dist/docs/perspective-docs.json +1 -1
  29. package/dist/esm/column-format.d.ts +16 -3
  30. package/dist/esm/perspective-viewer.d.ts +1 -0
  31. package/dist/esm/perspective-viewer.inline.js +9 -9
  32. package/dist/esm/perspective-viewer.inline.js.map +3 -3
  33. package/dist/esm/perspective-viewer.js +8 -8
  34. package/dist/esm/perspective-viewer.js.map +3 -3
  35. package/dist/esm/plugin.d.ts +10 -0
  36. package/dist/esm/ts-rs/PanelViewerConfig.d.ts +1 -1
  37. package/dist/esm/ts-rs/SaveWorkspaceOptions.d.ts +10 -0
  38. package/dist/esm/ts-rs/ViewerConfig.d.ts +1 -1
  39. package/dist/esm/ts-rs/WorkspaceConfig.d.ts +9 -1
  40. package/dist/esm/ts-rs/WorkspaceConfigUpdate.d.ts +13 -3
  41. package/dist/wasm/perspective-viewer.d.ts +43 -36
  42. package/dist/wasm/perspective-viewer.js +198 -136
  43. package/dist/wasm/perspective-viewer.wasm +0 -0
  44. package/dist/wasm/perspective-viewer.wasm.d.ts +19 -17
  45. package/package.json +1 -1
  46. package/src/css/column-settings-panel.css +28 -5
  47. package/src/css/column-style.css +291 -31
  48. package/src/css/containers/tabs.css +13 -3
  49. package/src/css/dom/select.css +21 -9
  50. package/src/css/form/code-editor.css +4 -4
  51. package/src/css/plugin-selector.css +1 -0
  52. package/src/css/plugin-settings-panel.css +72 -0
  53. package/src/css/viewer.css +0 -5
  54. package/src/rust/agent/tools.rs +53 -19
  55. package/src/rust/components/column_selector/active_column.rs +2 -2
  56. package/src/rust/components/column_selector/add_expression_button.rs +3 -3
  57. package/src/rust/components/column_selector/aggregate_selector.rs +2 -3
  58. package/src/rust/components/column_selector/config_selector.rs +8 -0
  59. package/src/rust/components/column_selector/expr_edit_button.rs +4 -10
  60. package/src/rust/components/column_selector/inactive_column.rs +2 -2
  61. package/src/rust/components/column_selector.rs +48 -4
  62. package/src/rust/components/column_settings_sidebar/style_tab/primitive_field.rs +293 -126
  63. package/src/rust/components/column_settings_sidebar/style_tab.rs +330 -234
  64. package/src/rust/components/column_settings_sidebar.rs +88 -69
  65. package/src/rust/components/containers/control_group.rs +91 -0
  66. package/src/rust/components/containers/mod.rs +1 -0
  67. package/src/rust/components/containers/select.rs +8 -2
  68. package/src/rust/components/datetime_column_style/simple.rs +15 -4
  69. package/src/rust/components/datetime_column_style.rs +50 -10
  70. package/src/rust/components/editable_header.rs +85 -144
  71. package/src/rust/components/expression_editor.rs +9 -16
  72. package/src/rust/components/form/code_editor.rs +16 -6
  73. package/src/rust/components/form/debug.rs +1 -0
  74. package/src/rust/components/form/mod.rs +3 -1
  75. package/src/rust/components/form/multi_stop_gradient_selector.rs +476 -0
  76. package/src/rust/components/form/named_value_picker.rs +86 -0
  77. package/src/rust/components/form/palette_selector.rs +440 -0
  78. package/src/rust/components/main_panel/msg.rs +2 -2
  79. package/src/rust/components/main_panel/reconcile.rs +4 -4
  80. package/src/rust/components/plugin_tab.rs +126 -112
  81. package/src/rust/components/settings_panel.rs +26 -20
  82. package/src/rust/components/status_bar.rs +0 -1
  83. package/src/rust/components/style_controls/number_string_format/digits_section.rs +22 -10
  84. package/src/rust/components/style_controls/number_string_format/misc_section.rs +6 -2
  85. package/src/rust/components/style_controls/number_string_format/style_section.rs +1 -0
  86. package/src/rust/components/style_controls/number_string_format/types.rs +24 -0
  87. package/src/rust/components/style_controls/number_string_format.rs +37 -14
  88. package/src/rust/components/viewer/msg.rs +46 -7
  89. package/src/rust/components/viewer/panels.rs +11 -9
  90. package/src/rust/components/viewer/render.rs +8 -3
  91. package/src/rust/components/viewer/settings.rs +163 -23
  92. package/src/rust/components/viewer/snapshots.rs +46 -21
  93. package/src/rust/components/viewer/wiring.rs +14 -25
  94. package/src/rust/components/viewer.rs +12 -8
  95. package/src/rust/config/column_config_schema.rs +435 -45
  96. package/src/rust/config/css_scale.rs +882 -0
  97. package/src/rust/config/datetime_column_style.rs +4 -21
  98. package/src/rust/config/mod.rs +2 -0
  99. package/src/rust/config/number_string_format.rs +211 -18
  100. package/src/rust/config/options.rs +10 -0
  101. package/src/rust/config/viewer_config.rs +49 -55
  102. package/src/rust/config/workspace_config.rs +132 -5
  103. package/src/rust/custom_elements/viewer.rs +214 -155
  104. package/src/rust/custom_events.rs +14 -1
  105. package/src/rust/js/regular_layout.rs +3 -3
  106. package/src/rust/lib.rs +2 -0
  107. package/src/rust/presentation/column_locator.rs +19 -5
  108. package/src/rust/presentation.rs +209 -36
  109. package/src/rust/queries/column_locator.rs +74 -44
  110. package/src/rust/queries/get_viewer_config.rs +0 -3
  111. package/src/rust/queries/mod.rs +2 -0
  112. package/src/rust/queries/palette_set.rs +82 -0
  113. package/src/rust/queries/plugin_column_styles.rs +6 -2
  114. package/src/rust/renderer/dispatch.rs +50 -12
  115. package/src/rust/renderer/plugin_config.rs +362 -53
  116. package/src/rust/renderer.rs +15 -42
  117. package/src/rust/session/column_defaults_update.rs +15 -8
  118. package/src/rust/session/metadata.rs +5 -1
  119. package/src/rust/session/props.rs +1 -0
  120. package/src/rust/session.rs +9 -6
  121. package/src/rust/tasks/create_panel.rs +44 -57
  122. package/src/rust/tasks/edit_expression.rs +19 -23
  123. package/src/rust/tasks/edit_window.rs +8 -10
  124. package/src/rust/tasks/eject.rs +4 -1
  125. package/src/rust/tasks/pipeline.rs +2 -2
  126. package/src/rust/tasks/presize_panels.rs +44 -5
  127. package/src/rust/tasks/reset_all.rs +4 -4
  128. package/src/rust/tasks/restore_and_render.rs +17 -44
  129. package/src/rust/tasks/restore_panel.rs +11 -13
  130. package/src/rust/tasks/set_edit_mode.rs +3 -1
  131. package/src/rust/tasks/sync_update_panels.rs +11 -1
  132. package/src/rust/tasks/update_theme.rs +23 -18
  133. package/src/rust/utils/css_vars.rs +26 -0
  134. package/src/rust/utils/mod.rs +2 -0
  135. package/src/rust/utils/spawn.rs +1 -1
  136. package/src/rust/workspace.rs +435 -272
  137. package/src/svg/lock.svg +7 -0
  138. package/src/themes/blueprint.css +190 -0
  139. package/src/themes/botanical.css +14 -17
  140. package/src/themes/defaults.css +4 -110
  141. package/src/themes/dracula.css +19 -14
  142. package/src/themes/eggplant.css +189 -0
  143. package/src/themes/gruvbox-dark.css +23 -15
  144. package/src/themes/gruvbox.css +11 -1
  145. package/src/themes/icons.css +2 -2
  146. package/src/themes/intl/de.css +23 -1
  147. package/src/themes/intl/es.css +23 -1
  148. package/src/themes/intl/fr.css +23 -1
  149. package/src/themes/intl/ja.css +23 -1
  150. package/src/themes/intl/pt.css +23 -1
  151. package/src/themes/intl/zh.css +23 -1
  152. package/src/themes/intl.css +26 -4
  153. package/src/themes/ledger.css +195 -0
  154. package/src/themes/monokai.css +24 -14
  155. package/src/themes/nord.css +186 -0
  156. package/src/themes/phosphor.css +7 -14
  157. package/src/themes/pro-dark.css +12 -16
  158. package/src/themes/pro.css +118 -0
  159. package/src/themes/solarized-dark.css +9 -16
  160. package/src/themes/solarized.css +7 -0
  161. package/src/themes/themes.css +10 -5
  162. package/src/themes/vaporwave.css +22 -14
  163. package/src/themes/velvet.css +192 -0
  164. package/src/ts/column-format.ts +52 -2
  165. package/src/ts/perspective-viewer.ts +1 -0
  166. package/src/ts/plugin.ts +14 -0
  167. package/src/ts/ts-rs/PanelViewerConfig.ts +1 -1
  168. package/src/ts/ts-rs/SaveWorkspaceOptions.ts +11 -0
  169. package/src/ts/ts-rs/ViewerConfig.ts +1 -1
  170. package/src/ts/ts-rs/WorkspaceConfig.ts +8 -2
  171. package/src/ts/ts-rs/WorkspaceConfigUpdate.ts +11 -3
  172. package/src/rust/components/form/color_range_selector.rs +0 -137
  173. package/src/svg/dropdown-selector-light.svg +0 -3
  174. /package/dist/wasm/snippets/{perspective-viewer-02e461f3d7062b26 → perspective-viewer-87bd21b215d0631a}/inline0.js +0 -0
  175. /package/dist/wasm/snippets/{perspective-viewer-02e461f3d7062b26 → perspective-viewer-87bd21b215d0631a}/inline1.js +0 -0
  176. /package/dist/wasm/snippets/{perspective-viewer-02e461f3d7062b26 → perspective-viewer-87bd21b215d0631a}/inline2.js +0 -0
  177. /package/dist/wasm/snippets/{perspective-viewer-02e461f3d7062b26 → perspective-viewer-87bd21b215d0631a}/inline3.js +0 -0
  178. /package/dist/wasm/snippets/{perspective-viewer-02e461f3d7062b26 → perspective-viewer-87bd21b215d0631a}/inline4.js +0 -0
  179. /package/dist/wasm/snippets/{perspective-viewer-02e461f3d7062b26 → perspective-viewer-87bd21b215d0631a}/inline5.js +0 -0
@@ -16,4 +16,122 @@ perspective-viewer,
16
16
  perspective-viewer[theme="Pro Light"],
17
17
  perspective-viewer [theme="Pro Light"] {
18
18
  --psp-theme-name: "Pro Light";
19
+ --psp--color: #161616;
20
+ color: var(--psp--color);
21
+ --psp-inactive--color: #ababab;
22
+ --psp-inactive--border-color: #dadada;
23
+ --psp-active--color: #2670a9;
24
+ --psp-error--color: #ff471e;
25
+ --psp--background-color: #ffffff;
26
+ --psp-icon-overflow-hint--color: rgba(0, 0, 0, 0.2);
27
+ --psp-select--background-color: none;
28
+ --psp-warning--background: #042121;
29
+ --psp-warning--color: #fdfffd;
30
+
31
+ --psp-icon-overflow-hint--color: #fdfffd;
32
+ --psp-placeholder--background: #8b868045;
33
+
34
+ --psp-button--font-size: 16px;
35
+ --psp-config-button--padding: 15px 8px 6px 8px;
36
+ --psp-column-selector--font-size: 16px;
37
+ --psp-column-type--width: 25px;
38
+ --psp-select--padding: 0px;
39
+ --psp-top-panel-row--display: inline-flex;
40
+ --psp-button--min-width: 33px;
41
+
42
+ font-family:
43
+ "ui-monospace", "SFMono-Regular", "SF Mono", "Menlo", "Consolas",
44
+ "Liberation Mono", monospace;
45
+ --psp-interface-monospace--font-family:
46
+ "ui-monospace", "SFMono-Regular", "SF Mono", "Menlo", "Consolas",
47
+ "Liberation Mono", monospace;
48
+
49
+ --psp-label--webgl-y1--content: "arrow_upward";
50
+ --psp-label--webgl-y2--content: "arrow_downward";
51
+ --psp-charts--treemap-axis--lines: none;
52
+ --psp-charts--tooltip--background: #ffffff;
53
+ --psp-charts--tooltip--color: #161616;
54
+ --psp-charts--tooltip--border-color: #ababab;
55
+ --psp-charts--gridline--color: #eaedef;
56
+ --psp-charts--axis-ticks--color: #161616;
57
+ --psp-charts--axis-lines--color: #c5c9d0;
58
+ --psp-charts--legend--background: var(--psp--background-color);
59
+ --psp-charts--series--color: rgba(31, 119, 180, 0.8);
60
+ --psp-charts--series-1--color: #0366d6;
61
+ --psp-charts--series-2--color: #ff7f0e;
62
+ --psp-charts--series-3--color: #2ca02c;
63
+ --psp-charts--series-4--color: #d62728;
64
+ --psp-charts--series-5--color: #9467bd;
65
+ --psp-charts--series-6--color: #8c564b;
66
+ --psp-charts--series-7--color: #e377c2;
67
+ --psp-charts--series-8--color: #7f7f7f;
68
+ --psp-charts--series-9--color: #bcbd22;
69
+ --psp-charts--series-10--color: #17becf;
70
+ --psp-datagrid--series-1--color: #0366d6;
71
+ --psp-datagrid--series-2--color: #ff7f0e;
72
+ --psp-datagrid--series-3--color: #2ca02c;
73
+ --psp-datagrid--series-4--color: #d62728;
74
+ --psp-datagrid--series-5--color: #9467bd;
75
+ --psp-datagrid--series-6--color: #8c564b;
76
+ --psp-datagrid--series-7--color: #e377c2;
77
+ --psp-datagrid--series-8--color: #7f7f7f;
78
+ --psp-datagrid--series-9--color: #bcbd22;
79
+ --psp-datagrid--series-10--color: #17becf;
80
+ --psp-charts--gradient--background: linear-gradient(
81
+ #4d342f 0%,
82
+ #e4521b 22.5%,
83
+ #feeb65 42.5%,
84
+ #f0f0f0 50%,
85
+ #dcedc8 57.5%,
86
+ #42b3d5 67.5%,
87
+ #1a237e 100%
88
+ );
89
+
90
+ --psp-datagrid--pos-cell--color: #338dcd;
91
+ --psp-datagrid--neg-cell--color: #ff471e;
92
+
93
+ --psp-openlayers--tile-url: "http://{a-c}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png";
94
+ --psp-openlayers--element--background: #fff;
95
+ --psp-openlayers--category-1--color: #0366d6;
96
+ --psp-openlayers--category-2--color: #ff7f0e;
97
+ --psp-openlayers--category-3--color: #2ca02c;
98
+ --psp-openlayers--category-4--color: #d62728;
99
+ --psp-openlayers--category-5--color: #9467bd;
100
+ --psp-openlayers--category-6--color: #8c564b;
101
+ --psp-openlayers--category-7--color: #e377c2;
102
+ --psp-openlayers--category-8--color: #7f7f7f;
103
+ --psp-openlayers--category-9--color: #bcbd22;
104
+ --psp-openlayers--category-10--color: #17becf;
105
+ --psp-openlayers--gradient--background: linear-gradient(
106
+ #4d342f 0%,
107
+ #e4521b 22.5%,
108
+ #feeb65 42.5%,
109
+ #f0f0f0 50%,
110
+ #dcedc8 57.5%,
111
+ #42b3d5 67.5%,
112
+ #1a237e 100%
113
+ );
114
+ }
115
+
116
+ perspective-context-menu[theme="Pro Light"],
117
+ perspective-copy-menu[theme="Pro Light"],
118
+ perspective-export-menu[theme="Pro Light"],
119
+ perspective-dropdown[theme="Pro Light"],
120
+ perspective-date-column-style[theme="Pro Light"],
121
+ perspective-datetime-column-style[theme="Pro Light"],
122
+ perspective-number-column-style[theme="Pro Light"],
123
+ perspective-string-column-style[theme="Pro Light"] {
124
+ --psp--color: #161616;
125
+ --psp-inactive--color: #ababab;
126
+ --psp-inactive--border-color: #dadada;
127
+ --psp-active--color: #2670a9;
128
+ --psp-error--color: #ff471e;
129
+ --psp--background-color: #ffffff;
130
+ --psp-icon-overflow-hint--color: rgba(0, 0, 0, 0.2);
131
+ --psp-select--background-color: none;
132
+ --psp-warning--background: #042121;
133
+ --psp-warning--color: #fdfffd;
134
+ color: var(--psp--color);
135
+ background-color: #ffffff;
136
+ border: 1px solid #ababab;
19
137
  }
@@ -23,6 +23,7 @@ perspective-viewer [theme="Solarized Dark"] {
23
23
  /* perspective-viewer-solarized--colors */
24
24
  color: #586e75;
25
25
  background-color: #eee8d5;
26
+ color-scheme: dark;
26
27
  --psp--color: #586e75;
27
28
  --psp-active--color: #268bd2;
28
29
  --psp-error--color: #cb4b16;
@@ -53,6 +54,13 @@ perspective-viewer [theme="Solarized Dark"] {
53
54
  --psp-charts--series-5--color: #2aa198;
54
55
  --psp-charts--series-6--color: #6c71c4;
55
56
  --psp-charts--series-7--color: #d33682;
57
+ --psp-datagrid--series-1--color: #268bd2;
58
+ --psp-datagrid--series-2--color: #cb4b16;
59
+ --psp-datagrid--series-3--color: #b58900;
60
+ --psp-datagrid--series-4--color: #859900;
61
+ --psp-datagrid--series-5--color: #2aa198;
62
+ --psp-datagrid--series-6--color: #6c71c4;
63
+ --psp-datagrid--series-7--color: #d33682;
56
64
  /* perspective-viewer-solarized-dark--colors */
57
65
  color: #93a1a1;
58
66
  background-color: #002b36;
@@ -61,14 +69,6 @@ perspective-viewer [theme="Solarized Dark"] {
61
69
  --psp-inactive--border-color: var(--psp-inactive--color);
62
70
  --psp--background-color: #073642;
63
71
 
64
- --psp-icon--select-arrow--mask-image: var(
65
- --psp-icon--select-arrow-light--mask-image
66
- );
67
-
68
- --psp-icon--select-arrow-hover--mask-image: var(
69
- --psp-icon--select-arrow-dark--mask-image
70
- );
71
-
72
72
  /* perspective-viewer-solarized-dark--webgl */
73
73
  --psp-charts--treemap--labels: white;
74
74
  --psp-charts--treemap--hover-highlight: white;
@@ -94,6 +94,7 @@ perspective-number-column-style[theme="Solarized Dark"],
94
94
  perspective-string-column-style[theme="Solarized Dark"] {
95
95
  /* perspective-viewer-solarized--colors */
96
96
  color: #586e75;
97
+ color-scheme: dark;
97
98
  --psp--color: #586e75;
98
99
  --psp-active--color: #268bd2;
99
100
  --psp-error--color: #cb4b16;
@@ -111,13 +112,5 @@ perspective-string-column-style[theme="Solarized Dark"] {
111
112
  --psp-inactive--border-color: var(--psp-inactive--color);
112
113
  --psp--background-color: #073642;
113
114
 
114
- --psp-icon--select-arrow--mask-image: var(
115
- --psp-icon--select-arrow-light--mask-image
116
- );
117
-
118
- --psp-icon--select-arrow-hover--mask-image: var(
119
- --psp-icon--select-arrow-dark--mask-image
120
- );
121
-
122
115
  background-color: #073642;
123
116
  }
@@ -57,6 +57,13 @@ perspective-viewer [theme="Solarized"] {
57
57
 
58
58
  --psp-charts--series-6--color: #6c71c4;
59
59
  --psp-charts--series-7--color: #d33682;
60
+ --psp-datagrid--series-1--color: #268bd2;
61
+ --psp-datagrid--series-2--color: #cb4b16;
62
+ --psp-datagrid--series-3--color: #b58900;
63
+ --psp-datagrid--series-4--color: #859900;
64
+ --psp-datagrid--series-5--color: #2aa198;
65
+ --psp-datagrid--series-6--color: #6c71c4;
66
+ --psp-datagrid--series-7--color: #d33682;
60
67
  }
61
68
 
62
69
  x {
@@ -12,12 +12,17 @@
12
12
 
13
13
  @import "./pro.css";
14
14
  @import "./pro-dark.css";
15
+ @import "./blueprint.css";
16
+ @import "./botanical.css";
17
+ @import "./dracula.css";
18
+ @import "./eggplant.css";
19
+ @import "./gruvbox.css";
20
+ @import "./gruvbox-dark.css";
21
+ @import "./ledger.css";
15
22
  @import "./monokai.css";
23
+ @import "./nord.css";
24
+ @import "./phosphor.css";
16
25
  @import "./solarized.css";
17
26
  @import "./solarized-dark.css";
18
27
  @import "./vaporwave.css";
19
- @import "./gruvbox.css";
20
- @import "./gruvbox-dark.css";
21
- @import "./dracula.css";
22
- @import "./botanical.css";
23
- @import "./phosphor.css";
28
+ @import "./velvet.css";
@@ -23,6 +23,7 @@ perspective-viewer [theme="Vaporwave"] {
23
23
  /* perspective-viewer-pro-dark--colors (overrides) */
24
24
  background-color: #242526;
25
25
  color: white;
26
+ color-scheme: dark;
26
27
  --psp--color: white;
27
28
  --psp-active--color: #2770a9;
28
29
  --psp-error--color: #ff9485;
@@ -38,14 +39,6 @@ perspective-viewer [theme="Vaporwave"] {
38
39
  --psp-warning--color: #242526;
39
40
  --psp-warning--background: var(--psp--color);
40
41
 
41
- --psp-icon--select-arrow--mask-image: var(
42
- --psp-icon--select-arrow-light--mask-image
43
- );
44
-
45
- --psp-icon--select-arrow-hover--mask-image: var(
46
- --psp-icon--select-arrow-dark--mask-image
47
- );
48
-
49
42
  --psp-code-editor--symbol--color: white;
50
43
  --psp-code-editor--literal--color: #7dc3f0;
51
44
  --psp-code-editor--operator--color: rgb(23, 166, 123);
@@ -78,6 +71,16 @@ perspective-viewer [theme="Vaporwave"] {
78
71
  --psp-charts--series-8--color: rgb(221, 99, 103);
79
72
  --psp-charts--series-9--color: rgb(120, 104, 206);
80
73
  --psp-charts--series-10--color: rgb(23, 166, 123);
74
+ --psp-datagrid--series-1--color: rgb(71, 120, 194);
75
+ --psp-datagrid--series-2--color: rgb(204, 120, 48);
76
+ --psp-datagrid--series-3--color: rgb(158, 84, 192);
77
+ --psp-datagrid--series-4--color: rgb(51, 150, 153);
78
+ --psp-datagrid--series-5--color: rgb(102, 114, 143);
79
+ --psp-datagrid--series-6--color: rgb(211, 103, 189);
80
+ --psp-datagrid--series-7--color: rgb(109, 124, 77);
81
+ --psp-datagrid--series-8--color: rgb(221, 99, 103);
82
+ --psp-datagrid--series-9--color: rgb(120, 104, 206);
83
+ --psp-datagrid--series-10--color: rgb(23, 166, 123);
81
84
  --psp-charts--gradient--background: linear-gradient(
82
85
  #dd6367 0%,
83
86
  #242526 50%,
@@ -153,6 +156,16 @@ perspective-viewer [theme="Vaporwave"] {
153
156
  --psp-charts--series-8--color: hsl(192, 99%, 25%);
154
157
  --psp-charts--series-9--color: hsl(157, 100%, 25%);
155
158
  --psp-charts--series-10--color: hsl(272, 100%, 35%);
159
+ --psp-datagrid--series-1--color: #01cdfe;
160
+ --psp-datagrid--series-2--color: #ff71ce;
161
+ --psp-datagrid--series-3--color: #05ffa1;
162
+ --psp-datagrid--series-4--color: #b967ff;
163
+ --psp-datagrid--series-5--color: #fffb96;
164
+ --psp-datagrid--series-6--color: hsl(192, 99%, 25%);
165
+ --psp-datagrid--series-7--color: hsl(321, 100%, 36%);
166
+ --psp-datagrid--series-8--color: hsl(192, 99%, 25%);
167
+ --psp-datagrid--series-9--color: hsl(157, 100%, 25%);
168
+ --psp-datagrid--series-10--color: hsl(272, 100%, 35%);
156
169
 
157
170
  --psp-charts--gradient--background: linear-gradient(
158
171
  #f3d431,
@@ -188,6 +201,7 @@ perspective-string-column-style[theme="Vaporwave"] {
188
201
  /* perspective-viewer-pro-dark--colors (overrides) */
189
202
  background-color: #242526;
190
203
  color: white;
204
+ color-scheme: dark;
191
205
  --psp--color: white;
192
206
  --psp-active--color: #2770a9;
193
207
  --psp-error--color: #ff9485;
@@ -202,12 +216,6 @@ perspective-string-column-style[theme="Vaporwave"] {
202
216
  --psp-input--filter: invert(1);
203
217
  --psp-warning--color: #242526;
204
218
  --psp-warning--background: var(--psp--color);
205
- --psp-icon--select-arrow--mask-image: var(
206
- --psp-icon--select-arrow-light--mask-image
207
- );
208
- --psp-icon--select-arrow-hover--mask-image: var(
209
- --psp-icon--select-arrow-dark--mask-image
210
- );
211
219
  --psp-code-editor--symbol--color: white;
212
220
  --psp-code-editor--literal--color: #7dc3f0;
213
221
  --psp-code-editor--operator--color: rgb(23, 166, 123);
@@ -0,0 +1,192 @@
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
+ @import "./defaults.css";
14
+
15
+ perspective-viewer,
16
+ perspective-viewer[theme="Velvet"],
17
+ perspective-viewer [theme="Velvet"] {
18
+ --psp-theme-name: "Velvet";
19
+ }
20
+
21
+ perspective-viewer[theme="Velvet"],
22
+ perspective-viewer [theme="Velvet"] {
23
+ --theme-bg0: #3a0d14;
24
+ --theme-bg1: #4a1119;
25
+ --theme-bg2: #5c1822;
26
+ --theme-bg3: #7a2431;
27
+ --theme-fg0: #fff5f7;
28
+ --theme-fg1: #f3c9d3;
29
+ --theme-fg2: #a8606f;
30
+ --theme-white: #ffffff;
31
+ --theme-pink: #ff8fb8;
32
+ --theme-pink-bright: #ffb3cf;
33
+ --theme-rose: #ff5c8d;
34
+ --theme-blush: #ffd6e2;
35
+ --theme-gold: #f2c078;
36
+ --theme-lilac: #d9b3ff;
37
+ --theme-peach: #ffcba4;
38
+ --theme-amber: #ffd166;
39
+ --theme-mint: #8fe3c8;
40
+ --theme-sky: #9ccfff;
41
+ --theme-periwinkle: #a3a8ff;
42
+ --theme-sage: #c5d99a;
43
+
44
+ background-color: var(--theme-bg0);
45
+ color: var(--theme-fg0);
46
+ color-scheme: dark;
47
+ --psp--color: var(--theme-fg1);
48
+ --psp-active--color: var(--theme-pink);
49
+ --psp-error--color: var(--theme-amber);
50
+ --psp-inactive--color: var(--theme-fg2);
51
+ --psp-inactive--border-color: var(--theme-bg3);
52
+ --psp--background-color: var(--theme-bg0);
53
+ --psp-active--background: rgba(255, 143, 184, 0.3);
54
+ --psp-expression--operator--color: var(--theme-pink-bright);
55
+ --psp-expression--function--color: var(--theme-pink);
56
+ --psp-expression--psp-error--color: var(--theme-amber);
57
+ --psp-calendar--filter: invert(1);
58
+ --psp-input--filter: invert(1);
59
+ --psp-warning--color: var(--theme-bg0);
60
+ --psp-warning--background: var(--theme-blush);
61
+
62
+ --psp-status-icon--connected--color: var(--theme-pink);
63
+ --psp-status-icon--initializing--color: var(--theme-blush);
64
+ --psp-status-icon--psp-error--color: var(--theme-amber);
65
+
66
+ --psp-code-editor--symbol--color: var(--theme-fg0);
67
+ --psp-code-editor--literal--color: var(--theme-pink-bright);
68
+ --psp-code-editor--operator--color: var(--theme-pink-bright);
69
+ --psp-code-editor--comment--color: var(--theme-fg2);
70
+ --psp-code-editor--column--color: var(--theme-lilac);
71
+
72
+ --psp-datagrid--pos-cell--color: var(--theme-white);
73
+ --psp-datagrid--neg-cell--color: var(--theme-rose);
74
+
75
+ --psp-charts--legend--color: var(--theme-fg1);
76
+ --psp-charts--treemap--labels: var(--theme-fg0);
77
+ --psp-charts--treemap--hover-highlight: var(--theme-fg0);
78
+ --psp-charts--tooltip--color: var(--theme-fg0);
79
+ --psp-charts--axis-ticks--color: var(--theme-fg1);
80
+ --psp-charts--axis-lines--color: var(--theme-bg3);
81
+ --psp-charts--gridline--color: var(--theme-bg2);
82
+ --psp-charts--tooltip--background: var(--theme-bg1);
83
+ --psp-charts--tooltip--border-color: var(--theme-bg3);
84
+ --psp-charts--legend--background: var(--psp--background-color);
85
+
86
+ --psp-charts--series--color: var(--theme-white);
87
+ --psp-charts--series-1--color: var(--theme-fg1);
88
+ --psp-charts--series-2--color: var(--theme-pink);
89
+ --psp-charts--series-3--color: var(--theme-gold);
90
+ --psp-charts--series-4--color: var(--theme-lilac);
91
+ --psp-charts--series-5--color: var(--theme-mint);
92
+ --psp-charts--series-6--color: var(--theme-rose);
93
+ --psp-charts--series-7--color: var(--theme-sky);
94
+ --psp-charts--series-8--color: var(--theme-peach);
95
+ --psp-charts--series-9--color: var(--theme-periwinkle);
96
+ --psp-charts--series-10--color: var(--theme-sage);
97
+ --psp-datagrid--series-1--color: var(--theme-fg1);
98
+ --psp-datagrid--series-2--color: var(--theme-pink);
99
+ --psp-datagrid--series-3--color: var(--theme-gold);
100
+ --psp-datagrid--series-4--color: var(--theme-lilac);
101
+ --psp-datagrid--series-5--color: var(--theme-mint);
102
+ --psp-datagrid--series-6--color: var(--theme-rose);
103
+ --psp-datagrid--series-7--color: var(--theme-sky);
104
+ --psp-datagrid--series-8--color: var(--theme-peach);
105
+ --psp-datagrid--series-9--color: var(--theme-periwinkle);
106
+ --psp-datagrid--series-10--color: var(--theme-sage);
107
+
108
+ --psp-charts--gradient--background: linear-gradient(
109
+ var(--theme-rose) 0%,
110
+ var(--theme-bg0) 50%,
111
+ var(--theme-white) 100%
112
+ );
113
+
114
+ --psp-openlayers--tile-url: "http://{a-c}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png";
115
+ --psp-openlayers--attribution--filter: invert(1) hue-rotate(180deg);
116
+ --psp-openlayers--element--background: var(--theme-bg1);
117
+ --psp-openlayers--category-1--color: var(--theme-fg1);
118
+ --psp-openlayers--category-2--color: var(--theme-pink);
119
+ --psp-openlayers--category-3--color: var(--theme-gold);
120
+ --psp-openlayers--category-4--color: var(--theme-lilac);
121
+ --psp-openlayers--category-5--color: var(--theme-mint);
122
+ --psp-openlayers--category-6--color: var(--theme-rose);
123
+ --psp-openlayers--category-7--color: var(--theme-sky);
124
+ --psp-openlayers--category-8--color: var(--theme-peach);
125
+ --psp-openlayers--category-9--color: var(--theme-periwinkle);
126
+ --psp-openlayers--category-10--color: var(--theme-sage);
127
+ --psp-openlayers--gradient--background: linear-gradient(
128
+ var(--theme-rose) 0%,
129
+ var(--theme-bg0) 50%,
130
+ var(--theme-white) 100%
131
+ );
132
+ }
133
+
134
+ perspective-context-menu[theme="Velvet"],
135
+ perspective-copy-menu[theme="Velvet"],
136
+ perspective-export-menu[theme="Velvet"],
137
+ perspective-dropdown[theme="Velvet"],
138
+ perspective-date-column-style[theme="Velvet"],
139
+ perspective-datetime-column-style[theme="Velvet"],
140
+ perspective-number-column-style[theme="Velvet"],
141
+ perspective-string-column-style[theme="Velvet"] {
142
+ --theme-bg0: #3a0d14;
143
+ --theme-bg1: #4a1119;
144
+ --theme-bg2: #5c1822;
145
+ --theme-bg3: #7a2431;
146
+ --theme-fg0: #fff5f7;
147
+ --theme-fg1: #f3c9d3;
148
+ --theme-fg2: #a8606f;
149
+ --theme-white: #ffffff;
150
+ --theme-pink: #ff8fb8;
151
+ --theme-pink-bright: #ffb3cf;
152
+ --theme-rose: #ff5c8d;
153
+ --theme-blush: #ffd6e2;
154
+ --theme-gold: #f2c078;
155
+ --theme-lilac: #d9b3ff;
156
+ --theme-peach: #ffcba4;
157
+ --theme-amber: #ffd166;
158
+ --theme-mint: #8fe3c8;
159
+ --theme-sky: #9ccfff;
160
+ --theme-periwinkle: #a3a8ff;
161
+ --theme-sage: #c5d99a;
162
+
163
+ background-color: var(--theme-bg0);
164
+ color: var(--theme-fg0);
165
+ color-scheme: dark;
166
+ --psp--color: var(--theme-fg1);
167
+ --psp-active--color: var(--theme-pink);
168
+ --psp-error--color: var(--theme-amber);
169
+ --psp-inactive--color: var(--theme-fg2);
170
+ --psp-inactive--border-color: var(--theme-bg3);
171
+ --psp--background-color: var(--theme-bg0);
172
+ --psp-active--background: rgba(255, 143, 184, 0.3);
173
+ --psp-expression--operator--color: var(--theme-pink-bright);
174
+ --psp-expression--function--color: var(--theme-pink);
175
+ --psp-expression--psp-error--color: var(--theme-amber);
176
+ --psp-calendar--filter: invert(1);
177
+ --psp-input--filter: invert(1);
178
+ --psp-warning--color: var(--theme-bg0);
179
+ --psp-warning--background: var(--theme-blush);
180
+
181
+ --psp-status-icon--connected--color: var(--theme-pink);
182
+ --psp-status-icon--initializing--color: var(--theme-blush);
183
+ --psp-status-icon--psp-error--color: var(--theme-amber);
184
+
185
+ --psp-code-editor--symbol--color: var(--theme-fg0);
186
+ --psp-code-editor--literal--color: var(--theme-pink-bright);
187
+ --psp-code-editor--operator--color: var(--theme-pink-bright);
188
+ --psp-code-editor--comment--color: var(--theme-fg2);
189
+ --psp-code-editor--column--color: var(--theme-lilac);
190
+
191
+ border: 1px solid #7a2431;
192
+ }
@@ -83,23 +83,67 @@ const DATE_LEGACY_DEFAULTS: Intl.DateTimeFormatOptions = {
83
83
  dateStyle: "short",
84
84
  };
85
85
 
86
+ function mergeNumberOptions(
87
+ base: Intl.NumberFormatOptions,
88
+ cfg?: NumberFormatConfig,
89
+ ): Intl.NumberFormatOptions {
90
+ const explicit: Record<string, unknown> = {};
91
+ for (const [k, v] of Object.entries(cfg ?? {})) {
92
+ if (v !== undefined && v !== null) {
93
+ explicit[k] = v;
94
+ }
95
+ }
96
+
97
+ const merged: Record<string, unknown> = { ...base };
98
+ if (
99
+ "minimumFractionDigits" in explicit ||
100
+ "maximumFractionDigits" in explicit
101
+ ) {
102
+ delete merged.minimumFractionDigits;
103
+ delete merged.maximumFractionDigits;
104
+ }
105
+
106
+ if (
107
+ "minimumSignificantDigits" in explicit ||
108
+ "maximumSignificantDigits" in explicit
109
+ ) {
110
+ delete merged.minimumSignificantDigits;
111
+ delete merged.maximumSignificantDigits;
112
+ }
113
+
114
+ return Object.assign(merged, explicit) as Intl.NumberFormatOptions;
115
+ }
116
+
117
+ /**
118
+ * `defaults` is the calling plugin's declared default format, filling in
119
+ * the fields `cfg` leaves unset.
120
+ */
86
121
  export function createNumberFormatter(
87
122
  type: string,
88
123
  cfg?: NumberFormatConfig,
124
+ defaults?: NumberFormatConfig,
89
125
  ): Intl.NumberFormat {
90
126
  // ts-rs renders serde-absent keys as `T | null`; the wire never
91
127
  // carries an explicit `null` (`skip_serializing_if`), and
92
128
  // `Intl.NumberFormat` treats both absent and `undefined` the same, so
93
129
  // the cast is presentation-only.
94
- const opts = (cfg ??
130
+ const base = ((defaults as Intl.NumberFormatOptions | undefined) ??
95
131
  NUMERIC_LEGACY_DEFAULTS[type] ??
96
132
  {}) as Intl.NumberFormatOptions;
133
+
134
+ const opts = cfg ? mergeNumberOptions(base, cfg) : base;
97
135
  return new Intl.NumberFormat(navigator.languages as string[], opts);
98
136
  }
99
137
 
138
+ /**
139
+ * `defaults` is the calling plugin's declared default `date_format`,
140
+ * applied only when `cfg` is wholly absent.
141
+ */
100
142
  export function createDatetimeFormatter(
101
143
  cfg?: DateFormatConfig,
144
+ defaults?: DateFormatConfig,
102
145
  ): Intl.DateTimeFormat {
146
+ cfg = cfg ?? defaults;
103
147
  if (!cfg || !("format" in cfg)) {
104
148
  const preset = simple_config(cfg);
105
149
  const opts: Intl.DateTimeFormatOptions = {
@@ -158,10 +202,16 @@ export function createDatetimeFormatter(
158
202
  return new Intl.DateTimeFormat(navigator.languages as string[], opts);
159
203
  }
160
204
 
205
+ /**
206
+ * `defaults` follows the same contract as
207
+ * [`createDatetimeFormatter`]: the plugin's declared default
208
+ * `date_format`, applied only when `cfg` is wholly absent.
209
+ */
161
210
  export function createDateFormatter(
162
211
  cfg?: DateFormatConfig,
212
+ defaults?: DateFormatConfig,
163
213
  ): Intl.DateTimeFormat {
164
- const preset = simple_config(cfg);
214
+ const preset = simple_config(cfg ?? defaults);
165
215
  const opts: Intl.DateTimeFormatOptions = {
166
216
  timeZone: "utc",
167
217
  dateStyle:
@@ -58,6 +58,7 @@ export type * from "./ts-rs/FilterReducer.d.ts";
58
58
  export type * from "./ts-rs/PluginStaticConfig.ts";
59
59
  export type * from "./ts-rs/ExportMethod.d.ts";
60
60
  export type * from "./ts-rs/PanelOptions.d.ts";
61
+ export type * from "./ts-rs/SaveWorkspaceOptions.d.ts";
61
62
  export type * from "./ts-rs/ClientOptions.d.ts";
62
63
  export type * from "./ts-rs/ExportOptions.d.ts";
63
64
  export type * from "./ts-rs/GetTableOptions.d.ts";
package/src/ts/plugin.ts CHANGED
@@ -93,6 +93,20 @@ export interface IPerspectiveViewerPlugin {
93
93
  */
94
94
  column_style_config?: (view_type: string, group: string) => any;
95
95
 
96
+ /**
97
+ * The per-column Style-tab schema: the controls the viewer renders
98
+ * for one column, re-queried on every field edit so the field set
99
+ * may depend on `current_value`.
100
+ */
101
+ column_config_schema?(
102
+ view_type: string,
103
+ group: string | undefined,
104
+ column_name: string,
105
+ current_value: Record<string, unknown> | null,
106
+ viewer_config?: Record<string, unknown>,
107
+ column_stats?: Record<string, unknown>,
108
+ ): { fields: Array<Record<string, unknown> & { kind: string }> };
109
+
96
110
  /**
97
111
  * Render this plugin using the provided `View`. While there is no
98
112
  * provision to cancel a render in progress per se, calling a method on
@@ -12,7 +12,7 @@ import type { JsonValue } from "./serde_json/JsonValue.js";
12
12
  /**
13
13
  * The per-panel state of a [`ViewerConfig`] — everything except the
14
14
  * element-level `settings` flag. This is the `panels` entry type of the
15
- * whole-element config format.
15
+ * workspace config format.
16
16
  */
17
17
  export type PanelViewerConfig<V = string> = {
18
18
  /**
@@ -0,0 +1,11 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ /**
4
+ * Options for the `saveWorkspace()` method.
5
+ */
6
+ export type SaveWorkspaceOptions = {
7
+ /**
8
+ * When `true`, the emitted `palette` is the full set the element
9
+ * holds rather than only the values the panels reference.
10
+ */
11
+ full_palette?: boolean, };
@@ -12,7 +12,7 @@ import type { JsonValue } from "./serde_json/JsonValue.js";
12
12
  /**
13
13
  * The state of an entire `custom_elements::PerspectiveViewerElement` component
14
14
  * and its `Plugin`: the element-level `settings` flag plus the per-panel
15
- * [`PanelViewerConfig`]. The split exists so the whole-element config format
15
+ * [`PanelViewerConfig`]. The split exists so the workspace config format
16
16
  * can serialize panel entries *without* a `settings` key (it is element-level
17
17
  * state there, carried by the top-level `active` field instead), while the
18
18
  * single-panel format flattens back to the legacy shape.
@@ -4,7 +4,7 @@ import type { Layout } from "./Layout.js";
4
4
  import type { PanelViewerConfig } from "./PanelViewerConfig.js";
5
5
 
6
6
  /**
7
- * The whole-element config format (`{version, active?, layout, panels}`) —
7
+ * The workspace config format (`{version, active?, layout, panels}`) —
8
8
  * the multi-panel counterpart of the single-panel [`ViewerConfig`] — as
9
9
  * emitted by [`PerspectiveViewerElement::save`].
10
10
  *
@@ -33,4 +33,10 @@ global_filters?: Array<Filter>,
33
33
  * which master contributed which clause does not — restored
34
34
  * `global_filters` are one unattributed bucket. Omitted when empty.
35
35
  */
36
- masters?: Array<string>, };
36
+ masters?: Array<string>,
37
+ /**
38
+ * Named color-scale definitions shared by every panel: CSS custom
39
+ * property name (`--psp-user--<kind>-<name>`) → canonical CSS
40
+ * value.
41
+ */
42
+ palette?: { [key in string]?: string }, };