@astrato-io/visualizations 0.10.0 → 0.11.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 (138) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/README.md +22 -4
  3. package/THIRD_PARTY_NOTICES.md +494 -0
  4. package/VISUALIZATION_DEFINITIONS.md +59 -145
  5. package/chunks/{Button-CCF851ea.js → Button-CPG4WX8X.js} +3 -3
  6. package/chunks/{CircularProgress-yupH6YWs.js → CircularProgress-PSLW8HmD.js} +12 -12
  7. package/chunks/FieldTypeIcon-5k2bkqd0.js +22 -0
  8. package/chunks/{LinearProgress-CyFjN4px.js → LinearProgress-KQ2EQlGL.js} +16 -16
  9. package/chunks/{MenuOption-CQpT79AP.js → MenuOption-B-6K7kks.js} +151 -151
  10. package/chunks/{Title-C-p4ZarD.js → Title-BmvwZYkh.js} +32 -32
  11. package/chunks/{_createAggregator-BF4qG9XK.js → _createAggregator-CFmH6gUN.js} +11 -11
  12. package/chunks/{app-filter-bar.compiler-8fxCo2q7.js → app-filter-bar.compiler-BY5-T16I.js} +8 -8
  13. package/chunks/{bar-layout-DStC-GNV.js → bar-layout-BNou0dZF.js} +2 -2
  14. package/chunks/{bar.compiler-CQAu8KL8.js → bar.compiler-BkhO7sDd.js} +55 -53
  15. package/chunks/{builder-CScg1TOS.js → builder-CNjuqD2z.js} +107 -56
  16. package/chunks/category-axis-D1OVyMrr.js +20 -0
  17. package/chunks/{coloring-9jU3s_-p.js → coloring-BOiP0rmn.js} +54 -54
  18. package/chunks/{createSimplePaletteValueFilter-C4hZpCdn.js → createSimplePaletteValueFilter-BkgQ7MFE.js} +166 -166
  19. package/chunks/defaults-B5_8S-J-.js +3 -0
  20. package/chunks/{definitions-C4grxhye.js → definitions-AS9GcavE.js} +263 -242
  21. package/chunks/{escobar-CjirINHP.js → escobar-cQ1eQ64G.js} +8528 -8461
  22. package/chunks/{extend-preset-D-l9u_we.js → extend-preset-BlCbcXKR.js} +421 -421
  23. package/chunks/{filter.compiler-lji2Acgn.js → filter.compiler-CI7dDNM1.js} +12 -12
  24. package/chunks/{filtering-C1zakrrX.js → filtering-Dwi7hDPZ.js} +263 -263
  25. package/chunks/handlers-C63NVo7i.js +15433 -0
  26. package/chunks/{icon-picker-styles-Bj80ZUBK.js → icon-picker-styles-CBlxEu3s.js} +8 -8
  27. package/chunks/{isEqual-Ch9OEye3.js → isEqual-BdHo6wqq.js} +1 -1
  28. package/chunks/{isFocusVisible-CgMP0qkR.js → isFocusVisible-C1nlVUwL.js} +9 -9
  29. package/chunks/line.compiler-DCv3h42f.js +198 -0
  30. package/chunks/linear-Bq_r9l5S.js +264 -0
  31. package/chunks/{logger-CKRjhSHQ.js → logger-Bc-DqDM_.js} +72 -72
  32. package/chunks/{lookup-BWllin0q.js → lookup-B3tWH2hX.js} +1 -0
  33. package/chunks/{map.compiler-CKzorLgK.js → map.compiler-CRO6XpdI.js} +43 -45
  34. package/chunks/measure-format-default-B6ghxih7.js +22 -0
  35. package/chunks/{metadata-Bb9pTXrq.js → metadata-CtkvZEhS.js} +1 -1
  36. package/chunks/number.compiler-kV4lobCZ.js +57 -0
  37. package/chunks/{operations-DZoY50VX.js → operations-COl9wgqi.js} +9893 -9831
  38. package/chunks/{range-D1BTmFMp.js → range-CMJ5yc5Z.js} +2 -2
  39. package/chunks/{react-dom-Dgv2azN2.js → react-dom-BjsCbYHq.js} +76 -76
  40. package/chunks/{render-wrappers-_P3xwu5A.js → render-wrappers-DFHi3Wkr.js} +1 -1
  41. package/chunks/{requirements-NHNrR8Ie.js → requirements-C5YLmHKe.js} +251 -227
  42. package/chunks/{shared-UitWpq1J.js → shared-DyqxOie0.js} +290 -278
  43. package/chunks/standalone-06i1wmIX.js +6 -0
  44. package/chunks/{standalone-DtBk_iUz.js → standalone-9jrQ3zJT.js} +10 -10
  45. package/chunks/standalone-B6zUvxNQ.js +357 -0
  46. package/chunks/{standalone-Bnnr87pc.js → standalone-BYK2U0Vd.js} +418 -679
  47. package/chunks/standalone-Be5APcVv.js +762 -0
  48. package/chunks/standalone-Bp4G3MDx.js +396 -0
  49. package/chunks/{standalone-CbPk8bKn.js → standalone-BrjtMIdd.js} +132 -132
  50. package/chunks/{standalone-BOzHA_d4.js → standalone-Bsfz5vnJ.js} +57 -57
  51. package/chunks/standalone-BuXpKMnc.js +2 -0
  52. package/chunks/standalone-CIjNYyya.js +8378 -0
  53. package/chunks/{standalone-B0U6c3su.js → standalone-CS5VGoja.js} +358 -358
  54. package/chunks/standalone-CUGt2FUF.js +2 -0
  55. package/chunks/{standalone-BapqaniK.js → standalone-ChfEHb28.js} +2299 -1072
  56. package/chunks/standalone-CnF2OYLQ.js +355 -0
  57. package/chunks/standalone-CznEEiq3.js +422 -0
  58. package/chunks/{standalone-Ck63MZzj.js → standalone-D9k5SCd8.js} +165 -165
  59. package/chunks/{standalone-CRdDZYeM.js → standalone-DYVYccmY.js} +855 -855
  60. package/chunks/{standalone-CVknVdUC.js → standalone-DaNxWIKn.js} +27 -27
  61. package/chunks/{standalone-swGs70tD.js → standalone-Db_HNuWx.js} +50 -50
  62. package/chunks/standalone-DcuE8KBa.js +287 -0
  63. package/chunks/{standalone-U0WJwFlG.js → standalone-I5kRIsp8.js} +97 -97
  64. package/chunks/{standalone-BBu90BhK.js → standalone-K2OvRAQM.js} +125 -125
  65. package/chunks/{standalone-DCFY1MAV.js → standalone-c4CPN6ug.js} +4634 -4633
  66. package/chunks/{standalone-ByKKqT5L.js → standalone-iOnJhCvA.js} +302 -302
  67. package/chunks/standalone-pCrzBiTy.js +773 -0
  68. package/chunks/standalone-qrZaimgC.js +689 -0
  69. package/chunks/standalone-yqDJ8h3K.js +1012 -0
  70. package/chunks/{table.compiler-OWSx5MOq.js → table.compiler-CMH_dtYs.js} +29 -29
  71. package/chunks/{useFieldName-B8iCYyw1.js → useFieldName-BfxBzhhH.js} +1 -1
  72. package/chunks/{utils-3Igg6xmO.js → utils-BdJrEeIQ.js} +4037 -4015
  73. package/chunks/{view-DdMLZySj.js → view-Q-_XIrWE.js} +1615 -1615
  74. package/chunks/{visualization-filters-CzvFHE6M.js → visualization-filters-BwS0xUqs.js} +1723 -1693
  75. package/chunks/{with-html-element-DOfkR3C1.js → with-html-element-D_ooGNWI.js} +4006 -3994
  76. package/definitions.js +2 -2
  77. package/docs/operations/astrato-app-filter-bar.md +1 -1
  78. package/docs/operations/bar.md +30 -1
  79. package/docs/operations/combo.md +30 -1
  80. package/docs/operations/date-picker.md +1 -1
  81. package/docs/operations/distribution-gauge.md +1 -1
  82. package/docs/operations/dot.md +1 -1
  83. package/docs/operations/filter.md +1 -1
  84. package/docs/operations/gauge.md +1 -1
  85. package/docs/operations/heatMap.md +1 -1
  86. package/docs/operations/histogram.md +1 -1
  87. package/docs/operations/iframe.md +1 -1
  88. package/docs/operations/image.md +1 -1
  89. package/docs/operations/index.md +5 -4
  90. package/docs/operations/line.md +48 -1
  91. package/docs/operations/map.md +5274 -0
  92. package/docs/operations/number.md +1 -1
  93. package/docs/operations/pie.md +1 -1
  94. package/docs/operations/radar.md +1 -1
  95. package/docs/operations/sankey.md +1 -1
  96. package/docs/operations/scatter.md +1 -1
  97. package/docs/operations/shape.md +1 -1
  98. package/docs/operations/simpleTextObject.md +1 -1
  99. package/docs/operations/slider.md +1 -1
  100. package/docs/operations/table.md +1 -1
  101. package/docs/operations/tree.md +1 -1
  102. package/docs/operations/treemap.md +1 -1
  103. package/docs/operations/waterfall.md +1 -1
  104. package/docs/operations/word-cloud.md +1 -1
  105. package/getters.js +3 -3
  106. package/index.js +528 -504
  107. package/metadata.js +2 -2
  108. package/operations.js +6 -6
  109. package/package.json +73 -68
  110. package/src/definitions/index.d.ts +1 -1
  111. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +34 -53
  112. package/src/definitions/model/definitions/schema-registry.d.ts +2 -2
  113. package/src/definitions/model/definitions/schemas/bar.schema.d.ts +1 -1
  114. package/src/definitions/model/definitions/schemas/broad-chart.schema.d.ts +2 -2
  115. package/src/definitions/model/definitions/schemas/common.schema.d.ts +14 -2
  116. package/src/definitions/model/definitions/schemas/index.d.ts +1 -1
  117. package/src/definitions/model/definitions/schemas/line.schema.d.ts +1 -1
  118. package/src/definitions/model/definitions/types/compilation.types.d.ts +4 -1
  119. package/src/types.d.ts +28 -28
  120. package/src/visualization-catalog.d.ts +3 -0
  121. package/styles.css +1 -1
  122. package/chunks/FieldTypeIcon-D_MzsdfY.js +0 -22
  123. package/chunks/defaults-cyNhn37t.js +0 -3
  124. package/chunks/handlers-ZviIUC-j.js +0 -15387
  125. package/chunks/line.compiler-De5fiKuR.js +0 -198
  126. package/chunks/number.compiler-CaTmJkmi.js +0 -53
  127. package/chunks/standalone-BEekPuA12.js +0 -357
  128. package/chunks/standalone-BR2JuRIC.js +0 -422
  129. package/chunks/standalone-BwJqDj2Z.js +0 -396
  130. package/chunks/standalone-CRfDOO1x.js +0 -287
  131. package/chunks/standalone-DZDGX3aa.js +0 -518
  132. package/chunks/standalone-DhfgeJIk.js +0 -1012
  133. package/chunks/standalone-DibjA73M.js +0 -6
  134. package/chunks/standalone-DxBAyqAu.js +0 -772
  135. package/chunks/standalone-KMQPsNsq.js +0 -2
  136. package/chunks/standalone-MBLSvsrY.js +0 -2
  137. package/chunks/standalone-wgFAVnnm.js +0 -355
  138. package/chunks/standalone-xGV0dqPV.js +0 -689
@@ -39,7 +39,7 @@ A definition does not cover every setting yet. If the chart needs a setting the
39
39
 
40
40
  A definition covers a subset of the operation catalogue. For settings outside it, apply operations to the compiled vSpec with `applyOperations` from `@astrato-io/visualizations/operations`, in one batch and before creating the instance. This runs in memory: it needs no runtime and makes no engine requests.
41
41
 
42
- Use `compilation.resolvedRefs` to resolve a definition `ref`. Dimension and measure references provide `dataItemInternalKey` and `dataItemUniqueSignature`; map layer references provide `kind: 'layer'` and `id` for the operation's `layer` selector. Bar charts return only data-item references, so this known bar definition can use a data-item type assertion. Code handling arbitrary visualization types should narrow references by `kind`.
42
+ Use `compilation.resolvedRefs` to get the data-item identity that operation payloads expect for a definition `ref`. A map also returns `compilation.resolvedLayerRefs`, whose entries have an `id` to pass as the operation's `layer` selector.
43
43
 
44
44
  ```ts
45
45
  import { applyOperations } from '@astrato-io/visualizations/operations';
@@ -107,7 +107,7 @@ Avoid finishing a chart by applying operations one at a time after it is mounted
107
107
  | Type | Name | Data requirements | Supported features |
108
108
  | ------------------------ | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
109
109
  | `map` | Map | Point, shape and heatmap layers require one dimension identifying locations. Connection layers require source and destination dimensions. Location measures use geo for the first location and thirdGeo for a connection destination. For latLng, these are latitude; secondGeo and fourthGeo supply longitude. Shape layers require a GeoJSON measure. Other data layers support latLng, geoPoint or geoHash. Size measures use the size role on point/connection layers. Heat intensity uses the measure role. Background map and image layers have no data bindings. | `dimensions`, `measures`, `filters`, `data-points`, `data-labels`, `object-settings` |
110
- | `bar` | Bar chart | At least one dimension. At least one measure. | `axes`, `axis-bands`, `axis-range`, `axis-scale`, `conditional-coloring`, `data-labels`, `dimensions`, `filters`, `legend`, `measure-axis`, `measures`, `orientation`, `query-limit`, `sorting`, `top-n`, `value-formatting` |
110
+ | `bar` | Bar chart | At least one measure. For a measure-only bar, send `dimensions: []` (the key is still required) with at least one measure. Several measures then stack into one bar unless presentation.layout is groups; a layout already set on the base vSpec is kept when presentation.layout is omitted. | `axes`, `axis-bands`, `axis-range`, `axis-scale`, `conditional-coloring`, `data-labels`, `dimensions`, `filters`, `legend`, `measure-axis`, `measures`, `orientation`, `query-limit`, `sorting`, `top-n`, `value-formatting` |
111
111
  | `combo` | Combo chart | Exactly one dimension. Between one and ten measures. | `dimensions`, `filters`, `measures`, `value-formatting`, `axes`, `axis-bands`, `axis-range`, `axis-scale`, `data-labels`, `legend`, `measure-axis`, `orientation`, `query-limit`, `series-type`, `sorting` |
112
112
  | `distribution-gauge` | Distribution gauge | Zero or one dimension. Between one and twenty measures. | `dimensions`, `filters`, `measures`, `value-formatting`, `conditional-coloring`, `display-mode`, `legend` |
113
113
  | `dot` | Dot chart | Exactly two dimensions. Exactly one measure. | `dimensions`, `filters`, `measures`, `value-formatting`, `conditional-coloring`, `axes`, `axis-range`, `legend`, `orientation` |
@@ -122,7 +122,7 @@ Avoid finishing a chart by applying operations one at a time after it is mounted
122
122
  | `sankey` | Sankey chart | Between two and fifteen dimensions. Exactly one measure. | `dimensions`, `filters`, `measures`, `value-formatting`, `conditional-coloring` |
123
123
  | `scatter` | Scatter chart | One or two dimensions. Two or three measures. | `dimensions`, `filters`, `measures`, `value-formatting`, `conditional-coloring`, `axes`, `axis-range`, `legend`, `query-limit`, `sorting` |
124
124
  | `table` | Table | Normal tables require at least one ordered dimension or measure column. Expandable tables require at least one dimension and one measure. Pivot tables require at least one row dimension, one column dimension, and one measure. | `dimensions`, `filters`, `layout`, `measures`, `query-limit`, `sorting`, `table-structure`, `totals`, `value-formatting` |
125
- | `waterfall` | Waterfall chart | Between one and one hundred measures. | `axes`, `axis-bands`, `axis-range`, `data-labels`, `filters`, `measures`, `orientation`, `value-formatting` |
125
+ | `waterfall` | Waterfall chart | No dimensions and between one and one hundred measures, or exactly one dimension and exactly two measures. | `axes`, `axis-bands`, `axis-range`, `data-labels`, `dimensions`, `filters`, `measures`, `orientation`, `value-formatting` |
126
126
  | `word-cloud` | Word cloud | Exactly one dimension. Exactly one measure. | `dimensions`, `filters`, `measures`, `value-formatting`, `conditional-coloring` |
127
127
  | `date-picker` | Date picker | Exactly one field. | `dimensions`, `filter-settings` |
128
128
  | `filter` | Filter | Exactly one field. | `dimensions`, `filter-settings` |
@@ -154,7 +154,7 @@ Layered geographic visualization with background maps, images, points, shapes, h
154
154
 
155
155
  - There is no fixed layer-count limit. Layers are ordered topmost first. Include a background map explicitly; the default basemap is replaced by the declared layers.
156
156
  - Layer and data-item references share one namespace and must all be unique across the definition. Display names may repeat.
157
- - resolvedRefs contains both layer and data-item references. A layer entry has kind "layer" and id; pass that id as the layer selector in map operations. Dimension and measure entries retain their data-item keys. Check kind before accessing an entry.
157
+ - resolvedRefs contains the data-item references. resolvedLayerRefs contains the layer references; pass the id of a layer entry as the layer selector in map operations.
158
158
  - Raw measure fields require an available aggregation. Semantic measures and calculations supply their own aggregation.
159
159
  - Assign each measure role at most once per layer. Set sizing.sizeType to byMeasurePixels/byMeasureDistance to use a size measure, or value.type to byMeasure to use heat intensity.
160
160
  - Definitions cover initial data bindings, static filters, view and basic presentation. Additional styling and interactions use the existing map operations.
@@ -423,8 +423,8 @@ Categorical comparison chart with sorting, limiting, per-measure axes, labels, l
423
423
 
424
424
  **Data requirements**
425
425
 
426
- - At least one dimension.
427
426
  - At least one measure.
427
+ - For a measure-only bar, send `dimensions: []` (the key is still required) with at least one measure. Several measures then stack into one bar unless presentation.layout is groups; a layout already set on the base vSpec is kept when presentation.layout is omitted.
428
428
 
429
429
  **Supported features**
430
430
 
@@ -457,10 +457,6 @@ Categorical comparison chart with sorting, limiting, per-measure axes, labels, l
457
457
  {
458
458
  "aggregation": "SUM",
459
459
  "fieldKey": "[Cars].[Sales In Thousands]",
460
- "format": {
461
- "formatType": "number2Decimal",
462
- "negativeType": "parenthesis"
463
- },
464
460
  "ref": "sales",
465
461
  "dataLabels": {
466
462
  "placements": ["outside", "inside"],
@@ -549,10 +545,6 @@ Categorical comparison chart with sorting, limiting, per-measure axes, labels, l
549
545
  {
550
546
  "aggregation": "SUM",
551
547
  "fieldKey": "[Cars].[Sales In Thousands]",
552
- "format": {
553
- "formatType": "number2Decimal",
554
- "negativeType": "parenthesis"
555
- },
556
548
  "ref": "sales"
557
549
  }
558
550
  ]
@@ -624,10 +616,6 @@ Combined categorical chart supporting multiple measures, per-measure axes, sorti
624
616
  {
625
617
  "aggregation": "SUM",
626
618
  "fieldKey": "[Cars].[Sales In Thousands]",
627
- "format": {
628
- "formatType": "number2Decimal",
629
- "negativeType": "parenthesis"
630
- },
631
619
  "ref": "sales",
632
620
  "dataLabels": {
633
621
  "visible": true
@@ -637,10 +625,6 @@ Combined categorical chart supporting multiple measures, per-measure axes, sorti
637
625
  {
638
626
  "aggregation": "AVG",
639
627
  "fieldKey": "[Cars].[Horsepower]",
640
- "format": {
641
- "formatType": "number2Decimal",
642
- "negativeType": "parenthesis"
643
- },
644
628
  "ref": "horsepower",
645
629
  "axis": "secondary",
646
630
  "seriesType": "line"
@@ -727,19 +711,11 @@ Gauge distribution across one or more values, optionally grouped by a dimension.
727
711
  {
728
712
  "aggregation": "SUM",
729
713
  "fieldKey": "[Cars].[Sales In Thousands]",
730
- "format": {
731
- "formatType": "number2Decimal",
732
- "negativeType": "parenthesis"
733
- },
734
714
  "ref": "sales"
735
715
  },
736
716
  {
737
717
  "aggregation": "AVG",
738
718
  "fieldKey": "[Cars].[Sales In Thousands]",
739
- "format": {
740
- "formatType": "number2Decimal",
741
- "negativeType": "parenthesis"
742
- },
743
719
  "ref": "averageSales"
744
720
  }
745
721
  ]
@@ -804,10 +780,6 @@ Dot comparison using two categorical dimensions and one measure.
804
780
  {
805
781
  "aggregation": "SUM",
806
782
  "fieldKey": "[Cars].[Sales In Thousands]",
807
- "format": {
808
- "formatType": "number2Decimal",
809
- "negativeType": "parenthesis"
810
- },
811
783
  "ref": "sales"
812
784
  }
813
785
  ]
@@ -881,19 +853,11 @@ Gauge values with an optional grouping dimension and optional data target.
881
853
  {
882
854
  "aggregation": "SUM",
883
855
  "fieldKey": "[Cars].[Sales In Thousands]",
884
- "format": {
885
- "formatType": "number2Decimal",
886
- "negativeType": "parenthesis"
887
- },
888
856
  "ref": "sales"
889
857
  },
890
858
  {
891
859
  "aggregation": "AVG",
892
860
  "fieldKey": "[Cars].[Sales In Thousands]",
893
- "format": {
894
- "formatType": "number2Decimal",
895
- "negativeType": "parenthesis"
896
- },
897
861
  "ref": "targetSales"
898
862
  }
899
863
  ]
@@ -958,19 +922,11 @@ Two-dimensional matrix colored and optionally sized by measures.
958
922
  {
959
923
  "aggregation": "SUM",
960
924
  "fieldKey": "[Cars].[Sales In Thousands]",
961
- "format": {
962
- "formatType": "number2Decimal",
963
- "negativeType": "parenthesis"
964
- },
965
925
  "ref": "sales"
966
926
  },
967
927
  {
968
928
  "aggregation": "AVG",
969
929
  "fieldKey": "[Cars].[Horsepower]",
970
- "format": {
971
- "formatType": "number2Decimal",
972
- "negativeType": "parenthesis"
973
- },
974
930
  "ref": "horsepower"
975
931
  }
976
932
  ]
@@ -1105,7 +1061,7 @@ Trend chart with sorting, query limiting, dual measure axes, labels, legend, and
1105
1061
  **Constraints and semantics**
1106
1062
 
1107
1063
  - Each measure may select the primary or secondary axis using its axis property.
1108
- - Visible data labels require dataPointShape on every measure.
1064
+ - Data labels are off unless presentation.dataLabels.visible is true. Visible labels require dataPointShape on every measure.
1109
1065
  - 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.
1110
1066
  - 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.
1111
1067
  - Set scale to log on a measure axis to draw it logarithmically, with gridlines at powers of ten. Zero and negative values are drawn at the floor of a log axis.
@@ -1131,10 +1087,6 @@ Trend chart with sorting, query limiting, dual measure axes, labels, legend, and
1131
1087
  {
1132
1088
  "aggregation": "SUM",
1133
1089
  "fieldKey": "[Cars].[Sales In Thousands]",
1134
- "format": {
1135
- "formatType": "number2Decimal",
1136
- "negativeType": "parenthesis"
1137
- },
1138
1090
  "ref": "sales",
1139
1091
  "axis": "primary",
1140
1092
  "dataPointShape": "circle"
@@ -1142,10 +1094,6 @@ Trend chart with sorting, query limiting, dual measure axes, labels, legend, and
1142
1094
  {
1143
1095
  "aggregation": "AVG",
1144
1096
  "fieldKey": "[Cars].[Horsepower]",
1145
- "format": {
1146
- "formatType": "number2Decimal",
1147
- "negativeType": "parenthesis"
1148
- },
1149
1097
  "ref": "horsepower",
1150
1098
  "axis": "secondary",
1151
1099
  "dataPointShape": "square"
@@ -1183,10 +1131,6 @@ Trend chart with sorting, query limiting, dual measure axes, labels, legend, and
1183
1131
  "titleVisible": true
1184
1132
  }
1185
1133
  },
1186
- "dataLabels": {
1187
- "density": "medium",
1188
- "visible": true
1189
- },
1190
1134
  "legend": {
1191
1135
  "position": "right",
1192
1136
  "title": "Cars comparison",
@@ -1222,10 +1166,6 @@ Trend chart with sorting, query limiting, dual measure axes, labels, legend, and
1222
1166
  {
1223
1167
  "aggregation": "SUM",
1224
1168
  "fieldKey": "[Cars].[Sales In Thousands]",
1225
- "format": {
1226
- "formatType": "number2Decimal",
1227
- "negativeType": "parenthesis"
1228
- },
1229
1169
  "ref": "sales",
1230
1170
  "dataPointShape": "circle"
1231
1171
  }
@@ -1267,10 +1207,6 @@ Trend chart with sorting, query limiting, dual measure axes, labels, legend, and
1267
1207
  {
1268
1208
  "aggregation": "SUM",
1269
1209
  "fieldKey": "[Cars].[Sales In Thousands]",
1270
- "format": {
1271
- "formatType": "number2Decimal",
1272
- "negativeType": "parenthesis"
1273
- },
1274
1210
  "ref": "sales",
1275
1211
  "dataPointShape": "circle"
1276
1212
  }
@@ -1326,10 +1262,6 @@ Radial comparison chart for one or more measures with optional categorical dimen
1326
1262
  {
1327
1263
  "aggregation": "SUM",
1328
1264
  "fieldKey": "[Cars].[Sales In Thousands]",
1329
- "format": {
1330
- "formatType": "number2Decimal",
1331
- "negativeType": "parenthesis"
1332
- },
1333
1265
  "ref": "sales"
1334
1266
  }
1335
1267
  ]
@@ -1388,10 +1320,6 @@ Part-to-whole chart with optional secondary radial measure.
1388
1320
  {
1389
1321
  "aggregation": "SUM",
1390
1322
  "fieldKey": "[Cars].[Sales In Thousands]",
1391
- "format": {
1392
- "formatType": "number2Decimal",
1393
- "negativeType": "parenthesis"
1394
- },
1395
1323
  "ref": "sales"
1396
1324
  }
1397
1325
  ]
@@ -1444,10 +1372,6 @@ Part-to-whole chart with optional secondary radial measure.
1444
1372
  {
1445
1373
  "aggregation": "SUM",
1446
1374
  "fieldKey": "[Cars].[Sales In Thousands]",
1447
- "format": {
1448
- "formatType": "number2Decimal",
1449
- "negativeType": "parenthesis"
1450
- },
1451
1375
  "ref": "sales"
1452
1376
  }
1453
1377
  ]
@@ -1512,10 +1436,6 @@ Hierarchical tree built from dimensions, measures, or both.
1512
1436
  {
1513
1437
  "aggregation": "SUM",
1514
1438
  "fieldKey": "[Cars].[Sales In Thousands]",
1515
- "format": {
1516
- "formatType": "number2Decimal",
1517
- "negativeType": "parenthesis"
1518
- },
1519
1439
  "ref": "sales"
1520
1440
  }
1521
1441
  ]
@@ -1588,10 +1508,6 @@ Hierarchical area chart using ordered dimensions and one size measure.
1588
1508
  {
1589
1509
  "aggregation": "SUM",
1590
1510
  "fieldKey": "[Cars].[Sales In Thousands]",
1591
- "format": {
1592
- "formatType": "number2Decimal",
1593
- "negativeType": "parenthesis"
1594
- },
1595
1511
  "ref": "sales"
1596
1512
  }
1597
1513
  ]
@@ -1655,10 +1571,6 @@ Flow chart across an ordered sequence of categorical dimensions.
1655
1571
  {
1656
1572
  "aggregation": "SUM",
1657
1573
  "fieldKey": "[Cars].[Sales In Thousands]",
1658
- "format": {
1659
- "formatType": "number2Decimal",
1660
- "negativeType": "parenthesis"
1661
- },
1662
1574
  "ref": "sales"
1663
1575
  }
1664
1576
  ]
@@ -1699,10 +1611,6 @@ Flow chart across an ordered sequence of categorical dimensions.
1699
1611
  {
1700
1612
  "aggregation": "SUM",
1701
1613
  "fieldKey": "[Cars].[Sales In Thousands]",
1702
- "format": {
1703
- "formatType": "number2Decimal",
1704
- "negativeType": "parenthesis"
1705
- },
1706
1614
  "ref": "sales"
1707
1615
  }
1708
1616
  ]
@@ -1759,28 +1667,16 @@ Relationship chart using horizontal and vertical measures with optional size and
1759
1667
  {
1760
1668
  "aggregation": "SUM",
1761
1669
  "fieldKey": "[Cars].[Sales In Thousands]",
1762
- "format": {
1763
- "formatType": "number2Decimal",
1764
- "negativeType": "parenthesis"
1765
- },
1766
1670
  "ref": "sales"
1767
1671
  },
1768
1672
  {
1769
1673
  "aggregation": "AVG",
1770
1674
  "fieldKey": "[Cars].[Horsepower]",
1771
- "format": {
1772
- "formatType": "number2Decimal",
1773
- "negativeType": "parenthesis"
1774
- },
1775
1675
  "ref": "horsepower"
1776
1676
  },
1777
1677
  {
1778
1678
  "aggregation": "AVG",
1779
1679
  "fieldKey": "[Cars].[Sales In Thousands]",
1780
- "format": {
1781
- "formatType": "number2Decimal",
1782
- "negativeType": "parenthesis"
1783
- },
1784
1680
  "ref": "size"
1785
1681
  }
1786
1682
  ]
@@ -1869,11 +1765,10 @@ Normal, expandable, or pivot tabular output with formatting, filtering, sorting,
1869
1765
  {
1870
1766
  "aggregation": "SUM",
1871
1767
  "fieldKey": "[Cars].[Sales In Thousands]",
1768
+ "ref": "sales",
1872
1769
  "format": {
1873
- "formatType": "number2Decimal",
1874
- "negativeType": "parenthesis"
1770
+ "formatType": "numberNoDecimal"
1875
1771
  },
1876
- "ref": "sales",
1877
1772
  "role": "measure"
1878
1773
  }
1879
1774
  ],
@@ -1975,10 +1870,6 @@ Normal, expandable, or pivot tabular output with formatting, filtering, sorting,
1975
1870
  {
1976
1871
  "aggregation": "SUM",
1977
1872
  "fieldKey": "[Cars].[Sales In Thousands]",
1978
- "format": {
1979
- "formatType": "number2Decimal",
1980
- "negativeType": "parenthesis"
1981
- },
1982
1873
  "ref": "sales"
1983
1874
  }
1984
1875
  ],
@@ -2023,10 +1914,6 @@ Normal, expandable, or pivot tabular output with formatting, filtering, sorting,
2023
1914
  {
2024
1915
  "aggregation": "SUM",
2025
1916
  "fieldKey": "[Cars].[Sales In Thousands]",
2026
- "format": {
2027
- "formatType": "number2Decimal",
2028
- "negativeType": "parenthesis"
2029
- },
2030
1917
  "ref": "sales"
2031
1918
  }
2032
1919
  ],
@@ -2064,19 +1951,20 @@ Normal, expandable, or pivot tabular output with formatting, filtering, sorting,
2064
1951
 
2065
1952
  ## `waterfall`: Waterfall chart
2066
1953
 
2067
- Sequential contribution chart composed from one or more measures.
1954
+ Sequential contribution chart, or a comparison of two measures across one dimension.
2068
1955
 
2069
1956
  **Data requirements**
2070
1957
 
2071
- - Between one and one hundred measures.
1958
+ - No dimensions and between one and one hundred measures, or exactly one dimension and exactly two measures.
2072
1959
 
2073
1960
  **Supported features**
2074
1961
 
2075
- `axes`, `axis-bands`, `axis-range`, `data-labels`, `filters`, `measures`, `orientation`, `value-formatting`
1962
+ `axes`, `axis-bands`, `axis-range`, `data-labels`, `dimensions`, `filters`, `measures`, `orientation`, `value-formatting`
2076
1963
 
2077
1964
  **Constraints and semantics**
2078
1965
 
2079
- - Dimensions are not supported. Measure order defines the waterfall sequence.
1966
+ - Without a dimension, measure order defines the waterfall sequence. With one dimension, the first measure supplies the opening total, each dimension value contributes the second measure minus the first, and the second measure supplies the closing total.
1967
+ - Comparison totals sum the returned rows, rather than requesting a separate aggregate total. Use two numeric measures with comparable units.
2080
1968
  - Set range on the primary 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 the primary measure axis to reverse its values.
2081
1969
  - 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.
2082
1970
 
@@ -2089,10 +1977,6 @@ Sequential contribution chart composed from one or more measures.
2089
1977
  {
2090
1978
  "aggregation": "SUM",
2091
1979
  "fieldKey": "[Cars].[Sales In Thousands]",
2092
- "format": {
2093
- "formatType": "number2Decimal",
2094
- "negativeType": "parenthesis"
2095
- },
2096
1980
  "ref": "sales",
2097
1981
  "dataLabels": {
2098
1982
  "visible": true
@@ -2101,10 +1985,6 @@ Sequential contribution chart composed from one or more measures.
2101
1985
  {
2102
1986
  "aggregation": "AVG",
2103
1987
  "fieldKey": "[Cars].[Horsepower]",
2104
- "format": {
2105
- "formatType": "number2Decimal",
2106
- "negativeType": "parenthesis"
2107
- },
2108
1988
  "ref": "horsepower",
2109
1989
  "dataLabels": {
2110
1990
  "visible": true
@@ -2145,6 +2025,52 @@ Sequential contribution chart composed from one or more measures.
2145
2025
  }
2146
2026
  ```
2147
2027
 
2028
+ **Additional scenarios**
2029
+
2030
+ ### Compare total and average sales by manufacturer
2031
+
2032
+ ```json
2033
+ {
2034
+ "data": {
2035
+ "dimensions": [
2036
+ {
2037
+ "fieldKey": "[Cars].[Manufacturer]",
2038
+ "ref": "manufacturer"
2039
+ }
2040
+ ],
2041
+ "measures": [
2042
+ {
2043
+ "aggregation": "SUM",
2044
+ "fieldKey": "[Cars].[Sales In Thousands]",
2045
+ "ref": "totalSales"
2046
+ },
2047
+ {
2048
+ "aggregation": "AVG",
2049
+ "fieldKey": "[Cars].[Sales In Thousands]",
2050
+ "ref": "averageSales"
2051
+ }
2052
+ ]
2053
+ },
2054
+ "presentation": {
2055
+ "axes": {
2056
+ "dimension": {
2057
+ "title": "Manufacturer",
2058
+ "titleVisible": true
2059
+ },
2060
+ "primaryMeasure": {
2061
+ "title": "Sales in thousands",
2062
+ "titleVisible": true
2063
+ }
2064
+ },
2065
+ "dataLabels": {
2066
+ "visible": true
2067
+ }
2068
+ },
2069
+ "type": "waterfall",
2070
+ "version": 1
2071
+ }
2072
+ ```
2073
+
2148
2074
  ## `word-cloud`: Word cloud
2149
2075
 
2150
2076
  Weighted word display using one label dimension and one measure.
@@ -2177,10 +2103,6 @@ Weighted word display using one label dimension and one measure.
2177
2103
  {
2178
2104
  "aggregation": "SUM",
2179
2105
  "fieldKey": "[Cars].[Sales In Thousands]",
2180
- "format": {
2181
- "formatType": "number2Decimal",
2182
- "negativeType": "parenthesis"
2183
- },
2184
2106
  "ref": "sales"
2185
2107
  }
2186
2108
  ]
@@ -2368,10 +2290,6 @@ Single aggregated or semantic value with value formatting and static filters.
2368
2290
  "measure": {
2369
2291
  "aggregation": "SUM",
2370
2292
  "fieldKey": "[Cars].[Sales In Thousands]",
2371
- "format": {
2372
- "formatType": "number2Decimal",
2373
- "negativeType": "parenthesis"
2374
- },
2375
2293
  "ref": "sales"
2376
2294
  }
2377
2295
  },
@@ -2400,10 +2318,6 @@ Single aggregated or semantic value with value formatting and static filters.
2400
2318
  "measure": {
2401
2319
  "aggregation": "SUM",
2402
2320
  "fieldKey": "[Cars].[Sales In Thousands]",
2403
- "format": {
2404
- "formatType": "number2Decimal",
2405
- "negativeType": "parenthesis"
2406
- },
2407
2321
  "ref": "sales"
2408
2322
  }
2409
2323
  },
@@ -1,8 +1,8 @@
1
1
  import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Da as t } from "./visualization-filters-CzvFHE6M.js";
3
- import { W as n, ci as r, si as i, sn as a, zr as o } from "./utils-3Igg6xmO.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";
4
4
  import { i as s, u as c } from "./responsive.styles-FItb913l.js";
5
- var l = /* @__PURE__ */ e(r()), u = o(), d = n({
5
+ var l = /* @__PURE__ */ e(o()), u = n(), d = r({
6
6
  container: {
7
7
  display: "flex",
8
8
  fontSize: "14px"
@@ -1,10 +1,10 @@
1
1
  import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Dt as t, Et as n, G as r, X as i, ci as a, it as o, zr as s } from "./utils-3Igg6xmO.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-Dgv2azN2.js";
4
- import { t as _ } from "./isFocusVisible-CgMP0qkR.js";
5
- import { d as v, f as y, h as b, m as x, u as S, y as C } from "./Title-C-p4ZarD.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";
6
6
  import { p as w } from "./responsive.styles-FItb913l.js";
7
- var T = /* @__PURE__ */ e(a(), 1);
7
+ var T = /* @__PURE__ */ e(s(), 1);
8
8
  function E(e) {
9
9
  let { focusableWhenDisabled: t, disabled: n, composite: r = !1, tabIndex: i = 0, isNativeButton: a } = e, o = r && t !== !1, s = r && t === !1;
10
10
  return T.useMemo(() => {
@@ -124,7 +124,7 @@ function j() {
124
124
  });
125
125
  return n.resolve = e, n.reject = t, n;
126
126
  }
127
- var M = s();
127
+ var M = t();
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 = t`
195
+ var ne = i`
196
196
  0% {
197
197
  transform: scale(0);
198
198
  opacity: 0.1;
@@ -202,7 +202,7 @@ var ne = t`
202
202
  transform: scale(1);
203
203
  opacity: 0.3;
204
204
  }
205
- `, z = t`
205
+ `, z = i`
206
206
  0% {
207
207
  opacity: 1;
208
208
  }
@@ -210,7 +210,7 @@ var ne = t`
210
210
  100% {
211
211
  opacity: 0;
212
212
  }
213
- `, re = t`
213
+ `, re = i`
214
214
  0% {
215
215
  transform: scale(1);
216
216
  }
@@ -477,7 +477,7 @@ var U = c("MuiButtonBase", [
477
477
  variants: [{
478
478
  props: { internalDisabledThemeFocusVisible: !1 },
479
479
  style: e.focusVisible && {
480
- ...i,
480
+ ...a,
481
481
  [`&.${U.focusVisible}`]: e.focusVisible
482
482
  }
483
483
  }]
@@ -590,7 +590,7 @@ c("MuiCircularProgress", [
590
590
  "circle",
591
591
  "circleDisableShrink"
592
592
  ]);
593
- var q = 44, J = t`
593
+ var q = 44, J = i`
594
594
  0% {
595
595
  transform: rotate(0deg);
596
596
  }
@@ -598,7 +598,7 @@ var q = 44, J = t`
598
598
  100% {
599
599
  transform: rotate(360deg);
600
600
  }
601
- `, Y = t`
601
+ `, Y = i`
602
602
  0% {
603
603
  stroke-dasharray: 1px, 200px;
604
604
  stroke-dashoffset: 0;
@@ -0,0 +1,22 @@
1
+ import { Br as e, Sr as t, _r as n, br as r, dr as i, fr as a, gr as o, hr as s, mr as c, pr as l, ur as u, vr as d, xr as f, yr as p } from "./utils-BdJrEeIQ.js";
2
+ import { s as m } from "./logger-Bc-DqDM_.js";
3
+ var h = m(), g = e(), _ = ({ fieldType: e, fill: m, isBucketing: _ }) => {
4
+ if (_) return /* @__PURE__ */ (0, g.jsx)(f, { fill: m });
5
+ switch (e) {
6
+ case h.FieldType.BOOLEAN: return /* @__PURE__ */ (0, g.jsx)(t, { fill: m });
7
+ case h.FieldType.DATE: return /* @__PURE__ */ (0, g.jsx)(r, { fill: m });
8
+ case h.FieldType.DECIMAL: return /* @__PURE__ */ (0, g.jsx)(p, { fill: m });
9
+ case h.FieldType.FLOAT: return /* @__PURE__ */ (0, g.jsx)(d, { fill: m });
10
+ case h.FieldType.GROUPED_DIMENSION: return /* @__PURE__ */ (0, g.jsx)(o, { fill: m });
11
+ case h.FieldType.INT: return /* @__PURE__ */ (0, g.jsx)(s, { fill: m });
12
+ case h.FieldType.JSON: return /* @__PURE__ */ (0, g.jsx)(c, { fill: m });
13
+ case h.FieldType.REAL: return /* @__PURE__ */ (0, g.jsx)(s, { fill: m });
14
+ case h.FieldType.STRING: return /* @__PURE__ */ (0, g.jsx)(l, { fill: m });
15
+ case h.FieldType.TIME: return /* @__PURE__ */ (0, g.jsx)(a, { fill: m });
16
+ case h.FieldType.TIMESTAMP: return /* @__PURE__ */ (0, g.jsx)(i, { fill: m });
17
+ case h.FieldType.TIMESTAMP_TZ: return /* @__PURE__ */ (0, g.jsx)(u, { fill: m });
18
+ case h.FieldType.GEOGRAPHY: return /* @__PURE__ */ (0, g.jsx)(n, { fill: m });
19
+ default: return null;
20
+ }
21
+ };
22
+ export { _ as t };