@nanahoshi/mona-ui 0.24.9 → 0.24.11
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/chart/README.md +223 -77
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +1882 -644
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +3 -1
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +1054 -452
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +126 -1
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +131 -13
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +94 -1
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +86 -1
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +86 -1
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +83 -2
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +73 -1
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +86 -1
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +73 -1
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +73 -1
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +86 -1
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +88 -1
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +86 -1
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +73 -1
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +73 -1
- package/fesm2022/nanahoshi-mona-ui-window.mjs +3 -1
- package/i18n/catalogs/en-US.messages.json +77 -5
- package/locales/ar-sa/ar-sa.messages.json +73 -1
- package/locales/de-de/de-de.messages.json +73 -1
- package/locales/es-es/es-es.messages.json +73 -1
- package/locales/fr-fr/fr-fr.messages.json +74 -2
- package/locales/id-id/id-id.messages.json +73 -1
- package/locales/it-it/it-it.messages.json +73 -1
- package/locales/ja-jp/ja-jp.messages.json +73 -1
- package/locales/ko-kr/ko-kr.messages.json +73 -1
- package/locales/pt-br/pt-br.messages.json +73 -1
- package/locales/ru-ru/ru-ru.messages.json +73 -1
- package/locales/tr-tr/tr-tr.messages.json +73 -1
- package/locales/zh-cn/zh-cn.messages.json +73 -1
- package/locales/zh-tw/zh-tw.messages.json +73 -1
- package/package.json +1 -1
- package/types/nanahoshi-mona-ui-chart.d.ts +519 -527
- package/types/nanahoshi-mona-ui-editor.d.ts +118 -21
- package/types/nanahoshi-mona-ui-i18n.d.ts +110 -0
- package/types/nanahoshi-mona-ui-internal.d.ts +24 -2
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +72 -0
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +72 -0
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +72 -0
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +72 -0
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +72 -0
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +72 -0
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +72 -0
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +72 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +72 -0
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +72 -0
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +72 -0
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +72 -0
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +72 -0
package/chart/README.md
CHANGED
|
@@ -22,9 +22,17 @@ The Mona UI Chart library combines declarative Angular template composition with
|
|
|
22
22
|
- `ArrowRight` / `ArrowLeft`: Navigate through X-axis interaction buckets, polar slices, funnel stages, waterfall steps, or angular spokes.
|
|
23
23
|
- `ArrowUp` / `ArrowDown`: Cycle through visible series at the focused data point or duplicate X coordinates, or navigate slices/levels.
|
|
24
24
|
- `Home` / `End`: Jump to first or last data point/slice/stage.
|
|
25
|
-
- `Enter
|
|
26
|
-
- `
|
|
27
|
-
-
|
|
25
|
+
- `Enter`: Emit `pointClick` for the focused data point, spoke, stage, or slice (and toggle its selection when the chart has `mona-chart-selection`).
|
|
26
|
+
- `Space`: Toggle the focused point's selection when the chart has `mona-chart-selection`; otherwise emit `pointClick` like `Enter`.
|
|
27
|
+
- `Escape`: Dismiss the active interaction, tooltip and announcement. With nothing to dismiss, the key is left to the page (a dialog around the chart closes). `Escape` anywhere also hides a tooltip the pointer opened.
|
|
28
|
+
- `Shift` + arrows (with `navigation`): Pan the viewport along the arrow's direction. `+` / `-` zoom and `0` resets.
|
|
29
|
+
- `Shift` + arrows (with `mona-chart-brush`, from a focused point): Extend a brush from that point; `Enter` commits it and `Escape` cancels it.
|
|
30
|
+
- Keys pressed in the legend or other projected content are left to that content.
|
|
31
|
+
- The host is `role="application"` with `aria-roledescription="chart"`, so screen readers pass the arrow keys to the chart; set `landmark` for a `region` landmark instead (give each one a unique name). Its description (`aria-describedby`) summarizes the series, the category range and each series' lowest and highest value, and lists the keys; `aria-description` replaces the summary. `dataTable` adds a visually hidden table of the data (the first 100 rows).
|
|
32
|
+
- Announcements give the point's position ("2 of 12"), read the point again at an edge, and report legend toggles.
|
|
33
|
+
- **Right-to-Left:** In an RTL subtree the title, legend order, tooltip text and the default Y axis follow the direction, and the chart lays out again when the direction changes. `start` and `end` follow it (`titleAlign`, the Y axis and legend `position`); `left` and `right` stay on that side. The X axis keeps its left-to-right order, so categories and time read the same in both directions.
|
|
34
|
+
- **Contrast:** The fallback palette (used when `--color-chart-N` isn't set) and the default financial colors reach 3:1 on light and dark surfaces. Rising candles are hollow by default, so they differ from falling ones by more than color; `fillMode="filled"` brings back solid bodies. A `--color-chart-N` theme is yours to keep at 3:1.
|
|
35
|
+
- **Two-Way Binding:** `[(viewport)]` on the chart, `[(selectedMarkIds)]` on `<mona-chart-selection>`, `[(visible)]` on series, and hidden items on pie, donut (`[(hiddenIndices)]`), radial bar, rose (`[(hiddenItemIds)]`), treemap (`[(hiddenNodeIds)]`) and funnel (`[(hiddenStageIds)]`). `viewportChange` emits the viewport state; `viewportChangeDetails` adds the previous state, source and gesture phase.
|
|
28
36
|
- **Interactive Legend:** Clickable legend items that toggle series or individual slice/stage/ring visibility with stable palette coloring (and semantic presentation legend markers for Waterfall steps).
|
|
29
37
|
- **Customizable Templates:** Custom Angular templates for tooltips (`monaChartTooltipTemplate`), axis tick labels (`monaChartAxisLabelTemplate`), legend items (`monaChartLegendItemTemplate`), slice data labels (`monaChartSliceLabelTemplate`), donut center content (`monaChartCenterTemplate`), gauge center content (`monaChartGaugeCenterTemplate`), treemap node labels (`monaChartTreemapLabelTemplate`), funnel stage labels (`monaChartFunnelLabelTemplate`), waterfall step labels (`monaChartWaterfallLabelTemplate`), and empty states (`monaChartNoDataTemplate`).
|
|
30
38
|
|
|
@@ -148,7 +156,7 @@ The benchmark is intentionally non-gating and emits one compact JSON record for
|
|
|
148
156
|
|
|
149
157
|
<mona-polar-series
|
|
150
158
|
field="gain"
|
|
151
|
-
|
|
159
|
+
categoryField="angle"
|
|
152
160
|
name="Gain (dBi)"
|
|
153
161
|
fillMode="gradient"
|
|
154
162
|
curve="smooth"
|
|
@@ -222,6 +230,122 @@ The benchmark is intentionally non-gating and emits one compact JSON record for
|
|
|
222
230
|
|
|
223
231
|
---
|
|
224
232
|
|
|
233
|
+
## Guide and Reference
|
|
234
|
+
|
|
235
|
+
The [chart guide](../../../docs/charts.md) covers data, locale, accessibility, the keyboard, right-to-left and theming. The [chart reference](../../mona-ui-tester/src/assets/docs/chart/api.md) lists every input, output, method and template of every component; the tables below list the common ones.
|
|
236
|
+
|
|
237
|
+
| Family | Components |
|
|
238
|
+
| :--- | :--- |
|
|
239
|
+
| Container | `<mona-chart>` |
|
|
240
|
+
| Axes | `<mona-chart-x-axis>`, `<mona-chart-y-axis>`, `<mona-chart-angular-axis>`, `<mona-chart-radial-axis>` |
|
|
241
|
+
| Cartesian series | `<mona-line-series>`, `<mona-area-series>`, `<mona-bar-series>`, `<mona-range-bar-series>`, `<mona-range-area-series>`, `<mona-scatter-series>`, `<mona-bubble-series>`, `<mona-heatmap-series>` |
|
|
242
|
+
| Financial series | `<mona-candlestick-series>`, `<mona-ohlc-series>` |
|
|
243
|
+
| Sector series | `<mona-pie-series>`, `<mona-donut-series>` |
|
|
244
|
+
| Polar series | `<mona-radar-series>`, `<mona-polar-series>` |
|
|
245
|
+
| Radial arc series | `<mona-radial-bar-series>`, `<mona-rose-series>`, `<mona-gauge-series>` |
|
|
246
|
+
| Other series | `<mona-treemap-series>`, `<mona-funnel-series>`, `<mona-waterfall-series>` |
|
|
247
|
+
| Overlays | `<mona-chart-crosshair>`, `<mona-chart-reference-line>`, `<mona-chart-reference-band>`, `<mona-chart-annotation>` |
|
|
248
|
+
| Interaction | `<mona-chart-legend>`, `<mona-chart-tooltip>`, `<mona-chart-brush>`, `<mona-chart-selection>` |
|
|
249
|
+
|
|
250
|
+
### Candlestick & OHLC Charts
|
|
251
|
+
|
|
252
|
+
Financial series require `openField`, `highField`, `lowField` and `closeField`. Rising candles are hollow by default, so they differ from falling ones by shape as well as color.
|
|
253
|
+
|
|
254
|
+
```html
|
|
255
|
+
<mona-chart aria-label="Share price" [data]="prices" xField="date">
|
|
256
|
+
<mona-chart-x-axis type="time" />
|
|
257
|
+
<mona-candlestick-series name="ACME" keyField="date" openField="open" highField="high" lowField="low" closeField="close" />
|
|
258
|
+
<!-- Or as bars: <mona-ohlc-series name="ACME" keyField="date" openField="open" highField="high" lowField="low" closeField="close" /> -->
|
|
259
|
+
<mona-chart-tooltip />
|
|
260
|
+
</mona-chart>
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### Radial Bar, Rose & Gauge Charts
|
|
264
|
+
|
|
265
|
+
```html
|
|
266
|
+
<mona-chart aria-label="Goals" [data]="goals">
|
|
267
|
+
<mona-radial-bar-series field="value" categoryField="goal" keyField="goal" />
|
|
268
|
+
<mona-chart-legend />
|
|
269
|
+
</mona-chart>
|
|
270
|
+
|
|
271
|
+
<mona-chart aria-label="Incidents by month" [data]="incidents">
|
|
272
|
+
<mona-rose-series field="count" categoryField="month" keyField="month" scaleMode="area" />
|
|
273
|
+
</mona-chart>
|
|
274
|
+
|
|
275
|
+
<mona-chart aria-label="Disk usage">
|
|
276
|
+
<mona-gauge-series name="Disk" [value]="72" [min]="0" [max]="100" indicator="both" />
|
|
277
|
+
</mona-chart>
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Treemap, Funnel & Waterfall Charts
|
|
281
|
+
|
|
282
|
+
```html
|
|
283
|
+
<mona-chart aria-label="Storage by folder" [data]="folders">
|
|
284
|
+
<mona-treemap-series field="size" labelField="name" keyField="id" childrenField="children" />
|
|
285
|
+
</mona-chart>
|
|
286
|
+
|
|
287
|
+
<mona-chart aria-label="Signup funnel" [data]="stages">
|
|
288
|
+
<mona-funnel-series field="visitors" categoryField="stage" keyField="stage" />
|
|
289
|
+
</mona-chart>
|
|
290
|
+
|
|
291
|
+
<mona-chart aria-label="Cash flow" [data]="steps" xField="label">
|
|
292
|
+
<mona-waterfall-series field="amount" kindField="kind" keyField="label" [showLabels]="true" />
|
|
293
|
+
<mona-chart-legend />
|
|
294
|
+
</mona-chart>
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### Pie & Donut Options
|
|
298
|
+
|
|
299
|
+
`<mona-pie-series>` and `<mona-donut-series>` read `category` and `value` by default. `[(hiddenIndices)]` holds what the legend hides, and `showLabels` with `labelContent` adds slice labels.
|
|
300
|
+
|
|
301
|
+
### Crosshair, Reference Lines, Bands & Annotations
|
|
302
|
+
|
|
303
|
+
```html
|
|
304
|
+
<mona-chart aria-label="Latency" [data]="latency" xField="time">
|
|
305
|
+
<mona-line-series field="p95" name="p95" keyField="time" />
|
|
306
|
+
<mona-chart-crosshair mode="x" />
|
|
307
|
+
<mona-chart-reference-line axis="y" [value]="200" label="Target" />
|
|
308
|
+
<mona-chart-reference-band axis="y" [from]="200" [to]="400" label="At risk" />
|
|
309
|
+
<mona-chart-annotation [x]="incidentTime" [y]="480" label="Incident" />
|
|
310
|
+
</mona-chart>
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### Legend, Tooltip, Brush & Selection
|
|
314
|
+
|
|
315
|
+
```html
|
|
316
|
+
<mona-chart aria-label="Sales" [data]="sales" xField="month">
|
|
317
|
+
<mona-bar-series field="revenue" name="Revenue" keyField="month" />
|
|
318
|
+
<mona-chart-legend position="end" [interactive]="true" />
|
|
319
|
+
<mona-chart-tooltip [shared]="true" />
|
|
320
|
+
<mona-chart-selection mode="multiple" [(selectedMarkIds)]="selected" />
|
|
321
|
+
<mona-chart-brush mode="x" selectionBehavior="replace" (brushChange)="onBrush($event)" />
|
|
322
|
+
</mona-chart>
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
Use `keyField` so a selection follows its rows when the data changes.
|
|
326
|
+
|
|
327
|
+
### Viewport, Navigation & Rendering
|
|
328
|
+
|
|
329
|
+
`[navigation]="true"` turns on pan and zoom with the wheel, a drag, a pinch and the keyboard. Bind `[(viewport)]` to own the viewport, or set `defaultViewport` for a starting window. `viewportChange` emits the `ChartViewportState`, and `viewportChangeDetails` adds the previous state, source and gesture phase. `synchronization="group"` links charts, `renderer="svg"` renders SVG instead of canvas, and `downsampling` controls how dense data is reduced for drawing.
|
|
330
|
+
|
|
331
|
+
```html
|
|
332
|
+
<mona-chart
|
|
333
|
+
aria-label="Traffic"
|
|
334
|
+
[data]="traffic"
|
|
335
|
+
xField="time"
|
|
336
|
+
[navigation]="true"
|
|
337
|
+
[(viewport)]="viewport"
|
|
338
|
+
[defaultViewport]="lastWeek"
|
|
339
|
+
synchronization="dashboard"
|
|
340
|
+
(viewportChangeDetails)="onViewportChange($event)">
|
|
341
|
+
<mona-line-series field="visits" name="Visits" keyField="time" [downsampling]="true" />
|
|
342
|
+
</mona-chart>
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
### Locale, Right-to-Left & Accessibility
|
|
346
|
+
|
|
347
|
+
Numbers, dates and built-in text follow the library locale (`provideMonaI18n`). The frame follows the host's direction: the title, legend order and default Y axis mirror, and the X axis stays left to right. The host is `role="application"`, is named by `aria-label` or `title`, describes itself from the data, and offers a hidden table with `dataTable`. See the [chart guide](../../../docs/charts.md).
|
|
348
|
+
|
|
225
349
|
## Components & Directives
|
|
226
350
|
|
|
227
351
|
### `<mona-chart>`
|
|
@@ -234,32 +358,53 @@ The root container that coordinates layout measurement, data domains, rendering
|
|
|
234
358
|
| `xField` | `ChartField` | `""` | Property key or accessor extracting the X-axis coordinate for each data item. |
|
|
235
359
|
| `title` | `string` | `""` | Title text rendered at the top of the chart above the plot area. |
|
|
236
360
|
| `subtitle` | `string` | `""` | Subtitle text rendered beneath the title. |
|
|
237
|
-
| `titleAlign` | `ChartHeaderAlignment` | `"
|
|
361
|
+
| `titleAlign` | `ChartHeaderAlignment` | `"start"` | Alignment of the chart title and subtitle: `"start"` and `"end"` follow the direction, `"center"`, and `"left"` and `"right"` stay on that side. |
|
|
238
362
|
| `animation` | `ChartAnimationInput` | `true` | Animation settings (`boolean` or `Partial<ChartAnimationOptions>`) for initial render, data transitions, and series visibility toggles. |
|
|
239
|
-
| `
|
|
240
|
-
| `
|
|
363
|
+
| `aria-label` | `string` | `""` | Accessible name; falls back to `title`, then the translated "Chart". |
|
|
364
|
+
| `aria-description` | `string` | `""` | Replaces the generated summary in the chart's description; the keyboard help still follows. |
|
|
365
|
+
| `class` | `string` | `""` | CSS classes applied to the chart container. |
|
|
366
|
+
| `landmark` | `boolean` | `false` | Makes the host a `region` landmark instead of `role="application"`. |
|
|
367
|
+
| `dataTable` | `boolean` | `false` | Adds a visually hidden table of the first 100 rows for screen readers. |
|
|
368
|
+
| `renderer` | `ChartRendererMode` | `"canvas"` | Render with `"canvas"` or `"svg"`. |
|
|
369
|
+
| `downsampling` | `ChartDownsamplingInput` | `true` | Density policy for dense continuous-X Cartesian series. |
|
|
370
|
+
| `navigation` | `ChartNavigationInput` | `false` | Turns on pan and zoom for Cartesian charts. |
|
|
371
|
+
| `viewport` | `ChartViewportState` | `undefined` | The active viewport. Bind `[(viewport)]`. While it is defined the parent owns the viewport. |
|
|
372
|
+
| `defaultViewport` | `ChartViewportState` | `undefined` | The starting viewport when the parent does not control `viewport`. |
|
|
373
|
+
| `synchronization` | `ChartSynchronizationInput` | `false` | Joins a named group that shares the viewport and crosshair across charts. |
|
|
374
|
+
| `viewportChange` | `output<ChartViewportState>` | — | Emits the new viewport state. |
|
|
375
|
+
| `viewportChangeDetails` | `output<ChartViewportChangeEvent>` | — | Emits each change with the previous state, source and gesture phase. |
|
|
241
376
|
| `pointClick` | `output<ChartPointEvent>` | — | Emits when a data point, vertex, bar, marker, or sector slice is clicked. |
|
|
242
377
|
| `pointFocusChange` | `output<ChartPointFocusEvent>` | — | Emits when keyboard focus moves to a new data point, marker, spoke, or slice. |
|
|
243
378
|
| `seriesVisibilityChange` | `output<ChartSeriesVisibilityEvent>` | — | Emits when a series visibility state is toggled via legend interaction. |
|
|
244
379
|
|
|
245
|
-
###
|
|
246
|
-
|
|
247
|
-
| Input | Type | Default
|
|
248
|
-
| :-------------- | :----------------------- |
|
|
249
|
-
| `axisLine` | `boolean` | `true`
|
|
250
|
-
| `gridLines` | `boolean` | `
|
|
251
|
-
| `labels` | `boolean` | `true`
|
|
252
|
-
| `labelRotation` | `ChartAxisLabelRotation` | `0`
|
|
253
|
-
| `labelPadding` | `number` | `
|
|
254
|
-
| `labelMaxWidth` | `number` | `undefined`
|
|
255
|
-
| `tickMarks` | `boolean` | `false`
|
|
256
|
-
| `tickSize` | `number` | `
|
|
257
|
-
| `titlePadding` | `number` | `
|
|
258
|
-
| `position` | `
|
|
259
|
-
| `min`
|
|
260
|
-
| `
|
|
261
|
-
| `
|
|
262
|
-
| `
|
|
380
|
+
### `<mona-chart-x-axis>`
|
|
381
|
+
|
|
382
|
+
| Input | Type | Default | Description |
|
|
383
|
+
| :-------------- | :----------------------- | :---------- | :---------- |
|
|
384
|
+
| `axisLine` | `boolean` | `true` | Whether to draw the baseline. |
|
|
385
|
+
| `gridLines` | `boolean` | `undefined` | Whether to draw grid lines across the plot. Omitted, the axis default applies. |
|
|
386
|
+
| `labels` | `boolean` | `true` | Whether to draw tick labels. |
|
|
387
|
+
| `labelRotation` | `ChartAxisLabelRotation` | `0` | Label rotation in degrees (`-90` to `90`), or `"auto"`. |
|
|
388
|
+
| `labelPadding` | `number` | `undefined` | Space in pixels between the ticks and labels (effective default `4`). |
|
|
389
|
+
| `labelMaxWidth` | `number` | `undefined` | Maximum width in pixels of a tick label. |
|
|
390
|
+
| `tickMarks` | `boolean` | `false` | Whether to draw tick marks. |
|
|
391
|
+
| `tickSize` | `number` | `undefined` | Length in pixels of the tick marks (effective default `6`). |
|
|
392
|
+
| `titlePadding` | `number` | `undefined` | Space in pixels between the labels and the title (effective default `6`). |
|
|
393
|
+
| `position` | `ChartXAxisPosition` | `"bottom"` | `"bottom"` or `"top"`. |
|
|
394
|
+
| `min` | `number \| Date` | `undefined` | Lower domain bound of a continuous scale. |
|
|
395
|
+
| `max` | `number \| Date` | `undefined` | Upper domain bound of a continuous scale. |
|
|
396
|
+
| `nice` | `boolean` | `true` | Rounds continuous domain bounds to clean tick values. |
|
|
397
|
+
| `tickCount` | `number` | `undefined` | Desired number of ticks (effective default `5`). |
|
|
398
|
+
| `type` | `ChartXAxisType` | `"auto"` | Scale type; `"auto"` infers it from the data. |
|
|
399
|
+
| `visible` | `boolean` | `true` | Whether the axis is visible. |
|
|
400
|
+
|
|
401
|
+
### `<mona-chart-y-axis>`
|
|
402
|
+
|
|
403
|
+
It takes the inputs above, without `Date` bounds or the `time` and `utc` types, and with its own position:
|
|
404
|
+
|
|
405
|
+
| Input | Type | Default | Description |
|
|
406
|
+
| :--------- | :------------------- | :-------- | :---------- |
|
|
407
|
+
| `position` | `ChartYAxisPosition` | `"start"` | `"start"` and `"end"` follow the direction; `"left"` and `"right"` stay on that side. |
|
|
263
408
|
|
|
264
409
|
### Animation & Transitions
|
|
265
410
|
|
|
@@ -316,17 +461,17 @@ Renders a Cartesian bar series supporting standalone bars, grouped slots, stacke
|
|
|
316
461
|
|
|
317
462
|
| Input / Output | Type | Default | Description |
|
|
318
463
|
| :--------------- | :-------------------- | :----------- | :---------------------------------------------------------------------------------------------------------- |
|
|
319
|
-
| `field` | `ChartField` | `"
|
|
464
|
+
| `field` | `ChartField` | `""` | Property key or accessor extracting the value. Object rows render nothing without it; rows that are plain numbers do not need it. |
|
|
320
465
|
| `xField` | `ChartField` | `undefined` | Property key or accessor extracting X-axis coordinate (overrides chart-level `xField`). |
|
|
321
466
|
| `keyField` | `ChartField` | `undefined` | Unique identifier field for stable mark tracking across animation transitions. |
|
|
322
|
-
| `name` | `string` | `"
|
|
467
|
+
| `name` | `string` | `""` | Series name for tooltips, legend and accessibility. Falls back to the field name when it is a string, then to "Series N". |
|
|
323
468
|
| `orientation` | `ChartBarOrientation` | `"vertical"` | Bar orientation: `"vertical"` (category on X, value on Y) or `"horizontal"` (category on Y, value on X). |
|
|
324
469
|
| `stack` | `string` | `undefined` | Stack group name. Series sharing the same stack identifier are stacked cumulatively into a single bar slot. |
|
|
325
470
|
| `stackMode` | `ChartStackMode` | `"normal"` | Stacking calculation mode: `"normal"` (raw cumulative sum) or `"percent"` (normalized to 100%). |
|
|
326
|
-
| `borderRadius` | `number` | `
|
|
471
|
+
| `borderRadius` | `number` | `undefined` | Corner radius for the outer cap of the bar/stack. |
|
|
327
472
|
| `maxBarWidth` | `number` | `undefined` | Maximum width/height of the bar in pixels. |
|
|
328
|
-
| `color` | `string` | `
|
|
329
|
-
| `fillOpacity` | `number` | `
|
|
473
|
+
| `color` | `string` | `""` | Bar fill color. Defaults to palette token. |
|
|
474
|
+
| `fillOpacity` | `number` | `undefined` | Bar fill opacity between 0.0 and 1.0. |
|
|
330
475
|
| `valueFormatter` | `ChartValueFormatter` | `undefined` | Custom formatter callback for bar raw values and stack totals in tooltips and live region. |
|
|
331
476
|
| `visible` | `model(boolean)` | `true` | Two-way bindable series visibility. |
|
|
332
477
|
|
|
@@ -336,16 +481,16 @@ Renders a Cartesian floating range bar series plotting discrete min-max interval
|
|
|
336
481
|
|
|
337
482
|
| Input / Output | Type | Default | Description |
|
|
338
483
|
| :--------------- | :-------------------- | :------------ | :-------------------------------------------------------------------------------------- |
|
|
339
|
-
| `fromField` | `ChartField` |
|
|
340
|
-
| `toField` | `ChartField` |
|
|
484
|
+
| `fromField` | `ChartField` | required | Property key or accessor extracting the range starting/lower value. |
|
|
485
|
+
| `toField` | `ChartField` | required | Property key or accessor extracting the range ending/upper value. |
|
|
341
486
|
| `xField` | `ChartField` | `undefined` | Property key or accessor extracting X-axis coordinate (overrides chart-level `xField`). |
|
|
342
487
|
| `orientation` | `ChartBarOrientation` | `"vertical"` | Bar orientation: `"vertical"` or `"horizontal"`. |
|
|
343
488
|
| `keyField` | `ChartField` | `undefined` | Unique identifier field for stable mark tracking across animation transitions. |
|
|
344
489
|
| `name` | `string` | `"Range Bar"` | Series name for tooltips, legend, and accessibility. |
|
|
345
|
-
| `borderRadius` | `number` | `
|
|
490
|
+
| `borderRadius` | `number` | `undefined` | Corner radius applied to all 4 corners of floating bars. |
|
|
346
491
|
| `maxBarWidth` | `number` | `undefined` | Maximum width/height of the bar in pixels. |
|
|
347
|
-
| `color` | `string` | `
|
|
348
|
-
| `fillOpacity` | `number` | `
|
|
492
|
+
| `color` | `string` | `""` | Bar fill color. Defaults to palette token. |
|
|
493
|
+
| `fillOpacity` | `number` | `undefined` | Bar fill opacity between 0.0 and 1.0. |
|
|
349
494
|
| `valueFormatter` | `ChartValueFormatter` | `undefined` | Custom formatter callback for formatting range bounds in tooltips and live region. |
|
|
350
495
|
| `visible` | `model(boolean)` | `true` | Two-way bindable series visibility. |
|
|
351
496
|
|
|
@@ -356,15 +501,15 @@ Renders a continuous Cartesian line series connecting data points with configura
|
|
|
356
501
|
| Input / Output | Type | Default | Description |
|
|
357
502
|
| :--------------- | :----------------------- | :----------- | :--------------------------------------------------------------------------------------------------- |
|
|
358
503
|
| `field` | `ChartField` | `""` | Property key or accessor extracting numeric Y value. |
|
|
359
|
-
| `xField` | `ChartField | undefined` | `undefined` | Property key or accessor extracting X-axis coordinate (overrides chart-level `xField`). |
|
|
360
|
-
| `keyField` | `ChartField | undefined` | `undefined` | Unique identifier field for stable mark tracking across animation transitions. |
|
|
504
|
+
| `xField` | `ChartField | `undefined` | `undefined` | Property key or accessor extracting X-axis coordinate (overrides chart-level `xField`). |
|
|
505
|
+
| `keyField` | `ChartField | `undefined` | `undefined` | Unique identifier field for stable mark tracking across animation transitions. |
|
|
361
506
|
| `name` | `string` | `""` | Series name for tooltips, legend, and accessibility. |
|
|
362
507
|
| `lineStyle` | `ChartLineStyle` | `"solid"` | Stroke pattern used to render the series line (`"solid"`, `"dashed"`, or `"dotted"`). |
|
|
363
508
|
| `curve` | `ChartCurve` | `"linear"` | Curve interpolation algorithm (`"linear"`, `"monotone-x"`, `"natural"`, `"step"`, `"step-after"`). |
|
|
364
509
|
| `connectNulls` | `boolean` | `false` | Whether to interpolate across null/missing data points without gaps. |
|
|
365
510
|
| `showPoints` | `boolean` | `false` | Whether to render point markers at data coordinates. |
|
|
366
|
-
| `pointRadius` | `number | undefined`
|
|
367
|
-
| `strokeWidth` | `number | undefined`
|
|
511
|
+
| `pointRadius` | `number | `undefined` | `undefined` | Radius in pixels for point markers. Defaults to `--mona-chart-point-radius` (3px). |
|
|
512
|
+
| `strokeWidth` | `number | `undefined` | `undefined` | Stroke width in pixels for the series line. Defaults to 2px. |
|
|
368
513
|
| `color` | `string` | `""` | Explicit stroke color override for the series line. Defaults to palette token. |
|
|
369
514
|
| `visible` | `model(boolean)` | `true` | Two-way bindable series visibility. |
|
|
370
515
|
|
|
@@ -374,22 +519,22 @@ Renders a continuous Cartesian area series supporting gradient fades, solid fill
|
|
|
374
519
|
|
|
375
520
|
| Input / Output | Type | Default | Description |
|
|
376
521
|
| :--------------- | :----------------------- | :----------- | :--------------------------------------------------------------------------------------------------- |
|
|
377
|
-
| `field` | `ChartField` | `""` | Property key or accessor extracting
|
|
378
|
-
| `xField` | `ChartField | undefined` | `undefined` | Property key or accessor extracting X-axis coordinate (overrides chart-level `xField`). |
|
|
379
|
-
| `keyField` | `ChartField | undefined` | `undefined` | Unique identifier field for stable mark tracking across animation transitions. |
|
|
380
|
-
| `name` | `string` | `""` | Series name for tooltips, legend
|
|
381
|
-
| `stack` | `string | undefined`
|
|
522
|
+
| `field` | `ChartField` | `""` | Property key or accessor extracting the value. Object rows render nothing without it; rows that are plain numbers do not need it. |
|
|
523
|
+
| `xField` | `ChartField | `undefined` | `undefined` | Property key or accessor extracting X-axis coordinate (overrides chart-level `xField`). |
|
|
524
|
+
| `keyField` | `ChartField | `undefined` | `undefined` | Unique identifier field for stable mark tracking across animation transitions. |
|
|
525
|
+
| `name` | `string` | `""` | Series name for tooltips, legend and accessibility. Falls back to the field name when it is a string, then to "Series N". |
|
|
526
|
+
| `stack` | `string | `undefined` | `undefined` | Stack group name. Series sharing the same stack identifier are stacked into cumulative bands. |
|
|
382
527
|
| `stackMode` | `ChartStackMode` | `"normal"` | Stacking calculation mode: `"normal"` (raw cumulative sum) or `"percent"` (normalized to 100%). |
|
|
383
528
|
| `fillMode` | `ChartAreaFillMode` | `"gradient"` | Area fill style: `"gradient"` fading to zero baseline, or uniform `"solid"`. |
|
|
384
529
|
| `lineStyle` | `ChartLineStyle` | `"solid"` | Stroke pattern used for the area's boundary line (`"solid"`, `"dashed"`, or `"dotted"`). Fill is unaffected. |
|
|
385
|
-
| `fillOpacity` | `number | undefined`
|
|
530
|
+
| `fillOpacity` | `number | `undefined` | `undefined` | Maximum opacity applied to the area fill. Defaults to 0.18. |
|
|
386
531
|
| `curve` | `ChartCurve` | `"linear"` | Curve interpolation algorithm (`"linear"`, `"monotone-x"`, `"natural"`, `"step"`, `"step-after"`). |
|
|
387
532
|
| `connectNulls` | `boolean` | `false` | Whether to interpolate across null/missing data points without gaps. |
|
|
388
533
|
| `showPoints` | `boolean` | `false` | Whether to render point markers at data coordinates. |
|
|
389
|
-
| `pointRadius` | `number | undefined`
|
|
390
|
-
| `strokeWidth` | `number | undefined`
|
|
534
|
+
| `pointRadius` | `number | `undefined` | `undefined` | Radius in pixels for point markers. Defaults to `--mona-chart-point-radius` (4px). |
|
|
535
|
+
| `strokeWidth` | `number | `undefined` | `undefined` | Stroke width in pixels for the area boundary line. Defaults to 2px. |
|
|
391
536
|
| `color` | `string` | `""` | Explicit stroke and fill color override for the area series. Defaults to palette token. |
|
|
392
|
-
| `valueFormatter` | `ChartValueFormatter | undefined` | `undefined` | Custom formatter callback for area raw values and stack totals in tooltips and live region. |
|
|
537
|
+
| `valueFormatter` | `ChartValueFormatter | `undefined` | `undefined` | Custom formatter callback for area raw values and stack totals in tooltips and live region. |
|
|
393
538
|
| `visible` | `model(boolean)` | `true` | Two-way bindable series visibility. |
|
|
394
539
|
|
|
395
540
|
|
|
@@ -400,18 +545,18 @@ Renders a continuous Cartesian range area series enclosing a confidence or varia
|
|
|
400
545
|
|
|
401
546
|
| Input / Output | Type | Default | Description |
|
|
402
547
|
| :--------------- | :-------------------- | :------------- | :------------------------------------------------------------------------------------------------- |
|
|
403
|
-
| `fromField` | `ChartField` |
|
|
404
|
-
| `toField` | `ChartField` |
|
|
548
|
+
| `fromField` | `ChartField` | required | Property key or accessor extracting the range starting boundary value. |
|
|
549
|
+
| `toField` | `ChartField` | required | Property key or accessor extracting the range ending boundary value. |
|
|
405
550
|
| `xField` | `ChartField` | `undefined` | Property key or accessor extracting X-axis coordinate (overrides chart-level `xField`). |
|
|
406
551
|
| `keyField` | `ChartField` | `undefined` | Unique identifier field for stable mark tracking across animation transitions. |
|
|
407
552
|
| `name` | `string` | `"Range Area"` | Series name for tooltips, legend, and accessibility. |
|
|
408
|
-
| `fillOpacity` | `number` | `
|
|
553
|
+
| `fillOpacity` | `number` | `undefined` | Range band fill opacity between 0.0 and 1.0. |
|
|
409
554
|
| `curve` | `ChartCurve` | `"linear"` | Curve interpolation algorithm (`"linear"`, `"monotone-x"`, `"natural"`, `"step"`, `"step-after"`). |
|
|
410
555
|
| `connectNulls` | `boolean` | `false` | Whether to interpolate across null/missing data points. |
|
|
411
556
|
| `showPoints` | `boolean` | `false` | Whether to render point markers at boundary coordinates. |
|
|
412
|
-
| `pointRadius` | `number` | `
|
|
413
|
-
| `strokeWidth` | `number` | `
|
|
414
|
-
| `color` | `string` | `
|
|
557
|
+
| `pointRadius` | `number` | `undefined` | Boundary marker radius in pixels when `showPoints` is true. |
|
|
558
|
+
| `strokeWidth` | `number` | `undefined` | Boundary outline stroke width in pixels. |
|
|
559
|
+
| `color` | `string` | `""` | Range band line and fill color. Defaults to palette token. |
|
|
415
560
|
| `valueFormatter` | `ChartValueFormatter` | `undefined` | Custom formatter callback for formatting range bounds in tooltips and live region. |
|
|
416
561
|
| `visible` | `model(boolean)` | `true` | Two-way bindable series visibility. |
|
|
417
562
|
|
|
@@ -425,11 +570,11 @@ Renders a Cartesian scatter series representing individual points along continuo
|
|
|
425
570
|
| `xField` | `ChartField` | `undefined` | Property key or accessor extracting X-axis coordinate (overrides chart-level `xField`). |
|
|
426
571
|
| `keyField` | `ChartField` | `undefined` | Unique identifier field for stable mark tracking across animation transitions. |
|
|
427
572
|
| `name` | `string` | `"Scatter"` | Series name for tooltips, legend, and accessibility. |
|
|
428
|
-
| `color` | `string` | `
|
|
573
|
+
| `color` | `string` | `""` | Series mark color. Defaults to palette token. |
|
|
429
574
|
| `pointRadius` | `number` | `undefined` | Marker circle radius in pixels. Defaults to `--mona-chart-point-radius` (4px). |
|
|
430
|
-
| `fillOpacity` | `number` | `
|
|
431
|
-
| `strokeColor` | `string` | `"
|
|
432
|
-
| `strokeWidth` | `number` | `
|
|
575
|
+
| `fillOpacity` | `number` | `undefined` | Fill opacity between 0.0 and 1.0. |
|
|
576
|
+
| `strokeColor` | `string` | `""` | Border stroke color. |
|
|
577
|
+
| `strokeWidth` | `number` | `undefined` | Border stroke width in pixels. |
|
|
433
578
|
| `visible` | `model(boolean)` | `true` | Two-way bindable series visibility. |
|
|
434
579
|
|
|
435
580
|
### `<mona-bubble-series>`
|
|
@@ -441,28 +586,28 @@ Renders a Cartesian bubble series encoding a 3rd quantitative dimension into mar
|
|
|
441
586
|
| `field` | `ChartField` | `"value"` | Property key or accessor extracting numeric Y-axis coordinate. |
|
|
442
587
|
| `sizeField` | `ChartField` | `"size"` | Property key or accessor extracting quantitative magnitude for bubble area. |
|
|
443
588
|
| `sizeFormatter` | `ChartValueFormatter<number>` | `undefined` | Formatter callback generating formatted size strings for tooltips and accessibility announcements. |
|
|
444
|
-
| `minRadius` | `number` | `
|
|
445
|
-
| `maxRadius` | `number` | `
|
|
589
|
+
| `minRadius` | `number` | `4` | Minimum bubble radius in pixels for the minimum size value. Defaults to `--mona-chart-bubble-min-radius` (4px). |
|
|
590
|
+
| `maxRadius` | `number` | `24` | Maximum bubble radius in pixels for the maximum size value. Defaults to `--mona-chart-bubble-max-radius` (24px). |
|
|
446
591
|
| `xField` | `ChartField` | `undefined` | Property key or accessor extracting X-axis coordinate (overrides chart-level `xField`). |
|
|
447
592
|
| `keyField` | `ChartField` | `undefined` | Unique identifier field for stable mark tracking across animation transitions. |
|
|
448
593
|
| `name` | `string` | `"Bubble"` | Series name for tooltips, legend, and accessibility. |
|
|
449
|
-
| `color` | `string` | `
|
|
450
|
-
| `fillOpacity` | `number` | `
|
|
451
|
-
| `strokeColor` | `string` | `"
|
|
452
|
-
| `strokeWidth` | `number` | `
|
|
594
|
+
| `color` | `string` | `""` | Series mark color. Defaults to palette token. |
|
|
595
|
+
| `fillOpacity` | `number` | `undefined` | Fill opacity between 0.0 and 1.0. |
|
|
596
|
+
| `strokeColor` | `string` | `""` | Border stroke color. |
|
|
597
|
+
| `strokeWidth` | `number` | `undefined` | Border stroke width in pixels. |
|
|
453
598
|
| `visible` | `model(boolean)` | `true` | Two-way bindable series visibility. |
|
|
454
599
|
|
|
455
600
|
### CSS Variables for Styling
|
|
456
601
|
|
|
457
|
-
Mona UI Charts support theme customization via standard CSS custom properties:
|
|
602
|
+
Mona UI Charts support theme customization via standard CSS custom properties. The [chart guide](../../../docs/charts.md#6-theming) lists all of them:
|
|
458
603
|
|
|
459
604
|
```css
|
|
460
605
|
:root {
|
|
461
606
|
--mona-chart-point-radius: 5px;
|
|
462
607
|
--mona-chart-bubble-min-radius: 4px;
|
|
463
608
|
--mona-chart-bubble-max-radius: 28px;
|
|
464
|
-
--mona-chart-
|
|
465
|
-
--mona-chart-
|
|
609
|
+
--mona-chart-grid-color: #e2e8f0;
|
|
610
|
+
--mona-chart-financial-rising-color: #15803d;
|
|
466
611
|
}
|
|
467
612
|
```
|
|
468
613
|
|
|
@@ -476,7 +621,7 @@ Configures the angular (spoke / degree) dimension in Polar and Radar charts.
|
|
|
476
621
|
| `gridLines` | `boolean` | `true` | Whether to render radiating spoke lines from the pole to the outer boundary. |
|
|
477
622
|
| `labels` | `boolean` | `true` | Whether to render angular category/degree labels. |
|
|
478
623
|
| `rotation` | `number` | `0` | Angle rotation in degrees (clockwise) of the 0° reference position. |
|
|
479
|
-
| `tickCount` | `number` | `
|
|
624
|
+
| `tickCount` | `number` | `undefined` | Desired number of angular ticks for continuous polar charts. |
|
|
480
625
|
| `visible` | `boolean` | `true` | Whether the angular axis is visible. |
|
|
481
626
|
|
|
482
627
|
### `<mona-chart-radial-axis>`
|
|
@@ -503,7 +648,7 @@ Renders a closed polygonal series comparing categorical metrics across angular s
|
|
|
503
648
|
| `categoryField` | `ChartField` | `"category"` | Property key or accessor extracting spoke category. |
|
|
504
649
|
| `keyField` | `ChartField` | `undefined` | Unique identifier field for stable mark tracking across animation transitions. |
|
|
505
650
|
| `name` | `string` | `"Radar"` | Series name for tooltips, legend, and accessibility. |
|
|
506
|
-
| `fillMode` | `ChartRadialFillMode` | `"
|
|
651
|
+
| `fillMode` | `ChartRadialFillMode` | `"none"` | Fill styling: `"solid"` wash, radial `"gradient"`, or `"none"`. |
|
|
507
652
|
| `curve` | `ChartRadialCurve` | `"linear"` | Curve interpolation: `"linear"` or `"smooth"` (closed Catmull-Rom spline). |
|
|
508
653
|
| `showPoints` | `boolean` | `true` | Whether vertex point markers are rendered. |
|
|
509
654
|
| `pointRadius` | `number` | `undefined` | Vertex marker radius in pixels. |
|
|
@@ -517,7 +662,8 @@ Renders a continuous polar series plotting values over continuous angular degree
|
|
|
517
662
|
| Input / Output | Type | Default | Description |
|
|
518
663
|
| :------------- | :-------------------- | :---------- | :----------------------------------------------------------------------------- |
|
|
519
664
|
| `field` | `ChartField` | `"value"` | Property key or accessor extracting numeric radial magnitude. |
|
|
520
|
-
| `
|
|
665
|
+
| `categoryField` | `ChartField` | `undefined` | Property key or accessor extracting angle in degrees. Takes precedence over `angleField`. |
|
|
666
|
+
| `angleField` | `ChartField` | `"angle"` | **Deprecated.** Use `categoryField`. |
|
|
521
667
|
| `keyField` | `ChartField` | `undefined` | Unique identifier field for stable mark tracking across animation transitions. |
|
|
522
668
|
| `name` | `string` | `"Polar"` | Series name for tooltips, legend, and accessibility. |
|
|
523
669
|
| `fillMode` | `ChartRadialFillMode` | `"none"` | Fill styling: `"solid"` wash, radial `"gradient"` (to pole), or `"none"`. |
|
|
@@ -533,20 +679,20 @@ Renders a 2D matrix heatmap visualization with perceptual Culori color scale int
|
|
|
533
679
|
| Input / Output | Type | Default | Description |
|
|
534
680
|
| :--------------- | :---------------------- | :------------- | :-------------------------------------------------------------------------------------------- |
|
|
535
681
|
| `data` | `readonly unknown[]` | `undefined` | Matrix cell dataset or sparse records. |
|
|
536
|
-
| `field` | `ChartField` |
|
|
537
|
-
| `xField` | `ChartField` | `
|
|
538
|
-
| `yField` | `ChartField` |
|
|
682
|
+
| `field` | `ChartField` | required | Property key or accessor extracting numeric heat value. |
|
|
683
|
+
| `xField` | `ChartField` | `undefined` | Property key or accessor extracting X category column. |
|
|
684
|
+
| `yField` | `ChartField` | required | Property key or accessor extracting Y category row. |
|
|
539
685
|
| `keyField` | `ChartField` | `undefined` | Unique identifier field for stable cell mark tracking across animation transitions. |
|
|
540
|
-
| `color` | `string` | `
|
|
686
|
+
| `color` | `string` | `""` | Custom single base color for sequential ramp generation. |
|
|
541
687
|
| `colors` | `readonly string[]` | `undefined` | Custom palette stops for color interpolation. |
|
|
542
688
|
| `colorMode` | `ChartHeatmapColorMode` | `"sequential"` | Color scale mode: `"sequential"` or `"diverging"`. |
|
|
543
689
|
| `min` | `number` | `undefined` | Explicit minimum domain value for color scale. |
|
|
544
690
|
| `max` | `number` | `undefined` | Explicit maximum domain value for color scale. |
|
|
545
691
|
| `midpoint` | `number` | `undefined` | Explicit midpoint value for diverging color scales (defaults to `(min + max) / 2`). |
|
|
546
692
|
| `cellGap` | `number` | `1` | Pixel gap between matrix cells. |
|
|
547
|
-
| `borderRadius` | `number` | `
|
|
548
|
-
| `strokeColor` | `string` | `
|
|
549
|
-
| `strokeWidth` | `number` | `
|
|
693
|
+
| `borderRadius` | `number` | `undefined` | Corner border radius in pixels for each cell rectangle. |
|
|
694
|
+
| `strokeColor` | `string` | `""` | Optional cell border outline color. |
|
|
695
|
+
| `strokeWidth` | `number` | `undefined` | Optional cell border outline width in pixels. |
|
|
550
696
|
| `showValues` | `boolean` | `false` | Whether to render numeric text labels inside cells with high-contrast text color calculation. |
|
|
551
697
|
| `xCategories` | `readonly unknown[]` | `undefined` | Explicit X-axis category order. |
|
|
552
698
|
| `yCategories` | `readonly unknown[]` | `undefined` | Explicit Y-axis category order. |
|