@perspective-dev/viewer 5.1.0 → 5.3.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.
Files changed (245) hide show
  1. package/dist/cdn/perspective-viewer.js +9 -9
  2. package/dist/cdn/perspective-viewer.js.map +4 -4
  3. package/dist/css/botanical.css +1 -1
  4. package/dist/css/dracula.css +1 -1
  5. package/dist/css/gruvbox-dark.css +1 -1
  6. package/dist/css/gruvbox.css +1 -1
  7. package/dist/css/icons.css +1 -1
  8. package/dist/css/intl/de.css +1 -1
  9. package/dist/css/intl/es.css +1 -1
  10. package/dist/css/intl/fr.css +1 -1
  11. package/dist/css/intl/ja.css +1 -1
  12. package/dist/css/intl/pt.css +1 -1
  13. package/dist/css/intl/zh.css +1 -1
  14. package/dist/css/intl.css +1 -1
  15. package/dist/css/monokai.css +1 -1
  16. package/dist/css/phosphor.css +1 -1
  17. package/dist/css/pro-dark.css +1 -1
  18. package/dist/css/pro.css +1 -1
  19. package/dist/css/solarized-dark.css +1 -1
  20. package/dist/css/solarized.css +1 -1
  21. package/dist/css/themes.css +1 -1
  22. package/dist/css/vaporwave.css +1 -1
  23. package/dist/docs/perspective-docs.json +1 -0
  24. package/dist/esm/column-format.d.ts +19 -28
  25. package/dist/esm/perspective-viewer.d.ts +3 -0
  26. package/dist/esm/perspective-viewer.inline.js +9 -9
  27. package/dist/esm/perspective-viewer.inline.js.map +4 -4
  28. package/dist/esm/perspective-viewer.js +9 -9
  29. package/dist/esm/perspective-viewer.js.map +4 -4
  30. package/dist/esm/plugin.d.ts +10 -0
  31. package/dist/esm/providers.d.ts +79 -0
  32. package/dist/esm/ts-rs/CompactDisplay.d.ts +5 -0
  33. package/dist/esm/ts-rs/CurrencyCode.d.ts +1 -0
  34. package/dist/esm/ts-rs/CurrencyDisplay.d.ts +1 -0
  35. package/dist/esm/ts-rs/CurrencyNumberFormatStyle.d.ts +8 -0
  36. package/dist/esm/ts-rs/CurrencySign.d.ts +1 -0
  37. package/dist/esm/ts-rs/CustomDatetimeFormat.d.ts +1 -0
  38. package/dist/esm/ts-rs/CustomDatetimeStyleConfig.d.ts +54 -0
  39. package/dist/esm/ts-rs/CustomNumberFormatConfig.d.ts +34 -0
  40. package/dist/esm/ts-rs/DatetimeColorMode.d.ts +1 -0
  41. package/dist/esm/ts-rs/DatetimeFormatType.d.ts +6 -0
  42. package/dist/esm/ts-rs/FormatMode.d.ts +1 -0
  43. package/dist/esm/ts-rs/FormatUnit.d.ts +1 -0
  44. package/dist/esm/ts-rs/Notation.d.ts +17 -0
  45. package/dist/esm/ts-rs/NumberFormatStyle.d.ts +18 -0
  46. package/dist/esm/ts-rs/PanelViewerConfig.d.ts +42 -2
  47. package/dist/esm/ts-rs/PluginStaticConfig.d.ts +35 -0
  48. package/dist/esm/ts-rs/RestoreOptions.d.ts +19 -0
  49. package/dist/esm/ts-rs/RoundingMode.d.ts +1 -0
  50. package/dist/esm/ts-rs/RoundingPriority.d.ts +1 -0
  51. package/dist/esm/ts-rs/SaveWorkspaceOptions.d.ts +10 -0
  52. package/dist/esm/ts-rs/SignDisplay.d.ts +1 -0
  53. package/dist/esm/ts-rs/SimpleDatetimeFormat.d.ts +1 -0
  54. package/dist/esm/ts-rs/SimpleDatetimeStyleConfig.d.ts +24 -0
  55. package/dist/esm/ts-rs/SplitRollupMode.d.ts +9 -0
  56. package/dist/esm/ts-rs/StringColorMode.d.ts +1 -0
  57. package/dist/esm/ts-rs/TrailingZeroDisplay.d.ts +1 -0
  58. package/dist/esm/ts-rs/Unit.d.ts +1 -0
  59. package/dist/esm/ts-rs/UnitDisplay.d.ts +1 -0
  60. package/dist/esm/ts-rs/UnitNumberFormatStyle.d.ts +6 -0
  61. package/dist/esm/ts-rs/UseGrouping.d.ts +1 -0
  62. package/dist/esm/ts-rs/ViewerConfig.d.ts +42 -2
  63. package/dist/esm/ts-rs/ViewerConfigInitial.d.ts +175 -0
  64. package/dist/esm/ts-rs/ViewerConfigUpdate.d.ts +63 -0
  65. package/dist/esm/ts-rs/WindowSpec.d.ts +3 -2
  66. package/dist/esm/ts-rs/WorkspaceConfig.d.ts +9 -1
  67. package/dist/esm/ts-rs/WorkspaceConfigUpdate.d.ts +20 -9
  68. package/dist/wasm/perspective-viewer.d.ts +157 -41
  69. package/dist/wasm/perspective-viewer.js +452 -151
  70. package/dist/wasm/perspective-viewer.wasm +0 -0
  71. package/dist/wasm/perspective-viewer.wasm.d.ts +22 -17
  72. package/package.json +2 -1
  73. package/src/css/_viewer_bundle.css +1 -0
  74. package/src/css/column-selector.css +8 -0
  75. package/src/css/column-settings-panel.css +9 -5
  76. package/src/css/column-style.css +209 -31
  77. package/src/css/config-selector.css +38 -3
  78. package/src/css/dom/select.css +2 -1
  79. package/src/css/form/code-editor.css +6 -7
  80. package/src/css/form/mirrored-textarea.css +81 -0
  81. package/src/css/viewer.css +328 -0
  82. package/src/rust/agent/client/mod.rs +19 -0
  83. package/src/rust/agent/client/protocol.rs +320 -0
  84. package/src/rust/agent/client/transport.rs +287 -0
  85. package/src/rust/agent/client/turn.rs +174 -0
  86. package/src/rust/agent/config.rs +159 -0
  87. package/src/rust/agent/docs.rs +293 -0
  88. package/src/rust/agent/markdown/block.rs +509 -0
  89. package/src/rust/agent/markdown/entity.rs +52 -0
  90. package/src/rust/agent/markdown/events.rs +71 -0
  91. package/src/rust/agent/markdown/inline.rs +497 -0
  92. package/src/rust/agent/markdown/mod.rs +466 -0
  93. package/src/rust/agent/mod.rs +23 -0
  94. package/src/rust/agent/preamble.md +16 -0
  95. package/src/rust/agent/runtime.rs +201 -0
  96. package/src/rust/agent/slot.rs +236 -0
  97. package/src/rust/agent/tools.rs +1141 -0
  98. package/src/rust/components/chat_panel.rs +289 -0
  99. package/src/rust/components/column_selector/active_column.rs +2 -2
  100. package/src/rust/components/column_selector/add_expression_button.rs +3 -3
  101. package/src/rust/components/column_selector/aggregate_selector.rs +2 -3
  102. package/src/rust/components/column_selector/config_selector.rs +84 -7
  103. package/src/rust/components/column_selector/expr_edit_button.rs +4 -10
  104. package/src/rust/components/column_selector/inactive_column.rs +2 -2
  105. package/src/rust/components/column_selector.rs +55 -4
  106. package/src/rust/components/column_settings_sidebar/style_tab/primitive_field.rs +293 -126
  107. package/src/rust/components/column_settings_sidebar/style_tab.rs +262 -225
  108. package/src/rust/components/column_settings_sidebar.rs +88 -69
  109. package/src/rust/components/containers/dragdrop_list.rs +37 -0
  110. package/src/rust/components/editable_header.rs +85 -144
  111. package/src/rust/components/expression_editor.rs +9 -16
  112. package/src/rust/components/form/code_editor.rs +29 -28
  113. package/src/rust/components/form/debug.rs +9 -5
  114. package/src/rust/components/form/mirrored_textarea.rs +165 -0
  115. package/src/rust/components/form/mod.rs +4 -1
  116. package/src/rust/components/form/multi_stop_gradient_selector.rs +476 -0
  117. package/src/rust/components/form/named_value_picker.rs +86 -0
  118. package/src/rust/components/form/palette_selector.rs +440 -0
  119. package/src/rust/components/main_panel/msg.rs +2 -2
  120. package/src/rust/components/main_panel/reconcile.rs +4 -4
  121. package/src/rust/components/mod.rs +2 -0
  122. package/src/rust/components/plugin_tab.rs +4 -28
  123. package/src/rust/components/settings_panel.rs +105 -22
  124. package/src/rust/components/viewer/msg.rs +46 -7
  125. package/src/rust/components/viewer/panels.rs +17 -20
  126. package/src/rust/components/viewer/render.rs +10 -3
  127. package/src/rust/components/viewer/settings.rs +163 -23
  128. package/src/rust/components/viewer/snapshots.rs +46 -21
  129. package/src/rust/components/viewer/wiring.rs +14 -25
  130. package/src/rust/components/viewer.rs +12 -8
  131. package/src/rust/components/window_editor.rs +75 -103
  132. package/src/rust/config/column_config_schema.rs +100 -41
  133. package/src/rust/config/css_scale.rs +882 -0
  134. package/src/rust/config/datetime_column_style/custom.rs +17 -0
  135. package/src/rust/config/datetime_column_style/simple.rs +10 -0
  136. package/src/rust/config/mod.rs +2 -0
  137. package/src/rust/config/number_string_format.rs +33 -0
  138. package/src/rust/config/options.rs +28 -0
  139. package/src/rust/config/plugin_static_config.rs +120 -5
  140. package/src/rust/config/viewer_config.rs +216 -3
  141. package/src/rust/config/workspace_config.rs +138 -10
  142. package/src/rust/custom_elements/viewer.rs +369 -119
  143. package/src/rust/custom_events.rs +43 -1
  144. package/src/rust/js/regular_layout.rs +3 -3
  145. package/src/rust/lib.rs +15 -0
  146. package/src/rust/presentation/column_locator.rs +19 -5
  147. package/src/rust/presentation.rs +200 -36
  148. package/src/rust/queries/column_locator.rs +74 -44
  149. package/src/rust/queries/get_viewer_config.rs +2 -1
  150. package/src/rust/queries/mod.rs +2 -0
  151. package/src/rust/queries/palette_set.rs +82 -0
  152. package/src/rust/queries/plugin_column_styles.rs +6 -2
  153. package/src/rust/renderer/dispatch.rs +16 -4
  154. package/src/rust/renderer/plugin_config.rs +309 -47
  155. package/src/rust/renderer.rs +15 -42
  156. package/src/rust/session/column_defaults_update.rs +32 -7
  157. package/src/rust/session/metadata.rs +23 -21
  158. package/src/rust/session/props.rs +1 -0
  159. package/src/rust/session/replace_expression_update.rs +1 -0
  160. package/src/rust/session.rs +9 -6
  161. package/src/rust/tasks/create_panel.rs +46 -49
  162. package/src/rust/tasks/edit_expression.rs +19 -23
  163. package/src/rust/tasks/edit_window.rs +9 -11
  164. package/src/rust/tasks/eject.rs +4 -1
  165. package/src/rust/tasks/pipeline.rs +2 -2
  166. package/src/rust/tasks/presize_panels.rs +44 -5
  167. package/src/rust/tasks/reset_all.rs +4 -4
  168. package/src/rust/tasks/restore_and_render.rs +17 -44
  169. package/src/rust/tasks/restore_panel.rs +37 -22
  170. package/src/rust/tasks/set_edit_mode.rs +3 -1
  171. package/src/rust/tasks/sync_update_panels.rs +18 -24
  172. package/src/rust/tasks/update_theme.rs +23 -18
  173. package/src/rust/utils/css_vars.rs +26 -0
  174. package/src/rust/utils/mod.rs +2 -0
  175. package/src/rust/utils/spawn.rs +1 -1
  176. package/src/rust/workspace.rs +454 -199
  177. package/src/svg/lock.svg +7 -0
  178. package/src/themes/botanical.css +10 -0
  179. package/src/themes/defaults.css +12 -0
  180. package/src/themes/dracula.css +17 -0
  181. package/src/themes/gruvbox-dark.css +20 -0
  182. package/src/themes/gruvbox.css +10 -0
  183. package/src/themes/icons.css +1 -0
  184. package/src/themes/intl/de.css +16 -0
  185. package/src/themes/intl/es.css +16 -0
  186. package/src/themes/intl/fr.css +16 -0
  187. package/src/themes/intl/ja.css +16 -0
  188. package/src/themes/intl/pt.css +16 -0
  189. package/src/themes/intl/zh.css +16 -0
  190. package/src/themes/intl.css +16 -0
  191. package/src/themes/monokai.css +22 -0
  192. package/src/themes/phosphor.css +5 -0
  193. package/src/themes/pro-dark.css +10 -0
  194. package/src/themes/solarized-dark.css +7 -0
  195. package/src/themes/solarized.css +7 -0
  196. package/src/themes/vaporwave.css +20 -0
  197. package/src/ts/column-format.ts +67 -46
  198. package/src/ts/perspective-viewer.ts +3 -0
  199. package/src/ts/plugin.ts +14 -0
  200. package/src/ts/providers.ts +96 -0
  201. package/src/ts/ts-rs/CompactDisplay.ts +3 -0
  202. package/src/ts/ts-rs/CurrencyCode.ts +3 -0
  203. package/src/ts/ts-rs/CurrencyDisplay.ts +3 -0
  204. package/src/ts/ts-rs/CurrencyNumberFormatStyle.ts +6 -0
  205. package/src/ts/ts-rs/CurrencySign.ts +3 -0
  206. package/src/ts/ts-rs/CustomDatetimeFormat.ts +3 -0
  207. package/src/ts/ts-rs/CustomDatetimeStyleConfig.ts +54 -0
  208. package/src/ts/ts-rs/CustomNumberFormatConfig.ts +25 -0
  209. package/src/ts/ts-rs/DatetimeColorMode.ts +3 -0
  210. package/src/ts/ts-rs/DatetimeFormatType.ts +8 -0
  211. package/src/ts/ts-rs/FormatMode.ts +3 -0
  212. package/src/ts/ts-rs/FormatUnit.ts +3 -0
  213. package/src/ts/ts-rs/Notation.ts +11 -0
  214. package/src/ts/ts-rs/NumberFormatStyle.ts +12 -0
  215. package/src/ts/ts-rs/PanelViewerConfig.ts +48 -2
  216. package/src/ts/ts-rs/PluginStaticConfig.ts +36 -1
  217. package/src/ts/ts-rs/RestoreOptions.ts +20 -0
  218. package/src/ts/ts-rs/RoundingMode.ts +3 -0
  219. package/src/ts/ts-rs/RoundingPriority.ts +3 -0
  220. package/src/ts/ts-rs/SaveWorkspaceOptions.ts +11 -0
  221. package/src/ts/ts-rs/SignDisplay.ts +3 -0
  222. package/src/ts/ts-rs/SimpleDatetimeFormat.ts +3 -0
  223. package/src/ts/ts-rs/SimpleDatetimeStyleConfig.ts +25 -0
  224. package/src/ts/ts-rs/SplitRollupMode.ts +11 -0
  225. package/src/ts/ts-rs/StringColorMode.ts +3 -0
  226. package/src/ts/ts-rs/TrailingZeroDisplay.ts +3 -0
  227. package/src/ts/ts-rs/Unit.ts +3 -0
  228. package/src/ts/ts-rs/UnitDisplay.ts +3 -0
  229. package/src/ts/ts-rs/UnitNumberFormatStyle.ts +5 -0
  230. package/src/ts/ts-rs/UseGrouping.ts +3 -0
  231. package/src/ts/ts-rs/ViewerConfig.ts +48 -2
  232. package/src/ts/ts-rs/ViewerConfigInitial.ts +164 -0
  233. package/src/ts/ts-rs/ViewerConfigUpdate.ts +72 -2
  234. package/src/ts/ts-rs/WindowSpec.ts +3 -2
  235. package/src/ts/ts-rs/WorkspaceConfig.ts +8 -2
  236. package/src/ts/ts-rs/WorkspaceConfigUpdate.ts +18 -9
  237. package/dist/esm/ts-rs/WindowAggregate.d.ts +0 -1
  238. package/src/rust/components/form/color_range_selector.rs +0 -137
  239. package/src/ts/ts-rs/WindowAggregate.ts +0 -3
  240. /package/dist/wasm/snippets/{perspective-viewer-8a8c7d5d696b43ae → perspective-viewer-39c3c3b28e3cbd48}/inline0.js +0 -0
  241. /package/dist/wasm/snippets/{perspective-viewer-8a8c7d5d696b43ae → perspective-viewer-39c3c3b28e3cbd48}/inline1.js +0 -0
  242. /package/dist/wasm/snippets/{perspective-viewer-8a8c7d5d696b43ae → perspective-viewer-39c3c3b28e3cbd48}/inline2.js +0 -0
  243. /package/dist/wasm/snippets/{perspective-viewer-8a8c7d5d696b43ae → perspective-viewer-39c3c3b28e3cbd48}/inline3.js +0 -0
  244. /package/dist/wasm/snippets/{perspective-viewer-8a8c7d5d696b43ae → perspective-viewer-39c3c3b28e3cbd48}/inline4.js +0 -0
  245. /package/dist/wasm/snippets/{perspective-viewer-8a8c7d5d696b43ae → perspective-viewer-39c3c3b28e3cbd48}/inline5.js +0 -0
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
@@ -0,0 +1,96 @@
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
+ * LLM provider presets for `viewer.agentConfig()`. These are plain data —
15
+ * the agent core is provider-agnostic (one OpenAI-chat-completions protocol
16
+ * over primitive `url`/`headers`/`apiKey` connection fields), so a
17
+ * "provider" is just a spreadable collection of those fields:
18
+ *
19
+ * ```javascript
20
+ * import { providers } from "@perspective-dev/viewer";
21
+ * viewer.agentConfig({
22
+ * ...providers.anthropic,
23
+ * apiKey: "sk-ant-...",
24
+ * model: "claude-haiku-4-5", // spread order = override order
25
+ * });
26
+ * ```
27
+ *
28
+ * Any OpenAI-compatible service works without a preset — pass its full
29
+ * chat-completions `url` (and `apiKey`/`headers` as needed) directly.
30
+ * Cloud presets call the provider from the browser tab; suitable for local
31
+ * development, or route `url` through your own proxy for production.
32
+ */
33
+
34
+ /**
35
+ * A spreadable connection preset for `viewer.agentConfig()`.
36
+ */
37
+ export interface AgentProviderPreset {
38
+ name: string;
39
+ url: string;
40
+ headers?: Record<string, string>;
41
+ model?: string;
42
+ }
43
+
44
+ export const providers = {
45
+ /**
46
+ * Anthropic's OpenAI-compatibility endpoint. `apiKey` required.
47
+ */
48
+ anthropic: {
49
+ name: "anthropic",
50
+ url: "https://api.anthropic.com/v1/chat/completions",
51
+ headers: { "anthropic-dangerous-direct-browser-access": "true" },
52
+ model: "claude-opus-5",
53
+ },
54
+
55
+ /**
56
+ * Google Gemini's OpenAI-compatibility endpoint. `apiKey` required.
57
+ */
58
+ gemini: {
59
+ name: "gemini",
60
+ url: "https://generativelanguage.googleapis.com/v1beta/openai/chat/completions",
61
+ model: "gemini-2.5-flash",
62
+ },
63
+
64
+ /**
65
+ * LM Studio's local developer server (enable CORS in its settings).
66
+ */
67
+ lmstudio: {
68
+ name: "lmstudio",
69
+ url: "http://localhost:1234/v1/chat/completions",
70
+ },
71
+
72
+ /**
73
+ * Local Ollama (set `OLLAMA_ORIGINS` for CORS).
74
+ */
75
+ ollama: {
76
+ name: "ollama",
77
+ url: "http://localhost:11434/v1/chat/completions",
78
+ },
79
+
80
+ /**
81
+ * OpenRouter. `apiKey` required.
82
+ */
83
+ openrouter: {
84
+ name: "openrouter",
85
+ url: "https://openrouter.ai/api/v1/chat/completions",
86
+ },
87
+
88
+ /**
89
+ * OpenAI. `apiKey` required.
90
+ */
91
+ openai: {
92
+ name: "openai",
93
+ url: "https://api.openai.com/v1/chat/completions",
94
+ model: "gpt-5.2",
95
+ },
96
+ } as const satisfies Record<string, AgentProviderPreset>;
@@ -0,0 +1,3 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ export type CompactDisplay = { "compactDisplay": "short" } | { "compactDisplay": "long" };
@@ -0,0 +1,3 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ export type CurrencyCode = "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BOV" | "BRL" | "BSD" | "BTN" | "BWP" | "BYR" | "BZD" | "CAD" | "CDF" | "CHE" | "CHF" | "CHW" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "CRC" | "CUC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KPW" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LTL" | "LVL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRO" | "MUR" | "MVR" | "MWK" | "MXN" | "MXV" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "SSP" | "STD" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "USN" | "USS" | "UYI" | "UYU" | "UZS" | "VEF" | "VND" | "VUV" | "WST" | "XAF" | "XAG" | "XAU" | "XBA" | "XBB" | "XBC" | "XBD" | "XCD" | "XDR" | "XFU" | "XOF" | "XPD" | "XPF" | "XPT" | "XTS" | "XXX" | "YER" | "ZAR" | "ZMW";
@@ -0,0 +1,3 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ export type CurrencyDisplay = "code" | "symbol" | "narrowSymbol" | "name";
@@ -0,0 +1,6 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { CurrencyCode } from "./CurrencyCode.js";
3
+ import type { CurrencyDisplay } from "./CurrencyDisplay.js";
4
+ import type { CurrencySign } from "./CurrencySign.js";
5
+
6
+ export type CurrencyNumberFormatStyle = { currency: CurrencyCode, currencyDisplay: CurrencyDisplay | null, currencySign: CurrencySign | null, };
@@ -0,0 +1,3 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ export type CurrencySign = "standard" | "accounting";
@@ -0,0 +1,3 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ export type CustomDatetimeFormat = "long" | "short" | "narrow" | "numeric" | "2-digit" | "disabled";
@@ -0,0 +1,54 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { CustomDatetimeFormat } from "./CustomDatetimeFormat.js";
3
+ import type { FormatUnit } from "./FormatUnit.js";
4
+
5
+ /**
6
+ * A datetime column's `date_format` in its `Custom` form: per-part
7
+ * `Intl.DateTimeFormatOptions` overrides, discriminated from the `Simple`
8
+ * preset form by the required `format: "custom"` key. Each part is a
9
+ * [`CustomDatetimeFormat`] variant valid for that `Intl` option;
10
+ * `"disabled"` omits the part from the formatted output entirely.
11
+ */
12
+ export type CustomDatetimeStyleConfig = { format: FormatUnit,
13
+ /**
14
+ * An IANA time zone name (e.g. `"America/New_York"`); defaults to the
15
+ * browser's local time zone.
16
+ */
17
+ timeZone?: string | null,
18
+ /**
19
+ * Sub-second digits to display, 0-3 (0 = none).
20
+ */
21
+ fractionalSecondDigits?: number,
22
+ /**
23
+ * Defaults to `"numeric"`.
24
+ */
25
+ second?: CustomDatetimeFormat,
26
+ /**
27
+ * Defaults to `"numeric"`.
28
+ */
29
+ minute?: CustomDatetimeFormat,
30
+ /**
31
+ * Defaults to `"numeric"`.
32
+ */
33
+ hour?: CustomDatetimeFormat,
34
+ /**
35
+ * Defaults to `"numeric"`.
36
+ */
37
+ day?: CustomDatetimeFormat,
38
+ /**
39
+ * A name form (`"long"`/`"short"`/`"narrow"`); defaults to
40
+ * `"disabled"` (weekday not shown).
41
+ */
42
+ weekday?: CustomDatetimeFormat,
43
+ /**
44
+ * Numeric or name form; defaults to `"numeric"`.
45
+ */
46
+ month?: CustomDatetimeFormat,
47
+ /**
48
+ * Defaults to `"2-digit"`.
49
+ */
50
+ year?: CustomDatetimeFormat,
51
+ /**
52
+ * 12-hour clock; defaults to `true`.
53
+ */
54
+ hour12?: boolean, };
@@ -0,0 +1,25 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { RoundingMode } from "./RoundingMode.js";
3
+ import type { RoundingPriority } from "./RoundingPriority.js";
4
+ import type { SignDisplay } from "./SignDisplay.js";
5
+ import type { TrailingZeroDisplay } from "./TrailingZeroDisplay.js";
6
+ import type { UseGrouping } from "./UseGrouping.js";
7
+
8
+ /**
9
+ * A numeric column's `number_format` (`columns_config` value) —
10
+ * `Intl.NumberFormat`-shaped options, written by the Style tab's number
11
+ * format editor and read by `createNumberFormatter`. The `style` and
12
+ * `notation` families ([`NumberFormatStyle`] / [`Notation`]) are serde-
13
+ * FLATTENED into this object but `#[ts(skip)]`'d (ts-rs cannot flatten
14
+ * `Option<enum>`) — the package's `NumberFormatConfig` re-composes the
15
+ * full wire type as `CustomNumberFormatConfig & Partial<NumberFormatStyle>
16
+ * & Partial<Notation>` (see `column-format.ts`).
17
+ */
18
+ export type CustomNumberFormatConfig = { minimumIntegerDigits?: number | null, minimumFractionDigits?: number | null, maximumFractionDigits?: number | null, minimumSignificantDigits?: number | null, maximumSignificantDigits?: number | null, roundingPriority?: RoundingPriority | null, roundingIncrement?: number | null, roundingMode?: RoundingMode | null, trailingZeroDisplay?: TrailingZeroDisplay | null,
19
+ /**
20
+ * NOTE (audit 2026-08-05): serialized values are the STRINGS
21
+ * `"always"`/`"auto"`/`"min2"` or the untagged BOOLEAN `false` —
22
+ * the former hand-written TS `useGrouping?: boolean` was wrong for
23
+ * the string cases.
24
+ */
25
+ useGrouping?: UseGrouping | null, signDisplay?: SignDisplay | null, };
@@ -0,0 +1,3 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ export type DatetimeColorMode = "none" | "foreground" | "background";
@@ -0,0 +1,8 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { CustomDatetimeStyleConfig } from "./CustomDatetimeStyleConfig.js";
3
+ import type { SimpleDatetimeStyleConfig } from "./SimpleDatetimeStyleConfig.js";
4
+
5
+ /**
6
+ * `Simple` case has all default-able keys and must be last!
7
+ */
8
+ export type DatetimeFormatType = CustomDatetimeStyleConfig | SimpleDatetimeStyleConfig;
@@ -0,0 +1,3 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ export type FormatMode = "none" | "link" | "bold" | "italics";
@@ -0,0 +1,3 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ export type FormatUnit = "custom";
@@ -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
+ import type { CompactDisplay } from "./CompactDisplay.js";
3
+
4
+ /**
5
+ * The `notation` family of a numeric column's `number_format` —
6
+ * serialized FLATTENED into [`CustomNumberFormatConfig`]'s object,
7
+ * discriminated by the `notation` key (`"standard"` default,
8
+ * `"scientific"`, `"engineering"`, `"compact"` + `compactDisplay`),
9
+ * mirroring `Intl.NumberFormat` options.
10
+ */
11
+ export type Notation = { "notation": "standard" } | { "notation": "scientific" } | { "notation": "engineering" } | { "notation": "compact" } & CompactDisplay;
@@ -0,0 +1,12 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { CurrencyNumberFormatStyle } from "./CurrencyNumberFormatStyle.js";
3
+ import type { UnitNumberFormatStyle } from "./UnitNumberFormatStyle.js";
4
+
5
+ /**
6
+ * The `style` family of a numeric column's `number_format` — serialized
7
+ * FLATTENED into [`CustomNumberFormatConfig`]'s object, discriminated by
8
+ * the `style` key (`"decimal"` default, `"currency"` + `currency`/
9
+ * `currencyDisplay`/`currencySign`, `"percent"`, `"unit"` + `unit`/
10
+ * `unitDisplay`), mirroring `Intl.NumberFormat` options.
11
+ */
12
+ export type NumberFormatStyle = { "style": "decimal" } | { "style": "currency" } & CurrencyNumberFormatStyle | { "style": "percent" } | { "style": "unit" } & UnitNumberFormatStyle;
@@ -5,12 +5,58 @@ import type { Filter } from "./Filter.js";
5
5
  import type { FilterReducer } from "./FilterReducer.js";
6
6
  import type { GroupRollupMode } from "./GroupRollupMode.js";
7
7
  import type { Sort } from "./Sort.js";
8
+ import type { SplitRollupMode } from "./SplitRollupMode.js";
8
9
  import type { Windows } from "./Windows.js";
9
10
  import type { JsonValue } from "./serde_json/JsonValue.js";
10
11
 
11
12
  /**
12
13
  * The per-panel state of a [`ViewerConfig`] — everything except the
13
14
  * element-level `settings` flag. This is the `panels` entry type of the
14
- * whole-element config format.
15
+ * workspace config format.
15
16
  */
16
- export type PanelViewerConfig<V = string> = { version: V, columns_config: { [key in string]?: { [key in string]?: JsonValue } }, plugin: string, plugin_config: { [key in string]?: JsonValue }, table: string | null, theme: string | null, title: string | null, group_by: Array<string>, split_by: Array<string>, sort: Array<Sort>, filter: Array<Filter>, group_rollup_mode: GroupRollupMode, filter_op?: FilterReducer, expressions: Expressions, windows?: Windows, columns: Array<string | null>, aggregates: { [key in string]?: Aggregate }, group_by_depth?: number | null, };
17
+ export type PanelViewerConfig<V = string> = {
18
+ /**
19
+ * The `@perspective-dev/viewer` version that wrote this config,
20
+ * stamped on save and used to migrate older tokens. Callers do not
21
+ * set it.
22
+ */
23
+ version: V,
24
+ /**
25
+ * Per-column styling, keyed by column name. The viewer treats the
26
+ * values as opaque — their shape is defined by the ACTIVE plugin,
27
+ * so a config written for one plugin may carry keys another
28
+ * ignores. Query the live shape with the `get_style_schema` agent
29
+ * tool, or the plugin's `column_config_schema()`.
30
+ */
31
+ columns_config: { [key in string]?: { [key in string]?: JsonValue } },
32
+ /**
33
+ * Name of the visualization plugin, from the set registered on the
34
+ * page (the `list_plugins` agent tool, or the plugin picker). This
35
+ * also decides what the view fields MEAN visually: `columns` is
36
+ * positional and each plugin reads the positions differently, and
37
+ * `group_by`/`split_by` draw different things per plugin.
38
+ */
39
+ plugin: string,
40
+ /**
41
+ * Plugin-wide settings (as opposed to the per-column
42
+ * [`Self::columns_config`]). Opaque to the viewer and defined by
43
+ * the active plugin; see `get_style_schema`.
44
+ */
45
+ plugin_config: { [key in string]?: JsonValue },
46
+ /**
47
+ * Name of the `Table` this panel renders, as hosted on the panel's
48
+ * `Client`. Every placed panel has a table binding (creation
49
+ * requires one by type — [`ViewerConfigInitial`]), so the saved
50
+ * config carries it unconditionally.
51
+ */
52
+ table: string,
53
+ /**
54
+ * Selected theme NAME (e.g. `"Pro Dark"`) — not a CSS value. Valid
55
+ * names are the Perspective themes loaded on the page, which
56
+ * `resetThemes()` re-scans. `None` selects the first available.
57
+ */
58
+ theme: string | null,
59
+ /**
60
+ * Panel title, shown in its tab. `None` renders the default title.
61
+ */
62
+ title: string | null, group_by: Array<string>, split_by: Array<string>, sort: Array<Sort>, filter: Array<Filter>, group_rollup_mode: GroupRollupMode, split_rollup_mode: SplitRollupMode, filter_op?: FilterReducer, expressions: Expressions, windows?: Windows, columns: Array<string | null>, aggregates: { [key in string]?: Aggregate }, group_by_depth?: number | null, };
@@ -1,6 +1,7 @@
1
1
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
2
  import type { ColumnSelectMode } from "./ColumnSelectMode.js";
3
3
  import type { GroupRollupMode } from "./GroupRollupMode.js";
4
+ import type { SplitRollupMode } from "./SplitRollupMode.js";
4
5
 
5
6
  /**
6
7
  * Static, immutable configuration for a plugin.
@@ -62,6 +63,11 @@ config_column_names?: Array<string>,
62
63
  * The first entry that matches a feature flag becomes the default.
63
64
  */
64
65
  group_rollup_modes?: Array<GroupRollupMode> | null,
66
+ /**
67
+ * Split-rollup modes the plugin accepts, in preference order.
68
+ * The first entry that matches a feature flag becomes the default.
69
+ */
70
+ split_rollup_modes?: Array<SplitRollupMode> | null,
65
71
  /**
66
72
  * Plugin load priority. Higher numbers win; ties resolve in
67
73
  * registration order. The highest-priority plugin is loaded by
@@ -75,4 +81,33 @@ priority?: number | null,
75
81
  * the per-column field set. When `false` or omitted, no StyleTab
76
82
  * is shown.
77
83
  */
78
- can_render_column_styles?: boolean, };
84
+ can_render_column_styles?: boolean,
85
+ /**
86
+ * What `group_by` MEANS visually for this plugin, e.g. `"X Axis"`
87
+ * for the Y-series charts or `"Hierarchy"` for treemap/sunburst.
88
+ * `None` where the field has no visual role of its own and is a
89
+ * plain aggregation key (the X/Y charts, whose axes both come from
90
+ * `columns`).
91
+ *
92
+ * This is the `group_by` counterpart of [`Self::config_column_names`]:
93
+ * the same declaration that names the positional `columns` slots
94
+ * should say what the other view fields draw, so that consumers —
95
+ * the settings UI's field labels, and the agent's `list_plugins`
96
+ * contract — read one source instead of restating the mapping.
97
+ */
98
+ group_by_role?: string | null,
99
+ /**
100
+ * What `split_by` MEANS visually for this plugin, e.g. `"Series"`.
101
+ * See [`Self::group_by_role`].
102
+ */
103
+ split_by_role?: string | null,
104
+ /**
105
+ * `true` when this plugin CONNECTS its points in row order, so the
106
+ * `View`'s row order is visible in the drawing: an unsorted config
107
+ * renders the table's natural order, which reads as a tangle unless
108
+ * the rows already arrive ordered along the axis. Declared rather
109
+ * than inferred, because "unsorted" is not itself a mistake — a
110
+ * pre-ordered table needs no `sort`, and the point plugins
111
+ * (scatter, density) do not care at all.
112
+ */
113
+ connects_row_order?: boolean, };
@@ -0,0 +1,20 @@
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 `restore()` method.
5
+ */
6
+ export type RestoreOptions = {
7
+ /**
8
+ * The target panel; the active panel when omitted.
9
+ */
10
+ panel?: string,
11
+ /**
12
+ * When `true`, a failed restore only REJECTS the returned `Promise` —
13
+ * the error is not committed to the viewer's visible error state, and
14
+ * the session remains usable for subsequent calls. For programmatic
15
+ * callers (e.g. the LLM agent's `set_view_config` tool) for whom a
16
+ * failed config patch is feedback rather than a user-facing fault.
17
+ * The config may be partially applied on failure; restore a
18
+ * known-good config to recover exactly.
19
+ */
20
+ suppress_errors?: boolean, };
@@ -0,0 +1,3 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ export type RoundingMode = "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven";
@@ -0,0 +1,3 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ export type RoundingPriority = "auto" | "morePrecision" | "lessPrecision";
@@ -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, };
@@ -0,0 +1,3 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ export type SignDisplay = "auto" | "always" | "exceptZero" | "negative" | "never";
@@ -0,0 +1,3 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ export type SimpleDatetimeFormat = "full" | "long" | "medium" | "short" | "disabled";
@@ -0,0 +1,25 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { SimpleDatetimeFormat } from "./SimpleDatetimeFormat.js";
3
+
4
+ /**
5
+ * A datetime column's `date_format` in its `Simple` preset form:
6
+ * `Intl.DateTimeFormatOptions`' `dateStyle`/`timeStyle` presets. This is
7
+ * the default form (no `format` key); setting `format: "custom"` selects
8
+ * the per-part `CustomDatetimeStyleConfig` instead.
9
+ */
10
+ export type SimpleDatetimeStyleConfig = {
11
+ /**
12
+ * An IANA time zone name (e.g. `"America/New_York"`); defaults to the
13
+ * browser's local time zone.
14
+ */
15
+ timeZone?: string | null,
16
+ /**
17
+ * Date preset breadth, or `"disabled"` to omit the date entirely;
18
+ * defaults to `"short"`.
19
+ */
20
+ dateStyle?: SimpleDatetimeFormat,
21
+ /**
22
+ * Time preset breadth, or `"disabled"` to omit the time entirely;
23
+ * defaults to `"medium"`.
24
+ */
25
+ timeStyle?: SimpleDatetimeFormat, };
@@ -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
+ * The `split_by` corollary to [`GroupRollupMode`]. `Flat` (the default,
5
+ * matching this crate's historical behavior) emits only full-depth split
6
+ * combinations as columns; `Rollup` additionally emits grand-total and
7
+ * subtotal column groups in "totals before" order. There is no `Total`
8
+ * variant - an empty `split_by` already expresses a single grand-total
9
+ * column group.
10
+ */
11
+ export type SplitRollupMode = "flat" | "rollup";
@@ -0,0 +1,3 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ export type StringColorMode = "none" | "foreground" | "background" | "series";
@@ -0,0 +1,3 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ export type TrailingZeroDisplay = "auto" | "stripIfInteger";
@@ -0,0 +1,3 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ export type Unit = "acre" | "bit" | "byte" | "celsius" | "centimeter" | "day" | "degree" | "fahrenheit" | "fluid-ounce" | "foot" | "gallob" | "gigabit" | "gigabyte" | "gram" | "hectare" | "hour" | "inch" | "kilobit" | "kilobyte" | "kilogram" | "kilometer" | "liter" | "megabit" | "megabyte" | "meter" | "microsecond" | "mile" | "mile-scandinavian" | "milliliter" | "millimeter" | "millisecond" | "minute" | "month" | "nanosecond" | "ounce" | "percent" | "petabyte" | "pound" | "second" | "stone" | "terabit" | "terabyte" | "week" | "yard" | "year";
@@ -0,0 +1,3 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ export type UnitDisplay = "short" | "narrow" | "long";
@@ -0,0 +1,5 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ import type { Unit } from "./Unit.js";
3
+ import type { UnitDisplay } from "./UnitDisplay.js";
4
+
5
+ export type UnitNumberFormatStyle = { unit: Unit, unitDisplay: UnitDisplay | null, };
@@ -0,0 +1,3 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ export type UseGrouping = "always" | "auto" | "min2" | boolean;
@@ -5,15 +5,61 @@ import type { Filter } from "./Filter.js";
5
5
  import type { FilterReducer } from "./FilterReducer.js";
6
6
  import type { GroupRollupMode } from "./GroupRollupMode.js";
7
7
  import type { Sort } from "./Sort.js";
8
+ import type { SplitRollupMode } from "./SplitRollupMode.js";
8
9
  import type { Windows } from "./Windows.js";
9
10
  import type { JsonValue } from "./serde_json/JsonValue.js";
10
11
 
11
12
  /**
12
13
  * The state of an entire `custom_elements::PerspectiveViewerElement` component
13
14
  * and its `Plugin`: the element-level `settings` flag plus the per-panel
14
- * [`PanelViewerConfig`]. The split exists so the whole-element config format
15
+ * [`PanelViewerConfig`]. The split exists so the workspace config format
15
16
  * can serialize panel entries *without* a `settings` key (it is element-level
16
17
  * state there, carried by the top-level `active` field instead), while the
17
18
  * single-panel format flattens back to the legacy shape.
18
19
  */
19
- export type ViewerConfig<V = string> = { settings: boolean, version: V, columns_config: { [key in string]?: { [key in string]?: JsonValue } }, plugin: string, plugin_config: { [key in string]?: JsonValue }, table: string | null, theme: string | null, title: string | null, group_by: Array<string>, split_by: Array<string>, sort: Array<Sort>, filter: Array<Filter>, group_rollup_mode: GroupRollupMode, filter_op?: FilterReducer, expressions: Expressions, windows?: Windows, columns: Array<string | null>, aggregates: { [key in string]?: Aggregate }, group_by_depth?: number | null, };
20
+ export type ViewerConfig<V = string> = { settings: boolean,
21
+ /**
22
+ * The `@perspective-dev/viewer` version that wrote this config,
23
+ * stamped on save and used to migrate older tokens. Callers do not
24
+ * set it.
25
+ */
26
+ version: V,
27
+ /**
28
+ * Per-column styling, keyed by column name. The viewer treats the
29
+ * values as opaque — their shape is defined by the ACTIVE plugin,
30
+ * so a config written for one plugin may carry keys another
31
+ * ignores. Query the live shape with the `get_style_schema` agent
32
+ * tool, or the plugin's `column_config_schema()`.
33
+ */
34
+ columns_config: { [key in string]?: { [key in string]?: JsonValue } },
35
+ /**
36
+ * Name of the visualization plugin, from the set registered on the
37
+ * page (the `list_plugins` agent tool, or the plugin picker). This
38
+ * also decides what the view fields MEAN visually: `columns` is
39
+ * positional and each plugin reads the positions differently, and
40
+ * `group_by`/`split_by` draw different things per plugin.
41
+ */
42
+ plugin: string,
43
+ /**
44
+ * Plugin-wide settings (as opposed to the per-column
45
+ * [`Self::columns_config`]). Opaque to the viewer and defined by
46
+ * the active plugin; see `get_style_schema`.
47
+ */
48
+ plugin_config: { [key in string]?: JsonValue },
49
+ /**
50
+ * Name of the `Table` this panel renders, as hosted on the panel's
51
+ * `Client`. Every placed panel has a table binding (creation
52
+ * requires one by type — [`ViewerConfigInitial`]), so the saved
53
+ * config carries it unconditionally.
54
+ */
55
+ table: string,
56
+ /**
57
+ * Selected theme NAME (e.g. `"Pro Dark"`) — not a CSS value. Valid
58
+ * names are the Perspective themes loaded on the page, which
59
+ * `resetThemes()` re-scans. `None` selects the first available.
60
+ */
61
+ theme: string | null,
62
+ /**
63
+ * Panel title, shown in its tab. `None` renders the default title.
64
+ */
65
+ title: string | null, group_by: Array<string>, split_by: Array<string>, sort: Array<Sort>, filter: Array<Filter>, group_rollup_mode: GroupRollupMode, split_rollup_mode: SplitRollupMode, filter_op?: FilterReducer, expressions: Expressions, windows?: Windows, columns: Array<string | null>, aggregates: { [key in string]?: Aggregate }, group_by_depth?: number | null, };