@graphenedata/cli 0.0.3 → 0.0.5
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/cli.ts +7 -43
- package/dist/cli/cli.js +509 -277
- package/dist/docs/graphene.md +924 -63
- package/dist/ui/component-utilities/echarts.js +3 -1
- package/dist/ui/component-utilities/themeStores.ts +35 -7
- package/dist/ui/components/AreaChart.svelte +2 -1
- package/dist/ui/components/BarChart.svelte +2 -1
- package/dist/ui/components/BigValue.svelte +1 -1
- package/dist/ui/components/Chart.svelte +10 -1
- package/dist/ui/components/ECharts.svelte +2 -0
- package/dist/ui/components/LineChart.svelte +2 -1
- package/dist/ui/components/PieChart.svelte +1 -1
- package/dist/ui/components/QueryLoad.svelte +5 -6
- package/dist/ui/components/TableRow.svelte +1 -1
- package/dist/ui/components/_Table.svelte +2 -0
- package/dist/ui/internal/queryEngine.ts +16 -13
- package/dist/ui/internal/telemetry.ts +5 -3
- package/dist/ui/web.js +26 -11
- package/package.json +2 -1
- package/dist/docs/data_apps/components/charts/annotations.md +0 -673
- package/dist/docs/data_apps/components/charts/area-chart.md +0 -202
- package/dist/docs/data_apps/components/charts/bar-chart.md +0 -317
- package/dist/docs/data_apps/components/charts/box-plot.md +0 -190
- package/dist/docs/data_apps/components/charts/bubble-chart.md +0 -151
- package/dist/docs/data_apps/components/charts/calendar-heatmap.md +0 -112
- package/dist/docs/data_apps/components/charts/custom-echarts.md +0 -308
- package/dist/docs/data_apps/components/charts/echarts-options.md +0 -217
- package/dist/docs/data_apps/components/charts/funnel-chart.md +0 -106
- package/dist/docs/data_apps/components/charts/heatmap.md +0 -180
- package/dist/docs/data_apps/components/charts/histogram.md +0 -107
- package/dist/docs/data_apps/components/charts/line-chart.md +0 -265
- package/dist/docs/data_apps/components/charts/mixed-type-charts.md +0 -240
- package/dist/docs/data_apps/components/charts/sankey-diagram.md +0 -301
- package/dist/docs/data_apps/components/charts/scatter-plot.md +0 -134
- package/dist/docs/data_apps/components/charts/sparkline.md +0 -68
- package/dist/docs/data_apps/components/data/big-value.md +0 -153
- package/dist/docs/data_apps/components/data/delta.md +0 -89
- package/dist/docs/data_apps/components/data/table.md +0 -470
- package/dist/docs/data_apps/components/data/value.md +0 -97
- package/dist/docs/data_apps/components/inputs/button-group.md +0 -154
- package/dist/docs/data_apps/components/inputs/checkbox.md +0 -52
- package/dist/docs/data_apps/components/inputs/date-input.md +0 -131
- package/dist/docs/data_apps/components/inputs/date-range.md +0 -124
- package/dist/docs/data_apps/components/inputs/dimension-grid.md +0 -67
- package/dist/docs/data_apps/components/inputs/dropdown.md +0 -199
- package/dist/docs/data_apps/components/inputs/index.md +0 -3
- package/dist/docs/data_apps/components/inputs/slider.md +0 -126
- package/dist/docs/data_apps/components/inputs/text-input.md +0 -86
- package/dist/docs/data_apps/components/maps/area-map.md +0 -397
- package/dist/docs/data_apps/components/maps/base-map.md +0 -269
- package/dist/docs/data_apps/components/maps/bubble-map.md +0 -361
- package/dist/docs/data_apps/components/maps/point-map.md +0 -326
- package/dist/docs/data_apps/components/maps/us-map.md +0 -167
- package/dist/docs/data_apps/components/ui/accordion.md +0 -116
- package/dist/docs/data_apps/components/ui/alert.md +0 -37
- package/dist/docs/data_apps/components/ui/big-link.md +0 -19
- package/dist/docs/data_apps/components/ui/details.md +0 -58
- package/dist/docs/data_apps/components/ui/download-data.md +0 -41
- package/dist/docs/data_apps/components/ui/embed.md +0 -47
- package/dist/docs/data_apps/components/ui/grid.md +0 -45
- package/dist/docs/data_apps/components/ui/image.md +0 -61
- package/dist/docs/data_apps/components/ui/info.md +0 -47
- package/dist/docs/data_apps/components/ui/last-refreshed.md +0 -28
- package/dist/docs/data_apps/components/ui/link-button.md +0 -20
- package/dist/docs/data_apps/components/ui/link.md +0 -40
- package/dist/docs/data_apps/components/ui/modal.md +0 -57
- package/dist/docs/data_apps/components/ui/note.md +0 -32
- package/dist/docs/data_apps/components/ui/print-format-components.md +0 -85
- package/dist/docs/data_apps/components/ui/tabs.md +0 -122
|
@@ -1,361 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Bubble Map
|
|
3
|
-
description: Compare points of interest on a map using bubble size, and optionally color, to visualize metrics.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Compare points of interest on a map using bubble size, and optionally color, to visualize metrics. It is easier to distinguish size than color, so the primary metric should generally be used to set the size.
|
|
7
|
-
|
|
8
|
-
**Example:**
|
|
9
|
-
|
|
10
|
-
```html
|
|
11
|
-
<BubbleMap
|
|
12
|
-
data="la_locations"
|
|
13
|
-
lat=lat
|
|
14
|
-
long=long
|
|
15
|
-
size=sales
|
|
16
|
-
sizeFmt=eur
|
|
17
|
-
value=sales
|
|
18
|
-
valueFmt=eur
|
|
19
|
-
pointName=point_name
|
|
20
|
-
/>
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
## Examples
|
|
25
|
-
|
|
26
|
-
### Custom Basemap
|
|
27
|
-
You can add a different basemap by passing in a basemap URL. You can find examples here: https://leaflet-extras.github.io/leaflet-providers/preview/
|
|
28
|
-
|
|
29
|
-
**Example:**
|
|
30
|
-
|
|
31
|
-
**Note:** you need to wrap the url in curly braces and backticks to avoid the curly braces in the URL being read as variables on your page
|
|
32
|
-
|
|
33
|
-
```svelte
|
|
34
|
-
<BubbleMap
|
|
35
|
-
data="la_locations"
|
|
36
|
-
lat=lat
|
|
37
|
-
long=long
|
|
38
|
-
value=sales
|
|
39
|
-
valueFmt=usd
|
|
40
|
-
pointName=point_name
|
|
41
|
-
height=200
|
|
42
|
-
basemap="`https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/{z"/{x}/{y}{r}.{ext}`}
|
|
43
|
-
attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### Custom Tooltip
|
|
47
|
-
|
|
48
|
-
#### `tooltipType=hover`
|
|
49
|
-
|
|
50
|
-
**Example:**
|
|
51
|
-
|
|
52
|
-
```svelte
|
|
53
|
-
<BubbleMap
|
|
54
|
-
data="la_locations"
|
|
55
|
-
lat=lat
|
|
56
|
-
long=long
|
|
57
|
-
value=sales
|
|
58
|
-
valueFmt=usd
|
|
59
|
-
size=sales
|
|
60
|
-
sizeFmt=usd
|
|
61
|
-
pointName=point_name
|
|
62
|
-
tooltipType=hover
|
|
63
|
-
tooltip="[
|
|
64
|
-
{id: 'point_name', showColumnName: false, valueClass: 'text-xl font-semibold'",
|
|
65
|
-
{id: 'sales', fmt: 'eur', fieldClass: 'text-[grey]', valueClass: 'text-[green]'}
|
|
66
|
-
]}
|
|
67
|
-
/>
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
#### With clickable link and `tooltipType=click`
|
|
71
|
-
|
|
72
|
-
**Example:**
|
|
73
|
-
|
|
74
|
-
```svelte
|
|
75
|
-
<BubbleMap
|
|
76
|
-
data="la_locations"
|
|
77
|
-
lat=lat
|
|
78
|
-
long=long
|
|
79
|
-
value=sales
|
|
80
|
-
valueFmt=usd
|
|
81
|
-
size=sales
|
|
82
|
-
sizeFmt=usd
|
|
83
|
-
pointName=point_name
|
|
84
|
-
tooltipType=click
|
|
85
|
-
tooltip="[
|
|
86
|
-
{id: 'point_name', showColumnName: false, valueClass: 'text-xl font-semibold'",
|
|
87
|
-
{id: 'sales', fmt: 'eur', fieldClass: 'text-[grey]', valueClass: 'text-[green]'},
|
|
88
|
-
{id: 'link_col', showColumnName: false, contentType: 'link', linkLabel: 'Click here', valueClass: 'font-bold mt-1'}
|
|
89
|
-
]}
|
|
90
|
-
/>
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
### Custom Color Palette
|
|
94
|
-
|
|
95
|
-
**Example:**
|
|
96
|
-
|
|
97
|
-
```svelte
|
|
98
|
-
<BubbleMap
|
|
99
|
-
data="la_locations"
|
|
100
|
-
lat=lat
|
|
101
|
-
long=long
|
|
102
|
-
value=sales
|
|
103
|
-
valueFmt=usd
|
|
104
|
-
pointName=point_name
|
|
105
|
-
colorPalette={['yellow','orange','red','darkred']}
|
|
106
|
-
/>
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### Custom Styling
|
|
110
|
-
|
|
111
|
-
**Example:**
|
|
112
|
-
|
|
113
|
-
```svelte
|
|
114
|
-
<BubbleMap
|
|
115
|
-
data="la_locations"
|
|
116
|
-
lat=lat
|
|
117
|
-
long=long
|
|
118
|
-
size=sales
|
|
119
|
-
sizeFmt=usd
|
|
120
|
-
pointName=point_name
|
|
121
|
-
color=#128c2b
|
|
122
|
-
opacity=1
|
|
123
|
-
borderWidth=1
|
|
124
|
-
borderColor=black
|
|
125
|
-
/>
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
### Max Bubble Size
|
|
129
|
-
|
|
130
|
-
**Example:**
|
|
131
|
-
|
|
132
|
-
```svelte
|
|
133
|
-
<BubbleMap
|
|
134
|
-
data="la_locations"
|
|
135
|
-
lat=lat
|
|
136
|
-
long=long
|
|
137
|
-
size=sales
|
|
138
|
-
sizeFmt=usd
|
|
139
|
-
pointName=point_name
|
|
140
|
-
maxSize=10
|
|
141
|
-
/>
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
### Link Drilldown
|
|
145
|
-
Pass in a `link` column to enable navigation on click of the point. These can be absolute or relative URLs
|
|
146
|
-
|
|
147
|
-
**Example:**
|
|
148
|
-
|
|
149
|
-
```svelte
|
|
150
|
-
<BubbleMap
|
|
151
|
-
data="la_locations"
|
|
152
|
-
lat=lat
|
|
153
|
-
long=long
|
|
154
|
-
size=sales
|
|
155
|
-
sizeFmt=usd
|
|
156
|
-
link=link_col
|
|
157
|
-
/>
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
### Use Map as Input
|
|
161
|
-
Use the `name` prop to set an input name for the map - when a point is clicked, it will set the input value to that row of data
|
|
162
|
-
|
|
163
|
-
**Example:**
|
|
164
|
-
|
|
165
|
-
```svelte
|
|
166
|
-
<BubbleMap
|
|
167
|
-
data="la_locations"
|
|
168
|
-
lat=lat
|
|
169
|
-
long=long
|
|
170
|
-
size=sales
|
|
171
|
-
sizeFmt=usd
|
|
172
|
-
name=my_point_map
|
|
173
|
-
/>
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
*Click a point on the map to see the input value get updated:*
|
|
177
|
-
|
|
178
|
-
#### Selected value for `{inputs.my_point_map}`:
|
|
179
|
-
|
|
180
|
-
<pre class="text-sm">{JSON.stringify(inputs.my_point_map, null, 2)}</pre>
|
|
181
|
-
|
|
182
|
-
#### Selected value for `{inputs.my_point_map.point_name}`:
|
|
183
|
-
|
|
184
|
-
{inputs.my_point_map.point_name}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
#### Filtered Data
|
|
188
|
-
<DataTable data="filtered_locations">
|
|
189
|
-
<Column id=id/>
|
|
190
|
-
<Column id=point_name/>
|
|
191
|
-
<Column id=lat/>
|
|
192
|
-
<Column id=long/>
|
|
193
|
-
<Column id=sales fmt=usd/>
|
|
194
|
-
</DataTable>
|
|
195
|
-
|
|
196
|
-
### Legends
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
#### Categorical Legend
|
|
200
|
-
|
|
201
|
-
**Example:**
|
|
202
|
-
|
|
203
|
-
```svelte
|
|
204
|
-
<BubbleMap
|
|
205
|
-
data="grouped_locations"
|
|
206
|
-
lat=lat
|
|
207
|
-
long=long
|
|
208
|
-
value=Category
|
|
209
|
-
size=sales
|
|
210
|
-
/>
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
#### Custom Colors
|
|
214
|
-
Set custom legend colors using the `colorPalette` prop to match the number of categories; excess categorical options will default to standard colors.
|
|
215
|
-
|
|
216
|
-
**Example:**
|
|
217
|
-
|
|
218
|
-
```svelte
|
|
219
|
-
<BubbleMap
|
|
220
|
-
data="grouped_locations"
|
|
221
|
-
lat=lat
|
|
222
|
-
long=long
|
|
223
|
-
value=Category
|
|
224
|
-
size=sales
|
|
225
|
-
colorPalette={['#C65D47', '#5BAF7A', '#4A8EBA', '#D35B85', '#E1C16D', '#6F5B9A', '#4E8D8D']}
|
|
226
|
-
/>
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
#### Scalar Legend
|
|
230
|
-
|
|
231
|
-
**Example:**
|
|
232
|
-
|
|
233
|
-
```svelte
|
|
234
|
-
<BubbleMap
|
|
235
|
-
data="grouped_locations"
|
|
236
|
-
lat=lat
|
|
237
|
-
long=long
|
|
238
|
-
value=sales
|
|
239
|
-
size=sales
|
|
240
|
-
valueFmt=usd
|
|
241
|
-
/>
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
#### Custom Colors
|
|
245
|
-
Define scalar legend colors using the `colorPalette` prop, allowing specified colors to create a gradient based on the range of values.
|
|
246
|
-
|
|
247
|
-
**Example:**
|
|
248
|
-
|
|
249
|
-
```svelte
|
|
250
|
-
<BubbleMap
|
|
251
|
-
data="grouped_locations"
|
|
252
|
-
lat=lat
|
|
253
|
-
long=long
|
|
254
|
-
value=sales
|
|
255
|
-
size=sales
|
|
256
|
-
colorPalette={['#C65D47', '#4A8EBA']}
|
|
257
|
-
valueFmt=usd
|
|
258
|
-
/>
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
## Options
|
|
262
|
-
|
|
263
|
-
### Bubbles
|
|
264
|
-
|
|
265
|
-
| Property | Description | Required | Options | Default |
|
|
266
|
-
|----------|-------------|----------|---------|---------|
|
|
267
|
-
| data | Query result, referenced using curly braces | true | query name | - |
|
|
268
|
-
| lat | Column containing latitude values | true | column name | - |
|
|
269
|
-
| long | Column containing longitude values | true | column name | - |
|
|
270
|
-
| size | Column that determines the size displayed for each point. | true | column name | - |
|
|
271
|
-
| sizeFmt | Format string for displaying the size value in tooltips. | false | format string | - |
|
|
272
|
-
| maxSize | Maximum size of the bubbles | false | number | 20 |
|
|
273
|
-
| value | Column that determines the value displayed at each point (used for color scale) | false | column name | - |
|
|
274
|
-
| valueFmt | Format string for displaying the value. | false | format string | - |
|
|
275
|
-
| pointName | Column containing the names/labels of the points - by default, this is shown as the title of the tooltip. | false | column name | - |
|
|
276
|
-
| title | Title for the map | false | string | - |
|
|
277
|
-
| subtitle | Subtitle - appears under the title | false | string | - |
|
|
278
|
-
| ignoreZoom | Stops map from zooming out to show all data for this layer | false | true, false | false |
|
|
279
|
-
|
|
280
|
-
### Color Scale
|
|
281
|
-
|
|
282
|
-
| Property | Description | Options | Default |
|
|
283
|
-
|----------|-------------|---------|---------|
|
|
284
|
-
| colorPalette | Array of colors used for theming the points based on data | array of colors | - |
|
|
285
|
-
| min | Minimum value to use for the color scale. | number | min of value column |
|
|
286
|
-
| max | Maximum value to use for the color scale. | number | max of value column |
|
|
287
|
-
|
|
288
|
-
### Legend
|
|
289
|
-
|
|
290
|
-
| Property | Description | Required | Options | Default |
|
|
291
|
-
|----------|-------------|----------|---------|---------|
|
|
292
|
-
| legend | Turns legend on or off | false | true, false | true |
|
|
293
|
-
| legendType | Appends a categorical or scalar legend to the map | false | categorical, scalar | - |
|
|
294
|
-
| legendPosition | Determines the legend's position on the map, with options provided | false | bottomLeft, topLeft, bottomRight, topRight | bottomLeft |
|
|
295
|
-
|
|
296
|
-
### Interactivity
|
|
297
|
-
|
|
298
|
-
| Property | Description | Options |
|
|
299
|
-
|----------|-------------|---------|
|
|
300
|
-
| link | URL to navigate to when a point is clicked. | URL |
|
|
301
|
-
| name | Input name. Can be referenced on your page with `{inputs.my_input_name}` | string |
|
|
302
|
-
|
|
303
|
-
### Styling
|
|
304
|
-
|
|
305
|
-
| Property | Description | Options | Default |
|
|
306
|
-
|----------|-------------|---------|---------|
|
|
307
|
-
| color | Color for the points. Use when you want all points to be the same color. | CSS color value | - |
|
|
308
|
-
| borderWidth | Width of the border around each point. | pixel value | 0.75 |
|
|
309
|
-
| borderColor | Color of the border around each point. | CSS color value | white |
|
|
310
|
-
| opacity | Opacity of the points. | number between 0 and 1 | 0.8 |
|
|
311
|
-
|
|
312
|
-
### Selected State
|
|
313
|
-
|
|
314
|
-
| Property | Description | Options | Default |
|
|
315
|
-
|----------|-------------|---------|---------|
|
|
316
|
-
| selectedColor | When point is selected: Color for the points. Use when you want all points to be the same color. | CSS color value | - |
|
|
317
|
-
| selectedBorderWidth | When point is selected: Width of the border around each point. | pixel value | 0.75 |
|
|
318
|
-
| selectedBorderColor | When point is selected: Color of the border around each point. | CSS color value | white |
|
|
319
|
-
| selectedOpacity | When point is selected: Opacity of the points. | number between 0 and 1 | 0.8 |
|
|
320
|
-
|
|
321
|
-
### Tooltips
|
|
322
|
-
|
|
323
|
-
| Property | Description | Options | Default |
|
|
324
|
-
|----------|-------------|---------|---------|
|
|
325
|
-
| showTooltip | Whether to show tooltips | true, false | true |
|
|
326
|
-
| tooltipType | Determines whether tooltips are activated by hover or click. | hover, click | hover |
|
|
327
|
-
| tooltipClass | CSS class applied to the tooltip content. You can pass Tailwind classes into this prop to custom-style the tooltip | CSS class | - |
|
|
328
|
-
| tooltip | Configuration for tooltips associated with each area. See below example for format | array of objects | - |
|
|
329
|
-
|
|
330
|
-
#### `tooltip` example:
|
|
331
|
-
|
|
332
|
-
```javascript
|
|
333
|
-
tooltip="[
|
|
334
|
-
{id: 'zip_code', fmt: 'id', showColumnName: false, valueClass: 'text-xl font-semibold'",
|
|
335
|
-
{id: 'sales', fmt: 'eur', fieldClass: 'text-[grey]', valueClass: 'text-[green]'},
|
|
336
|
-
{id: 'zip_code', showColumnName: false, contentType: 'link', linkLabel: 'Click here', valueClass: 'font-bold mt-1'}
|
|
337
|
-
]}
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
#### All options available in `tooltip`:
|
|
341
|
-
- `id`: column ID
|
|
342
|
-
- `title`: custom string to use as title of field
|
|
343
|
-
- `fmt`: format to use for value
|
|
344
|
-
- `showColumnName`: whether to show the column name. If `false`, only the value will be shown
|
|
345
|
-
- `contentType`: currently can only be "link"
|
|
346
|
-
- `linkLabel`: text to show for a link when contentType="link"
|
|
347
|
-
- `formatColumnTitle`: whether to automatically uppercase the first letter of the title. Only applies when `title` not passed explicitly
|
|
348
|
-
- `valueClass`: custom Tailwind classes to style the values
|
|
349
|
-
- `fieldClass`: custom Tailwind classes to style the column names
|
|
350
|
-
|
|
351
|
-
### Base Map
|
|
352
|
-
|
|
353
|
-
| Property | Description | Options | Default |
|
|
354
|
-
|----------|-------------|---------|---------|
|
|
355
|
-
| basemap | URL template for the basemap tiles. | URL | - |
|
|
356
|
-
| attribution | Attribution text to display on the map (e.g., "© OpenStreetMap contributors"). | text | - |
|
|
357
|
-
| title | Optional title displayed above the map. | text | - |
|
|
358
|
-
| startingLat | Starting latitude for the map center. | latitude coordinate | - |
|
|
359
|
-
| startingLong | Starting longitude for the map center. | longitude coordinate | - |
|
|
360
|
-
| startingZoom | Initial zoom level of the map. | number (1 to 18) | - |
|
|
361
|
-
| height | Height of the map in pixels. | pixel value | 300 |
|
|
@@ -1,326 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Point Map
|
|
3
|
-
description: Display points of interest on a map, optionally color-coded by a metric.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Show points of interest on a map, optionally color-coded by a metric.
|
|
7
|
-
|
|
8
|
-
**Example:**
|
|
9
|
-
|
|
10
|
-
```html
|
|
11
|
-
<PointMap
|
|
12
|
-
data="la_locations"
|
|
13
|
-
lat=lat
|
|
14
|
-
long=long
|
|
15
|
-
pointName=point_name
|
|
16
|
-
height=200
|
|
17
|
-
/>
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
## Examples
|
|
22
|
-
|
|
23
|
-
### Custom Basemap
|
|
24
|
-
You can add a different basemap by passing in a basemap URL. You can find examples here: https://leaflet-extras.github.io/leaflet-providers/preview/
|
|
25
|
-
|
|
26
|
-
**Example:**
|
|
27
|
-
|
|
28
|
-
**Note:** you need to wrap the url in curly braces and backticks to avoid the curly braces in the URL being read as variables on your page
|
|
29
|
-
|
|
30
|
-
```svelte
|
|
31
|
-
<PointMap
|
|
32
|
-
data="la_locations"
|
|
33
|
-
lat=lat
|
|
34
|
-
long=long
|
|
35
|
-
value=sales
|
|
36
|
-
valueFmt=usd
|
|
37
|
-
pointName=point_name
|
|
38
|
-
height=200
|
|
39
|
-
basemap="`https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/{z"/{x}/{y}{r}.{ext}`}
|
|
40
|
-
attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
|
41
|
-
/>
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Custom Tooltip
|
|
45
|
-
|
|
46
|
-
#### `tooltipType=hover`
|
|
47
|
-
|
|
48
|
-
**Example:**
|
|
49
|
-
|
|
50
|
-
```svelte
|
|
51
|
-
<PointMap
|
|
52
|
-
data="la_locations"
|
|
53
|
-
lat=lat
|
|
54
|
-
long=long
|
|
55
|
-
value=sales
|
|
56
|
-
valueFmt=usd
|
|
57
|
-
pointName=point_name
|
|
58
|
-
height=200
|
|
59
|
-
tooltipType=hover
|
|
60
|
-
tooltip="[
|
|
61
|
-
{id: 'point_name', showColumnName: false, valueClass: 'text-xl font-semibold'",
|
|
62
|
-
{id: 'sales', fmt: 'eur', fieldClass: 'text-[grey]', valueClass: 'text-[green]'}
|
|
63
|
-
]}
|
|
64
|
-
/>
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
#### With clickable link and `tooltipType=click`
|
|
68
|
-
|
|
69
|
-
**Example:**
|
|
70
|
-
|
|
71
|
-
```svelte
|
|
72
|
-
<PointMap
|
|
73
|
-
data="la_locations"
|
|
74
|
-
lat=lat
|
|
75
|
-
long=long
|
|
76
|
-
value=sales
|
|
77
|
-
valueFmt=usd
|
|
78
|
-
pointName=point_name
|
|
79
|
-
height=200
|
|
80
|
-
tooltipType=click
|
|
81
|
-
tooltip="[
|
|
82
|
-
{id: 'point_name', showColumnName: false, valueClass: 'text-xl font-semibold'",
|
|
83
|
-
{id: 'sales', fmt: 'eur', fieldClass: 'text-[grey]', valueClass: 'text-[green]'},
|
|
84
|
-
{id: 'link_col', showColumnName: false, contentType: 'link', linkLabel: 'Click here', valueClass: 'font-bold mt-1'}
|
|
85
|
-
]}
|
|
86
|
-
/>
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### Custom Color Palette
|
|
90
|
-
|
|
91
|
-
**Example:**
|
|
92
|
-
|
|
93
|
-
```svelte
|
|
94
|
-
<PointMap
|
|
95
|
-
data="la_locations"
|
|
96
|
-
lat=lat
|
|
97
|
-
long=long
|
|
98
|
-
value=sales
|
|
99
|
-
valueFmt=usd
|
|
100
|
-
pointName=point_name
|
|
101
|
-
height=200
|
|
102
|
-
colorPalette={['yellow','orange','red','darkred']}
|
|
103
|
-
/>
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### Custom Styling
|
|
107
|
-
|
|
108
|
-
**Example:**
|
|
109
|
-
|
|
110
|
-
```svelte
|
|
111
|
-
<PointMap
|
|
112
|
-
data="la_locations"
|
|
113
|
-
lat=lat
|
|
114
|
-
long=long
|
|
115
|
-
pointName=point_name
|
|
116
|
-
height=200
|
|
117
|
-
color=#128c2b
|
|
118
|
-
size=10
|
|
119
|
-
opacity=0.6
|
|
120
|
-
borderWidth=0
|
|
121
|
-
/>
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### Link Drilldown
|
|
125
|
-
Pass in a `link` column to enable navigation on click of the point. These can be absolute or relative URLs
|
|
126
|
-
|
|
127
|
-
**Example:**
|
|
128
|
-
|
|
129
|
-
```svelte
|
|
130
|
-
<PointMap
|
|
131
|
-
data="la_locations"
|
|
132
|
-
lat=lat
|
|
133
|
-
long=long
|
|
134
|
-
link=link_col
|
|
135
|
-
height=200
|
|
136
|
-
/>
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
### Use Map as Input
|
|
140
|
-
Use the `name` prop to set an input name for the map - when a point is clicked, it will set the input value to that row of data
|
|
141
|
-
|
|
142
|
-
**Example:**
|
|
143
|
-
|
|
144
|
-
```svelte
|
|
145
|
-
<PointMap
|
|
146
|
-
data="la_locations"
|
|
147
|
-
lat=lat
|
|
148
|
-
long=long
|
|
149
|
-
name=my_point_map
|
|
150
|
-
height=200
|
|
151
|
-
/>
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
*Click a point on the map to see the input value get updated:*
|
|
155
|
-
|
|
156
|
-
#### Selected value for `{inputs.my_point_map}`:
|
|
157
|
-
|
|
158
|
-
<pre class="text-sm">{JSON.stringify(inputs.my_point_map, null, 2)}</pre>
|
|
159
|
-
|
|
160
|
-
#### Selected value for `{inputs.my_point_map.point_name}`:
|
|
161
|
-
|
|
162
|
-
{inputs.my_point_map.point_name}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
#### Filtered Data
|
|
166
|
-
|
|
167
|
-
| id | point_name | lat | long | sales |
|
|
168
|
-
|----|------------|-----|------|-------|
|
|
169
|
-
| {filtered_locations.id} | {filtered_locations.point_name} | {filtered_locations.lat} | {filtered_locations.long} | {filtered_locations.sales} |
|
|
170
|
-
|
|
171
|
-
### Legends
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
#### Categorical Legend
|
|
175
|
-
|
|
176
|
-
**Example:**
|
|
177
|
-
|
|
178
|
-
```svelte
|
|
179
|
-
<PointMap
|
|
180
|
-
data="grouped_locations"
|
|
181
|
-
lat=lat
|
|
182
|
-
long=long
|
|
183
|
-
value=Category
|
|
184
|
-
/>
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
#### Custom Colors
|
|
188
|
-
Set custom legend colors using the `colorPalette` prop to match the number of categories; excess categorical options will default to standard colors.
|
|
189
|
-
|
|
190
|
-
**Example:**
|
|
191
|
-
|
|
192
|
-
```svelte
|
|
193
|
-
<PointMap
|
|
194
|
-
data="grouped_locations"
|
|
195
|
-
lat=lat
|
|
196
|
-
long=long
|
|
197
|
-
value=Category
|
|
198
|
-
colorPalette={['#C65D47', '#5BAF7A', '#4A8EBA', '#D35B85', '#E1C16D', '#6F5B9A', '#4E8D8D']}
|
|
199
|
-
/>
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
#### Scalar Legend
|
|
203
|
-
|
|
204
|
-
**Example:**
|
|
205
|
-
|
|
206
|
-
```svelte
|
|
207
|
-
<PointMap
|
|
208
|
-
data="grouped_locations"
|
|
209
|
-
lat=lat
|
|
210
|
-
long=long
|
|
211
|
-
value=sales
|
|
212
|
-
valueFmt=usd
|
|
213
|
-
/>
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
#### Custom Colors
|
|
217
|
-
Define scalar legend colors using the `colorPalette` prop, allowing specified colors to create a gradient based on the range of values.
|
|
218
|
-
|
|
219
|
-
**Example:**
|
|
220
|
-
|
|
221
|
-
```svelte
|
|
222
|
-
<PointMap
|
|
223
|
-
data="grouped_locations"
|
|
224
|
-
lat=lat
|
|
225
|
-
long=long
|
|
226
|
-
value=sales
|
|
227
|
-
valueFmt=usd
|
|
228
|
-
colorPalette={['#C65D47', '#4A8EBA']}
|
|
229
|
-
/>
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
## Options
|
|
233
|
-
|
|
234
|
-
### Points
|
|
235
|
-
|
|
236
|
-
| Property | Required | Type | Description |
|
|
237
|
-
|----------|----------|------|-------------|
|
|
238
|
-
| data | ✓ | query name | Query result, referenced using curly braces |
|
|
239
|
-
| value | | column name | Column that determines the value displayed at each point. |
|
|
240
|
-
| valueFmt | | format string | Format string for displaying the value. |
|
|
241
|
-
| pointName | | column name | Column containing the names/labels of the points - by default, this is shown as the title of the tooltip. |
|
|
242
|
-
| title | | string | Title for the map |
|
|
243
|
-
| subtitle | | string | Subtitle - appears under the title |
|
|
244
|
-
| ignoreZoom | | true/false (default: false) | Stops map from zooming out to show all data for this layer |
|
|
245
|
-
|
|
246
|
-
### Color Scale
|
|
247
|
-
|
|
248
|
-
| Property | Type | Description |
|
|
249
|
-
|----------|------|-------------|
|
|
250
|
-
| colorPalette | array of colors | Array of colors used for theming the points based on data |
|
|
251
|
-
| min | number | Minimum value to use for the color scale. |
|
|
252
|
-
| max | number | Maximum value to use for the color scale. |
|
|
253
|
-
|
|
254
|
-
### Legend
|
|
255
|
-
|
|
256
|
-
| Property | Type | Default | Description |
|
|
257
|
-
|----------|------|---------|-------------|
|
|
258
|
-
| legend | true/false | true | Turns legend on or off |
|
|
259
|
-
| legendType | categorical/scalar | | Appends a categorical or scalar legend to the map |
|
|
260
|
-
| legendPosition | bottomLeft/topLeft/bottomRight/topRight | bottomLeft | Determines the legend's position on the map, with options provided |
|
|
261
|
-
|
|
262
|
-
### Interactivity
|
|
263
|
-
|
|
264
|
-
| Property | Type | Description |
|
|
265
|
-
|----------|------|-------------|
|
|
266
|
-
| link | URL | URL to navigate to when a point is clicked. |
|
|
267
|
-
| name | string | Input name. Can be referenced on your page with `{inputs.my_input_name}` |
|
|
268
|
-
|
|
269
|
-
### Styling
|
|
270
|
-
| Property | Type | Default | Description |
|
|
271
|
-
|----------|------|---------|-------------|
|
|
272
|
-
| color | CSS color value | | Color for the points. Use when you want all points to be the same color. |
|
|
273
|
-
| size | number | 5 | Size of the points |
|
|
274
|
-
| borderWidth | pixel value | | Width of the border around each point. |
|
|
275
|
-
| borderColor | CSS color value | | Color of the border around each point. |
|
|
276
|
-
| opacity | number between 0 and 1 | | Opacity of the points. |
|
|
277
|
-
|
|
278
|
-
### Selected State
|
|
279
|
-
|
|
280
|
-
| Property | Type | Default | Description |
|
|
281
|
-
|----------|------|---------|-------------|
|
|
282
|
-
| selectedColor | CSS color value | | When point is selected: Color for the points. Use when you want all points to be the same color. |
|
|
283
|
-
| selectedBorderWidth | pixel value | 0.75 | When point is selected: Width of the border around each point. |
|
|
284
|
-
| selectedBorderColor | CSS color value | white | When point is selected: Color of the border around each point. |
|
|
285
|
-
| selectedOpacity | number between 0 and 1 | 0.8 | When point is selected: Opacity of the points. |
|
|
286
|
-
|
|
287
|
-
### Tooltips
|
|
288
|
-
| Property | Type | Default | Description |
|
|
289
|
-
|----------|------|---------|-------------|
|
|
290
|
-
| showTooltip | boolean | true | Whether to show tooltips |
|
|
291
|
-
| tooltipType | hover/click | hover | Determines whether tooltips are activated by hover or click. |
|
|
292
|
-
| tooltipClass | CSS class | | CSS class applied to the tooltip content. You can pass Tailwind classes into this prop to custom-style the tooltip |
|
|
293
|
-
| tooltip | array of objects | | Configuration for tooltips associated with each area. See below example for format |
|
|
294
|
-
|
|
295
|
-
#### `tooltip` example:
|
|
296
|
-
|
|
297
|
-
```javascript
|
|
298
|
-
tooltip="[
|
|
299
|
-
{id: 'zip_code', fmt: 'id', showColumnName: false, valueClass: 'text-xl font-semibold'",
|
|
300
|
-
{id: 'sales', fmt: 'eur', fieldClass: 'text-[grey]', valueClass: 'text-[green]'},
|
|
301
|
-
{id: 'zip_code', showColumnName: false, contentType: 'link', linkLabel: 'Click here', valueClass: 'font-bold mt-1'}
|
|
302
|
-
]}
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
#### All options available in `tooltip`:
|
|
306
|
-
- `id`: column ID
|
|
307
|
-
- `title`: custom string to use as title of field
|
|
308
|
-
- `fmt`: format to use for value
|
|
309
|
-
- `showColumnName`: whether to show the column name. If `false`, only the value will be shown
|
|
310
|
-
- `contentType`: currently can only be "link"
|
|
311
|
-
- `linkLabel`: text to show for a link when contentType="link"
|
|
312
|
-
- `formatColumnTitle`: whether to automatically uppercase the first letter of the title. Only applies when `title` not passed explicitly
|
|
313
|
-
- `valueClass`: custom Tailwind classes to style the values
|
|
314
|
-
- `fieldClass`: custom Tailwind classes to style the column names
|
|
315
|
-
|
|
316
|
-
### Base Map
|
|
317
|
-
|
|
318
|
-
| Property | Type | Description |
|
|
319
|
-
|----------|------|-------------|
|
|
320
|
-
| basemap | URL | URL template for the basemap tiles. |
|
|
321
|
-
| attribution | text | Attribution text to display on the map (e.g., "© OpenStreetMap contributors"). |
|
|
322
|
-
| title | text | Optional title displayed above the map. |
|
|
323
|
-
| startingLat | latitude coordinate | Starting latitude for the map center. |
|
|
324
|
-
| startingLong | longitude coordinate | Starting longitude for the map center. |
|
|
325
|
-
| startingZoom | number (1 to 18) | Initial zoom level of the map. |
|
|
326
|
-
| height | pixel value | 300 | Height of the map in pixels. |
|