gaugeit.js 0.1.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.
Files changed (43) hide show
  1. package/CONTRIBUTING.md +36 -0
  2. package/LICENSE +21 -0
  3. package/NOTICE.md +5 -0
  4. package/README.md +894 -0
  5. package/SECURITY.md +24 -0
  6. package/adapters/react/Gaugeit.d.ts +11 -0
  7. package/adapters/react/Gaugeit.js +66 -0
  8. package/adapters/react/Gaugeit.jsx +1 -0
  9. package/dist/gaugeit.cjs +4686 -0
  10. package/dist/gaugeit.cjs.map +7 -0
  11. package/dist/gaugeit.css +300 -0
  12. package/dist/gaugeit.d.ts +442 -0
  13. package/dist/gaugeit.esm.js +4683 -0
  14. package/dist/gaugeit.esm.js.map +7 -0
  15. package/dist/gaugeit.esm.min.js +2 -0
  16. package/dist/gaugeit.esm.min.js.map +7 -0
  17. package/dist/gaugeit.min.cjs +2 -0
  18. package/dist/gaugeit.min.cjs.map +7 -0
  19. package/dist/gaugeit.min.css +1 -0
  20. package/dist/gaugeit.standalone.js +4720 -0
  21. package/dist/gaugeit.standalone.js.map +7 -0
  22. package/dist/gaugeit.standalone.min.js +302 -0
  23. package/dist/gaugeit.standalone.min.js.map +7 -0
  24. package/dist/gaugeit.umd.js +4713 -0
  25. package/dist/gaugeit.umd.js.map +7 -0
  26. package/dist/gaugeit.umd.min.js +4 -0
  27. package/dist/gaugeit.umd.min.js.map +7 -0
  28. package/dist/manifest.json +24 -0
  29. package/docs/api.md +456 -0
  30. package/docs/architecture.md +224 -0
  31. package/docs/assets/arc_zones.png +0 -0
  32. package/docs/assets/center_zero.png +0 -0
  33. package/docs/assets/classic_instrument.png +0 -0
  34. package/docs/assets/classic_linear_center_zero.png +0 -0
  35. package/docs/assets/classic_linear_instrument.png +0 -0
  36. package/docs/assets/heritage_rolling_tape.png +0 -0
  37. package/docs/assets/heritage_round.png +0 -0
  38. package/docs/assets/line_scale.png +0 -0
  39. package/docs/assets/rose_balance.png +0 -0
  40. package/docs/creating-gauge-types.md +286 -0
  41. package/docs/development.md +56 -0
  42. package/docs/framework-integration.md +84 -0
  43. package/package.json +114 -0
@@ -0,0 +1,24 @@
1
+ {
2
+ "version": "0.1.0",
3
+ "files": {
4
+ "gaugeit.cjs": 162825,
5
+ "gaugeit.cjs.map": 302482,
6
+ "gaugeit.css": 7164,
7
+ "gaugeit.d.ts": 12569,
8
+ "gaugeit.esm.js": 163099,
9
+ "gaugeit.esm.js.map": 302721,
10
+ "gaugeit.esm.min.js": 85299,
11
+ "gaugeit.esm.min.js.map": 310871,
12
+ "gaugeit.min.cjs": 84896,
13
+ "gaugeit.min.cjs.map": 310031,
14
+ "gaugeit.min.css": 6024,
15
+ "gaugeit.standalone.js": 181580,
16
+ "gaugeit.standalone.js.map": 312102,
17
+ "gaugeit.standalone.min.js": 93212,
18
+ "gaugeit.standalone.min.js.map": 321180,
19
+ "gaugeit.umd.js": 173940,
20
+ "gaugeit.umd.js.map": 303897,
21
+ "gaugeit.umd.min.js": 86026,
22
+ "gaugeit.umd.min.js.map": 311361
23
+ }
24
+ }
package/docs/api.md ADDED
@@ -0,0 +1,456 @@
1
+ # API reference
2
+
3
+ ## Top-level functions
4
+
5
+ ### `createGauge(target, options?)`
6
+
7
+ Creates a gauge and returns a `Gauge` instance. `target` may be an element or CSS selector. Creating another managed gauge on the same host destroys the earlier managed instance.
8
+
9
+ ### `registerGaugeType(name, definition)`
10
+
11
+ Registers or replaces a type in the default registry.
12
+
13
+ ### `autoMount(selector = '[data-gaugeit]', root = document)`
14
+
15
+ Creates gauges from matching elements. Repeated calls return existing auto-mounted instances instead of initializing them twice.
16
+
17
+ ### `defineGaugeitElement(tagName = 'gauge-it')`
18
+
19
+ Defines an optional custom element and returns its constructor. Returns `null` when custom elements are unavailable.
20
+
21
+ ### `getMountedGauge(element)`
22
+
23
+ Returns a managed instance or `null`.
24
+
25
+ ### `unmountGauge(element)`
26
+
27
+ Destroys and removes a managed instance. Returns whether an instance existed.
28
+
29
+ ## Gauge methods
30
+
31
+ ### `setValue(value, options?)`
32
+
33
+ Options:
34
+
35
+ - `animate`: defaults to the instance animation setting;
36
+ - `duration`: overrides duration for this update;
37
+ - `easing`: overrides easing for this update.
38
+
39
+ ### `set(value, options?)`
40
+
41
+ Alias for `setValue`.
42
+
43
+ ### `updateOptions(patch, behavior?)`
44
+
45
+ Deeply merges a partial configuration into the original user options, validates the result, and re-renders. Arrays such as `zones` are replaced. Supplying `patch.value` updates the displayed value immediately unless `behavior.animateToValue` is enabled.
46
+
47
+ `behavior.animateToValue` may be used to animate after the rebuild.
48
+
49
+ ### `setOptions(patch, behavior?)`
50
+
51
+ Alias for `updateOptions`.
52
+
53
+ ### `replaceOptions(options, behavior?)`
54
+
55
+ Replaces the complete user-option object instead of recursively merging a patch.
56
+ The current target value is preserved unless `options.value` is supplied. An explicit
57
+ value is displayed immediately unless `behavior.animateToValue` is enabled. This method
58
+ is useful for declarative framework adapters and custom elements where removed keys
59
+ must return to the selected type's fallback values.
60
+
61
+ ### `getValue()`
62
+
63
+ Returns the stable requested value.
64
+
65
+ ### `getDisplayedValue()`
66
+
67
+ Returns the current rendered base value, including animation but excluding pointer or indicator jitter.
68
+
69
+ ### `pause()` / `resume()`
70
+
71
+ Stops or resumes active visual work.
72
+
73
+ ### `refresh()`
74
+
75
+ Rebuilds the gauge from current options.
76
+
77
+ ### `destroy()`
78
+
79
+ Cancels work, disconnects observers, removes listeners, and removes generated content.
80
+
81
+ ## Top-level options
82
+
83
+ | Option | Default | Purpose |
84
+ | --- | --- | --- |
85
+ | `type` | `arc` | Registered gauge type name. |
86
+ | `min` | `0` | Minimum scale value. |
87
+ | `max` | `100` | Maximum scale value. |
88
+ | `value` | `0` | Initial value. |
89
+ | `invert` | `false` | Reverse the visual value direction without changing the numeric range. |
90
+ | `overflow` | `clamp` | `clamp`, `expand`, or `allow`. |
91
+ | `precision` | `3` | Internal displayed-value decimal precision. |
92
+ | `className` | empty | Extra class on the generated root. |
93
+ | `layout` | intrinsic | Content-aware sizing and fixed-host containment. |
94
+ | `responsive` | `true` | Use width `100%` with SVG viewBox scaling. |
95
+
96
+
97
+ ## `layout`
98
+
99
+ - `mode`: `intrinsic` or `contain`;
100
+ - `padding`: extra SVG viewBox padding;
101
+ - `includeGeometry`: retain the type's configured logical width and height as the minimum drawing area.
102
+
103
+ `intrinsic` is the default. The renderer calculates conservative bounds for the face,
104
+ arc, zones, scale, labels, pointer, and readouts, then expands the SVG viewBox. A
105
+ 360-degree gauge therefore occupies more document height instead of overflowing the
106
+ next element. `contain` uses the same viewBox but fills a host whose CSS width and
107
+ height are explicitly constrained.
108
+
109
+ ## `geometry`
110
+
111
+ `Gaugeit.geometry.centeredArcAngles(sweep, centerAngle)` is a convenience helper for
112
+ controls and presets. `centerAngle: 0` means the normal upright orientation, equivalent
113
+ to SVG angle 270; positive values rotate clockwise. It returns `{ startAngle, endAngle }`.
114
+
115
+ | Option | Purpose |
116
+ | --- | --- |
117
+ | `mode` | `radial`, `linear`, or `tape`; built-in types choose the correct mode. |
118
+ | `width`, `height` | Logical SVG dimensions. Resizable linear and tape presets scale their fallback geometry from these values. |
119
+ | `aspectRatio` | Optional positive ratio used by resizable presets to derive a missing width or height. |
120
+ | `centerX`, `centerY` | Pointer pivot and arc center. |
121
+ | `radius` | General type radius available to layers. |
122
+ | `startAngle`, `endAngle` | Scale angles in SVG degrees. `180` to `360` is an upper semicircle from left to right. |
123
+ | `preserveAspectRatio` | SVG aspect-ratio behavior. |
124
+
125
+ The sweep may be clockwise or counter-clockwise and is limited to one full revolution.
126
+ For `classic-linear`, `classic-linear-zero`, and `rolling-tape`, logical width and height
127
+ also control the preset composition. CSS may independently constrain the rendered host;
128
+ use `layout.mode: 'contain'` for a fixed-width and fixed-height host.
129
+
130
+ ## `linear`
131
+
132
+ Linear gauge types define their axis independently from radial geometry:
133
+
134
+ | Option | Purpose |
135
+ | --- | --- |
136
+ | `originY` | Internal SVG baseline used as public linear `y = 0`. |
137
+ | `startX`, `startY` | Minimum-side axis point before applying `invert`; X increases rightward and Y upward. |
138
+ | `endX`, `endY` | Maximum-side axis point before applying `invert`; X increases rightward and Y upward. |
139
+ | `tickSide` | `negative`, `positive`, or `cross` relative to the axis normal. |
140
+ | `labelOffset` | Label distance from the axis; positive is visually upward on a left-to-right axis. |
141
+ | `zoneOffset` | Default track and zone distance; positive is visually upward on a left-to-right axis. |
142
+
143
+ The two-point axis supports horizontal, vertical, and diagonal custom linear types.
144
+ The built-in classic-linear preset uses `originY: 142`, `startY: 0`, and `endY: 0`, so
145
+ changing Axis Y to a positive value moves the whole scale upward. Numeric linear readout
146
+ Y coordinates use the same origin and positive-up convention; its title fallback is
147
+ `y: 60`. `Gaugeit.geometry.valueToLinearPoint()`, `linearPointToValue()`, and
148
+ `linearYToSvg()` expose the mapping used by the built-in layers.
149
+
150
+ ## `invert`
151
+
152
+ `invert: true` mirrors value placement across the configured sweep: the maximum uses
153
+ the normal minimum endpoint and the minimum uses the normal maximum endpoint. Pointer
154
+ movement, ticks, labels, and zones all use the same mapping. Zone definitions remain
155
+ numeric and unchanged, so a `{ min: 0, max: 15 }` low-value zone follows the low end of
156
+ an inverted scale automatically.
157
+
158
+ ## `light`
159
+
160
+ The optional shared annunciator lamp is available to every built-in type and to custom
161
+ types that include `Gaugeit.layers.light`. It is disabled by default.
162
+
163
+ ```js
164
+ light: {
165
+ visible: true,
166
+ x: 108,
167
+ y: 110,
168
+ radius: 10,
169
+ color: 'amber',
170
+ customColor: '',
171
+ offColor: '#f3ead6',
172
+ offEdgeColor: '#817768',
173
+ bezelColor: '#4b5563',
174
+ bezelHighlightColor: '#f8fafc',
175
+ opacity: 1,
176
+ on: false,
177
+ glow: true,
178
+ pulse: true,
179
+ pulseInterval: 2600,
180
+ blink: true,
181
+ blinkInterval: 1000,
182
+ trigger: { mode: 'below', source: 'target', value: 15, min: 0, max: 15 }
183
+ }
184
+ ```
185
+
186
+ - `visible`: render or omit the component;
187
+ - `x`, `y`: logical SVG coordinates; linear Y values use the positive-up convention;
188
+ - `radius`: bulb radius in logical gauge units;
189
+ - `color`: `red`, `green`, `blue`, `amber`, `yellow`, `orange`, `white`, `halogen`, `cyan`, or `brown`;
190
+ - `customColor`: optional CSS color overriding the selected active palette;
191
+ - `offColor`, `offEdgeColor`: unlit diffused-lens center and edge colors;
192
+ - `bezelColor`, `bezelHighlightColor`: panel-mount bezel colors;
193
+ - `opacity`: total bulb opacity;
194
+ - `on`: manual state used by `trigger.mode: 'manual'`;
195
+ - `glow`: enable the active halo;
196
+ - `pulse`, `pulseInterval`: subtle steady-light breathing effect and period;
197
+ - `blink`: blink while the condition is active; the off half-cycle renders the full normal unlit-lens appearance instead of fading the whole lamp;
198
+ - `blinkInterval`: complete blink period in milliseconds, minimum 100;
199
+ - `trigger.mode`: `manual`, `below`, `above`, or `between`;
200
+ - `trigger.value`: inclusive threshold for `below` and `above`;
201
+ - `trigger.min`, `trigger.max`: inclusive bounds for `between`.
202
+
203
+ The lamp evaluates the stable target value by default, preventing threshold delays during
204
+ pointer animation. Set `trigger.source` to `displayed` to follow the animated value or to
205
+ `pointer` to include visual jitter. Gradient stops use resolved color values rather than
206
+ unresolved SVG custom-property references, keeping the lens rendering consistent across
207
+ browsers and DOM test environments.
208
+
209
+ ## `face`
210
+
211
+ `face` controls the optional old-style instrument background.
212
+
213
+ Important fields:
214
+
215
+ - `visible`;
216
+ - `shape`: `panel` or `circle`;
217
+ - `fit`: `geometry` or `content`;
218
+ - `contentPadding`: spacing used when a content-fitted face expands;
219
+ - `minWidth`, `minHeight`: optional lower limits for `fit: 'content'`;
220
+ - `clipContent`: clip every later non-face layer to the inner bezel;
221
+ - `x`, `y`, `width`, `height`;
222
+ - `cornerRadius`;
223
+ - `color`;
224
+ - `strokeColor`, `strokeWidth`;
225
+ - `innerStrokeColor`, `innerStrokeWidth`;
226
+ - `shadow`;
227
+ - `glass`.
228
+
229
+ ## `track`
230
+
231
+ - `visible`;
232
+ - `color`;
233
+ - `width`;
234
+ - `radius`;
235
+ - `opacity`;
236
+ - `lineCap`;
237
+ - `showUnderZones`.
238
+
239
+ When `showUnderZones` is `false`, transparent zones are gaps. When it is `true`, the base track remains visible below every zone.
240
+
241
+ ## `zones`
242
+
243
+ Each zone supports:
244
+
245
+ ```js
246
+ {
247
+ min: 0,
248
+ max: 25,
249
+ color: '#ef4444',
250
+ width: 20,
251
+ taper: {
252
+ startWidth: 0,
253
+ endWidth: 32,
254
+ segments: 48
255
+ },
256
+ radius: 112,
257
+ opacity: 1,
258
+ lineCap: 'butt',
259
+ className: 'application-warning-zone',
260
+ offset: 0 // optional linear-axis normal offset
261
+ }
262
+ ```
263
+
264
+ `strokeStyle` is accepted as a compatibility alias for `color`.
265
+
266
+ For radial gauges, `taper.startWidth` and `taper.endWidth` define variable thickness at
267
+ the zone's numeric `min` and `max` endpoints. Missing taper widths fall back to `width`,
268
+ and `taper.segments` controls smoothness between 2 and 256 samples. Tapered zones are
269
+ filled SVG annular paths; uniform zones remain normal strokes. The taper follows numeric
270
+ value direction automatically when `invert` is enabled.
271
+
272
+ Zones are clamped to the gauge range. When zones overlap, the last matching zone wins for the overlapping segment and for `pointer.colorByZone`.
273
+
274
+ ## `scale`
275
+
276
+ ### Shared
277
+
278
+ - `endpointMode`: `auto`, `both`, or `dedupe`; `auto` removes the duplicate maximum endpoint on a closed 360-degree scale;
279
+ - `radius`;
280
+ - `position`: `inside`, `outside`, or `cross`.
281
+
282
+ ### `scale.major`
283
+
284
+ - `visible`;
285
+ - `interval`: explicit value spacing;
286
+ - `divisions`: desired division count when interval is not supplied;
287
+ - `length`;
288
+ - `width`;
289
+ - `color`;
290
+ - `opacity`.
291
+
292
+ ### `scale.minor`
293
+
294
+ - `visible`;
295
+ - `subdivisions`: minor tick count between adjacent major ticks;
296
+ - `length`;
297
+ - `width`;
298
+ - `color`;
299
+ - `opacity`.
300
+
301
+ Major and minor ticks are each rendered as one combined SVG path, reducing DOM node count for dense scales.
302
+
303
+ ## `labels`
304
+
305
+ - `visible`;
306
+ - `interval`: independent label interval, or the major tick interval when omitted;
307
+ - `radius`;
308
+ - `color`;
309
+ - `fontFamily`, `fontSize`, `fontWeight`;
310
+ - `fractionDigits`;
311
+ - `rotation`: `horizontal`, `radial`, or `tangent`;
312
+ - `formatter(value, context)`.
313
+
314
+ ## `pointer`
315
+
316
+ - `visible`;
317
+ - `type`: `needle`, `line`, `arrow`, or `spear`;
318
+ - `length`;
319
+ - `shaftLength`: optional straight-body length before an arrow, spear, or needle tip; `null` keeps the type fallback;
320
+ - `tailLength`;
321
+ - `width`;
322
+ - `color`;
323
+ - `strokeColor`, `strokeWidth`;
324
+ - `opacity`;
325
+ - `colorByZone`;
326
+ - `cap.visible`, `cap.radius`, `cap.color`, `cap.strokeColor`, `cap.strokeWidth`;
327
+ - `cap.stackOrder`: `above` (default) or `below`, relative to the pointer shape.
328
+
329
+ SVG stacking follows document paint order rather than a numeric CSS `z-index`.
330
+ Built-in radial types place the readout layer before the pointer layer, so the pointer
331
+ always paints above title, value, and unit text. Each type explicitly chooses its cap
332
+ stack order. A custom type can place `readoutLayer` and `pointerLayer` in a different
333
+ order and can set `pointer.cap.stackOrder: 'below'` when the pointer must paint over
334
+ its center cap.
335
+
336
+ ## `indicator`
337
+
338
+ Linear types use `indicator` instead of the radial `pointer` layer:
339
+
340
+ - `visible`;
341
+ - `type`: `hairline`, `marker`, or `carriage`;
342
+ - `position`: `negative`, `positive`, or `cross`;
343
+ - `length`;
344
+ - `centerOffset`: signed center shift across the axis; positive is visually upward for a left-to-right horizontal axis;
345
+ - deprecated `offset`: retained as a compatibility alias with its original axis-normal sign;
346
+ - `width`, `color`, `strokeColor`, `strokeWidth`, `opacity`, and `lineCap`;
347
+ - `colorByZone`;
348
+ - `markerSize`;
349
+ - `carriageWidth`, `carriageRadius`;
350
+ - `cap.visible`, `cap.radius`, `cap.color`, `cap.strokeColor`, `cap.strokeWidth`;
351
+ - `cap.stackOrder`: `above` (default) or `below`, relative to the indicator shape.
352
+
353
+ The indicator consumes `state.pointerValue`, so existing animation and jitter remain
354
+ pointer-only visual effects and do not change the readout, API value, events, or ARIA
355
+ value. The classic-linear fallback does not draw a center cap; applications may opt in
356
+ with `indicator.cap.visible: true`.
357
+ The built-in linear type paints its indicator layer after the readout layer, matching
358
+ the radial pointer-over-readout behavior.
359
+
360
+
361
+ ## `centerZero`
362
+
363
+ Both `center-zero` and `classic-linear-zero` use the reusable zero marker. The first is
364
+ a radial heritage dial; the second composes the existing classic linear layers.
365
+
366
+ - `zeroValue`: the numeric reference represented by the center position;
367
+ - `symmetric`: expand the resolved range equally around `zeroValue`;
368
+ - `marker.visible`;
369
+ - `marker.radius` for radial gauges;
370
+ - `marker.position` and `marker.centerOffset` for linear gauges;
371
+ - `marker.length`, `marker.width`;
372
+ - `marker.color`, `marker.opacity`, `marker.lineCap`.
373
+
374
+ The preset defaults to `-100 ... 100`, but both the range and all colors remain
375
+ overridable.
376
+
377
+ ## `tape`
378
+
379
+ `rolling-tape` uses a fixed edge-to-edge reference line and a moving scale strip:
380
+
381
+ - `orientation`: `vertical` or `horizontal`;
382
+ - `x`, `y`, `width`, `height`, `cornerRadius`;
383
+ - `windowColor`, `windowStrokeColor`, `windowStrokeWidth`;
384
+ - `windowInnerStrokeColor`, `windowInnerStrokeWidth`;
385
+ - `stripColor`, `textColor`, `tickColor`, `minorTickColor`;
386
+ - `majorTickWidth`, `minorTickWidth`, `majorTickLength`, `minorTickLength`;
387
+ - `tickInset`, `labelOffset`;
388
+ - `interval`, `minorSubdivisions`, `majorSpacing`;
389
+ - `indicatorColor`, `indicatorWidth`;
390
+ - `fadeSize`, `fadeColor`;
391
+ - `colorByZone`.
392
+
393
+ The strip is generated from reusable slots around the current value, so a large numeric
394
+ range does not create an unbounded SVG tree. `invert` reverses tape travel while zones
395
+ remain attached to their numeric values. `Gaugeit.geometry.tapeWindowBox()`,
396
+ `resolveTapeInterval()`, `tapeMinorStep()`, and `tapeValueOffset()` are exported for
397
+ custom implementations.
398
+
399
+ ## `readout`
400
+
401
+ `readout.visible` controls the full group. `title`, `value`, and `unit` each support position, typography, color, and visibility.
402
+ `value.visible` and `unit.visible` default to `false`. Their content never needs to be
403
+ rendered when the surrounding application already presents the numeric value.
404
+
405
+ Each part supports independent numeric `x` and `y` coordinates in the configured SVG viewBox. `x: 'auto'` centers the part. `y: 'auto'` uses `position: 'top'`, `center`, or `bottom`; `margin`, `offsetX`, and `offsetY` refine automatic placement only. Numeric coordinates are final absolute SVG positions.
406
+ The built-in `arc` title position defaults to `('auto', 35)`. Its value position defaults to `(160, 130)` so an enabled value sits
407
+ inside the arc instead of overlapping its colored sectors. The radial `center-zero`
408
+ title defaults to `('auto', 205)`, between the pointer hub and lower value readout.
409
+ The rolling-tape separate value supports the same independent `x` and `y` coordinates.
410
+
411
+ The value configuration additionally supports:
412
+
413
+ - `fractionDigits`;
414
+ - `prefix` and `suffix`;
415
+ - `locale` passed to `Intl.NumberFormat`;
416
+ - `formatter(value, context)`.
417
+
418
+ A formatter takes precedence over locale and fraction settings.
419
+
420
+ ## `animation`
421
+
422
+ - `enabled`;
423
+ - `duration` in milliseconds;
424
+ - `easing`: named easing or callback;
425
+ - `animateOnInit`;
426
+ - `startFrom`: `min`, `max`, `value`, or a number;
427
+ - `respectReducedMotion`.
428
+
429
+ Built-in easing names are exported through `Gaugeit.easingNames`.
430
+
431
+ ## `effects.jitter`
432
+
433
+ Jitter randomizes only the active moving visual: radial pointer angle, linear indicator position, or rolling-tape position. It does not affect readouts, API values, events, or accessibility attributes.
434
+
435
+ - `enabled`;
436
+ - `amplitude`;
437
+ - `amplitudeUnit`: `value` or `percent`;
438
+ - `frequency`: new random target changes per second;
439
+ - `smoothing`: higher values create slower movement;
440
+ - `whenIdleOnly`: suppress jitter during a stable-value animation.
441
+
442
+ ## `accessibility`
443
+
444
+ - `label`;
445
+ - `description`;
446
+ - `valueText`: string or callback.
447
+
448
+ The generated root has meter semantics and updated numeric attributes.
449
+
450
+ ## `performance`
451
+
452
+ - `pauseWhenHidden`;
453
+ - `pauseWhenOffscreen`.
454
+
455
+ Both default to `true`. Runtime changes through `updateOptions()` or
456
+ `replaceOptions()` reconfigure the corresponding observers.