@astrato-io/visualizations 0.9.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +7 -3
- package/THIRD_PARTY_NOTICES.md +163 -14
- package/VISUALIZATION_DEFINITIONS.md +376 -36
- package/chunks/{Button-5CxPEACP.js → Button-Dn3rJrYf.js} +4 -4
- package/chunks/{CircularProgress-DFS-LQb7.js → CircularProgress-BFeu06Yb.js} +39 -39
- package/chunks/FieldTypeIcon-DrMoGpHJ.js +22 -0
- package/chunks/{LinearProgress-CjIQfkNA.js → LinearProgress-ClO6GUjN.js} +9 -9
- package/chunks/{MenuOption-Cb7B7x6z.js → MenuOption-Czc34u4q.js} +143 -142
- package/chunks/{Title-CtFw1bVg.js → Title-BgYnaVTR.js} +22 -22
- package/chunks/_createAggregator-BMu9uRax.js +50 -0
- package/chunks/{app-filter-bar.compiler-B9775gLJ.js → app-filter-bar.compiler-CVir0wkl.js} +10 -10
- package/chunks/bar-layout-C_UgRlVl.js +9 -0
- package/chunks/{bar.compiler-B7wlH_Ro.js → bar.compiler-DYuFdi9J.js} +100 -82
- package/chunks/{builder-Dxo7D7c6.js → builder-C-TKA-My.js} +70 -37
- package/chunks/color-rules-DYJL4fIW.js +15 -0
- package/chunks/color-settings-DJFoFTip.js +5 -0
- package/chunks/{coloring-B-Wa8D5P.js → coloring-BtnPiQ_o.js} +37 -37
- package/chunks/createSimplePaletteValueFilter--zrZxRV9.js +2005 -0
- package/chunks/defaults-Dtk7fg3C.js +3 -0
- package/chunks/{definitions-DNpzD9tY.js → definitions-CT304NDn.js} +655 -417
- package/chunks/{escobar-C4Nm3eJ7.js → escobar-CvEV2ES1.js} +7441 -7127
- package/chunks/{extend-preset-BVKFtoe-.js → extend-preset-D9-JP92b.js} +998 -933
- package/chunks/{filter.compiler-BlS3zoy_.js → filter.compiler-CXeZznks.js} +7 -7
- package/chunks/{filtering-CGuLpg7u.js → filtering-8_bFv-jb.js} +333 -377
- package/chunks/handlers-C6CZ0XJA.js +15399 -0
- package/chunks/{icon-picker-styles-DYQgVEKG.js → icon-picker-styles-BXiJ1SZS.js} +11 -11
- package/chunks/isEqual-D8Ay63xR.js +16 -0
- package/chunks/{isFocusVisible-B1_z03UT.js → isFocusVisible-Bu8gGZu5.js} +1 -1
- package/chunks/label-format-type-C46pzgx7.js +17 -0
- package/chunks/{line.compiler-Bo9i9qag.js → line.compiler-DmHpmQCC.js} +9 -9
- package/chunks/{logger-3lng-wOw.js → logger-DdZpR7xZ.js} +79 -72
- package/chunks/map.compiler-Q_Y1Pvat.js +343 -0
- package/chunks/{metadata-Fmx1swpK.js → metadata-BQm_TXI1.js} +1 -1
- package/chunks/{number.compiler-CdLd5aGW.js → number.compiler-DQdg6zTy.js} +7 -7
- package/chunks/operations-DKQWuLL7.js +31315 -0
- package/chunks/{range-CzO4isKK.js → range-BdhzvYQ_.js} +2 -2
- package/chunks/{react-dom-BwZT0N3F.js → react-dom-BGP4tbXV.js} +70 -70
- package/chunks/{render-wrappers-CAuvgMxi.js → render-wrappers-BZpyDnJy.js} +1 -1
- package/chunks/{requirements-CYpVh65U.js → requirements-e8Fe96ag.js} +60 -58
- package/chunks/shared-C_2F90xq.js +1337 -0
- package/chunks/standalone-4MsKiqs0.js +355 -0
- package/chunks/standalone-B794g9pE.js +1012 -0
- package/chunks/{standalone-C6XDHYAM.js → standalone-B8ZSqauS.js} +110 -110
- package/chunks/{standalone-5DnapeHH.js → standalone-BA2YXyJS.js} +126 -124
- package/chunks/{standalone-CXniic5x.js → standalone-BDrXVxlP.js} +6 -5
- package/chunks/{standalone-B6s_xG2u.js → standalone-BE_ONgiG.js} +116 -116
- package/chunks/{standalone-CPUiiWNP.js → standalone-BTY3w_JA.js} +37 -37
- package/chunks/standalone-BgumbdaJ2.js +357 -0
- package/chunks/{standalone-DWPfdP0A.js → standalone-BkbiH-o8.js} +482 -482
- package/chunks/standalone-Blh4qejk.js +689 -0
- package/chunks/standalone-CXY4FpF7.js +773 -0
- package/chunks/{standalone-BvWdpUL3.js → standalone-CY_kjarf.js} +34 -31
- package/chunks/{standalone-DuwTOBXH.js → standalone-CaTxAydz.js} +587 -587
- package/chunks/{standalone-BDrQMxLi.js → standalone-Cc98Pdr6.js} +1799 -1015
- package/chunks/{standalone-DMCwtebn.js → standalone-Cl0TSfqC.js} +125 -125
- package/chunks/{standalone-CoQxJ6ov.js → standalone-CsoMmE9T.js} +778 -778
- package/chunks/standalone-DH0xTEes.js +2 -0
- package/chunks/{standalone-LFVgLhia.js → standalone-DHRalbVO.js} +311 -303
- package/chunks/standalone-DNh9NcMa.js +580 -0
- package/chunks/standalone-DcnHjNnC.js +2 -0
- package/chunks/{standalone-r4ObFvys.js → standalone-DflyWtuR.js} +217 -215
- package/chunks/standalone-DrHdGkY7.js +762 -0
- package/chunks/standalone-c_rROMtx.js +287 -0
- package/chunks/standalone-drcFLeN6.js +6 -0
- package/chunks/{standalone-CNkHsynO.js → standalone-wOWRCpdn.js} +54 -56
- package/chunks/{standalone-Cu73fzSr.js → standalone-z0o52o5t.js} +5128 -4908
- package/chunks/{table.compiler-C1qjqXaT.js → table.compiler-COaHE9VD.js} +18 -18
- package/chunks/{useFieldName-mWrD_uk_.js → useFieldName-CdnCWzhd.js} +1 -1
- package/chunks/{utils-DYYD4Zzf.js → utils-DganVptf.js} +4758 -4747
- package/chunks/{view-7fH6mGmY.js → view-Bzlros43.js} +2021 -1665
- package/chunks/{visualization-filters-mVnsnvLP.js → visualization-filters-D7i6oh1Z.js} +3177 -2425
- package/chunks/{with-html-element-B0Clt4jY.js → with-html-element-CiIhFEa5.js} +3740 -3547
- package/definitions.js +2 -2
- package/docs/operations/astrato-app-filter-bar.md +1 -1
- package/docs/operations/bar.md +303 -2
- package/docs/operations/combo.md +262 -1
- package/docs/operations/date-picker.md +1 -1
- package/docs/operations/distribution-gauge.md +1 -1
- package/docs/operations/dot.md +148 -1
- package/docs/operations/filter.md +1 -1
- package/docs/operations/gauge.md +1 -1
- package/docs/operations/heatMap.md +1 -1
- package/docs/operations/histogram.md +262 -1
- package/docs/operations/iframe.md +1 -1
- package/docs/operations/image.md +1 -1
- package/docs/operations/index.md +7 -7
- package/docs/operations/line.md +280 -1
- package/docs/operations/number.md +1 -1
- package/docs/operations/pie.md +1 -1
- package/docs/operations/radar.md +1 -1
- package/docs/operations/sankey.md +1 -1
- package/docs/operations/scatter.md +148 -1
- package/docs/operations/shape.md +1 -1
- package/docs/operations/simpleTextObject.md +1 -1
- package/docs/operations/slider.md +1 -1
- package/docs/operations/table.md +374 -157
- package/docs/operations/tree.md +1 -1
- package/docs/operations/treemap.md +1 -1
- package/docs/operations/waterfall.md +1 -1
- package/docs/operations/word-cloud.md +1 -1
- package/getters.js +2 -2
- package/index.js +482 -434
- package/metadata.js +2 -2
- package/operations.js +5 -5
- package/package.json +72 -67
- package/src/definitions/index.d.ts +7 -1
- package/src/definitions/model/definitions/available-fields.d.ts +2 -2
- package/src/definitions/model/definitions/compilers/compile.d.ts +1 -0
- package/src/definitions/model/definitions/data-item-resolution.d.ts +3 -3
- package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +219 -7
- package/src/definitions/model/definitions/index.d.ts +2 -1
- package/src/definitions/model/definitions/schema-registry.d.ts +305 -0
- package/src/definitions/model/definitions/schemas/bar.schema.d.ts +2 -0
- package/src/definitions/model/definitions/schemas/common.schema.d.ts +4 -3
- package/src/definitions/model/definitions/schemas/index.d.ts +1 -0
- package/src/definitions/model/definitions/schemas/map.schema.d.ts +590 -0
- package/src/definitions/model/definitions/types/compilation.types.d.ts +9 -1
- package/src/definitions/model/definitions/types/definition.types.d.ts +2 -2
- package/src/definitions/model/definitions/types/index.d.ts +1 -1
- package/src/index.d.ts +1 -1
- package/src/operations/index.d.ts +1 -1
- package/src/types.d.ts +17 -13
- package/chunks/FieldTypeIcon-pSVQFemC.js +0 -22
- package/chunks/ToggleButton-Br9HCPCv.js +0 -150
- package/chunks/color-rules-CN7TcGrC.js +0 -6
- package/chunks/color-settings-3VRlf_Vw.js +0 -6
- package/chunks/handlers-CMbyj5y1.js +0 -12930
- package/chunks/isEqual-DBg_b35N.js +0 -12
- package/chunks/label-format-type-weq1XfcX.js +0 -8
- package/chunks/operations-HSqnCRvv.js +0 -26324
- package/chunks/shared-DFoJxjVN.js +0 -1218
- package/chunks/standalone-530a5lvf.js +0 -1003
- package/chunks/standalone-B4jrf4KE.js +0 -354
- package/chunks/standalone-BMoJXGYe.js +0 -2
- package/chunks/standalone-BfvGggeM2.js +0 -355
- package/chunks/standalone-CMJJIi9v.js +0 -2
- package/chunks/standalone-C_Jd4gkj.js +0 -6
- package/chunks/standalone-CiaaibTa.js +0 -518
- package/chunks/standalone-DBeXQrwH.js +0 -468
- package/chunks/standalone-DpSRmAWx.js +0 -287
- package/chunks/standalone-kzAhwH19.js +0 -689
- package/chunks/standalone-mb7LwEiq.js +0 -3874
- /package/chunks/{src-BOS6SqkZ2.js → src-BOS6SqkZ.js} +0 -0
|
@@ -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 get the data-item identity that operation payloads expect for a definition `ref
|
|
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';
|
|
@@ -102,44 +102,327 @@ Avoid finishing a chart by applying operations one at a time after it is mounted
|
|
|
102
102
|
|
|
103
103
|
## Capability Index
|
|
104
104
|
|
|
105
|
-
| Type | Name | Data requirements
|
|
106
|
-
| ------------------------ | ---------------------- |
|
|
107
|
-
| `
|
|
108
|
-
| `
|
|
109
|
-
| `
|
|
110
|
-
| `
|
|
111
|
-
| `
|
|
112
|
-
| `
|
|
113
|
-
| `
|
|
114
|
-
| `
|
|
115
|
-
| `
|
|
116
|
-
| `
|
|
117
|
-
| `
|
|
118
|
-
| `
|
|
119
|
-
| `
|
|
120
|
-
| `
|
|
121
|
-
| `
|
|
122
|
-
| `
|
|
123
|
-
| `
|
|
124
|
-
| `
|
|
125
|
-
| `
|
|
126
|
-
| `
|
|
127
|
-
| `
|
|
128
|
-
| `
|
|
129
|
-
| `
|
|
130
|
-
| `
|
|
131
|
-
| `
|
|
132
|
-
| `
|
|
133
|
-
| `
|
|
105
|
+
| Type | Name | Data requirements | Supported features |
|
|
106
|
+
| ------------------------ | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
107
|
+
| `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` |
|
|
108
|
+
| `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` |
|
|
109
|
+
| `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` |
|
|
110
|
+
| `distribution-gauge` | Distribution gauge | Zero or one dimension. Between one and twenty measures. | `dimensions`, `filters`, `measures`, `value-formatting`, `conditional-coloring`, `display-mode`, `legend` |
|
|
111
|
+
| `dot` | Dot chart | Exactly two dimensions. Exactly one measure. | `dimensions`, `filters`, `measures`, `value-formatting`, `conditional-coloring`, `axes`, `axis-range`, `legend`, `orientation` |
|
|
112
|
+
| `gauge` | Gauge chart | Zero or one dimension. Between one and twenty measures; with one dimension, at most two measures. | `dimensions`, `filters`, `measures`, `value-formatting`, `conditional-coloring`, `display-mode`, `legend` |
|
|
113
|
+
| `heatMap` | Heat map | Exactly two dimensions. One or two measures. | `dimensions`, `filters`, `measures`, `value-formatting`, `conditional-coloring`, `axes`, `legend`, `query-limit`, `sorting` |
|
|
114
|
+
| `histogram` | Histogram | Exactly one numeric dimension. No caller-supplied measures. | `axes`, `axis-bands`, `axis-range`, `dimensions`, `filters`, `legend`, `orientation`, `value-formatting` |
|
|
115
|
+
| `line` | Line chart | At least one dimension. At least one measure. | `axes`, `axis-bands`, `axis-range`, `axis-scale`, `conditional-coloring`, `data-labels`, `data-points`, `dimensions`, `filters`, `legend`, `measure-axis`, `measures`, `orientation`, `query-limit`, `sorting`, `value-formatting` |
|
|
116
|
+
| `radar` | Radar chart | Zero to two dimensions. Two to five measures without dimensions, or one with dimensions. | `dimensions`, `filters`, `measures`, `value-formatting`, `conditional-coloring`, `legend` |
|
|
117
|
+
| `pie` | Pie chart | Exactly one dimension. One or two measures. | `dimensions`, `filters`, `measures`, `value-formatting`, `conditional-coloring`, `legend`, `query-limit`, `sorting` |
|
|
118
|
+
| `tree` | Tree chart | Zero to ten dimensions. Zero to one hundred measures, or at most one with dimensions. | `dimensions`, `filters`, `measures`, `value-formatting`, `layout`, `query-limit`, `sorting` |
|
|
119
|
+
| `treemap` | Treemap | Between one and ten dimensions. Exactly one measure. | `dimensions`, `filters`, `measures`, `value-formatting`, `conditional-coloring`, `legend` |
|
|
120
|
+
| `sankey` | Sankey chart | Between two and fifteen dimensions. Exactly one measure. | `dimensions`, `filters`, `measures`, `value-formatting`, `conditional-coloring` |
|
|
121
|
+
| `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` |
|
|
122
|
+
| `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` |
|
|
123
|
+
| `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` |
|
|
124
|
+
| `word-cloud` | Word cloud | Exactly one dimension. Exactly one measure. | `dimensions`, `filters`, `measures`, `value-formatting`, `conditional-coloring` |
|
|
125
|
+
| `date-picker` | Date picker | Exactly one field. | `dimensions`, `filter-settings` |
|
|
126
|
+
| `filter` | Filter | Exactly one field. | `dimensions`, `filter-settings` |
|
|
127
|
+
| `iframe` | Iframe | No query data. | `content` |
|
|
128
|
+
| `image` | Image | No query data. | `content`, `object-settings` |
|
|
129
|
+
| `number` | Number | Exactly one measure. | `filters`, `measures`, `value-formatting` |
|
|
130
|
+
| `shape` | Shape | No query data. | `object-settings` |
|
|
131
|
+
| `simpleTextObject` | Text object | No query data. | `content`, `object-settings` |
|
|
132
|
+
| `atomic-input` | Atomic input | No query data; variable-backed input. | `input-settings` |
|
|
133
|
+
| `astrato-app-filter-bar` | Astrato App Filter Bar | No query data; uses field metadata and selections supplied by the host. | `selection-settings` |
|
|
134
|
+
| `slider` | Slider | Exactly one field. | `dimensions`, `filter-settings` |
|
|
135
|
+
|
|
136
|
+
## `map`: Map
|
|
137
|
+
|
|
138
|
+
Layered geographic visualization with background maps, images, points, shapes, heatmaps and connections.
|
|
139
|
+
|
|
140
|
+
**Data requirements**
|
|
141
|
+
|
|
142
|
+
- Point, shape and heatmap layers require one dimension identifying locations. Connection layers require source and destination dimensions.
|
|
143
|
+
- Location measures use geo for the first location and thirdGeo for a connection destination. For latLng, these are latitude; secondGeo and fourthGeo supply longitude.
|
|
144
|
+
- Shape layers require a GeoJSON measure. Other data layers support latLng, geoPoint or geoHash.
|
|
145
|
+
- 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.
|
|
146
|
+
|
|
147
|
+
**Supported features**
|
|
148
|
+
|
|
149
|
+
`dimensions`, `measures`, `filters`, `data-points`, `data-labels`, `object-settings`
|
|
150
|
+
|
|
151
|
+
**Constraints and semantics**
|
|
152
|
+
|
|
153
|
+
- 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.
|
|
154
|
+
- Layer and data-item references share one namespace and must all be unique across the definition. Display names may repeat.
|
|
155
|
+
- 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.
|
|
156
|
+
- Raw measure fields require an available aggregation. Semantic measures and calculations supply their own aggregation.
|
|
157
|
+
- 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.
|
|
158
|
+
- Definitions cover initial data bindings, static filters, view and basic presentation. Additional styling and interactions use the existing map operations.
|
|
159
|
+
- Compile only against an empty or unconfigured default map vSpec. HERE backgrounds require an API key.
|
|
160
|
+
|
|
161
|
+
**Canonical example**
|
|
162
|
+
|
|
163
|
+
```json
|
|
164
|
+
{
|
|
165
|
+
"type": "map",
|
|
166
|
+
"version": 1,
|
|
167
|
+
"layers": [
|
|
168
|
+
{
|
|
169
|
+
"type": "point",
|
|
170
|
+
"ref": "locations",
|
|
171
|
+
"locationType": "latLng",
|
|
172
|
+
"data": {
|
|
173
|
+
"dimensions": [
|
|
174
|
+
{
|
|
175
|
+
"ref": "location",
|
|
176
|
+
"fieldKey": "[Locations].[Name]"
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
"measures": [
|
|
180
|
+
{
|
|
181
|
+
"ref": "locationLatitude",
|
|
182
|
+
"fieldKey": "[Locations].[Latitude]",
|
|
183
|
+
"aggregation": "AVG",
|
|
184
|
+
"role": "geo"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"ref": "locationLongitude",
|
|
188
|
+
"fieldKey": "[Locations].[Longitude]",
|
|
189
|
+
"aggregation": "AVG",
|
|
190
|
+
"role": "secondGeo"
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
},
|
|
194
|
+
"presentation": {
|
|
195
|
+
"color": "#2563EB",
|
|
196
|
+
"sizing": {
|
|
197
|
+
"size": 12
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"type": "map",
|
|
203
|
+
"ref": "basemap",
|
|
204
|
+
"presentation": {
|
|
205
|
+
"mapType": "openStreetMap"
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**Additional scenarios**
|
|
213
|
+
|
|
214
|
+
### Heatmap
|
|
215
|
+
|
|
216
|
+
```json
|
|
217
|
+
{
|
|
218
|
+
"type": "map",
|
|
219
|
+
"version": 1,
|
|
220
|
+
"layers": [
|
|
221
|
+
{
|
|
222
|
+
"type": "heatMap",
|
|
223
|
+
"ref": "density",
|
|
224
|
+
"locationType": "latLng",
|
|
225
|
+
"data": {
|
|
226
|
+
"dimensions": [
|
|
227
|
+
{
|
|
228
|
+
"ref": "location",
|
|
229
|
+
"fieldKey": "[Locations].[Name]"
|
|
230
|
+
}
|
|
231
|
+
],
|
|
232
|
+
"measures": [
|
|
233
|
+
{
|
|
234
|
+
"ref": "densityLatitude",
|
|
235
|
+
"fieldKey": "[Locations].[Latitude]",
|
|
236
|
+
"aggregation": "AVG",
|
|
237
|
+
"role": "geo"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"ref": "densityLongitude",
|
|
241
|
+
"fieldKey": "[Locations].[Longitude]",
|
|
242
|
+
"aggregation": "AVG",
|
|
243
|
+
"role": "secondGeo"
|
|
244
|
+
}
|
|
245
|
+
]
|
|
246
|
+
},
|
|
247
|
+
"presentation": {
|
|
248
|
+
"heat": {
|
|
249
|
+
"radius": 25,
|
|
250
|
+
"blur": 15
|
|
251
|
+
},
|
|
252
|
+
"value": {
|
|
253
|
+
"type": "fixed",
|
|
254
|
+
"value": 1
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"type": "map",
|
|
260
|
+
"ref": "basemap",
|
|
261
|
+
"presentation": {
|
|
262
|
+
"mapType": "openStreetMap"
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Connections
|
|
270
|
+
|
|
271
|
+
```json
|
|
272
|
+
{
|
|
273
|
+
"type": "map",
|
|
274
|
+
"version": 1,
|
|
275
|
+
"layers": [
|
|
276
|
+
{
|
|
277
|
+
"type": "pointConnection",
|
|
278
|
+
"ref": "routes",
|
|
279
|
+
"locationType": "latLng",
|
|
280
|
+
"secondLocationType": "latLng",
|
|
281
|
+
"data": {
|
|
282
|
+
"dimensions": [
|
|
283
|
+
{
|
|
284
|
+
"ref": "origin",
|
|
285
|
+
"fieldKey": "[Locations].[Name]"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"ref": "destination",
|
|
289
|
+
"fieldKey": "[Locations].[Destination]"
|
|
290
|
+
}
|
|
291
|
+
],
|
|
292
|
+
"measures": [
|
|
293
|
+
{
|
|
294
|
+
"ref": "originLatitude",
|
|
295
|
+
"fieldKey": "[Locations].[Latitude]",
|
|
296
|
+
"aggregation": "AVG",
|
|
297
|
+
"role": "geo"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"ref": "originLongitude",
|
|
301
|
+
"fieldKey": "[Locations].[Longitude]",
|
|
302
|
+
"aggregation": "AVG",
|
|
303
|
+
"role": "secondGeo"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"ref": "destinationLatitude",
|
|
307
|
+
"fieldKey": "[Locations].[Destination Latitude]",
|
|
308
|
+
"aggregation": "AVG",
|
|
309
|
+
"role": "thirdGeo"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"ref": "destinationLongitude",
|
|
313
|
+
"fieldKey": "[Locations].[Destination Longitude]",
|
|
314
|
+
"aggregation": "AVG",
|
|
315
|
+
"role": "fourthGeo"
|
|
316
|
+
}
|
|
317
|
+
]
|
|
318
|
+
},
|
|
319
|
+
"presentation": {
|
|
320
|
+
"useGeodesicLines": true,
|
|
321
|
+
"arrow": {
|
|
322
|
+
"show": true
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"type": "map",
|
|
328
|
+
"ref": "basemap",
|
|
329
|
+
"presentation": {
|
|
330
|
+
"mapType": "openStreetMap"
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
]
|
|
334
|
+
}
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### GeoJSON shapes
|
|
338
|
+
|
|
339
|
+
```json
|
|
340
|
+
{
|
|
341
|
+
"type": "map",
|
|
342
|
+
"version": 1,
|
|
343
|
+
"layers": [
|
|
344
|
+
{
|
|
345
|
+
"type": "shape",
|
|
346
|
+
"ref": "regions",
|
|
347
|
+
"data": {
|
|
348
|
+
"dimensions": [
|
|
349
|
+
{
|
|
350
|
+
"ref": "region",
|
|
351
|
+
"fieldKey": "[Locations].[Name]"
|
|
352
|
+
}
|
|
353
|
+
],
|
|
354
|
+
"measures": [
|
|
355
|
+
{
|
|
356
|
+
"ref": "boundary",
|
|
357
|
+
"fieldKey": "[Locations].[Boundary]",
|
|
358
|
+
"aggregation": "ANY_VALUE",
|
|
359
|
+
"role": "geo"
|
|
360
|
+
}
|
|
361
|
+
]
|
|
362
|
+
},
|
|
363
|
+
"presentation": {
|
|
364
|
+
"color": "#2563EB",
|
|
365
|
+
"opacity": 60,
|
|
366
|
+
"strokeEnabled": true
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"type": "map",
|
|
371
|
+
"ref": "basemap",
|
|
372
|
+
"presentation": {
|
|
373
|
+
"mapType": "openStreetMap"
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
]
|
|
377
|
+
}
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
### Image overlay
|
|
381
|
+
|
|
382
|
+
```json
|
|
383
|
+
{
|
|
384
|
+
"type": "map",
|
|
385
|
+
"version": 1,
|
|
386
|
+
"layers": [
|
|
387
|
+
{
|
|
388
|
+
"type": "image",
|
|
389
|
+
"ref": "overlay",
|
|
390
|
+
"image": {
|
|
391
|
+
"imageUrl": "https://example.com/overlay.png"
|
|
392
|
+
},
|
|
393
|
+
"position": {
|
|
394
|
+
"topLeftLatitude": 52,
|
|
395
|
+
"topLeftLongitude": 20,
|
|
396
|
+
"bottomRightLatitude": 51,
|
|
397
|
+
"bottomRightLongitude": 21
|
|
398
|
+
},
|
|
399
|
+
"opacity": 60
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"type": "map",
|
|
403
|
+
"ref": "basemap",
|
|
404
|
+
"presentation": {
|
|
405
|
+
"mapType": "openStreetMap"
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
],
|
|
409
|
+
"view": {
|
|
410
|
+
"latitude": 51.5,
|
|
411
|
+
"longitude": 20.5,
|
|
412
|
+
"zoom": 7,
|
|
413
|
+
"zoomMode": "manual"
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
```
|
|
134
417
|
|
|
135
418
|
## `bar`: Bar chart
|
|
136
419
|
|
|
137
|
-
Categorical comparison chart with sorting, limiting, per-measure axes, labels, and orientation controls.
|
|
420
|
+
Categorical comparison chart with sorting, limiting, per-measure axes, labels, layout, and orientation controls.
|
|
138
421
|
|
|
139
422
|
**Data requirements**
|
|
140
423
|
|
|
141
|
-
- At least one dimension.
|
|
142
424
|
- At least one measure.
|
|
425
|
+
- 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.
|
|
143
426
|
|
|
144
427
|
**Supported features**
|
|
145
428
|
|
|
@@ -153,6 +436,8 @@ Categorical comparison chart with sorting, limiting, per-measure axes, labels, a
|
|
|
153
436
|
- 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.
|
|
154
437
|
- 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.
|
|
155
438
|
- 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.
|
|
439
|
+
- Several measures on one dimension are drawn side by side unless presentation.layout is stacked. A second dimension is a series, stacked unless presentation.layout is groups. One dimension with one measure ignores layout.
|
|
440
|
+
- Data label placements are tried in order; inside labels sit at the end of the bar. Set dataLabels.textColor to fix the label color in every placement.
|
|
156
441
|
|
|
157
442
|
**Canonical example**
|
|
158
443
|
|
|
@@ -1777,19 +2062,20 @@ Normal, expandable, or pivot tabular output with formatting, filtering, sorting,
|
|
|
1777
2062
|
|
|
1778
2063
|
## `waterfall`: Waterfall chart
|
|
1779
2064
|
|
|
1780
|
-
Sequential contribution chart
|
|
2065
|
+
Sequential contribution chart, or a comparison of two measures across one dimension.
|
|
1781
2066
|
|
|
1782
2067
|
**Data requirements**
|
|
1783
2068
|
|
|
1784
|
-
-
|
|
2069
|
+
- No dimensions and between one and one hundred measures, or exactly one dimension and exactly two measures.
|
|
1785
2070
|
|
|
1786
2071
|
**Supported features**
|
|
1787
2072
|
|
|
1788
|
-
`axes`, `axis-bands`, `axis-range`, `data-labels`, `filters`, `measures`, `orientation`, `value-formatting`
|
|
2073
|
+
`axes`, `axis-bands`, `axis-range`, `data-labels`, `dimensions`, `filters`, `measures`, `orientation`, `value-formatting`
|
|
1789
2074
|
|
|
1790
2075
|
**Constraints and semantics**
|
|
1791
2076
|
|
|
1792
|
-
-
|
|
2077
|
+
- 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.
|
|
2078
|
+
- Comparison totals sum the returned rows, rather than requesting a separate aggregate total. Use two numeric measures with comparable units.
|
|
1793
2079
|
- 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.
|
|
1794
2080
|
- 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.
|
|
1795
2081
|
|
|
@@ -1858,6 +2144,60 @@ Sequential contribution chart composed from one or more measures.
|
|
|
1858
2144
|
}
|
|
1859
2145
|
```
|
|
1860
2146
|
|
|
2147
|
+
**Additional scenarios**
|
|
2148
|
+
|
|
2149
|
+
### Compare total and average sales by manufacturer
|
|
2150
|
+
|
|
2151
|
+
```json
|
|
2152
|
+
{
|
|
2153
|
+
"data": {
|
|
2154
|
+
"dimensions": [
|
|
2155
|
+
{
|
|
2156
|
+
"fieldKey": "[Cars].[Manufacturer]",
|
|
2157
|
+
"ref": "manufacturer"
|
|
2158
|
+
}
|
|
2159
|
+
],
|
|
2160
|
+
"measures": [
|
|
2161
|
+
{
|
|
2162
|
+
"aggregation": "SUM",
|
|
2163
|
+
"fieldKey": "[Cars].[Sales In Thousands]",
|
|
2164
|
+
"format": {
|
|
2165
|
+
"formatType": "number2Decimal",
|
|
2166
|
+
"negativeType": "parenthesis"
|
|
2167
|
+
},
|
|
2168
|
+
"ref": "totalSales"
|
|
2169
|
+
},
|
|
2170
|
+
{
|
|
2171
|
+
"aggregation": "AVG",
|
|
2172
|
+
"fieldKey": "[Cars].[Sales In Thousands]",
|
|
2173
|
+
"format": {
|
|
2174
|
+
"formatType": "number2Decimal",
|
|
2175
|
+
"negativeType": "parenthesis"
|
|
2176
|
+
},
|
|
2177
|
+
"ref": "averageSales"
|
|
2178
|
+
}
|
|
2179
|
+
]
|
|
2180
|
+
},
|
|
2181
|
+
"presentation": {
|
|
2182
|
+
"axes": {
|
|
2183
|
+
"dimension": {
|
|
2184
|
+
"title": "Manufacturer",
|
|
2185
|
+
"titleVisible": true
|
|
2186
|
+
},
|
|
2187
|
+
"primaryMeasure": {
|
|
2188
|
+
"title": "Sales in thousands",
|
|
2189
|
+
"titleVisible": true
|
|
2190
|
+
}
|
|
2191
|
+
},
|
|
2192
|
+
"dataLabels": {
|
|
2193
|
+
"visible": true
|
|
2194
|
+
}
|
|
2195
|
+
},
|
|
2196
|
+
"type": "waterfall",
|
|
2197
|
+
"version": 1
|
|
2198
|
+
}
|
|
2199
|
+
```
|
|
2200
|
+
|
|
1861
2201
|
## `word-cloud`: Word cloud
|
|
1862
2202
|
|
|
1863
2203
|
Weighted word display using one label dimension and one measure.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { o as e } from "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Oa as t } from "./visualization-filters-D7i6oh1Z.js";
|
|
3
|
+
import { W as n, ci as r, si as i, sn as a, zr as o } from "./utils-DganVptf.js";
|
|
4
4
|
import { i as s, u as c } from "./responsive.styles-FItb913l.js";
|
|
5
|
-
var l = /* @__PURE__ */ e(
|
|
5
|
+
var l = /* @__PURE__ */ e(r()), u = o(), d = n({
|
|
6
6
|
container: {
|
|
7
7
|
display: "flex",
|
|
8
8
|
fontSize: "14px"
|
|
9
9
|
},
|
|
10
10
|
button: ({ responsive: e, withoutWrapper: t }) => ({
|
|
11
|
-
...
|
|
11
|
+
...i.normal14,
|
|
12
12
|
display: "flex",
|
|
13
13
|
flexDirection: "row",
|
|
14
14
|
justifyContent: "center",
|