@bonnard/cli 0.2.12 → 0.2.13
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.
|
@@ -23,7 +23,7 @@ Choose the component that best fits your data:
|
|
|
23
23
|
|
|
24
24
|
- Components are self-closing (`/>`)
|
|
25
25
|
- `data` uses curly braces: `data={query_name}`
|
|
26
|
-
- Other props use quotes: `x="
|
|
26
|
+
- Other props use quotes: `x="orders.city"`
|
|
27
27
|
- Boolean props can be shorthand: `horizontal`
|
|
28
28
|
|
|
29
29
|
## Component Reference
|
|
@@ -33,13 +33,13 @@ Choose the component that best fits your data:
|
|
|
33
33
|
Displays a single KPI metric as a large number.
|
|
34
34
|
|
|
35
35
|
```markdown
|
|
36
|
-
<BigValue data={total_revenue} value="total_revenue" title="Revenue" />
|
|
36
|
+
<BigValue data={total_revenue} value="orders.total_revenue" title="Revenue" />
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
| Prop | Type | Required | Description |
|
|
40
40
|
|------|------|----------|-------------|
|
|
41
41
|
| `data` | query ref | Yes | Query name (should return a single row) |
|
|
42
|
-
| `value` | string | Yes |
|
|
42
|
+
| `value` | string | Yes | Fully qualified measure field name to display |
|
|
43
43
|
| `title` | string | No | Label above the value |
|
|
44
44
|
| `fmt` | string | No | Format preset or Excel code (e.g. `fmt="eur2"`, `fmt="$#,##0.00"`) |
|
|
45
45
|
|
|
@@ -48,16 +48,16 @@ Displays a single KPI metric as a large number.
|
|
|
48
48
|
Renders a line chart, typically for time series. Supports multiple y columns and series splitting.
|
|
49
49
|
|
|
50
50
|
```markdown
|
|
51
|
-
<LineChart data={monthly_revenue} x="created_at" y="total_revenue" title="Revenue Trend" />
|
|
52
|
-
<LineChart data={trend} x="
|
|
53
|
-
<LineChart data={revenue_by_type} x="created_at" y="total_revenue" series="type" />
|
|
51
|
+
<LineChart data={monthly_revenue} x="orders.created_at" y="orders.total_revenue" title="Revenue Trend" />
|
|
52
|
+
<LineChart data={trend} x="orders.created_at" y="orders.total_revenue,orders.count" />
|
|
53
|
+
<LineChart data={revenue_by_type} x="orders.created_at" y="orders.total_revenue" series="orders.type" />
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
| Prop | Type | Required | Description |
|
|
57
57
|
|------|------|----------|-------------|
|
|
58
58
|
| `data` | query ref | Yes | Query name |
|
|
59
59
|
| `x` | string | Yes | Field for x-axis (typically a time dimension) |
|
|
60
|
-
| `y` | string | Yes | Field(s) for y-axis. Comma-separated for multiple (e.g. `y="
|
|
60
|
+
| `y` | string | Yes | Field(s) for y-axis. Comma-separated for multiple (e.g. `y="orders.total_revenue,orders.count"`) |
|
|
61
61
|
| `title` | string | No | Chart title |
|
|
62
62
|
| `series` | string | No | Column to split data into separate colored lines |
|
|
63
63
|
| `type` | string | No | `"stacked"` for stacked lines (default: no stacking) |
|
|
@@ -68,17 +68,17 @@ Renders a line chart, typically for time series. Supports multiple y columns and
|
|
|
68
68
|
Renders a vertical bar chart. Add `horizontal` for horizontal bars. Supports multi-series with stacked or grouped display.
|
|
69
69
|
|
|
70
70
|
```markdown
|
|
71
|
-
<BarChart data={revenue_by_city} x="city" y="total_revenue" />
|
|
72
|
-
<BarChart data={revenue_by_city} x="city" y="total_revenue" horizontal />
|
|
73
|
-
<BarChart data={revenue_by_type} x="
|
|
74
|
-
<BarChart data={revenue_by_type} x="
|
|
71
|
+
<BarChart data={revenue_by_city} x="orders.city" y="orders.total_revenue" />
|
|
72
|
+
<BarChart data={revenue_by_city} x="orders.city" y="orders.total_revenue" horizontal />
|
|
73
|
+
<BarChart data={revenue_by_type} x="orders.created_at" y="orders.total_revenue" series="orders.type" />
|
|
74
|
+
<BarChart data={revenue_by_type} x="orders.created_at" y="orders.total_revenue" series="orders.type" type="grouped" />
|
|
75
75
|
```
|
|
76
76
|
|
|
77
77
|
| Prop | Type | Required | Description |
|
|
78
78
|
|------|------|----------|-------------|
|
|
79
79
|
| `data` | query ref | Yes | Query name |
|
|
80
80
|
| `x` | string | Yes | Field for category axis |
|
|
81
|
-
| `y` | string | Yes | Field(s) for value axis. Comma-separated for multiple (e.g. `y="
|
|
81
|
+
| `y` | string | Yes | Field(s) for value axis. Comma-separated for multiple (e.g. `y="orders.total_revenue,orders.count"`) |
|
|
82
82
|
| `title` | string | No | Chart title |
|
|
83
83
|
| `horizontal` | boolean | No | Render as horizontal bar chart |
|
|
84
84
|
| `series` | string | No | Column to split data into separate colored bars |
|
|
@@ -90,15 +90,15 @@ Renders a vertical bar chart. Add `horizontal` for horizontal bars. Supports mul
|
|
|
90
90
|
Renders a filled area chart. Supports series splitting and stacked areas.
|
|
91
91
|
|
|
92
92
|
```markdown
|
|
93
|
-
<AreaChart data={monthly_revenue} x="created_at" y="total_revenue" />
|
|
94
|
-
<AreaChart data={revenue_by_source} x="created_at" y="total_revenue" series="source" type="stacked" />
|
|
93
|
+
<AreaChart data={monthly_revenue} x="orders.created_at" y="orders.total_revenue" />
|
|
94
|
+
<AreaChart data={revenue_by_source} x="orders.created_at" y="orders.total_revenue" series="orders.source" type="stacked" />
|
|
95
95
|
```
|
|
96
96
|
|
|
97
97
|
| Prop | Type | Required | Description |
|
|
98
98
|
|------|------|----------|-------------|
|
|
99
99
|
| `data` | query ref | Yes | Query name |
|
|
100
100
|
| `x` | string | Yes | Field for x-axis |
|
|
101
|
-
| `y` | string | Yes | Field(s) for y-axis. Comma-separated for multiple (e.g. `y="
|
|
101
|
+
| `y` | string | Yes | Field(s) for y-axis. Comma-separated for multiple (e.g. `y="orders.total_revenue,orders.count"`) |
|
|
102
102
|
| `title` | string | No | Chart title |
|
|
103
103
|
| `series` | string | No | Column to split data into separate colored areas |
|
|
104
104
|
| `type` | string | No | `"stacked"` for stacked areas (default: no stacking) |
|
|
@@ -109,7 +109,7 @@ Renders a filled area chart. Supports series splitting and stacked areas.
|
|
|
109
109
|
Renders a pie/donut chart.
|
|
110
110
|
|
|
111
111
|
```markdown
|
|
112
|
-
<PieChart data={by_status} name="status" value="count" title="Order Status" />
|
|
112
|
+
<PieChart data={by_status} name="orders.status" value="orders.count" title="Order Status" />
|
|
113
113
|
```
|
|
114
114
|
|
|
115
115
|
| Prop | Type | Required | Description |
|
|
@@ -125,7 +125,7 @@ Renders query results as a sortable, paginated table. Click any column header to
|
|
|
125
125
|
|
|
126
126
|
```markdown
|
|
127
127
|
<DataTable data={top_products} />
|
|
128
|
-
<DataTable data={top_products} columns="
|
|
128
|
+
<DataTable data={top_products} columns="orders.category,orders.total_revenue,orders.count" />
|
|
129
129
|
<DataTable data={top_products} rows="25" />
|
|
130
130
|
<DataTable data={top_products} rows="all" />
|
|
131
131
|
```
|
|
@@ -135,7 +135,7 @@ Renders query results as a sortable, paginated table. Click any column header to
|
|
|
135
135
|
| `data` | query ref | Yes | Query name |
|
|
136
136
|
| `columns` | string | No | Comma-separated list of columns to show (default: all) |
|
|
137
137
|
| `title` | string | No | Table title |
|
|
138
|
-
| `fmt` | string | No | Column format map: `fmt="
|
|
138
|
+
| `fmt` | string | No | Column format map: `fmt="orders.total_revenue:eur2,orders.created_at:shortdate"` |
|
|
139
139
|
| `rows` | string | No | Rows per page. Default `10`. Use `rows="all"` to disable pagination. |
|
|
140
140
|
|
|
141
141
|
**Sorting:** Click a column header to sort ascending. Click again to sort descending. Null values always sort to the end. Numbers sort numerically, strings sort case-insensitively.
|
|
@@ -149,9 +149,9 @@ Renders query results as a sortable, paginated table. Click any column header to
|
|
|
149
149
|
Consecutive `<BigValue>` components are automatically wrapped in a responsive grid — no `<Grid>` tag needed:
|
|
150
150
|
|
|
151
151
|
```markdown
|
|
152
|
-
<BigValue data={total_revenue} value="total_revenue" title="Revenue" />
|
|
153
|
-
<BigValue data={order_count} value="count" title="Orders" />
|
|
154
|
-
<BigValue data={avg_order} value="avg_order_value" title="Avg Order" />
|
|
152
|
+
<BigValue data={total_revenue} value="orders.total_revenue" title="Revenue" />
|
|
153
|
+
<BigValue data={order_count} value="orders.count" title="Orders" />
|
|
154
|
+
<BigValue data={avg_order} value="orders.avg_order_value" title="Avg Order" />
|
|
155
155
|
```
|
|
156
156
|
|
|
157
157
|
This renders as a 3-column row. The grid auto-sizes up to 4 columns based on the number of consecutive BigValues. For more control, use an explicit `<Grid>` tag.
|
|
@@ -162,9 +162,9 @@ Wrap components in a `<Grid>` tag to arrange them in columns:
|
|
|
162
162
|
|
|
163
163
|
```markdown
|
|
164
164
|
<Grid cols="3">
|
|
165
|
-
<BigValue data={total_orders} value="count" title="Orders" />
|
|
166
|
-
<BigValue data={total_revenue} value="total_revenue" title="Revenue" />
|
|
167
|
-
<BigValue data={avg_order} value="avg_order_value" title="Avg Order" />
|
|
165
|
+
<BigValue data={total_orders} value="orders.count" title="Orders" />
|
|
166
|
+
<BigValue data={total_revenue} value="orders.total_revenue" title="Revenue" />
|
|
167
|
+
<BigValue data={avg_order} value="orders.avg_order_value" title="Avg Order" />
|
|
168
168
|
</Grid>
|
|
169
169
|
```
|
|
170
170
|
|
|
@@ -198,7 +198,7 @@ Values are auto-formatted by default — numbers get locale grouping (1,234.56),
|
|
|
198
198
|
| `longdate` | `d mmmm yyyy` | 13 January 2025 |
|
|
199
199
|
| `monthyear` | `mmm yyyy` | Jan 2025 |
|
|
200
200
|
|
|
201
|
-
Any string that isn't a preset name is treated as a raw Excel format code (ECMA-376). For example: `fmt="
|
|
201
|
+
Any string that isn't a preset name is treated as a raw Excel format code (ECMA-376). For example: `fmt="orders.total_revenue:$#,##0.00"`.
|
|
202
202
|
|
|
203
203
|
Note: Percentage presets (`pct`, `pct1`, `pct2`) multiply by 100 per Excel convention — 0.45 displays as "45%".
|
|
204
204
|
|
|
@@ -206,19 +206,19 @@ Note: Percentage presets (`pct`, `pct1`, `pct2`) multiply by 100 per Excel conve
|
|
|
206
206
|
|
|
207
207
|
```markdown
|
|
208
208
|
<!-- BigValue with currency -->
|
|
209
|
-
<BigValue data={total_revenue} value="total_revenue" title="Revenue" fmt="eur2" />
|
|
209
|
+
<BigValue data={total_revenue} value="orders.total_revenue" title="Revenue" fmt="eur2" />
|
|
210
210
|
|
|
211
211
|
<!-- DataTable with per-column formatting -->
|
|
212
|
-
<DataTable data={sales} fmt="total_revenue:usd2,created_at:shortdate,margin:pct1" />
|
|
212
|
+
<DataTable data={sales} fmt="orders.total_revenue:usd2,orders.created_at:shortdate,orders.margin:pct1" />
|
|
213
213
|
|
|
214
214
|
<!-- Chart with formatted tooltips -->
|
|
215
|
-
<BarChart data={monthly} x="
|
|
216
|
-
<LineChart data={trend} x="
|
|
215
|
+
<BarChart data={monthly} x="orders.created_at" y="orders.total_revenue" yFmt="usd" />
|
|
216
|
+
<LineChart data={trend} x="orders.created_at" y="orders.growth" yFmt="pct1" />
|
|
217
217
|
```
|
|
218
218
|
|
|
219
219
|
## Field Names
|
|
220
220
|
|
|
221
|
-
|
|
221
|
+
All field names in component props must be **fully qualified** with the view or cube name — the same format used in query blocks. For example, use `value="orders.total_revenue"` not `value="total_revenue"`.
|
|
222
222
|
|
|
223
223
|
## See Also
|
|
224
224
|
|