@dashspec/renderer 0.1.10 → 0.1.12

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/docs/data.md CHANGED
@@ -497,7 +497,7 @@ Reading a member of `null` or `undefined` gives `undefined` instead of an error.
497
497
  | `fmt.compact(v)` | `12.3K` |
498
498
  | `fmt.percent(v, decimals = 0)` | `42.5%` (`v` is already a percentage) |
499
499
  | `fmt.duration(seconds)` | `1 hr 1 min` |
500
- | `fmt.date(v, style = "date")` | A date; `style` `"date"`, `"datetime"` or `"time"`, in the dashboard's time zone |
500
+ | `fmt.date(v, style = "date")` | A date; `style` `"date"`, `"datetime"` or `"time"`, or the parts you want (`{ weekday: 'short', day: 'numeric', month: 'short' }`), in the dashboard's locale and time zone |
501
501
  | `fmt.ago(v)` | `just now`, `3 min ago`, `2 hr ago`, `4 days ago` |
502
502
  | `t.<key>` | `display.translations` text for the active locale, else the first locale's, else the key ([JSON format](json-format.md#specdisplay)) |
503
503
 
package/docs/widgets.md CHANGED
@@ -67,7 +67,7 @@ Field props such as `x`, `label` or `value` name a field of each data row; dot p
67
67
  | Kind | What it shows | Main props | Events |
68
68
  |---|---|---|---|
69
69
  | `Kpi` | A metric card: label, big value, target and an "On track / Action needed" chip | `unit`, `unitStyle` (`small` / `value`), `format`, `decimals`, `target`, `targetLabel`, `goodWhen` (`up` / `down` / `none`), `badge`, `statusLabels`, `compare`, `band`, `progress`, `note`, `emptyText`, `empty` (show `emptyText` even with a value), `sublabel`, `size` (`normal` / `hero`), `tone` | `click`, `hover` (part `value`) |
70
- | `Tiles` | One tile per row: label, big number, caption | `label`, `value` (required), `caption`, `status`, `statusMap`, `valueTone`, `count`, `format`, `unit`, `columns`, `minTileWidth`, `wrap`, `chips`, `mutedWhen`, `highlightWhen`, `highlightTone`, `selectable`, `selected`; `value` may be a template over `row` (`"${row.value ?? row.passed}"`) | `click`, `hover`, `select` (part `tile`) |
70
+ | `Tiles` | One tile per row: label, big number, caption | `label`, `value` (required), `caption`, `status`, `statusMap`, `valueTone`, `count`, `format`, `unit`, `columns`, `minTileWidth`, `wrap`, `captionInline` (caption right after the number), `stretch` (`false`: few tiles keep their column width), `chips`, `mutedWhen`, `highlightWhen`, `highlightTone`, `selectable`, `selected`; `value` may be a template over `row` (`"${row.value ?? row.passed}"`) | `click`, `hover`, `select` (part `tile`) |
71
71
  | `Gauge` | A value on an arc or circle with coloured bands | `min` (0), `max` (100), `bands: [{ to, tone }]`, `shape` (`arc` / `circle`), `unit`, `format`, `decimals` | `click` |
72
72
  | `Status` | A status badge from a state field, or fixed text | `state` (field, default `"state"`), `stateMap`, `labels`, `label`, `text`, `tone` | `click` |
73
73
 
@@ -112,7 +112,7 @@ Field props such as `x`, `label` or `value` name a field of each data row; dot p
112
112
  | `PieChart` | A pie or donut | `label`, `value` (required), `donut`, `unit`, `format`, `decimals` | `click`, `hover`, `hoverEnd`, `legendClick` (parts `slice`, `legend`) |
113
113
  | `Scatter` | Points by two numbers | `x`, `y` (required), `size`, `series`, `xLabel`, `yLabel` | `click`, `hover`, `hoverEnd`, `brush`, `legendClick` |
114
114
  | `MatrixChart` | A heatmap of rows × columns | `rows`, `cols`, `value` (required), `unit`, `format` | `click`, `cellClick`, `hover` (part `cell`) |
115
- | `Breakdown` | Parts of a whole as meters, a segmented bar or a donut | `label`, `value` (required), `mode` (`meters` / `segmented` / `donut`), `remainder: { label, total }`, `showPercent`, `limit`, `unit`, `format` | `click`, `hover` (part `item`) |
115
+ | `Breakdown` | Parts of a whole as meters, a segmented bar or a donut | `label`, `value` (fields of each data row), `items` (fixed `{ label, value, tone }` instead of rows; values can be templates), `mode` (`meters` / `segmented` / `donut`), `remainder: { label, total }`, `showPercent`, `limit`, `unit`, `format` | `click`, `hover` (part `item`) |
116
116
  | `Sparkline` | A tiny line, no axes | `y` (required), `x`, `area` (default `true`) | `hover` |
117
117
 
118
118
  ```json
@@ -199,6 +199,9 @@ the row in `ui.expandedRow`, so a datasource can fetch its details.
199
199
  }
200
200
  ```
201
201
 
202
+ `pagination` also takes `layout` (`"pages"`, numbered pages, or `"simple"`: "Showing 1–25 of 223
203
+ rows", Previous, "Page 1 of 9", Next) and `sizes: false` to hide the rows-per-page picker.
204
+
202
205
  `pagination`, `search`, `sorting` and `filtering` each take `mode: "client"` (the table
203
206
  works on the rows it has) or `"server"` (the table writes `page`, `pageSize`, `search`,
204
207
  `sortKey`, `sortOrder`, `ordering` or `filters` to `panels.<id>.ui`, and your datasource
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dashspec/renderer",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "Draws a dashboard from DashSpec JSON: widgets, data, events, state.",
5
5
  "keywords": [
6
6
  "dashboard",