@nanahoshi/mona-ui 0.26.0 → 0.26.2

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.
@@ -0,0 +1,479 @@
1
+ # Scatter & Bubble
2
+
3
+ > Scatter and bubble series for the relationship between two or three numeric values.
4
+
5
+ Entry point: `@nanahoshi/mona-ui/chart`
6
+
7
+ **Selectors:** `mona-scatter-series`, `mona-bubble-series`
8
+
9
+ Scatter and bubble series draw one marker per row at its X and Y value, to show how two numbers relate: whether they rise together, where they cluster and which rows stand apart. A bubble series adds a third number as the size of each marker. They go inside a `mona-chart` with a numeric or time X axis and a Y axis, and can share one chart with each other and with the other Cartesian series.
10
+
11
+ ## Overview
12
+
13
+ Pick the series by how many numbers each row has.
14
+
15
+ | Series | Use it for | Reads |
16
+ | :--- | :--- | :--- |
17
+ | `mona-scatter-series` | The relationship between two numbers: correlation, clusters and outliers. | `field` |
18
+ | `mona-bubble-series` | The same, with a third number shown as the area of each marker, such as population or revenue. | `field`, `sizeField` |
19
+
20
+ **Use something else when:**
21
+
22
+ - The X values are categories, such as products or months by name. Scatter and bubble series need a numeric or time X axis, so use bars, see [Bar & Waterfall](chart-bar.md).
23
+ - The rows are a sequence and the reader should follow it from one to the next. A line connects them, see [Line & Area](chart-line-area.md).
24
+ - The third number matters as much as the other two. Readers compare areas far less precisely than positions, so give it an axis of its own in a second chart.
25
+
26
+ The chart, axes, legend, tooltip and interaction parts these series sit in are described on [Chart Overview](chart.md).
27
+
28
+ ## Import & Quick Start
29
+
30
+ ```typescript
31
+ import {
32
+ ChartComponent,
33
+ ChartTooltipComponent,
34
+ ChartXAxisComponent,
35
+ ChartYAxisComponent,
36
+ ScatterSeriesComponent
37
+ } from "@nanahoshi/mona-ui/chart";
38
+ ```
39
+
40
+ ```html
41
+ <mona-chart aria-label="Fuel use by weight" class="h-72 w-full" xField="weight" [data]="cars">
42
+ <mona-chart-x-axis title="Weight (kg)" />
43
+ <mona-chart-y-axis title="L/100 km" />
44
+ <mona-scatter-series field="consumption" name="Cars" />
45
+ <mona-chart-tooltip />
46
+ </mona-chart>
47
+ ```
48
+
49
+ Give the chart a height. It fills its host, and a host without a height has none.
50
+
51
+ ## Anatomy
52
+
53
+ Each series reads its rows from the chart's `data`, unless it has its own `data`. It takes the X value from the chart's `xField`, or from its own `xField`, the Y value from `field`, and a bubble's size from `sizeField`. A field is a property name or an accessor, `(row, index) => value`.
54
+
55
+ | Input | Scatter | Bubble |
56
+ | :--- | :---: | :---: |
57
+ | `field`, `xField`, `data`, `keyField` | ✓ | ✓ |
58
+ | `sizeField`, `sizeFormatter` | | ✓ |
59
+ | `pointRadius` | ✓ | |
60
+ | `minRadius`, `maxRadius` | | ✓ |
61
+ | `color`, `fillOpacity`, `strokeColor`, `strokeWidth` | ✓ | ✓ |
62
+ | `dataLabels`, `downsampling`, `valueFormatter` | ✓ | ✓ |
63
+
64
+ `keyField` names a value that identifies a row across data changes, such as an id, so the chart can tell which marker moved rather than which was replaced. Without it, rows are matched by their X value, and rows that share one by their order.
65
+
66
+ ### Templates
67
+
68
+ - `ng-template[monaChartDataLabel]`, inside a series, replaces the text of its data labels. The context is a `ChartDataLabelContext`, with `formattedValue`, `formattedX`, `xValue`, `yValue` and `datum`, and for a bubble `sizeValue` and `formattedSize`. Turn `dataLabels` on as well.
69
+ - The chart, axis, legend and tooltip templates are described on [Chart Overview](chart.md).
70
+
71
+ ## Examples
72
+
73
+ ### Correlation
74
+
75
+ Two scatter series, each with its own `data`, share the chart's `xField`. A larger `pointRadius` on the second tells them apart without relying on color, and `valueFormatter` adds the unit to the tooltip.
76
+
77
+ `correlation-example.component.ts`
78
+
79
+ ```typescript
80
+ import { Component } from "@angular/core";
81
+ import {
82
+ ChartComponent,
83
+ ChartLegendComponent,
84
+ ChartTooltipComponent,
85
+ ChartXAxisComponent,
86
+ ChartYAxisComponent,
87
+ ScatterSeriesComponent
88
+ } from "@nanahoshi/mona-ui/chart";
89
+ import type { ChartValueFormatter } from "@nanahoshi/mona-ui/chart";
90
+
91
+ @Component({
92
+ selector: "app-chart-scatter-correlation-example",
93
+ imports: [
94
+ ChartComponent,
95
+ ChartLegendComponent,
96
+ ChartTooltipComponent,
97
+ ChartXAxisComponent,
98
+ ChartYAxisComponent,
99
+ ScatterSeriesComponent
100
+ ],
101
+ templateUrl: "./correlation-example.component.html"
102
+ })
103
+ export class ChartScatterCorrelationExampleComponent {
104
+ protected readonly evening = [
105
+ { hours: 1.5, score: 48 },
106
+ { hours: 2, score: 55 },
107
+ { hours: 3, score: 52 },
108
+ { hours: 3.5, score: 63 },
109
+ { hours: 4.5, score: 66 },
110
+ { hours: 5, score: 72 },
111
+ { hours: 6, score: 70 },
112
+ { hours: 7.5, score: 81 },
113
+ { hours: 8, score: 79 },
114
+ { hours: 9.5, score: 88 }
115
+ ];
116
+ protected readonly morning = [
117
+ { hours: 1, score: 52 },
118
+ { hours: 2.5, score: 61 },
119
+ { hours: 3, score: 58 },
120
+ { hours: 4, score: 70 },
121
+ { hours: 4.5, score: 74 },
122
+ { hours: 5.5, score: 71 },
123
+ { hours: 6.5, score: 83 },
124
+ { hours: 7, score: 86 },
125
+ { hours: 8.5, score: 90 },
126
+ { hours: 9, score: 94 }
127
+ ];
128
+ protected readonly points: ChartValueFormatter = value => `${value} points`;
129
+ }
130
+ ```
131
+
132
+ `correlation-example.component.html`
133
+
134
+ ```html
135
+ <mona-chart aria-label="Exam score by hours studied" class="h-72 w-full" xField="hours">
136
+ <mona-chart-x-axis title="Hours studied" />
137
+ <mona-chart-y-axis title="Score" />
138
+ <mona-scatter-series field="score" name="Morning class" [data]="morning" [valueFormatter]="points" />
139
+ <mona-scatter-series
140
+ field="score"
141
+ name="Evening class"
142
+ [data]="evening"
143
+ [pointRadius]="6"
144
+ [valueFormatter]="points" />
145
+ <mona-chart-legend />
146
+ <mona-chart-tooltip />
147
+ </mona-chart>
148
+ ```
149
+
150
+ ### Bubbles on a log axis
151
+
152
+ A bubble series sizes each marker by `sizeField`. Here the X axis is `type="log"`, since incomes span two orders of magnitude, `minRadius` and `maxRadius` widen the size range, and `sizeFormatter` writes the population in the tooltip.
153
+
154
+ `bubble-example.component.ts`
155
+
156
+ ```typescript
157
+ import { Component } from "@angular/core";
158
+ import {
159
+ BubbleSeriesComponent,
160
+ ChartComponent,
161
+ ChartTooltipComponent,
162
+ ChartXAxisComponent,
163
+ ChartYAxisComponent
164
+ } from "@nanahoshi/mona-ui/chart";
165
+ import type { ChartAxisFormatter, ChartValueFormatter } from "@nanahoshi/mona-ui/chart";
166
+
167
+ const compact = new Intl.NumberFormat("en", { notation: "compact", maximumFractionDigits: 1 });
168
+
169
+ @Component({
170
+ selector: "app-chart-scatter-bubble-example",
171
+ imports: [BubbleSeriesComponent, ChartComponent, ChartTooltipComponent, ChartXAxisComponent, ChartYAxisComponent],
172
+ templateUrl: "./bubble-example.component.html"
173
+ })
174
+ export class ChartScatterBubbleExampleComponent {
175
+ /** Rounded figures for illustration: income in US dollars, population in millions. */
176
+ protected readonly countries = [
177
+ { country: "Brazil", income: 8900, lifeExpectancy: 73.4, population: 215 },
178
+ { country: "China", income: 12700, lifeExpectancy: 78.6, population: 1412 },
179
+ { country: "Ethiopia", income: 1000, lifeExpectancy: 65, population: 123 },
180
+ { country: "Germany", income: 48700, lifeExpectancy: 80.7, population: 84 },
181
+ { country: "India", income: 2400, lifeExpectancy: 67.7, population: 1417 },
182
+ { country: "Indonesia", income: 4800, lifeExpectancy: 67.6, population: 276 },
183
+ { country: "Japan", income: 34000, lifeExpectancy: 84.5, population: 125 },
184
+ { country: "Mexico", income: 11500, lifeExpectancy: 70.2, population: 128 },
185
+ { country: "Nigeria", income: 2200, lifeExpectancy: 52.7, population: 218 },
186
+ { country: "United States", income: 76300, lifeExpectancy: 77.5, population: 333 }
187
+ ];
188
+ protected readonly dollars: ChartAxisFormatter = value => `$${compact.format(Number(value))}`;
189
+ protected readonly people: ChartValueFormatter = value => `${value} million people`;
190
+ protected readonly years: ChartValueFormatter = value => `${value} years`;
191
+ }
192
+ ```
193
+
194
+ `bubble-example.component.html`
195
+
196
+ ```html
197
+ <mona-chart aria-label="Life expectancy by income per person" class="h-80 w-full" xField="income" [data]="countries">
198
+ <mona-chart-x-axis title="Income per person (USD)" type="log" [formatter]="dollars" />
199
+ <mona-chart-y-axis title="Life expectancy (years)" />
200
+ <mona-bubble-series
201
+ field="lifeExpectancy"
202
+ name="Countries"
203
+ sizeField="population"
204
+ [maxRadius]="36"
205
+ [minRadius]="6"
206
+ [sizeFormatter]="people"
207
+ [valueFormatter]="years" />
208
+ <mona-chart-tooltip />
209
+ </mona-chart>
210
+ ```
211
+
212
+ ### Dense data
213
+
214
+ Twenty thousand markers are more than the plot can show apart, so by default the chart draws a representative subset, and the tooltip still finds every row, drawn or not. Switch to every marker to compare, and zoom in with the wheel or by pinching: the chart draws more of the rows as fewer are in view.
215
+
216
+ `dense-example.component.ts`
217
+
218
+ ```typescript
219
+ import { Component, computed, signal } from "@angular/core";
220
+ import {
221
+ ChartComponent,
222
+ ChartTooltipComponent,
223
+ ChartXAxisComponent,
224
+ ChartYAxisComponent,
225
+ ScatterSeriesComponent
226
+ } from "@nanahoshi/mona-ui/chart";
227
+ import { SegmentedComponent } from "@nanahoshi/mona-ui/segmented";
228
+ import type { SegmentedOption } from "@nanahoshi/mona-ui/segmented";
229
+
230
+ type MarkerMode = "every" | "reduce";
231
+
232
+ interface ServerRequest {
233
+ readonly duration: number;
234
+ readonly size: number;
235
+ }
236
+
237
+ /** Requests from a seeded generator, so every load draws the same cloud. */
238
+ function serverRequests(count: number): ServerRequest[] {
239
+ let state = 42;
240
+ const next = (): number => {
241
+ state = (state * 1664525 + 1013904223) % 4294967296;
242
+ return state / 4294967296;
243
+ };
244
+ return Array.from({ length: count }, () => {
245
+ const size = Math.round(next() ** 2 * 2000);
246
+ const slow = next() < 0.04 ? 400 + next() * 600 : 0;
247
+ return { duration: Math.round(40 + size * 0.12 + next() * 90 + slow), size };
248
+ });
249
+ }
250
+
251
+ @Component({
252
+ selector: "app-chart-scatter-dense-example",
253
+ imports: [
254
+ ChartComponent,
255
+ ChartTooltipComponent,
256
+ ChartXAxisComponent,
257
+ ChartYAxisComponent,
258
+ ScatterSeriesComponent,
259
+ SegmentedComponent
260
+ ],
261
+ templateUrl: "./dense-example.component.html"
262
+ })
263
+ export class ChartScatterDenseExampleComponent {
264
+ protected readonly mode = signal<MarkerMode>("reduce");
265
+ protected readonly modes: readonly SegmentedOption<MarkerMode>[] = [
266
+ { label: "Reduce markers", value: "reduce" },
267
+ { label: "Draw every marker", value: "every" }
268
+ ];
269
+ protected readonly reduce = computed(() => this.mode() === "reduce");
270
+ protected readonly requests = serverRequests(20_000);
271
+
272
+ protected onModeChange(mode: MarkerMode | null): void {
273
+ if (mode) {
274
+ this.mode.set(mode);
275
+ }
276
+ }
277
+ }
278
+ ```
279
+
280
+ `dense-example.component.html`
281
+
282
+ ```html
283
+ <div class="flex w-full flex-col gap-3">
284
+ <mona-segmented
285
+ aria-label="Markers drawn"
286
+ size="small"
287
+ [options]="modes"
288
+ [value]="mode()"
289
+ (valueChange)="onModeChange($event)"></mona-segmented>
290
+ <mona-chart
291
+ aria-label="Response time by request size"
292
+ class="h-80 w-full"
293
+ xField="size"
294
+ [data]="requests"
295
+ [downsampling]="reduce()"
296
+ [navigation]="true">
297
+ <mona-chart-x-axis title="Request size (KB)" />
298
+ <mona-chart-y-axis title="Response time (ms)" />
299
+ <mona-scatter-series field="duration" name="Requests" [pointRadius]="2" [strokeWidth]="0" />
300
+ <mona-chart-tooltip />
301
+ </mona-chart>
302
+ </div>
303
+ ```
304
+
305
+ ## Appearance & Styling
306
+
307
+ | Input | Values | Effect |
308
+ | :--- | :--- | :--- |
309
+ | `pointRadius` | Pixels, from `1` to `100` | The radius of every scatter marker. Defaults to `4`. |
310
+ | `minRadius`, `maxRadius` | Pixels, from `1` to `100` | The radius of the smallest and the largest bubble. When unset, they come from the theme, or are `4` and `24`. When `minRadius` is the larger, the two are swapped. |
311
+ | `fillOpacity` | A number from `0` to `1` | How opaque the markers are. Defaults to `0.9` for scatter and `0.55` for bubbles, so overlapping bubbles stay visible. |
312
+ | `strokeColor` | Any CSS color | The outline. A scatter marker is outlined in the surface color by default, which separates touching markers; a bubble is outlined in its own color. |
313
+ | `strokeWidth` | Pixels | The width of the outline. Defaults to `1.5`; `0` removes it, which helps dense data. |
314
+ | `color` | Any CSS color, or a CSS variable such as `var(--color-chart-3)` | Replaces the palette color. By default series take `--color-chart-1` to `--color-chart-5` in order. A `text-*` class on the series sets it too. |
315
+
316
+ ## Theming
317
+
318
+ These custom properties set the defaults of every scatter or bubble series inside the element that declares them, so a theme can set them once. An input on the series wins over them.
319
+
320
+ | Property | Default | Sets |
321
+ | :--- | :--- | :--- |
322
+ | `--mona-chart-point-radius` | `4` | `pointRadius` |
323
+ | `--mona-chart-marker-fill-opacity` | `0.9` scatter, `0.55` bubble | `fillOpacity`, falling back to `--mona-chart-fill-opacity` |
324
+ | `--mona-chart-marker-stroke-color` | Surface color for scatter, series color for bubbles | `strokeColor` |
325
+ | `--mona-chart-marker-stroke-width` | `1.5` | `strokeWidth` |
326
+ | `--mona-chart-bubble-min-radius` | `4` | `minRadius` of a bubble series |
327
+ | `--mona-chart-bubble-max-radius` | `24` | `maxRadius` of a bubble series |
328
+
329
+ ```css
330
+ .dense-charts {
331
+ --mona-chart-point-radius: 2;
332
+ --mona-chart-marker-stroke-width: 0;
333
+ }
334
+ ```
335
+
336
+ The bubble radii have no custom property: set `minRadius` and `maxRadius` on the series.
337
+
338
+ ## Behavior
339
+
340
+ ### X axis
341
+
342
+ Scatter and bubble series need a continuous X axis: `linear`, `log`, `symlog`, `pow`, `sqrt`, `time` or `utc`. An `auto` X axis is `linear` when the X values are numbers and `time` when they are dates. When the X values are text, or the X axis is `category`, the series draws nothing, and a development warning says why.
343
+
344
+ ### Missing and invalid values
345
+
346
+ A row is left out when its X value doesn't fit the axis, its Y value isn't a finite number, or, for a bubble, its size is missing, zero or negative. Left-out rows don't count toward the axis ranges or the bubble sizes. Numbers written as text, such as `"12.5"`, are read as numbers for Y and size.
347
+
348
+ ### Bubble size
349
+
350
+ - A bubble's area, not its radius, is proportional to its size, so a value twice as large covers twice the area. The smallest size gets `minRadius` and the largest `maxRadius`.
351
+ - The size range covers every visible bubble series on the chart, so the same size draws the same bubble in each. Hiding a series from the legend recomputes the range from the series that remain.
352
+ - When every bubble has the same size, each is drawn halfway between `minRadius` and `maxRadius`.
353
+ - `sizeFormatter` formats the size in the tooltip, the data label context and screen reader announcements. Without it, sizes are written in compact notation, such as `1.4K`.
354
+
355
+ ### Overlapping markers
356
+
357
+ Markers are drawn in the order of the series, then of the rows, so a later row covers an earlier one. When markers overlap, the pointer picks the one on top. Put the largest bubbles first in the data so the smaller ones stay visible and reachable, or lower `fillOpacity`.
358
+
359
+ ### Value formatting
360
+
361
+ `valueFormatter` formats a series' Y values in its tooltip, data labels and screen reader announcements, and leaves the axis ticks alone. The X value in the tooltip uses the X axis `formatter`. Without either, numbers and dates follow the library locale.
362
+
363
+ ### Data labels
364
+
365
+ `dataLabels` writes each marker's Y value beside it. `position: "auto"` tries above, below, ahead and behind the marker, then its center, and skips a label that would collide. `inside-start`, `inside-center` and `inside-end` fall back to `center`, and `outside-start` and `outside-end` to `bottom` and `top`. Label a few markers rather than all: on dense data most labels collide and are skipped. The shared options are on [Chart Overview](chart.md), under Data labels.
366
+
367
+ ### Navigation
368
+
369
+ With `navigation` on and a scatter or bubble series in the chart, `zoomAxes` and `panAxes` of `"auto"` zoom and pan X and Y together, since both are continuous. Over an axis, the wheel and a drag zoom or pan that axis alone. Set them to `"x"` or `"y"` to lock the other axis.
370
+
371
+ ### Dense data
372
+
373
+ - When more markers are in view than `downsampling.threshold`, by default the larger of 2,000 and four times the plot width in pixels, the chart draws a representative subset spread over the plot. `maxPoints` caps the markers drawn, and a higher `samplesPerPixel` keeps more of them.
374
+ - Scatter and bubble series always use their own spatial reducer, so the `algorithm` option doesn't change what they draw.
375
+ - Hover, click and brushing still find the exact row under the pointer, drawn or not, and the bubble sizes still come from every row. Keyboard navigation and data labels follow the markers that are drawn.
376
+ - A series' `downsampling` overrides the chart's, and `false` draws every marker. The rules are on [Chart Overview](chart.md), under High-density downsampling.
377
+
378
+ ### Two-way binding
379
+
380
+ `[(visible)]` holds whether the series is shown. The legend sets it when the user toggles the series.
381
+
382
+ ## Accessibility
383
+
384
+ The chart is the focusable element, and these series add no roles of their own. Each marker is announced with its series name, X value and formatted Y value, and a bubble adds its size, so give each series a `name`, title both axes, and use `valueFormatter` and `sizeFormatter` to add units the reader would otherwise miss.
385
+
386
+ - **Don't rely on color alone.** Tell series apart by `pointRadius` or `strokeColor` as well, and keep the legend.
387
+ - **Don't rely on size alone.** Readers judge areas loosely. Put the exact size in the tooltip with `sizeFormatter`, and consider `dataTable` so the values can be read as a table.
388
+ - **Keep markers apart.** Overlapping markers hide each other from the pointer as well as the eye; a lower `fillOpacity` or a smaller radius helps.
389
+
390
+ ### Keyboard Navigation
391
+
392
+ | Key | Action |
393
+ | :--- | :--- |
394
+ | `ArrowRight` / `ArrowLeft` | Move to the markers at the next or previous X value, from left to right, wrapping at the ends. |
395
+ | `ArrowUp` / `ArrowDown` | Move between the markers that share the focused X value, in any series. |
396
+ | `Home` / `End` | Move to the first or last X value. |
397
+
398
+ Only the markers drawn in the plot can be focused, so zoom in to reach markers a dense chart leaves out. The rest of the keys, including selection, brushing and navigation, are listed on [Chart Overview](chart.md).
399
+
400
+ ## API
401
+
402
+ Everything below is imported from `@nanahoshi/mona-ui/chart`.
403
+
404
+ ### `BubbleSeriesComponent`
405
+
406
+ Renders 3-dimensional data points with position (X, Y) and proportionally-scaled circle areas (Size).
407
+
408
+ **Selector:** `mona-bubble-series`
409
+
410
+ #### Inputs
411
+
412
+ | Name | Type | Default | Description |
413
+ | --- | --- | --- | --- |
414
+ | `class` | `string` | `""` | Additional CSS classes applied to the series host element. |
415
+ | `color` | `string` | `""` | Explicit fill color for the bubbles. |
416
+ | `data` | `readonly unknown[] \| undefined` | `undefined` | Series-specific dataset overriding the root chart data. |
417
+ | `dataLabels` | `ChartDataLabelsInput` | `false` | Data label display options or boolean flag enabling default labels. |
418
+ | `downsampling` | `ChartDownsamplingInput \| undefined` | `undefined` | Per-series high-density downsampling override. Undefined inherits the chart policy. |
419
+ | `field` | `ChartField` | `"value"` | Property key or accessor extracting the Y value for each data item. |
420
+ | `fillOpacity` | `number \| undefined` | `undefined` | Fill opacity for bubbles between 0 and 1. |
421
+ | `keyField` | `ChartField \| undefined` | `undefined` | Property key or accessor extracting a stable datum identity across updates. |
422
+ | `maxRadius` | `number \| undefined` | `undefined` | Maximum rendered pixel radius for the largest data size value. When unset, the series reads `--mona-chart-bubble-max-radius`, or uses `24`. |
423
+ | `minRadius` | `number \| undefined` | `undefined` | Minimum rendered pixel radius for the smallest data size value. When unset, the series reads `--mona-chart-bubble-min-radius`, or uses `4`. |
424
+ | `name` | `string` | `"Bubble"` | Name of the series displayed in legends and tooltips. |
425
+ | `seriesKey` | `string \| undefined` | `undefined` | Optional stable key identifying this series for mark identity and selection across updates. |
426
+ | `sizeField` | `ChartField` | `"size"` | Property key or accessor extracting the size magnitude for each bubble. |
427
+ | `sizeFormatter` | `ChartValueFormatter \| undefined` | `undefined` | Optional custom formatter for displaying bubble size values in tooltips. |
428
+ | `strokeColor` | `string` | `""` | Stroke outline color for bubble markers. |
429
+ | `strokeWidth` | `number \| undefined` | `undefined` | Stroke width in pixels for bubble marker outlines. |
430
+ | `valueFormatter` | `ChartValueFormatter \| undefined` | `undefined` | Formats this series' values in tooltips, data labels and announcements, without changing the axis ticks. Takes precedence over the axis formatter. |
431
+ | `visible` (two-way) | `boolean` | `true` | Whether the series is currently visible on the chart and in calculations. |
432
+ | `xAxisId` | `string \| undefined` | `undefined` | Optional ID of the Cartesian X axis this series binds to. When omitted, the primary X axis is used. |
433
+ | `xField` | `ChartField \| undefined` | `undefined` | Property key or accessor extracting the X value, overriding the root chart X field. |
434
+ | `yAxisId` | `string \| undefined` | `undefined` | Optional ID of the Cartesian Y axis this series binds to. When omitted, the primary Y axis is used. |
435
+
436
+ #### Outputs
437
+
438
+ | Name | Type | Description |
439
+ | --- | --- | --- |
440
+ | `visibleChange` | `boolean` | Emitted when `visible` changes. |
441
+
442
+ ### `ScatterSeriesComponent`
443
+
444
+ Renders individual point markers across continuous numeric (linear) or temporal (time/utc) Cartesian coordinates.
445
+
446
+ **Selector:** `mona-scatter-series`
447
+
448
+ #### Inputs
449
+
450
+ | Name | Type | Default | Description |
451
+ | --- | --- | --- | --- |
452
+ | `class` | `string` | `""` | Additional CSS classes applied to the series host element. |
453
+ | `color` | `string` | `""` | Explicit fill color for the scatter points. |
454
+ | `data` | `readonly unknown[] \| undefined` | `undefined` | Series-specific dataset overriding the root chart data. |
455
+ | `dataLabels` | `ChartDataLabelsInput` | `false` | Data label display options or boolean flag enabling default labels. |
456
+ | `downsampling` | `ChartDownsamplingInput \| undefined` | `undefined` | Per-series high-density downsampling override. Undefined inherits the chart policy. |
457
+ | `field` | `ChartField` | `"value"` | Property key or accessor extracting the Y value for each data item. |
458
+ | `fillOpacity` | `number \| undefined` | `undefined` | Fill opacity for scatter points between 0 and 1. |
459
+ | `keyField` | `ChartField \| undefined` | `undefined` | Property key or accessor extracting a stable datum identity across updates. |
460
+ | `name` | `string` | `"Scatter"` | Name of the series displayed in legends and tooltips. |
461
+ | `pointRadius` | `number \| undefined` | `undefined` | Radius in pixels for scatter point markers. |
462
+ | `seriesKey` | `string \| undefined` | `undefined` | Optional stable key identifying this series for mark identity and selection across updates. |
463
+ | `strokeColor` | `string` | `""` | Stroke outline color for scatter point markers. |
464
+ | `strokeWidth` | `number \| undefined` | `undefined` | Stroke width in pixels for scatter point markers. |
465
+ | `valueFormatter` | `ChartValueFormatter \| undefined` | `undefined` | Formats this series' values in tooltips, data labels and announcements, without changing the axis ticks. Takes precedence over the axis formatter. |
466
+ | `visible` (two-way) | `boolean` | `true` | Whether the series is currently visible on the chart and in calculations. |
467
+ | `xAxisId` | `string \| undefined` | `undefined` | Optional ID of the Cartesian X axis this series binds to. When omitted, the primary X axis is used. |
468
+ | `xField` | `ChartField \| undefined` | `undefined` | Property key or accessor extracting the X value, overriding the root chart X field. |
469
+ | `yAxisId` | `string \| undefined` | `undefined` | Optional ID of the Cartesian Y axis this series binds to. When omitted, the primary Y axis is used. |
470
+
471
+ #### Outputs
472
+
473
+ | Name | Type | Description |
474
+ | --- | --- | --- |
475
+ | `visibleChange` | `boolean` | Emitted when `visible` changes. |
476
+
477
+ ### Types
478
+
479
+ **Documented elsewhere:** [`ChartDataLabelsInput`](chart.md), [`ChartDownsamplingInput`](chart.md), [`ChartField`](chart.md), [`ChartValueFormatter`](chart.md)