@concepttocloud/saiku-embed 3.18.2 → 3.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -50,6 +50,40 @@ globally — no further setup.
50
50
  ></saiku-embed>
51
51
  ```
52
52
 
53
+ ### A saved query, rendered as a hierarchical matrix (v3.19)
54
+
55
+ Matrix mode preserves the row / column axis structure — measures on
56
+ columns, dimension members on rows — instead of flattening to a single
57
+ row-key map like `render="table"` does. Useful for pivot-style reports.
58
+
59
+ ```html
60
+ <saiku-embed
61
+ server="..."
62
+ token="..."
63
+ path="homes/admin/Examples/Sales.saiku"
64
+ render="matrix"
65
+ height="500px"
66
+ ></saiku-embed>
67
+ ```
68
+
69
+ ### An AI ask widget over a cube (v3.19, `kind="ai"`)
70
+
71
+ Point the token at a cube (rather than a saved query) and drop in a
72
+ plain-English ask box. Behind the scenes it POSTs to
73
+ `/rest/saiku/api/embed/ai/{cubeId}/ask`, which runs the question through
74
+ the server's configured LLM provider under the pinned owner's data
75
+ scope. Requires an AI-kind token (see "Minting an AI token" below).
76
+
77
+ ```html
78
+ <saiku-embed
79
+ server="..."
80
+ token="..."
81
+ kind="ai"
82
+ path="foodmart/FoodMart/FoodMart/Sales"
83
+ height="200px"
84
+ ></saiku-embed>
85
+ ```
86
+
53
87
  ### A saved dashboard
54
88
 
55
89
  ```html
@@ -79,11 +113,11 @@ If the resource is marked publicly embeddable on the server
79
113
 
80
114
  | Attribute | Default | Notes |
81
115
  |-----------|-------------|------------------------------------------------------------------------|
82
- | `server` | _(required)_| Origin of the Saiku launcher, e.g. `https://demo.saiku.bi` |
83
- | `path` | _(required)_| Repository path of the saved query (`.saiku`) or dashboard (`.saikudash`) |
84
- | `kind` | `query` | `query` or `dashboard` |
116
+ | `server` | _(optional)_| Origin of the Saiku launcher, e.g. `https://demo.saiku.bi`. Leave empty for same-origin (v3.19+) |
117
+ | `path` | _(required)_| `kind=query`: saved query path (`.saiku`) `kind=dashboard`: dashboard path (`.saikudash`) — `kind=ai`: cube ref `connection/catalog/schema/cubeName` |
118
+ | `kind` | `query` | `query`, `dashboard`, or `ai` |
85
119
  | `token` | _(none)_ | Embed token from `POST /saiku/api/embed/tokens`. Omit for public reads |
86
- | `render` | `table` | For `kind=query`: `table` or `chart` |
120
+ | `render` | `table` | For `kind=query`: `table`, `matrix`, or `chart` |
87
121
  | `mode` | `bar` | For `render=chart`: `bar`, `line`, or `pie` |
88
122
  | `height` | `400px` | CSS height of the rendered surface |
89
123
 
@@ -108,6 +142,28 @@ curl -X POST 'https://YOUR-SAIKU/rest/saiku/api/embed/tokens' \
108
142
  # → { "status": "OK", "token": "tx-...", "expiresAt": ... }
109
143
  ```
110
144
 
145
+ ### Minting an AI token (v3.19)
146
+
147
+ For `kind="ai"` embeds. `resourcePath` is a cube ref rather than a
148
+ file path. Mint is admin-only for v1 (cube-level ACLs are a follow-up).
149
+
150
+ ```bash
151
+ curl -X POST 'https://YOUR-SAIKU/rest/saiku/api/embed/tokens' \
152
+ -u admin:admin \
153
+ -H 'Content-Type: application/json' \
154
+ -d '{
155
+ "resourceKind": "ai",
156
+ "resourcePath": "foodmart/FoodMart/FoodMart/Sales",
157
+ "ttlHours": 72,
158
+ "label": "DimSum widget on marketing site"
159
+ }'
160
+ ```
161
+
162
+ Server-side, an AI ask requires the launcher to have an LLM provider
163
+ configured (`saiku.ai.ask.provider = anthropic | openai` plus the
164
+ matching API key). Without it, the widget renders a degraded message
165
+ rather than an error.
166
+
111
167
  Paste the `token` into the host page's `<saiku-embed token="...">`.
112
168
  Tokens are server-authoritative — revoke any time via:
113
169
 
@@ -161,6 +217,28 @@ saiku-embed {
161
217
  }
162
218
  ```
163
219
 
220
+ ### Theming the chart itself
221
+
222
+ The variables above style the embed **chrome** (frame, header, table). To brand
223
+ the **chart series + axes**, set these (custom properties inherit through the
224
+ shadow boundary, so the canvas chart picks them up):
225
+
226
+ ```css
227
+ saiku-embed {
228
+ /* Series colour cycle — set as many as you need, 1..8, contiguously.
229
+ Any unset → the chart falls back to the built-in palette. */
230
+ --saiku-embed-chart-1: #2563eb;
231
+ --saiku-embed-chart-2: #16a34a;
232
+ --saiku-embed-chart-3: #dc2626;
233
+ /* …up to --saiku-embed-chart-8 */
234
+
235
+ /* Axis labels / legend / titles use --saiku-embed-fg;
236
+ axis + split lines use --saiku-embed-muted (both shared with the chrome). */
237
+ }
238
+ ```
239
+
240
+ An embed with none of these set renders exactly as before (ECharts defaults).
241
+
164
242
  ## Security model
165
243
 
166
244
  - **Header-only token transport.** The token travels as
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@concepttocloud/saiku-embed",
3
- "version": "3.18.2",
3
+ "version": "3.19.0",
4
4
  "description": "<saiku-embed> Web Component — drop a saved Saiku query or dashboard into any page.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",