@astrato-io/visualizations 0.11.0 → 0.12.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 (135) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +129 -4
  3. package/VISUALIZATION_DEFINITIONS.md +3 -1
  4. package/chunks/{Button-CPG4WX8X.js → Button-CQdoKSXX.js} +3 -3
  5. package/chunks/{CircularProgress-PSLW8HmD.js → CircularProgress-DpT1lwWw.js} +18 -18
  6. package/chunks/FieldTypeIcon-Cg4F9Q5D.js +22 -0
  7. package/chunks/{LinearProgress-KQ2EQlGL.js → LinearProgress-B7S0Q26A.js} +8 -8
  8. package/chunks/{MenuOption-B-6K7kks.js → MenuOption-DpKFJxmo.js} +133 -133
  9. package/chunks/{Title-BmvwZYkh.js → Title-m5damhc0.js} +10 -10
  10. package/chunks/{_createAggregator-CFmH6gUN.js → _createAggregator-BA8_iU9q.js} +7 -7
  11. package/chunks/{app-filter-bar.compiler-BY5-T16I.js → app-filter-bar.compiler--T4Qz3Wu.js} +3 -3
  12. package/chunks/{bar-layout-BNou0dZF.js → bar-layout-OFhxn2Go.js} +2 -2
  13. package/chunks/{bar.compiler-BkhO7sDd.js → bar.compiler-hWZBYYvV.js} +62 -62
  14. package/chunks/{builder-CNjuqD2z.js → builder-7w_bgV_h.js} +31 -31
  15. package/chunks/{coloring-BOiP0rmn.js → coloring-Cd6p0GQJ.js} +88 -83
  16. package/chunks/{createSimplePaletteValueFilter-BkgQ7MFE.js → createSimplePaletteValueFilter-CiJT8s1s.js} +55 -55
  17. package/chunks/defaults-CMFqXvaJ.js +3 -0
  18. package/chunks/{definitions-AS9GcavE.js → definitions-DTauTjIX.js} +412 -406
  19. package/chunks/{escobar-cQ1eQ64G.js → escobar-CMvphKSK.js} +4787 -4717
  20. package/chunks/{extend-preset-BlCbcXKR.js → extend-preset-BpXttHFk.js} +371 -372
  21. package/chunks/{filter.compiler-CI7dDNM1.js → filter.compiler-DOGFweJz.js} +4 -4
  22. package/chunks/{filtering-Dwi7hDPZ.js → filtering-NOnDcGbo.js} +183 -183
  23. package/chunks/handlers-CyYFSfhM.js +15393 -0
  24. package/chunks/{icon-picker-styles-CBlxEu3s.js → icon-picker-styles-DuSERhBU.js} +2 -2
  25. package/chunks/{isEqual-BdHo6wqq.js → isEqual-4f8yUUtC.js} +1 -1
  26. package/chunks/{isFocusVisible-C1nlVUwL.js → isFocusVisible-Czm70MGc.js} +1 -1
  27. package/chunks/line.compiler-B-4H55_T.js +203 -0
  28. package/chunks/{logger-Bc-DqDM_.js → logger-Cioob-QV.js} +71 -70
  29. package/chunks/{map.compiler-CRO6XpdI.js → map.compiler-Cv5V6EhF.js} +13 -13
  30. package/chunks/measure-axis-label-format-COy8U_dd.js +27 -0
  31. package/chunks/{measure-format-default-B6ghxih7.js → measure-format-default-B_kuGSzi.js} +7 -3
  32. package/chunks/{metadata-CtkvZEhS.js → metadata-dGSe5UWy.js} +5 -5
  33. package/chunks/{number.compiler-kV4lobCZ.js → number.compiler-D7nMcEMv.js} +8 -8
  34. package/chunks/{operations-COl9wgqi.js → operations-CgfehCad.js} +11462 -11223
  35. package/chunks/{range-CMJ5yc5Z.js → range-Dmwp9kVB.js} +2 -2
  36. package/chunks/{react-dom-BjsCbYHq.js → react-dom-CfuL-m78.js} +24 -24
  37. package/chunks/{render-wrappers-DFHi3Wkr.js → render-wrappers--g-zPFBW.js} +1 -1
  38. package/chunks/{requirements-C5YLmHKe.js → requirements-DHayNJ2C.js} +83 -83
  39. package/chunks/{shared-DyqxOie0.js → shared-DoEN9nNM.js} +282 -277
  40. package/chunks/standalone-B3hRGgYi.js +773 -0
  41. package/chunks/{standalone-BYK2U0Vd.js → standalone-BPNXgFft.js} +380 -380
  42. package/chunks/standalone-BPTT8XEu.js +424 -0
  43. package/chunks/standalone-BgAeHROc.js +2 -0
  44. package/chunks/{standalone-I5kRIsp8.js → standalone-BkQxag7M.js} +81 -81
  45. package/chunks/{standalone-DYVYccmY.js → standalone-Bxa3x6dg.js} +913 -913
  46. package/chunks/standalone-C0If-V6O.js +773 -0
  47. package/chunks/standalone-C1TOyflX.js +287 -0
  48. package/chunks/{standalone-DaNxWIKn.js → standalone-CE5PwJN0.js} +21 -21
  49. package/chunks/{standalone-K2OvRAQM.js → standalone-CG7IFN6n.js} +121 -121
  50. package/chunks/{standalone-Db_HNuWx.js → standalone-CKlgGu80.js} +44 -44
  51. package/chunks/standalone-CNf-oA2U.js +355 -0
  52. package/chunks/{standalone-9jrQ3zJT.js → standalone-CXPdWFlw.js} +10 -10
  53. package/chunks/{standalone-c4CPN6ug.js → standalone-Cf0_5tbu.js} +5783 -5785
  54. package/chunks/{standalone-Bp4G3MDx.js → standalone-DMi4-Vp3.js} +118 -118
  55. package/chunks/{standalone-BrjtMIdd.js → standalone-DTEX67C8.js} +108 -108
  56. package/chunks/{standalone-iOnJhCvA.js → standalone-DU46-kYv.js} +181 -181
  57. package/chunks/standalone-Dbn3jSH6.js +690 -0
  58. package/chunks/{standalone-CS5VGoja.js → standalone-DdcAL_k_.js} +833 -837
  59. package/chunks/standalone-DwCIA0UG.js +1057 -0
  60. package/chunks/standalone-Dz13tl3P.js +357 -0
  61. package/chunks/{standalone-CIjNYyya.js → standalone-H9GFzFk_.js} +937 -938
  62. package/chunks/{standalone-ChfEHb28.js → standalone-MduR0qre.js} +1279 -1279
  63. package/chunks/standalone-ejTz66P3.js +2 -0
  64. package/chunks/{standalone-D9k5SCd8.js → standalone-keB-0wK3.js} +189 -189
  65. package/chunks/{standalone-Bsfz5vnJ.js → standalone-nnkuQd0K.js} +35 -35
  66. package/chunks/standalone-vGGR6Vcn.js +6 -0
  67. package/chunks/{table.compiler-CMH_dtYs.js → table.compiler-mS4UvhLT.js} +12 -12
  68. package/chunks/theme-MYp6Rj1J.js +232 -0
  69. package/chunks/{useFieldName-BfxBzhhH.js → useFieldName-AdSak4Ch.js} +1 -1
  70. package/chunks/{utils-BdJrEeIQ.js → utils-CUKgR7it.js} +3265 -3133
  71. package/chunks/{view-Q-_XIrWE.js → view-BeYwpcVD.js} +478 -478
  72. package/chunks/{visualization-filters-BwS0xUqs.js → visualization-filters-B9qik5_K.js} +2706 -2384
  73. package/chunks/{with-html-element-D_ooGNWI.js → with-html-element-1GSeLT59.js} +3888 -3870
  74. package/definitions.js +2 -2
  75. package/docs/operations/astrato-app-filter-bar.md +1 -1
  76. package/docs/operations/bar.md +115 -32
  77. package/docs/operations/combo.md +50 -17
  78. package/docs/operations/date-picker.md +4 -4
  79. package/docs/operations/distribution-gauge.md +18 -16
  80. package/docs/operations/dot.md +107 -24
  81. package/docs/operations/filter.md +10 -8
  82. package/docs/operations/gauge.md +20 -18
  83. package/docs/operations/heatMap.md +73 -21
  84. package/docs/operations/histogram.md +45 -12
  85. package/docs/operations/iframe.md +1 -1
  86. package/docs/operations/image.md +1 -1
  87. package/docs/operations/index.md +11 -11
  88. package/docs/operations/line.md +57 -24
  89. package/docs/operations/map.md +16 -16
  90. package/docs/operations/number.md +10 -9
  91. package/docs/operations/pie.md +23 -21
  92. package/docs/operations/radar.md +13 -11
  93. package/docs/operations/sankey.md +19 -17
  94. package/docs/operations/scatter.md +111 -28
  95. package/docs/operations/shape.md +5 -5
  96. package/docs/operations/simpleTextObject.md +4 -4
  97. package/docs/operations/slider.md +1 -1
  98. package/docs/operations/table.md +27 -25
  99. package/docs/operations/tree.md +5 -3
  100. package/docs/operations/treemap.md +70 -18
  101. package/docs/operations/waterfall.md +40 -7
  102. package/docs/operations/word-cloud.md +69 -17
  103. package/getters.js +2 -2
  104. package/index.js +474 -525
  105. package/metadata.js +2 -2
  106. package/operations.js +24 -17
  107. package/package.json +71 -72
  108. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +1 -1
  109. package/src/definitions/model/definitions/schema-registry.d.ts +13 -12
  110. package/src/definitions/model/definitions/schemas/bar.schema.d.ts +2 -2
  111. package/src/definitions/model/definitions/schemas/common.schema.d.ts +5 -4
  112. package/src/definitions/model/definitions/schemas/line.schema.d.ts +3 -2
  113. package/src/definitions/model/definitions/schemas/number.schema.d.ts +1 -1
  114. package/src/definitions/model/definitions/schemas/table.schema.d.ts +14 -14
  115. package/src/index.d.ts +1 -1
  116. package/src/operations/index.d.ts +11 -1
  117. package/src/types.d.ts +166 -1
  118. package/chunks/FieldTypeIcon-5k2bkqd0.js +0 -22
  119. package/chunks/category-axis-D1OVyMrr.js +0 -20
  120. package/chunks/color-rules-DYJL4fIW.js +0 -15
  121. package/chunks/color-settings-DJFoFTip.js +0 -5
  122. package/chunks/defaults-B5_8S-J-.js +0 -3
  123. package/chunks/handlers-C63NVo7i.js +0 -15433
  124. package/chunks/line.compiler-DCv3h42f.js +0 -198
  125. package/chunks/standalone-06i1wmIX.js +0 -6
  126. package/chunks/standalone-B6zUvxNQ.js +0 -357
  127. package/chunks/standalone-Be5APcVv.js +0 -762
  128. package/chunks/standalone-BuXpKMnc.js +0 -2
  129. package/chunks/standalone-CUGt2FUF.js +0 -2
  130. package/chunks/standalone-CnF2OYLQ.js +0 -355
  131. package/chunks/standalone-CznEEiq3.js +0 -422
  132. package/chunks/standalone-DcuE8KBa.js +0 -287
  133. package/chunks/standalone-pCrzBiTy.js +0 -773
  134. package/chunks/standalone-qrZaimgC.js +0 -689
  135. package/chunks/standalone-yqDJ8h3K.js +0 -1012
package/CHANGELOG.md CHANGED
@@ -4,6 +4,25 @@ Changes to `@astrato-io/visualizations`, newest first. Operation names, payload
4
4
  installed version are in the bundled [Operations Reference](./docs/operations/index.md) and in
5
5
  `getVisualizationMetadata(type).operations`.
6
6
 
7
+ ## 0.12.0
8
+
9
+ ### Added
10
+
11
+ - Chart theming on the runtime. `createVisualizationRuntime({ theme, mode })` takes a full chart theme and a `light` or
12
+ `dark` mode, and `runtime.setTheme()` and `runtime.setMode()` redraw mounted charts without remounting them. Theme
13
+ values may be `{ light, dark }` pairs, resolved for the active mode.
14
+ - Color fields accept theme references such as `theme:primary`, `theme:palette.3` or `theme:status.negative` as well
15
+ as literal colors. The stored vSpec keeps the reference. An unknown reference draws `#9e9e9e` and is reported as
16
+ `UNRESOLVED_THEME_REFERENCES`.
17
+ - Diverging gradients: a gradient is `sequential` or `diverging`, with a `midpoint` (zero, a number or automatic) and
18
+ optional `steps`.
19
+ - Theme slots for styling that was hardcoded: font sizes, tooltip, label contrast inside marks, hover outline, muted
20
+ fill, status colors, and optional null and "Others" colors. Labels, legend and axis text follow the theme's text color
21
+ and table cells its surface.
22
+ - `colors.table.rowHighlight` sets the background of the row or column a table highlights under the pointer when the
23
+ vSpec sets none, and `theme:table.rowHighlight` refers to it. It defaults to `#f2f2f2`, and to a dark gray in dark
24
+ mode.
25
+
7
26
  ## 0.11.0
8
27
 
9
28
  ### Added
package/README.md CHANGED
@@ -512,6 +512,129 @@ Browsers do not draw hidden pages, so a chart cannot finish in a background tab.
512
512
  is visible and starts over when a hidden page returns, so readiness stays pending in the background and resolves once
513
513
  the chart renders on return.
514
514
 
515
+ ## Theming
516
+
517
+ Pass a theme and a color mode when creating the runtime. Every chart the runtime mounts draws with them, and
518
+ `runtime.setTheme()` and `runtime.setMode()` redraw mounted charts without remounting them. Anything you leave out
519
+ keeps the default, so a runtime created without a theme renders exactly as before.
520
+
521
+ ```ts
522
+ const runtime = createVisualizationRuntime({
523
+ client,
524
+ registry,
525
+ mode: 'dark', // optional; defaults to 'light'
526
+ theme: {
527
+ fontFamily: 'Inter',
528
+ titleFontFamily: 'Inter Display', // optional; defaults to fontFamily
529
+ colors: {
530
+ primary: { light: '#2f5bea', dark: '#7d9bff' },
531
+ text: { light: '#1b1d29', dark: '#e8e9f0' },
532
+ surface: { light: '#ffffff', dark: '#16171d' },
533
+ gridline: { light: '#e3e4ea', dark: '#34363f' },
534
+ axis: { line: { light: '#d0d2da', dark: '#3d3f49' }, label: { light: '#6b6e7b', dark: '#a3a6b3' } },
535
+ },
536
+ palettes: {
537
+ categorical: [{ id: 'brand', colors: ['#2f5bea', '#f2994a', '#27ae60', '#eb5757', '#9b51e0'] }],
538
+ sequential: [{ id: 'blues', colors: { light: ['#e8eefd', '#2f5bea'], dark: ['#1d2440', '#7d9bff'] } }],
539
+ },
540
+ },
541
+ });
542
+
543
+ // follow the host's color scheme
544
+ runtime.setMode(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
545
+
546
+ // replace the whole theme; pass undefined to return to the default theme
547
+ runtime.setTheme(nextTheme);
548
+ ```
549
+
550
+ Any color, color list or palette's `colors` may be a `{ light, dark }` pair. The runtime uses the value for the
551
+ active mode, so you pass one theme and switch the mode. A plain value is used in both modes. In dark mode, text,
552
+ surface, gridline and axis colors, the hover outline and the table row highlight you leave out use built-in dark
553
+ defaults; palettes, `primary` and the other colors stay the same.
554
+
555
+ | Setting | What it styles |
556
+ | ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
557
+ | `fontFamily`, `titleFontFamily` | Chart text and chart titles. See [Fonts And Icons](#fonts-and-icons). |
558
+ | `colors.primary` | Series that have no palette, such as a single-measure bar chart. |
559
+ | `colors.brand` | Further colors offered as theme colors in color pickers. |
560
+ | `colors.text`, `colors.title` | Labels, legends and values; titles default to `text`. |
561
+ | `colors.surface` | The background charts draw on. Charts that paint cells, such as tables, use it. |
562
+ | `colors.border`, `colors.gridline` | Object borders and gridlines. |
563
+ | `colors.axis.line`, `.tick`, `.label`, `.title` | Axes. The tick defaults to the line color and the title to the label color. |
564
+ | `palettes.categorical`, `palettes.defaultCategorical` | Palettes for coloring by category, and the one used when a vSpec names none. |
565
+ | `palettes.sequential`, `palettes.defaultSequential` | Ramps for coloring by value, from low to high, and the default ramp. |
566
+ | `palettes.diverging`, `palettes.defaultDiverging` | Ramps for diverging gradients, from low through a neutral middle to high, and the default. |
567
+ | `colors.tooltip.background`, `.text` | Tooltips. |
568
+ | `colors.dataLabel.onDark`, `.onLight` | Labels inside marks, which take whichever of `text`, `onDark` and `onLight` contrasts best with the mark. Labels outside marks use `text`. |
569
+ | `colors.selection.hoverStroke`, `.mutedFill`, `mutedOpacity` | The hovered mark's outline, and marks a selection leaves out: mixed towards gray at `mutedOpacity` (default 0.25), or `mutedFill` when they have no fill. |
570
+ | `colors.status.positive`, `.negative`, `.total` | Increases, decreases and totals, such as waterfall bars whose vSpec sets no colors. |
571
+ | `colors.null`, `colors.others` | Categorical colors for null values and the Top N "Others" group. Unset, they take palette colors. |
572
+ | `colors.table.rowHighlight` | The row or column a table highlights under the pointer, when its vSpec sets no highlight color. Defaults to `#f2f2f2`. |
573
+ | `fontSizes.axisLabel`, `.legend`, `.dataLabel`, `.fieldTitle` | Default font sizes in pixels. A size set in a vSpec takes precedence. |
574
+
575
+ Sankey, treemap and map labels and line end labels keep the built-in pair rather than `colors.dataLabel`; they
576
+ still prefer `text` when it contrasts best with the mark.
577
+
578
+ Theme palettes are listed before the built-in ones. A vSpec selects a palette by its `id`; a vSpec that names no
579
+ palette uses the default, which is the first palette in the list unless you name another, including a built-in one.
580
+ The runtime throws a `TypeError` for a theme it cannot read and logs a warning for a default palette id that matches
581
+ no palette.
582
+
583
+ The runtime does not paint the mount container, so give it the same background as `colors.surface`.
584
+
585
+ ### Diverging And Banded Gradients
586
+
587
+ Gradient coloring is sequential by default. `setColoringGradientRamp` makes it diverging, so the middle color of a
588
+ diverging ramp sits on a midpoint and colors grow more intense in both directions, and can draw any gradient as solid
589
+ bands:
590
+
591
+ ```ts
592
+ await applyRuntimeOperations({
593
+ instanceId: 'margin-by-region',
594
+ runtime,
595
+ operationRequests: [
596
+ { id: 'type', name: 'setColoringType', payload: 'gradient' },
597
+ { id: 'ramp', name: 'setColoringGradientRamp', payload: { kind: 'diverging', midpoint: 0, steps: 6 } },
598
+ ],
599
+ });
600
+ ```
601
+
602
+ `midpoint` is a number, or `'auto'` for the middle of the gradient limits, and defaults to 0. The ramp reaches equally
603
+ far on both sides of the midpoint, so equal distances from it get equal intensity. `steps`, from 2 to 12, draws that
604
+ many bands; `null` returns to a continuous gradient. A diverging gradient uses `palettes.defaultDiverging` unless
605
+ `setChartPalette` names a diverging ramp: one from `palettes.diverging` or a built-in one (`redblue`, `purplegreen`,
606
+ `browngreen`).
607
+
608
+ ### Theme Color References
609
+
610
+ Any vSpec color field that an operation can set, such as the coloring color, color overwrites and rules, custom
611
+ palettes, table styles and axis colors, accepts a theme color reference as well as a hex color. A reference is the
612
+ string `theme:` followed by a slot. It resolves when the chart draws, against the runtime's theme and mode, so the chart
613
+ follows later `setTheme()` and `setMode()` calls without being edited. The vSpec keeps the reference. Only color fields
614
+ resolve: text, titles and condition values that read like a reference are drawn as written.
615
+
616
+ ```ts
617
+ await applyRuntimeOperations({
618
+ instanceId: 'revenue',
619
+ runtime,
620
+ operationRequests: [{ id: 'color', name: 'setColoringColor', payload: 'theme:palette.3' }],
621
+ });
622
+ ```
623
+
624
+ | Reference | Resolves to |
625
+ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
626
+ | `theme:primary` | `colors.primary` |
627
+ | `theme:text`, `theme:title`, `theme:surface` | `colors.text`, `colors.title`, `colors.surface` |
628
+ | `theme:border`, `theme:gridline` | `colors.border` (defaults to the axis line color), `colors.gridline` |
629
+ | `theme:axis.line`, `theme:axis.tick`, `theme:axis.label`, `theme:axis.title` | The matching `colors.axis` color |
630
+ | `theme:palette.<n>` | The nth color, from 1, of the default categorical palette |
631
+ | `theme:brand.<n>` | The nth color, from 1, of `[colors.primary, ...colors.brand]` |
632
+ | `theme:tooltip.background`, `theme:tooltip.text`, `theme:dataLabel.onDark`, `theme:dataLabel.onLight`, `theme:selection.hoverStroke`, `theme:selection.mutedFill`, `theme:status.positive`, `theme:status.negative`, `theme:status.total`, `theme:table.rowHighlight`, `theme:null`, `theme:others` | The matching theme color |
633
+
634
+ A reference the theme cannot resolve, such as an unknown slot or a palette index past the end, draws in a neutral grey
635
+ (`#9e9e9e`). The runtime logs it once through the logger's `warn`, with the instance id and the references, and again
636
+ when the set of unresolved references changes.
637
+
515
638
  ## Maps
516
639
 
517
640
  See the [map definition reference](./VISUALIZATION_DEFINITIONS.md#map-map) and
@@ -532,7 +655,7 @@ the map reports ready; their URLs must be accessible from the application.
532
655
  Charts draw axis labels and legends on `<canvas>`, which only uses fonts that have finished loading. The runtime picks
533
656
  the chart font for you, so no host CSS is needed:
534
657
 
535
- 1. `createVisualizationRuntime({ theme: { fontFamily } })`, when set.
658
+ 1. `theme.fontFamily` from `createVisualizationRuntime()` or `runtime.setTheme()`, when set.
536
659
  2. Otherwise the host page's font: `--astrato-font-family`, then `--font-family` (both read from `:root`), then the
537
660
  `font-family` of `body`.
538
661
 
@@ -646,8 +769,9 @@ Calls for different instances are independent and may run concurrently.
646
769
 
647
770
  Supply `availableFields` for operations that add or replace dimensions, measures, calculations, or raw fields. The
648
771
  catalog must belong to the same semantic-layer context as the instance. Operations that only modify existing visual
649
- properties may not require it. Most integrations do not need the advanced `variables`, `vTheme`, `changesQueue`, or
650
- custom `registry` inputs.
772
+ properties may not require it. Palette names such as "theme default" or
773
+ "theme palette 2" resolve against the runtime's theme and mode. Most integrations do not need the advanced `variables`,
774
+ `theme`, `mode`, `changesQueue`, or custom `registry` inputs.
651
775
 
652
776
  ### Batches, Results, And Errors
653
777
 
@@ -703,7 +827,8 @@ each definition `ref`. A map also returns `compilation.resolvedLayerRefs`, whose
703
827
  operation's `layer` selector. It runs in memory and makes no engine requests. It is also useful when validating a vSpec,
704
828
  running operations in tests, or building an adapter with intentional custom state ownership. It does not serialize separate calls or protect against a
705
829
  newer runtime/chart vSpec. Avoid applying its result to a live runtime from an older instance snapshot; use
706
- `applyRuntimeOperations` for that case.
830
+ `applyRuntimeOperations` for that case. Pass `theme` and `mode` when operations name theme palettes, since there is no
831
+ runtime theme to resolve them against.
707
832
 
708
833
  ### Table Column Operations
709
834
 
@@ -11,6 +11,7 @@ The reference and the public per-type descriptors share the same metadata catalo
11
11
  - Definition-local `ref` values let sorting, Top N, and similar settings refer to data items before internal identities exist.
12
12
  - Raw fields used as measures require `aggregation`. Semantic dimensions, predefined measures, and calculations retain their engine semantics.
13
13
  - Omit `format` on a dimension unless it needs a specific format. A date field then shows readable dates; `none` or `inherit` on a date field shows raw timestamp numbers. To choose a date format, use a date format type such as `ddmmmyyyy`.
14
+ - Measure axes print values compactly, such as `40M` or `$1.5M`, while data labels and tooltips keep the measure's format. To print an axis with the measure's format, set `labelFormat: 'value'` on `presentation.axes.primaryMeasure` or `secondaryMeasure`. Percent, date, time and duration formats are never compacted.
14
15
  - Each static filter in `filterGroup` takes the value keys of its operator: `inList` and `excludedFromList` take a `values` array, `isBetween` and `isNotBetween` take `valueFrom` and `valueTo`, `isNull` and `notNull` take none, and every other operator, such as `contains`, takes one string in `value`.
15
16
  - Unsupported sections and properties are rejected instead of ignored.
16
17
  - The compiler returns one complete vSpec or structured issues; it never returns partial state. A successful result can also carry `warnings` about settings that are likely to display poorly.
@@ -82,7 +83,7 @@ Avoid finishing a chart by applying operations one at a time after it is mounted
82
83
  | -------------------- | ------------------------------------------------------------------------------ |
83
84
  | `axes` | Semantic dimension/primary-measure/secondary-measure axis presentation. |
84
85
  | `axis-bands` | Shaded ranges between two primary measure axis values. |
85
- | `axis-range` | Measure-axis range (min, max, starts at zero) and inversion. |
86
+ | `axis-range` | Measure-axis range (min, max, starts at zero), inversion and label format. |
86
87
  | `axis-scale` | Linear or logarithmic measure axis. |
87
88
  | `content` | User-visible content such as text, image, or URL. |
88
89
  | `data-labels` | Chart or measure label visibility and supported label settings. |
@@ -1061,6 +1062,7 @@ Trend chart with sorting, query limiting, dual measure axes, labels, legend, and
1061
1062
  **Constraints and semantics**
1062
1063
 
1063
1064
  - Each measure may select the primary or secondary axis using its axis property.
1065
+ - Clicking a point, the line near a point or an axis label selects its axis value. Set presentation.selectOnClick to false to turn this off; when it is omitted, a selectOnClick already set on the base vSpec is kept.
1064
1066
  - Data labels are off unless presentation.dataLabels.visible is true. Visible labels require dataPointShape on every measure.
1065
1067
  - presentation.axes.primaryMeasure.bands shades the plot between two primary measure axis values; start and end are measure values, and the bands replace any on the base vSpec.
1066
1068
  - Set range on a measure axis to fix its min, max, or both, for example to give several charts one shared scale. To keep an auto-fitted axis anchored at zero, leave both unset and put startsAtZero inside range, not on the axis itself: "primaryMeasure": { "range": { "startsAtZero": true } }. Set inverted on a measure axis to reverse its values, for example to put rank 1 at the top.
@@ -1,8 +1,8 @@
1
1
  import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Na as t } from "./visualization-filters-BwS0xUqs.js";
3
- import { Br as n, G as r, ci as i, cn as a, li as o } from "./utils-BdJrEeIQ.js";
2
+ import { Ua as t } from "./visualization-filters-B9qik5_K.js";
3
+ import { G as n, Ur as r, di as i, dn as a, fi as o } from "./utils-CUKgR7it.js";
4
4
  import { i as s, u as c } from "./responsive.styles-FItb913l.js";
5
- var l = /* @__PURE__ */ e(o()), u = n(), d = r({
5
+ var l = /* @__PURE__ */ e(o()), u = r(), d = n({
6
6
  container: {
7
7
  display: "flex",
8
8
  fontSize: "14px"
@@ -1,8 +1,8 @@
1
1
  import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Br as t, Dt as n, K as r, Ot as i, Z as a, at as o, li as s } from "./utils-BdJrEeIQ.js";
3
- import { _ as c, a as l, c as u, d, l as f, m as p, n as m, u as h, v as g } from "./react-dom-BjsCbYHq.js";
4
- import { t as _ } from "./isFocusVisible-C1nlVUwL.js";
5
- import { d as v, f as y, h as b, m as x, u as S, y as C } from "./Title-BmvwZYkh.js";
2
+ import { Dt as t, K as n, Ot as r, Ur as i, Z as a, at as o, fi as s } from "./utils-CUKgR7it.js";
3
+ import { _ as c, a as l, c as u, d, l as f, m as p, n as m, u as h, v as g } from "./react-dom-CfuL-m78.js";
4
+ import { t as _ } from "./isFocusVisible-Czm70MGc.js";
5
+ import { d as v, f as y, h as b, m as x, u as S, y as C } from "./Title-m5damhc0.js";
6
6
  import { p as w } from "./responsive.styles-FItb913l.js";
7
7
  var T = /* @__PURE__ */ e(s(), 1);
8
8
  function E(e) {
@@ -124,7 +124,7 @@ function j() {
124
124
  });
125
125
  return n.resolve = e, n.reject = t, n;
126
126
  }
127
- var M = t();
127
+ var M = i();
128
128
  function N(e) {
129
129
  let { className: t, classes: n, pulsate: r = !1, rippleX: i, rippleY: a, rippleSize: s, in: c, onExited: l, timeout: u } = e, [d, f] = T.useState(!1), p = S(), m = T.useRef(!1), h = T.useRef(l);
130
130
  h.current = l;
@@ -192,7 +192,7 @@ function te({ event: e, element: t, center: n }) {
192
192
  rippleSize: o
193
193
  };
194
194
  }
195
- var ne = i`
195
+ var ne = r`
196
196
  0% {
197
197
  transform: scale(0);
198
198
  opacity: 0.1;
@@ -202,7 +202,7 @@ var ne = i`
202
202
  transform: scale(1);
203
203
  opacity: 0.3;
204
204
  }
205
- `, z = i`
205
+ `, z = r`
206
206
  0% {
207
207
  opacity: 1;
208
208
  }
@@ -210,7 +210,7 @@ var ne = i`
210
210
  100% {
211
211
  opacity: 0;
212
212
  }
213
- `, re = i`
213
+ `, re = r`
214
214
  0% {
215
215
  transform: scale(1);
216
216
  }
@@ -225,7 +225,7 @@ var ne = i`
225
225
  `;
226
226
  function ie(e) {
227
227
  if (e.motion.reducedMotion === "always") return null;
228
- let t = n`
228
+ let n = t`
229
229
  &.${P.rippleVisible} {
230
230
  animation-name: ${ne};
231
231
  animation-duration: ${F}ms;
@@ -250,11 +250,11 @@ function ie(e) {
250
250
  animation-delay: 200ms;
251
251
  }
252
252
  `;
253
- return e.motion.reducedMotion === "system" ? n`
253
+ return e.motion.reducedMotion === "system" ? t`
254
254
  @media (prefers-reduced-motion: no-preference) {
255
- ${t}
255
+ ${n}
256
256
  }
257
- ` : t;
257
+ ` : n;
258
258
  }
259
259
  var B = d("span", {
260
260
  name: "MuiTouchRipple",
@@ -311,10 +311,10 @@ var B = d("span", {
311
311
 
312
312
  ${({ theme: e }) => ie(e)}
313
313
  `, ae = /*#__PURE__*/ T.forwardRef(function(e, t) {
314
- let n = f({
314
+ let r = f({
315
315
  props: e,
316
316
  name: "MuiTouchRipple"
317
- }), i = y(r().motion.reducedMotion, !1), { center: a = !1, classes: s = I, className: c, ...l } = n, [u, d] = T.useState({
317
+ }), i = y(n().motion.reducedMotion, !1), { center: a = !1, classes: s = I, className: c, ...l } = r, [u, d] = T.useState({
318
318
  items: L,
319
319
  order: L
320
320
  }), p = u.items, m = T.useRef(0), h = T.useRef(null), g = T.useRef(!1);
@@ -590,7 +590,7 @@ c("MuiCircularProgress", [
590
590
  "circle",
591
591
  "circleDisableShrink"
592
592
  ]);
593
- var q = 44, J = i`
593
+ var q = 44, J = r`
594
594
  0% {
595
595
  transform: rotate(0deg);
596
596
  }
@@ -598,7 +598,7 @@ var q = 44, J = i`
598
598
  100% {
599
599
  transform: rotate(360deg);
600
600
  }
601
- `, Y = i`
601
+ `, Y = r`
602
602
  0% {
603
603
  stroke-dasharray: 1px, 200px;
604
604
  stroke-dashoffset: 0;
@@ -613,9 +613,9 @@ var q = 44, J = i`
613
613
  stroke-dasharray: 1px, 200px;
614
614
  stroke-dashoffset: -126px;
615
615
  }
616
- `, X = typeof J == "string" ? null : n`
616
+ `, X = typeof J == "string" ? null : t`
617
617
  animation: ${J} 1.4s linear infinite;
618
- `, Z = typeof Y == "string" ? null : n`
618
+ `, Z = typeof Y == "string" ? null : t`
619
619
  animation: ${Y} 1.4s ease-in-out infinite;
620
620
  `, ce = (e) => {
621
621
  let { classes: t, variant: n, color: r, disableShrink: i } = e;
@@ -0,0 +1,22 @@
1
+ import { Cr as e, Sr as t, Tr as n, Ur as r, _r as i, br as a, gr as o, hr as s, mr as c, pr as l, vr as u, wr as d, xr as f, yr as p } from "./utils-CUKgR7it.js";
2
+ import { s as m } from "./logger-Cioob-QV.js";
3
+ var h = m(), g = r(), _ = ({ fieldType: r, fill: m, isBucketing: _ }) => {
4
+ if (_) return /* @__PURE__ */ (0, g.jsx)(d, { fill: m });
5
+ switch (r) {
6
+ case h.FieldType.BOOLEAN: return /* @__PURE__ */ (0, g.jsx)(n, { fill: m });
7
+ case h.FieldType.DATE: return /* @__PURE__ */ (0, g.jsx)(e, { fill: m });
8
+ case h.FieldType.DECIMAL: return /* @__PURE__ */ (0, g.jsx)(t, { fill: m });
9
+ case h.FieldType.FLOAT: return /* @__PURE__ */ (0, g.jsx)(f, { fill: m });
10
+ case h.FieldType.GROUPED_DIMENSION: return /* @__PURE__ */ (0, g.jsx)(p, { fill: m });
11
+ case h.FieldType.INT: return /* @__PURE__ */ (0, g.jsx)(u, { fill: m });
12
+ case h.FieldType.JSON: return /* @__PURE__ */ (0, g.jsx)(i, { fill: m });
13
+ case h.FieldType.REAL: return /* @__PURE__ */ (0, g.jsx)(u, { fill: m });
14
+ case h.FieldType.STRING: return /* @__PURE__ */ (0, g.jsx)(o, { fill: m });
15
+ case h.FieldType.TIME: return /* @__PURE__ */ (0, g.jsx)(s, { fill: m });
16
+ case h.FieldType.TIMESTAMP: return /* @__PURE__ */ (0, g.jsx)(c, { fill: m });
17
+ case h.FieldType.TIMESTAMP_TZ: return /* @__PURE__ */ (0, g.jsx)(l, { fill: m });
18
+ case h.FieldType.GEOGRAPHY: return /* @__PURE__ */ (0, g.jsx)(a, { fill: m });
19
+ default: return null;
20
+ }
21
+ };
22
+ export { _ as t };
@@ -1,6 +1,6 @@
1
1
  import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Br as t, Dt as n, Ot as r, at as i, et as a, li as o } from "./utils-BdJrEeIQ.js";
3
- import { _ as s, a as c, c as l, d as u, l as d, m as f, n as p, u as m, v as h } from "./react-dom-BjsCbYHq.js";
2
+ import { Dt as t, Ot as n, Ur as r, at as i, et as a, fi as o } from "./utils-CUKgR7it.js";
3
+ import { _ as s, a as c, c as l, d as u, l as d, m as f, n as p, u as m, v as h } from "./react-dom-CfuL-m78.js";
4
4
  import { p as g } from "./responsive.styles-FItb913l.js";
5
5
  var _ = /* @__PURE__ */ e(o(), 1);
6
6
  function v(e) {
@@ -18,7 +18,7 @@ var y = s("MuiLinearProgress", [
18
18
  "bar",
19
19
  "bar1",
20
20
  "bar2"
21
- ]), b = t(), x = 4, S = {}, C = r`
21
+ ]), b = r(), x = 4, S = {}, C = n`
22
22
  0% {
23
23
  left: -35%;
24
24
  right: 100%;
@@ -33,9 +33,9 @@ var y = s("MuiLinearProgress", [
33
33
  left: 100%;
34
34
  right: -90%;
35
35
  }
36
- `, w = typeof C == "string" ? null : n`
36
+ `, w = typeof C == "string" ? null : t`
37
37
  animation: ${C} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
38
- `, T = r`
38
+ `, T = n`
39
39
  0% {
40
40
  left: -200%;
41
41
  right: 100%;
@@ -50,9 +50,9 @@ var y = s("MuiLinearProgress", [
50
50
  left: 107%;
51
51
  right: -8%;
52
52
  }
53
- `, E = typeof T == "string" ? null : n`
53
+ `, E = typeof T == "string" ? null : t`
54
54
  animation: ${T} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
55
- `, D = r`
55
+ `, D = n`
56
56
  0% {
57
57
  opacity: 1;
58
58
  background-position: 0 -23px;
@@ -67,7 +67,7 @@ var y = s("MuiLinearProgress", [
67
67
  opacity: 1;
68
68
  background-position: -200px -23px;
69
69
  }
70
- `, O = typeof D == "string" ? null : n`
70
+ `, O = typeof D == "string" ? null : t`
71
71
  animation: ${D} 3s infinite linear;
72
72
  `, k = (e) => {
73
73
  let { classes: t, variant: n, color: r } = e;