@cfasim-ui/docs 0.6.4 → 0.7.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.
- package/charts/ChoroplethMap/ChoroplethMap.md +99 -29
- package/charts/ChoroplethMap/ChoroplethMap.vue +456 -127
- package/charts/DataTable/DataTable.vue +1 -7
- package/charts/_shared/ChartZoomControls.vue +138 -0
- package/charts/_shared/index.ts +4 -15
- package/charts/_shared/seriesCsv.ts +2 -2
- package/charts/_shared/touch.ts +8 -0
- package/charts/_shared/useChartFoundation.ts +0 -1
- package/components/MultiSelect/MultiSelect.md +1 -1
- package/components/MultiSelect/MultiSelect.vue +24 -83
- package/components/NumberInput/NumberInput.md +5 -5
- package/components/NumberInput/NumberInput.vue +12 -59
- package/components/SelectBox/SelectBox.md +1 -0
- package/components/SelectBox/SelectBox.vue +34 -125
- package/components/TextInput/TextInput.md +2 -1
- package/components/TextInput/TextInput.vue +11 -51
- package/components/ToggleGroup/ToggleGroup.md +2 -2
- package/components/ToggleGroup/ToggleGroup.vue +21 -26
- package/components/_internal/FieldLabel.vue +27 -0
- package/components/_internal/field.ts +27 -0
- package/components/_internal/input.css +54 -0
- package/components/_internal/listbox.css +53 -0
- package/components/env.d.ts +4 -0
- package/index.json +8 -8
- package/package.json +1 -1
- package/pyodide/messages.ts +23 -0
- package/pyodide/pyodide.worker.ts +2 -21
- package/pyodide/pyodideWorkerApi.ts +7 -44
- package/shared/index.ts +1 -0
- package/shared/workerError.ts +17 -0
- package/wasm/messages.ts +6 -0
- package/wasm/wasm.worker.ts +1 -7
- package/wasm/wasmWorkerApi.ts +8 -26
|
@@ -254,18 +254,73 @@ Use an array of `CategoricalStop` objects to map string values to colors. Each s
|
|
|
254
254
|
</template>
|
|
255
255
|
</ComponentDemo>
|
|
256
256
|
|
|
257
|
-
###
|
|
257
|
+
### Pan and zoom
|
|
258
|
+
|
|
259
|
+
Maps are **fully static by default** — tooltips, hover, click-select, and
|
|
260
|
+
programmatic `focus` zoom all work, but there are no zoom gestures and no
|
|
261
|
+
controls. That's the right mode when clicks mean navigation instead of
|
|
262
|
+
exploration (see the state-map pattern below); a parent driving `focus`
|
|
263
|
+
provides its own way back (e.g. a "Back" button that clears the focus).
|
|
264
|
+
|
|
265
|
+
Add the `zoom` prop to enable the interaction. The map is then **static
|
|
266
|
+
until activated** — the scroll wheel never zooms inline, so the map can't
|
|
267
|
+
hijack page scrolling. A grey hint overlaid on the top of the map ("Double
|
|
268
|
+
click to zoom" / "Tap to zoom") advertises the gesture until it's been
|
|
269
|
+
used; pass `:zoom-hint="false"` to hide it.
|
|
270
|
+
|
|
271
|
+
- **Desktop:** double-click zooms in place (shift+double-click zooms out),
|
|
272
|
+
or press **+** in the always-present **+ / − / reset** control stack in
|
|
273
|
+
the top-left corner. Any of these — or clicking a feature — starts the
|
|
274
|
+
pan/zoom mode; from then on, drag pans the map. The reset button (a
|
|
275
|
+
counterclockwise arrow) animates back to the full extent (clearing any
|
|
276
|
+
`focus`); − and reset are disabled while the map is at its full extent.
|
|
277
|
+
- **Touch:** a tap expands the map to fill the window, zoomed in on the
|
|
278
|
+
tapped point. Inside, one finger pans, a pinch zooms, and a tap selects a
|
|
279
|
+
feature; the +/−/reset controls sit top-left and a close (✕) button
|
|
280
|
+
top-right returns to the inline map at full extent. The inline map ignores
|
|
281
|
+
touch gestures entirely, so the page always scrolls freely.
|
|
282
|
+
|
|
283
|
+
Filling the window is always an activated state: whether entered via the
|
|
284
|
+
menu's **Fullscreen** item or a tap, pan/zoom works immediately and the
|
|
285
|
+
controls are present — no double-click needed first. The scroll wheel (and
|
|
286
|
+
trackpad pinch) zooms there too, since page scrolling is locked while the
|
|
287
|
+
map fills the window.
|
|
288
|
+
|
|
289
|
+
Prefer in-place zooming on touch? Set `:touch-expand="false"` — the first
|
|
290
|
+
tap zooms the inline map in on the tapped point (the touch analogue of a
|
|
291
|
+
desktop double-click) instead of expanding it. From there one finger pans,
|
|
292
|
+
a pinch zooms, and taps select; the +/−/reset controls render inline, and
|
|
293
|
+
reset restores the original static, page-scrollable state. Fullscreen is
|
|
294
|
+
unaffected: that view stays continuously interactive and its reset only
|
|
295
|
+
recenters.
|
|
296
|
+
|
|
297
|
+
#### Full-page mode (`zoom-mode="scroll"`)
|
|
298
|
+
|
|
299
|
+
When the map _is_ the page — a dedicated map route, a dashboard panel, a
|
|
300
|
+
kiosk — the activation step just gets in the way, and there's no page
|
|
301
|
+
scroll to protect. Pair `zoom` with `zoom-mode="scroll"` to make the map
|
|
302
|
+
immediately interactive: the wheel (and trackpad pinch) zooms, dragging
|
|
303
|
+
pans, and touch gestures work inline with no tap-to-expand step. The
|
|
304
|
+
+/−/reset controls are always shown and the hint is suppressed.
|
|
258
305
|
|
|
259
|
-
|
|
306
|
+
```vue
|
|
307
|
+
<ChoroplethMap
|
|
308
|
+
:topology="statesTopo"
|
|
309
|
+
:data="stateData"
|
|
310
|
+
zoom
|
|
311
|
+
zoom-mode="scroll"
|
|
312
|
+
/>
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### County-level map
|
|
260
316
|
|
|
261
|
-
|
|
317
|
+
Set `geoType="counties"` to render county-level data using 5-digit FIPS codes. State borders are drawn on top for context. Double-click (or tap on touch) to explore — useful for dense county data.
|
|
262
318
|
|
|
263
319
|
<ComponentDemo>
|
|
264
320
|
<ChoroplethMap
|
|
265
321
|
:topology="countiesTopo"
|
|
266
322
|
geo-type="counties"
|
|
267
|
-
|
|
268
|
-
:zoom="true"
|
|
323
|
+
zoom
|
|
269
324
|
:data="[
|
|
270
325
|
{ id: '06037', value: 100 },
|
|
271
326
|
{ id: '06073', value: 80 },
|
|
@@ -289,7 +344,6 @@ On touch devices, add `two-finger-pan` so a single finger scrolls the page (the
|
|
|
289
344
|
<ChoroplethMap
|
|
290
345
|
:topology="countiesTopo"
|
|
291
346
|
geo-type="counties"
|
|
292
|
-
pan
|
|
293
347
|
zoom
|
|
294
348
|
:data="[
|
|
295
349
|
{ id: '06037', value: 100 },
|
|
@@ -315,8 +369,7 @@ Set `geoType="hsas"` to render Health Service Area boundaries. HSAs are dissolve
|
|
|
315
369
|
<ChoroplethMap
|
|
316
370
|
:topology="countiesTopo"
|
|
317
371
|
geo-type="hsas"
|
|
318
|
-
|
|
319
|
-
:zoom="true"
|
|
372
|
+
zoom
|
|
320
373
|
:data="[
|
|
321
374
|
{ id: '010259', value: 100 },
|
|
322
375
|
{ id: '060766', value: 90 },
|
|
@@ -340,7 +393,6 @@ Set `geoType="hsas"` to render Health Service Area boundaries. HSAs are dissolve
|
|
|
340
393
|
<ChoroplethMap
|
|
341
394
|
:topology="countiesTopo"
|
|
342
395
|
geo-type="hsas"
|
|
343
|
-
pan
|
|
344
396
|
zoom
|
|
345
397
|
:data="[
|
|
346
398
|
{ id: '010259', value: 100 },
|
|
@@ -367,11 +419,18 @@ This needs a counties topology (the same `us-atlas/counties-10m.json`). `data`
|
|
|
367
419
|
can stay national; only features inside the selected state are drawn and
|
|
368
420
|
colored.
|
|
369
421
|
|
|
422
|
+
This demo also opts for the quieter touch flow: `:touch-expand="false"` makes
|
|
423
|
+
a tap zoom in place instead of expanding to fill the window, and
|
|
424
|
+
`:zoom-hint="false"` drops the grey gesture hint.
|
|
425
|
+
|
|
370
426
|
<ComponentDemo>
|
|
371
427
|
<ChoroplethMap
|
|
372
428
|
:topology="countiesTopo"
|
|
373
429
|
geo-type="counties"
|
|
374
430
|
state="California"
|
|
431
|
+
zoom
|
|
432
|
+
:touch-expand="false"
|
|
433
|
+
:zoom-hint="false"
|
|
375
434
|
:data="[
|
|
376
435
|
{ id: '06037', value: 100 },
|
|
377
436
|
{ id: '06073', value: 80 },
|
|
@@ -392,6 +451,9 @@ colored.
|
|
|
392
451
|
:topology="countiesTopo"
|
|
393
452
|
geo-type="counties"
|
|
394
453
|
state="California"
|
|
454
|
+
zoom
|
|
455
|
+
:touch-expand="false"
|
|
456
|
+
:zoom-hint="false"
|
|
395
457
|
:data="[
|
|
396
458
|
{ id: '06037', value: 100 }, // Los Angeles
|
|
397
459
|
{ id: '06073', value: 80 }, // San Diego
|
|
@@ -416,16 +478,22 @@ Bind the `focus` prop to pan and zoom to a specific feature. Pass a feature
|
|
|
416
478
|
id (FIPS code, HSA code, or name) — or an array of ids to focus on a region.
|
|
417
479
|
With `v-model:focus`, clicking an unfocused feature focuses it and clicking
|
|
418
480
|
the focused feature toggles back off. If a tooltip is configured, focusing
|
|
419
|
-
shows that feature's tooltip. Users can
|
|
420
|
-
area; the built-in **
|
|
481
|
+
shows that feature's tooltip. Users can keep exploring around the focused
|
|
482
|
+
area; the built-in **reset** button clears focus and snaps back to the full
|
|
483
|
+
extent.
|
|
421
484
|
|
|
422
485
|
Set `:focus-zoom="false"` to highlight (and draw cross-geoType overlays)
|
|
423
486
|
**without** panning or zooming — useful for a click-to-select interaction
|
|
424
487
|
where the map should stay put while a side panel shows the details.
|
|
425
488
|
|
|
426
|
-
|
|
427
|
-
`stateClick` and toggles focus
|
|
428
|
-
|
|
489
|
+
On touch, selection happens inside the tap-to-expand view: a single-finger
|
|
490
|
+
**tap** on a feature there emits `stateClick` and toggles focus. (With
|
|
491
|
+
`:zoom="false"` a tap selects directly on the inline map instead.) Hover
|
|
492
|
+
tooltips stay off on touch for performance.
|
|
493
|
+
|
|
494
|
+
Click-to-focus interactions usually pair best with `:touch-expand="false"`,
|
|
495
|
+
as in the demos below — the first tap zooms in place and the next tap
|
|
496
|
+
selects, so the map stays in your layout instead of taking over the window.
|
|
429
497
|
|
|
430
498
|
Counties are tiny without a zoom — focus is a natural fit for drill-down.
|
|
431
499
|
|
|
@@ -435,6 +503,8 @@ Counties are tiny without a zoom — focus is a natural fit for drill-down.
|
|
|
435
503
|
geo-type="counties"
|
|
436
504
|
v-model:focus="focused"
|
|
437
505
|
:focus-zoom-level="8"
|
|
506
|
+
zoom
|
|
507
|
+
:touch-expand="false"
|
|
438
508
|
:data="[
|
|
439
509
|
{ id: '06037', value: 100 },
|
|
440
510
|
{ id: '06073', value: 80 },
|
|
@@ -469,6 +539,8 @@ const focused = ref(null);
|
|
|
469
539
|
geo-type="counties"
|
|
470
540
|
v-model:focus="focused"
|
|
471
541
|
:focus-zoom-level="8"
|
|
542
|
+
zoom
|
|
543
|
+
:touch-expand="false"
|
|
472
544
|
:data="data"
|
|
473
545
|
title="Click a county to focus"
|
|
474
546
|
>
|
|
@@ -496,8 +568,8 @@ on top with a `FocusItem`.
|
|
|
496
568
|
:topology="countiesTopo"
|
|
497
569
|
geo-type="counties"
|
|
498
570
|
data-geo-type="hsas"
|
|
499
|
-
|
|
500
|
-
:
|
|
571
|
+
zoom
|
|
572
|
+
:touch-expand="false"
|
|
501
573
|
:data="[
|
|
502
574
|
{ id: '060737', value: 80 },
|
|
503
575
|
{ id: '060723', value: 60 },
|
|
@@ -523,6 +595,8 @@ on top with a `FocusItem`.
|
|
|
523
595
|
:topology="countiesTopo"
|
|
524
596
|
geo-type="counties"
|
|
525
597
|
data-geo-type="hsas"
|
|
598
|
+
zoom
|
|
599
|
+
:touch-expand="false"
|
|
526
600
|
:data="hsaData"
|
|
527
601
|
:focus="[{ id: '06043' }, { id: '060737', geoType: 'hsas', style: 'dashed' }]"
|
|
528
602
|
title="HSA-keyed data on a county map"
|
|
@@ -549,8 +623,8 @@ subpath so consumers that don't need HSA lookups don't pay for the
|
|
|
549
623
|
:topology="countiesTopo"
|
|
550
624
|
geo-type="counties"
|
|
551
625
|
data-geo-type="hsas"
|
|
552
|
-
|
|
553
|
-
:
|
|
626
|
+
zoom
|
|
627
|
+
:touch-expand="false"
|
|
554
628
|
:focus="parentFocus"
|
|
555
629
|
@update:focus="focusedCounty = typeof $event === 'string' ? $event : null"
|
|
556
630
|
:data="[
|
|
@@ -595,6 +669,8 @@ const focus = computed(() => {
|
|
|
595
669
|
:topology="countiesTopo"
|
|
596
670
|
geo-type="counties"
|
|
597
671
|
data-geo-type="hsas"
|
|
672
|
+
zoom
|
|
673
|
+
:touch-expand="false"
|
|
598
674
|
:data="hsaData"
|
|
599
675
|
:focus="focus"
|
|
600
676
|
@update:focus="focusedCounty = typeof $event === 'string' ? $event : null"
|
|
@@ -654,8 +730,7 @@ Renders every US county with a value and a custom tooltip slot.
|
|
|
654
730
|
:topology="countiesTopo"
|
|
655
731
|
geo-type="counties"
|
|
656
732
|
:data="denseCountyData"
|
|
657
|
-
|
|
658
|
-
:zoom="true"
|
|
733
|
+
zoom
|
|
659
734
|
:color-scale="{ min: '#f0f5ff', max: '#08306b' }"
|
|
660
735
|
title="All US counties — tooltip perf demo"
|
|
661
736
|
:height="500"
|
|
@@ -680,13 +755,7 @@ const data = countiesTopo.objects.counties.geometries.map((g, i) => ({
|
|
|
680
755
|
}));
|
|
681
756
|
</script>
|
|
682
757
|
|
|
683
|
-
<ChoroplethMap
|
|
684
|
-
:topology="countiesTopo"
|
|
685
|
-
geo-type="counties"
|
|
686
|
-
:data="data"
|
|
687
|
-
pan
|
|
688
|
-
zoom
|
|
689
|
-
>
|
|
758
|
+
<ChoroplethMap :topology="countiesTopo" geo-type="counties" :data="data" zoom>
|
|
690
759
|
<template #tooltip="{ id, name, value }">
|
|
691
760
|
<div style="font-weight: 600">{{ name }}</div>
|
|
692
761
|
<div style="opacity: 0.7; font-size: 0.85em">FIPS {{ id }}</div>
|
|
@@ -793,8 +862,9 @@ tech).
|
|
|
793
862
|
| `legend` | `boolean` | No | `true` |
|
|
794
863
|
| `legendTitle` | `string` | No | — |
|
|
795
864
|
| `zoom` | `boolean` | No | `false` |
|
|
796
|
-
| `
|
|
797
|
-
| `
|
|
865
|
+
| `zoomMode` | `"activate" \| "scroll"` | No | `"activate"` |
|
|
866
|
+
| `touchExpand` | `boolean` | No | `true` |
|
|
867
|
+
| `zoomHint` | `boolean` | No | `true` |
|
|
798
868
|
| `tooltipTrigger` | `"hover" \| "click"` | No | — |
|
|
799
869
|
| `tooltipFormat` | `(data: {
|
|
800
870
|
id: string` | No | — |
|