@lightdash/cli 3.122.3 → 3.124.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.
@@ -213,7 +213,11 @@ order, `sortBy` describes result ordering, `totalColumnCount` exposes truncation
213
213
  the viewer can see in that space, resolved at runtime with the viewer's own
214
214
  permissions (an inaccessible space answers like a missing one: `space: null`,
215
215
  no charts). Each entry carries `{ uuid, name, description, chartKind, slug,
216
- updatedAt }`; pass `chart.uuid` to `savedChart(...)` to render one. Use it
216
+ updatedAt }`; pass `chart.uuid` to `savedChart(...)` to render one. Its
217
+ `useLightdash` result carries `chartVisualization` (the stored
218
+ `chartConfig` / `pivotConfig` / `tableConfig`, or null on older hosts):
219
+ read axes and series from it when present, else fall back to `chartKind`
220
+ plus the columns. Use it
217
221
  for galleries that must pick up newly saved charts without a rebuild; keep
218
222
  explicit `savedChart('<uuid>')` references for charts the app lays out by
219
223
  hand. Render a friendly empty state for `charts.length === 0` and hide the
@@ -100,6 +100,15 @@ since its shape is unknown at build time. Render an empty state for zero
100
100
  charts and hide the section when `available` is false. The recipe lives in
101
101
  the `sdk-features` skill under `space-charts`.
102
102
 
103
+ To draw each chart the way it looks in Lightdash, read
104
+ `chartVisualization` from its `useLightdash` result: the saved
105
+ `chartConfig` (`type` plus a type-specific `config`; for `cartesian`,
106
+ `config.layout.xField` / `config.layout.yField` and
107
+ `config.eChartsConfig.series`), `pivotConfig.columns` and
108
+ `tableConfig.columnOrder`. It is `null` on older hosts and every key inside
109
+ is optional in practice, so guard each read and fall back to `chartKind`
110
+ plus the result columns.
111
+
103
112
  ### Linked charts must be DATA-DRIVEN and crash-proof
104
113
 
105
114
  A linked chart's query can change in Lightdash *after* the app is generated (the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightdash/cli",
3
- "version": "3.122.3",
3
+ "version": "3.124.0",
4
4
  "description": "Lightdash CLI tool",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -22,8 +22,8 @@
22
22
  "@actions/core": "1.11.1",
23
23
  "@aws-sdk/credential-providers": "3.995.0",
24
24
  "@casl/ability": "6.8.0",
25
- "@lightdash/common": "3.122.3",
26
- "@lightdash/warehouses": "3.122.3",
25
+ "@lightdash/common": "3.124.0",
26
+ "@lightdash/warehouses": "3.124.0",
27
27
  "@sidvind/better-ajv-errors": "7.0.0",
28
28
  "@types/columnify": "1.5.1",
29
29
  "ajv": "8.18.0",