@cfasim-ui/charts 0.7.3 → 0.7.4
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/dist/ChoroplethMap/ChoroplethMap.d.ts +58 -16
- package/dist/ChoroplethMap/ChoroplethTooltip.d.ts +30 -6
- package/dist/index.css +1 -1
- package/dist/index.js +127 -104
- package/package.json +2 -2
|
@@ -242,7 +242,9 @@ declare function __VLS_template(): {
|
|
|
242
242
|
tooltipChildRef: ({
|
|
243
243
|
$: import('vue').ComponentInternalInstance;
|
|
244
244
|
$data: {};
|
|
245
|
-
$props:
|
|
245
|
+
$props: {
|
|
246
|
+
readonly mode?: "float" | "sheet" | undefined;
|
|
247
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
246
248
|
$attrs: import('vue').Attrs;
|
|
247
249
|
$refs: {
|
|
248
250
|
[x: string]: unknown;
|
|
@@ -257,10 +259,15 @@ declare function __VLS_template(): {
|
|
|
257
259
|
$host: Element | null;
|
|
258
260
|
$emit: (event: string, ...args: any[]) => void;
|
|
259
261
|
$el: any;
|
|
260
|
-
$options: import('vue').ComponentOptionsBase<Readonly<{
|
|
262
|
+
$options: import('vue').ComponentOptionsBase<Readonly<{
|
|
263
|
+
mode?: "float" | "sheet";
|
|
264
|
+
}> & Readonly<{}>, {
|
|
261
265
|
setData(next: import('./ChoroplethTooltip').ChoroplethTooltipData | null): void;
|
|
266
|
+
setOpen(next: boolean): void;
|
|
262
267
|
getEl(): HTMLDivElement | null;
|
|
263
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
268
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
269
|
+
mode: "float" | "sheet";
|
|
270
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
264
271
|
beforeCreate?: (() => void) | (() => void)[];
|
|
265
272
|
created?: (() => void) | (() => void)[];
|
|
266
273
|
beforeMount?: (() => void) | (() => void)[];
|
|
@@ -280,14 +287,28 @@ declare function __VLS_template(): {
|
|
|
280
287
|
$forceUpdate: () => void;
|
|
281
288
|
$nextTick: typeof nextTick;
|
|
282
289
|
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
283
|
-
} & Readonly<{
|
|
290
|
+
} & Readonly<{
|
|
291
|
+
mode: "float" | "sheet";
|
|
292
|
+
}> & Omit<Readonly<{
|
|
293
|
+
mode?: "float" | "sheet";
|
|
294
|
+
}> & Readonly<{}>, "mode" | "setData" | "setOpen" | "getEl"> & {
|
|
284
295
|
setData: (next: import('./ChoroplethTooltip').ChoroplethTooltipData | null) => void;
|
|
296
|
+
setOpen: (next: boolean) => void;
|
|
285
297
|
getEl: () => HTMLDivElement | null;
|
|
286
298
|
} & {} & import('vue').ComponentCustomProperties & {} & {
|
|
287
|
-
$slots:
|
|
288
|
-
default?(
|
|
289
|
-
|
|
290
|
-
|
|
299
|
+
$slots: {
|
|
300
|
+
default?(_: {
|
|
301
|
+
id: string;
|
|
302
|
+
name: string;
|
|
303
|
+
value?: number | string | undefined;
|
|
304
|
+
feature: unknown;
|
|
305
|
+
}): any;
|
|
306
|
+
default?(_: {
|
|
307
|
+
id: string;
|
|
308
|
+
name: string;
|
|
309
|
+
value?: number | string | undefined;
|
|
310
|
+
feature: unknown;
|
|
311
|
+
}): any;
|
|
291
312
|
};
|
|
292
313
|
}) | null;
|
|
293
314
|
};
|
|
@@ -341,7 +362,9 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
341
362
|
tooltipChildRef: ({
|
|
342
363
|
$: import('vue').ComponentInternalInstance;
|
|
343
364
|
$data: {};
|
|
344
|
-
$props:
|
|
365
|
+
$props: {
|
|
366
|
+
readonly mode?: "float" | "sheet" | undefined;
|
|
367
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
345
368
|
$attrs: import('vue').Attrs;
|
|
346
369
|
$refs: {
|
|
347
370
|
[x: string]: unknown;
|
|
@@ -356,10 +379,15 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
356
379
|
$host: Element | null;
|
|
357
380
|
$emit: (event: string, ...args: any[]) => void;
|
|
358
381
|
$el: any;
|
|
359
|
-
$options: import('vue').ComponentOptionsBase<Readonly<{
|
|
382
|
+
$options: import('vue').ComponentOptionsBase<Readonly<{
|
|
383
|
+
mode?: "float" | "sheet";
|
|
384
|
+
}> & Readonly<{}>, {
|
|
360
385
|
setData(next: import('./ChoroplethTooltip').ChoroplethTooltipData | null): void;
|
|
386
|
+
setOpen(next: boolean): void;
|
|
361
387
|
getEl(): HTMLDivElement | null;
|
|
362
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
388
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
389
|
+
mode: "float" | "sheet";
|
|
390
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
363
391
|
beforeCreate?: (() => void) | (() => void)[];
|
|
364
392
|
created?: (() => void) | (() => void)[];
|
|
365
393
|
beforeMount?: (() => void) | (() => void)[];
|
|
@@ -379,14 +407,28 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
379
407
|
$forceUpdate: () => void;
|
|
380
408
|
$nextTick: typeof nextTick;
|
|
381
409
|
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
382
|
-
} & Readonly<{
|
|
410
|
+
} & Readonly<{
|
|
411
|
+
mode: "float" | "sheet";
|
|
412
|
+
}> & Omit<Readonly<{
|
|
413
|
+
mode?: "float" | "sheet";
|
|
414
|
+
}> & Readonly<{}>, "mode" | "setData" | "setOpen" | "getEl"> & {
|
|
383
415
|
setData: (next: import('./ChoroplethTooltip').ChoroplethTooltipData | null) => void;
|
|
416
|
+
setOpen: (next: boolean) => void;
|
|
384
417
|
getEl: () => HTMLDivElement | null;
|
|
385
418
|
} & {} & import('vue').ComponentCustomProperties & {} & {
|
|
386
|
-
$slots:
|
|
387
|
-
default?(
|
|
388
|
-
|
|
389
|
-
|
|
419
|
+
$slots: {
|
|
420
|
+
default?(_: {
|
|
421
|
+
id: string;
|
|
422
|
+
name: string;
|
|
423
|
+
value?: number | string | undefined;
|
|
424
|
+
feature: unknown;
|
|
425
|
+
}): any;
|
|
426
|
+
default?(_: {
|
|
427
|
+
id: string;
|
|
428
|
+
name: string;
|
|
429
|
+
value?: number | string | undefined;
|
|
430
|
+
feature: unknown;
|
|
431
|
+
}): any;
|
|
390
432
|
};
|
|
391
433
|
}) | null;
|
|
392
434
|
}, any>;
|
|
@@ -4,12 +4,32 @@ export interface ChoroplethTooltipData {
|
|
|
4
4
|
value?: number | string;
|
|
5
5
|
feature: unknown;
|
|
6
6
|
}
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
/**
|
|
9
|
+
* `"float"` (default) renders the classic pointer-anchored tooltip.
|
|
10
|
+
* `"sheet"` renders a bottom sheet that slides up inside the map
|
|
11
|
+
* wrapper instead — used in the expanded touch view, where it stays
|
|
12
|
+
* correctly positioned regardless of the page's pinch-zoom state
|
|
13
|
+
* (the wrapper is pinned to the visual viewport; floating fixed
|
|
14
|
+
* positioning is not).
|
|
15
|
+
*/
|
|
16
|
+
mode?: "float" | "sheet";
|
|
17
|
+
};
|
|
7
18
|
declare function __VLS_template(): {
|
|
8
19
|
attrs: Partial<{}>;
|
|
9
|
-
slots:
|
|
10
|
-
default?(
|
|
11
|
-
|
|
12
|
-
|
|
20
|
+
slots: {
|
|
21
|
+
default?(_: {
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
value?: number | string | undefined;
|
|
25
|
+
feature: unknown;
|
|
26
|
+
}): any;
|
|
27
|
+
default?(_: {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
value?: number | string | undefined;
|
|
31
|
+
feature: unknown;
|
|
32
|
+
}): any;
|
|
13
33
|
};
|
|
14
34
|
refs: {
|
|
15
35
|
root: HTMLDivElement;
|
|
@@ -17,10 +37,14 @@ declare function __VLS_template(): {
|
|
|
17
37
|
rootEl: any;
|
|
18
38
|
};
|
|
19
39
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
20
|
-
declare const __VLS_component: import('vue').DefineComponent<
|
|
40
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
|
|
21
41
|
setData(next: ChoroplethTooltipData | null): void;
|
|
42
|
+
/** Sheet-mode visibility (float mode is driven imperatively via getEl). */
|
|
43
|
+
setOpen(next: boolean): void;
|
|
22
44
|
getEl(): HTMLDivElement | null;
|
|
23
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<
|
|
45
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
46
|
+
mode: "float" | "sheet";
|
|
47
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
24
48
|
root: HTMLDivElement;
|
|
25
49
|
}, any>;
|
|
26
50
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
package/dist/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.chart-menu-trigger-area[data-v-f5743494]{z-index:1;position:absolute;top:.5em;right:.5em}.chart-menu-trigger-area--expanded[data-v-f5743494]{top:1.25em;right:1.25em}.chart-menu-button[data-v-f5743494]{border:1px solid var(--color-border);background:var(--color-bg-0,#fff);width:28px;height:28px;color:var(--color-text-secondary);cursor:pointer;opacity:0;border-radius:.25em;justify-content:center;align-items:center;transition:opacity .15s;display:flex}.chart-menu-button[data-state=open][data-v-f5743494],.chart-close-button[data-v-f5743494]{opacity:1}.chart-menu-button[data-v-f5743494]:hover{background:var(--color-bg-1,#0000000d);color:var(--color-text)}.line-chart-wrapper:hover .chart-menu-button,.bar-chart-wrapper:hover .chart-menu-button,.choropleth-wrapper:hover .chart-menu-button,.line-chart-wrapper:focus-within .chart-menu-button,.bar-chart-wrapper:focus-within .chart-menu-button,.choropleth-wrapper:focus-within .chart-menu-button{opacity:1}.chart-sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.chart-menu-content{z-index:100;background:var(--color-bg-0);border:1px solid var(--color-border);border-radius:.25em;min-width:140px;padding:.25em;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a}.chart-menu-item{font-size:var(--font-size-sm);cursor:pointer;-webkit-user-select:none;user-select:none;white-space:nowrap;border-radius:.25em;outline:none;align-items:center;padding:.375em .5em;display:flex}.chart-menu-item[data-highlighted]{background:var(--color-primary);color:#fff}.chart-zoom-controls[data-v-87ceeada]{z-index:1;flex-direction:column;gap:4px;display:flex;position:absolute;top:.5em;left:.5em}.chart-zoom-controls--expanded[data-v-87ceeada]{top:1.25em;left:1.25em}.chart-zoom-button[data-v-87ceeada]{border:1px solid var(--color-border,#e5e7eb);background:var(--color-bg-0,#fff);width:28px;height:28px;color:var(--color-text-secondary,#555);cursor:pointer;border-radius:.25em;justify-content:center;align-items:center;padding:0;display:flex}.chart-zoom-button[data-v-87ceeada]:hover:not(:disabled){background:var(--color-bg-1,#0000000d);color:var(--color-text)}.chart-zoom-button[data-v-87ceeada]:disabled{opacity:.4;cursor:default}.line-chart-wrapper[data-v-a3132bed]{width:100%;position:relative}.line-chart-tooltip-label[data-v-a3132bed]{margin-bottom:.25em;font-weight:600}.line-chart-tooltip-row[data-v-a3132bed]{align-items:center;gap:.375em;display:flex}.line-chart-download-link[data-v-a3132bed]{text-align:right;font-size:var(--font-size-sm);margin-top:.25em;display:block}.line-chart-tooltip-swatch[data-v-a3132bed]{border-radius:50%;flex-shrink:0;width:.625em;height:.625em;display:inline-block}.line-chart-download-button{border:1px solid var(--color-border);background:var(--color-bg-0,#fff);color:var(--color-text);font-size:var(--font-size-sm);cursor:pointer;border-radius:.25em;align-items:center;margin-top:.5em;padding:.5em 1em;display:inline-flex}.line-chart-download-button:hover{background:var(--color-bg-1,#0000000d)}.line-chart-download-button:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}.bar-chart-wrapper[data-v-251f7945]{width:100%;position:relative}.bar-chart-tooltip-label[data-v-251f7945]{margin-bottom:.25em;font-weight:600}.bar-chart-tooltip-row[data-v-251f7945]{align-items:center;gap:.375em;display:flex}.bar-chart-download-link[data-v-251f7945]{text-align:right;font-size:var(--font-size-sm);margin-top:.25em;display:block}.bar-chart-tooltip-swatch[data-v-251f7945]{border-radius:50%;flex-shrink:0;width:.625em;height:.625em;display:inline-block}.bar-chart-download-button{border:1px solid var(--color-border);background:var(--color-bg-0,#fff);color:var(--color-text);font-size:var(--font-size-sm);cursor:pointer;border-radius:.25em;align-items:center;margin-top:.5em;padding:.5em 1em;display:inline-flex}.bar-chart-download-button:hover{background:var(--color-bg-1,#0000000d)}.bar-chart-download-button:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}.choropleth-wrapper[data-v-
|
|
1
|
+
.chart-menu-trigger-area[data-v-f5743494]{z-index:1;position:absolute;top:.5em;right:.5em}.chart-menu-trigger-area--expanded[data-v-f5743494]{top:1.25em;right:1.25em}.chart-menu-button[data-v-f5743494]{border:1px solid var(--color-border);background:var(--color-bg-0,#fff);width:28px;height:28px;color:var(--color-text-secondary);cursor:pointer;opacity:0;border-radius:.25em;justify-content:center;align-items:center;transition:opacity .15s;display:flex}.chart-menu-button[data-state=open][data-v-f5743494],.chart-close-button[data-v-f5743494]{opacity:1}.chart-menu-button[data-v-f5743494]:hover{background:var(--color-bg-1,#0000000d);color:var(--color-text)}.line-chart-wrapper:hover .chart-menu-button,.bar-chart-wrapper:hover .chart-menu-button,.choropleth-wrapper:hover .chart-menu-button,.line-chart-wrapper:focus-within .chart-menu-button,.bar-chart-wrapper:focus-within .chart-menu-button,.choropleth-wrapper:focus-within .chart-menu-button{opacity:1}.chart-sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.chart-menu-content{z-index:100;background:var(--color-bg-0);border:1px solid var(--color-border);border-radius:.25em;min-width:140px;padding:.25em;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a}.chart-menu-item{font-size:var(--font-size-sm);cursor:pointer;-webkit-user-select:none;user-select:none;white-space:nowrap;border-radius:.25em;outline:none;align-items:center;padding:.375em .5em;display:flex}.chart-menu-item[data-highlighted]{background:var(--color-primary);color:#fff}.chart-zoom-controls[data-v-87ceeada]{z-index:1;flex-direction:column;gap:4px;display:flex;position:absolute;top:.5em;left:.5em}.chart-zoom-controls--expanded[data-v-87ceeada]{top:1.25em;left:1.25em}.chart-zoom-button[data-v-87ceeada]{border:1px solid var(--color-border,#e5e7eb);background:var(--color-bg-0,#fff);width:28px;height:28px;color:var(--color-text-secondary,#555);cursor:pointer;border-radius:.25em;justify-content:center;align-items:center;padding:0;display:flex}.chart-zoom-button[data-v-87ceeada]:hover:not(:disabled){background:var(--color-bg-1,#0000000d);color:var(--color-text)}.chart-zoom-button[data-v-87ceeada]:disabled{opacity:.4;cursor:default}.line-chart-wrapper[data-v-a3132bed]{width:100%;position:relative}.line-chart-tooltip-label[data-v-a3132bed]{margin-bottom:.25em;font-weight:600}.line-chart-tooltip-row[data-v-a3132bed]{align-items:center;gap:.375em;display:flex}.line-chart-download-link[data-v-a3132bed]{text-align:right;font-size:var(--font-size-sm);margin-top:.25em;display:block}.line-chart-tooltip-swatch[data-v-a3132bed]{border-radius:50%;flex-shrink:0;width:.625em;height:.625em;display:inline-block}.line-chart-download-button{border:1px solid var(--color-border);background:var(--color-bg-0,#fff);color:var(--color-text);font-size:var(--font-size-sm);cursor:pointer;border-radius:.25em;align-items:center;margin-top:.5em;padding:.5em 1em;display:inline-flex}.line-chart-download-button:hover{background:var(--color-bg-1,#0000000d)}.line-chart-download-button:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}.bar-chart-wrapper[data-v-251f7945]{width:100%;position:relative}.bar-chart-tooltip-label[data-v-251f7945]{margin-bottom:.25em;font-weight:600}.bar-chart-tooltip-row[data-v-251f7945]{align-items:center;gap:.375em;display:flex}.bar-chart-download-link[data-v-251f7945]{text-align:right;font-size:var(--font-size-sm);margin-top:.25em;display:block}.bar-chart-tooltip-swatch[data-v-251f7945]{border-radius:50%;flex-shrink:0;width:.625em;height:.625em;display:inline-block}.bar-chart-download-button{border:1px solid var(--color-border);background:var(--color-bg-0,#fff);color:var(--color-text);font-size:var(--font-size-sm);cursor:pointer;border-radius:.25em;align-items:center;margin-top:.5em;padding:.5em 1em;display:inline-flex}.bar-chart-download-button:hover{background:var(--color-bg-1,#0000000d)}.bar-chart-download-button:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}.chart-tooltip-sheet[data-v-90392830]{z-index:2;background:var(--color-bg-0,#fff);color:var(--color-text,inherit);border-top:1px solid var(--color-border,#e5e7eb);padding:14px 16px calc(14px + env(safe-area-inset-bottom,0px));pointer-events:none;font-size:14px;line-height:1.4;transition:transform .25s;position:absolute;bottom:0;left:0;right:0;transform:translateY(100%);box-shadow:0 -4px 12px #0000001f}.chart-tooltip-sheet.is-open[data-v-90392830]{transform:translateY(0)}.choropleth-wrapper[data-v-1b0772ac]{--choropleth-legend-bg:var(--color-bg-0,#fff);width:100%;position:relative;container-type:inline-size}.choropleth-wrapper svg[data-v-1b0772ac]{width:100%;height:auto;display:block}.choropleth-wrapper.pannable svg[data-v-1b0772ac]{cursor:grab}.choropleth-wrapper.is-fullscreen svg[data-v-1b0772ac]{flex:auto;width:100%;height:100%;min-height:0}.choropleth-wrapper.pannable svg[data-v-1b0772ac]:active{cursor:grabbing}.state-path[data-v-1b0772ac]{cursor:pointer}.choropleth-zoom-hint[data-v-1b0772ac]{z-index:1;text-align:center;color:var(--color-text-secondary,#777);opacity:.6;pointer-events:none;text-shadow:1px 0 0 var(--color-bg-0,#fff), -1px 0 0 var(--color-bg-0,#fff), 0 1px 0 var(--color-bg-0,#fff), 0 -1px 0 var(--color-bg-0,#fff), 0 0 3px var(--color-bg-0,#fff);padding-top:6px;font-size:12px;line-height:1.4;position:absolute;left:0;right:0}@container (width<=480px){.choropleth-zoom-hint[data-v-1b0772ac]{padding:0;position:static}}.choropleth-header[data-v-1b0772ac]{background:var(--choropleth-legend-bg);color:currentColor;border-radius:4px;flex-direction:column;align-items:center;gap:10px;width:fit-content;margin:0 auto;padding:8px 14px;display:flex}.choropleth-title[data-v-1b0772ac]{white-space:pre-line;font-size:14px;font-weight:600;line-height:1.2}.choropleth-legend[data-v-1b0772ac]{align-items:center;gap:14px;font-size:13px;line-height:1.2;display:flex}.choropleth-legend-title[data-v-1b0772ac]{font-weight:600}.choropleth-legend[data-v-1b0772ac]:has(.choropleth-legend-continuous){align-items:flex-start}.choropleth-legend:has(.choropleth-legend-continuous) .choropleth-legend-title[data-v-1b0772ac]{line-height:12px}.choropleth-legend-item[data-v-1b0772ac]{align-items:center;gap:6px;display:inline-flex}.choropleth-legend-swatch[data-v-1b0772ac]{border-radius:3px;width:12px;height:12px;display:inline-block}.choropleth-legend-continuous[data-v-1b0772ac]{flex-direction:column;width:160px;display:flex}.choropleth-legend-gradient[data-v-1b0772ac]{border-radius:2px;height:12px}.choropleth-legend-ticks[data-v-1b0772ac]{opacity:.7;height:14px;margin-top:4px;font-size:11px;position:relative}.choropleth-legend-ticks>span[data-v-1b0772ac]{position:absolute;transform:translate(-50%)}.chart-tooltip-anchor[data-v-44377f70]{pointer-events:none;width:1px;height:1px;position:absolute}.chart-tooltip-content{z-index:100;background:var(--color-bg-0,#fff);border:1px solid var(--color-border,#e5e7eb);font-size:var(--font-size-sm,.875rem);pointer-events:none;border-radius:.375em;padding:.5em .75em;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a}.TableOuter[data-v-9b1b6a76]{display:inline-block;position:relative}.TableOuter.full-width[data-v-9b1b6a76]{display:block}.TableWrapper[data-v-9b1b6a76]{font-size:var(--font-size-sm);overflow-x:auto}.Table[data-v-9b1b6a76]{border-collapse:collapse;font-variant-numeric:tabular-nums;border:1px solid var(--color-border);table-layout:fixed;margin:0;display:table}.Table.full-width[data-v-9b1b6a76]{width:100%}.Table tr[data-v-9b1b6a76],.Table th[data-v-9b1b6a76],.Table td[data-v-9b1b6a76]{background:0 0;border:none}.Table th[data-v-9b1b6a76],.Table td[data-v-9b1b6a76]{white-space:nowrap;text-overflow:ellipsis;text-align:left;padding:.75em 1.25em;overflow:hidden}.Table th.cell-wrap[data-v-9b1b6a76],.Table td.cell-wrap[data-v-9b1b6a76]{white-space:normal;text-overflow:clip;overflow:visible}.Table th[data-v-9b1b6a76]{border-bottom:1px solid var(--color-border-header);font-weight:600;position:sticky;top:0}.Table tbody td[data-v-9b1b6a76]{border-bottom:1px solid var(--color-border)}.Table tbody tr:last-child td[data-v-9b1b6a76]{border-bottom:none}.TableOuter[data-v-9b1b6a76] .chart-menu-trigger-area{top:4px;right:4px}.TableOuter[data-v-9b1b6a76] .chart-menu-button{opacity:1}.TableOuter.has-menu .Table thead th[data-v-9b1b6a76]:last-child{padding-right:2.5em}.data-table-download-button{border:1px solid var(--color-border);background:var(--color-bg-0,#fff);color:var(--color-text);font-size:var(--font-size-sm);cursor:pointer;border-radius:.25em;align-items:center;margin-top:.75em;padding:.5em 1em;display:inline-flex}.data-table-download-button:hover{background:var(--color-bg-1,#0000000d)}.data-table-download-button:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}.data-table-download-link{text-align:right;font-size:var(--font-size-sm);margin-top:.25em;display:block}
|
|
2
2
|
/*$vite$:1*/
|
package/dist/index.js
CHANGED
|
@@ -1462,11 +1462,11 @@ var $t = {
|
|
|
1462
1462
|
"font-size",
|
|
1463
1463
|
"fill",
|
|
1464
1464
|
"font-weight"
|
|
1465
|
-
],
|
|
1465
|
+
], gn = [
|
|
1466
1466
|
"d",
|
|
1467
1467
|
"fill",
|
|
1468
1468
|
"fill-opacity"
|
|
1469
|
-
],
|
|
1469
|
+
], $ = [
|
|
1470
1470
|
"d",
|
|
1471
1471
|
"stroke",
|
|
1472
1472
|
"stroke-width"
|
|
@@ -2158,7 +2158,7 @@ var $t = {
|
|
|
2158
2158
|
"fill-opacity": e.opacity ?? .2,
|
|
2159
2159
|
stroke: "none",
|
|
2160
2160
|
style: h(e.blendMode ? { mixBlendMode: e.blendMode } : void 0)
|
|
2161
|
-
}, null, 12,
|
|
2161
|
+
}, null, 12, gn))), 128)),
|
|
2162
2162
|
(_(!0), a(e, null, y(O.value, (t, n) => (_(), a(e, { key: n }, [
|
|
2163
2163
|
t.line !== !1 && t.outline ? (_(), a("path", {
|
|
2164
2164
|
key: 0,
|
|
@@ -2169,7 +2169,7 @@ var $t = {
|
|
|
2169
2169
|
"stroke-linecap": "round",
|
|
2170
2170
|
"stroke-linejoin": "round",
|
|
2171
2171
|
"data-testid": "line-outline"
|
|
2172
|
-
}, null, 8,
|
|
2172
|
+
}, null, 8, $)) : i("", !0),
|
|
2173
2173
|
t.line === !1 ? i("", !0) : (_(), a("path", {
|
|
2174
2174
|
key: 1,
|
|
2175
2175
|
d: ce(t),
|
|
@@ -3364,25 +3364,33 @@ var $t = {
|
|
|
3364
3364
|
position: "fixed",
|
|
3365
3365
|
left: "0",
|
|
3366
3366
|
top: "0",
|
|
3367
|
+
"z-index": "calc(var(--cfasim-z-fullscreen, 1000) + 1)",
|
|
3367
3368
|
visibility: "hidden",
|
|
3368
3369
|
"will-change": "transform",
|
|
3369
3370
|
"pointer-events": "none",
|
|
3370
3371
|
transform: "translateY(-50%)"
|
|
3371
3372
|
}
|
|
3372
|
-
}, br = /* @__PURE__ */ l({
|
|
3373
|
+
}, br = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
3373
3374
|
__name: "ChoroplethTooltip",
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3375
|
+
props: { mode: { default: "float" } },
|
|
3376
|
+
setup(n, { expose: s }) {
|
|
3377
|
+
let c = v(null), l = v(!1), u = w("root");
|
|
3378
|
+
return s({
|
|
3377
3379
|
setData(e) {
|
|
3378
|
-
|
|
3380
|
+
c.value = e;
|
|
3381
|
+
},
|
|
3382
|
+
setOpen(e) {
|
|
3383
|
+
l.value = e;
|
|
3379
3384
|
},
|
|
3380
3385
|
getEl() {
|
|
3381
|
-
return
|
|
3386
|
+
return u.value;
|
|
3382
3387
|
}
|
|
3383
|
-
}), (
|
|
3388
|
+
}), (s, u) => (_(), a(e, null, [(_(), r(t, { to: "body" }, [o("div", yr, [c.value && n.mode === "float" ? te(s.$slots, "default", m(d({ key: 0 }, c.value)), void 0, !0) : i("", !0)], 512)])), n.mode === "sheet" ? (_(), a("div", {
|
|
3389
|
+
key: 0,
|
|
3390
|
+
class: p(["chart-tooltip-sheet", { "is-open": l.value }])
|
|
3391
|
+
}, [c.value ? te(s.$slots, "default", m(d({ key: 0 }, c.value)), void 0, !0) : i("", !0)], 2)) : i("", !0)], 64));
|
|
3384
3392
|
}
|
|
3385
|
-
}), xr = ["role", "aria-label"], Sr = {
|
|
3393
|
+
}), [["__scopeId", "data-v-90392830"]]), xr = ["role", "aria-label"], Sr = {
|
|
3386
3394
|
class: "chart-sr-only",
|
|
3387
3395
|
"aria-live": "polite"
|
|
3388
3396
|
}, Cr = {
|
|
@@ -3475,20 +3483,20 @@ var $t = {
|
|
|
3475
3483
|
}, Se = null, Ce = !1, V = null, we = v(!1), Te = v(1), Ee = v(1), De = v(!1), Oe = n(() => p.zoomMode === "scroll"), ke = n(() => p.zoom && (Oe.value || !p.touchExpand && De.value)), Ae = 0, je = 0, Me = 0, Ne = null, U = 0, W = null;
|
|
3476
3484
|
function G() {
|
|
3477
3485
|
let e = k.value, t = A.value;
|
|
3478
|
-
!e || !t || (e.addEventListener("touchstart",
|
|
3486
|
+
!e || !t || (e.addEventListener("touchstart", en, { passive: !0 }), e.addEventListener("touchend", tn), e.addEventListener("touchcancel", rn, { passive: !0 }), !J() && (t.addEventListener("click", Zt), t.addEventListener("mouseover", Zt), t.addEventListener("mousemove", Qt), t.addEventListener("mouseout", $t)));
|
|
3479
3487
|
}
|
|
3480
3488
|
function Pe() {
|
|
3481
3489
|
let e = k.value, t = A.value;
|
|
3482
|
-
e && (e.removeEventListener("touchstart",
|
|
3490
|
+
e && (e.removeEventListener("touchstart", en), e.removeEventListener("touchend", tn), e.removeEventListener("touchcancel", rn)), t && (t.removeEventListener("click", Zt), t.removeEventListener("mouseover", Zt), t.removeEventListener("mousemove", Qt), t.removeEventListener("mouseout", $t));
|
|
3483
3491
|
}
|
|
3484
3492
|
function K() {
|
|
3485
|
-
|
|
3493
|
+
Q();
|
|
3486
3494
|
}
|
|
3487
3495
|
let Ie = null;
|
|
3488
3496
|
g(() => {
|
|
3489
|
-
|
|
3497
|
+
G(), Le(), on(), Y(), It(), k.value && typeof ResizeObserver < "u" && (Ie = new ResizeObserver((e) => {
|
|
3490
3498
|
let t = e[0]?.contentRect.width;
|
|
3491
|
-
t && (Ee.value = t / Rr,
|
|
3499
|
+
t && (Ee.value = t / Rr, Gt());
|
|
3492
3500
|
}), Ie.observe(k.value)), window.addEventListener("scroll", K, {
|
|
3493
3501
|
passive: !0,
|
|
3494
3502
|
capture: !0
|
|
@@ -3502,9 +3510,9 @@ var $t = {
|
|
|
3502
3510
|
V = ce().scaleExtent([1, We.value]).clickDistance(6).on("start", () => {
|
|
3503
3511
|
ye = !0;
|
|
3504
3512
|
}).on("zoom", (e) => {
|
|
3505
|
-
|
|
3513
|
+
Q(), A.value && A.value.setAttribute("transform", e.transform);
|
|
3506
3514
|
let t = e.transform;
|
|
3507
|
-
Te.value = t.k,
|
|
3515
|
+
Te.value = t.k, Gt(), we.value = t.k !== 1 || t.x !== 0 || t.y !== 0, we.value && (De.value = !0);
|
|
3508
3516
|
}).on("end", () => {
|
|
3509
3517
|
ye = !1;
|
|
3510
3518
|
}), V.filter((e) => {
|
|
@@ -3564,15 +3572,15 @@ var $t = {
|
|
|
3564
3572
|
let t = R.get(String(e.feature.id));
|
|
3565
3573
|
t && r.set(t, e.item);
|
|
3566
3574
|
}
|
|
3567
|
-
for (let [e] of B) r.has(e) || e === z ||
|
|
3575
|
+
for (let [e] of B) r.has(e) || e === z || qt(e);
|
|
3568
3576
|
for (let [e, t] of r) {
|
|
3569
3577
|
let n = B.get(e);
|
|
3570
|
-
n != null && n.style === t.style && n.stroke === t.stroke && n.strokeWidth === t.strokeWidth && e !== z || e !== z &&
|
|
3578
|
+
n != null && n.style === t.style && n.stroke === t.stroke && n.strokeWidth === t.strokeWidth && e !== z || e !== z && Kt(e, t);
|
|
3571
3579
|
}
|
|
3572
3580
|
B.clear();
|
|
3573
3581
|
for (let [e, t] of r) B.set(e, t);
|
|
3574
3582
|
if (He(n), e.length === 0) {
|
|
3575
|
-
Ve = !0,
|
|
3583
|
+
Ve = !0, Q();
|
|
3576
3584
|
return;
|
|
3577
3585
|
}
|
|
3578
3586
|
if (p.focusZoom === !1) {
|
|
@@ -3591,9 +3599,9 @@ var $t = {
|
|
|
3591
3599
|
let e = String(h.id), t = R.get(e);
|
|
3592
3600
|
if (!t) return;
|
|
3593
3601
|
let n = t.getBoundingClientRect();
|
|
3594
|
-
|
|
3602
|
+
zt(e, n.left + n.width / 2, n.top + n.height / 2);
|
|
3595
3603
|
};
|
|
3596
|
-
a ? (
|
|
3604
|
+
a ? (Vt(), i.transition().duration(Fr).call(V.transform, m).on("end", g)) : (V.transform(i, m), g());
|
|
3597
3605
|
}
|
|
3598
3606
|
function He(e) {
|
|
3599
3607
|
let t = ae.value;
|
|
@@ -3607,15 +3615,15 @@ var $t = {
|
|
|
3607
3615
|
let n = document.createElementNS(Ar, "path");
|
|
3608
3616
|
n.setAttribute("d", r(i) ?? ""), n.setAttribute("fill", "none"), n.setAttribute("pointer-events", "none"), n.setAttribute("stroke-linejoin", "round"), n.setAttribute("class", "focus-overlay"), t.appendChild(n), e = { el: n }, ve.set(a, e);
|
|
3609
3617
|
}
|
|
3610
|
-
e.strokeWidth = n.strokeWidth, e.el.setAttribute("stroke", n.stroke ?? "#fff"),
|
|
3618
|
+
e.strokeWidth = n.strokeWidth, e.el.setAttribute("stroke", n.stroke ?? "#fff"), Ht(e.el, n.style);
|
|
3611
3619
|
}
|
|
3612
|
-
|
|
3620
|
+
Gt();
|
|
3613
3621
|
}
|
|
3614
3622
|
function Ue() {
|
|
3615
3623
|
if (!k.value || !V) return;
|
|
3616
3624
|
yt.value.length > 0 && D("update:focus", null);
|
|
3617
3625
|
let e = F(k.value);
|
|
3618
|
-
e.interrupt(),
|
|
3626
|
+
e.interrupt(), Vt();
|
|
3619
3627
|
let t = J() && !$.isFullscreen.value && !Oe.value, n = e.transition().duration(Fr).call(V.transform, le);
|
|
3620
3628
|
t && n.on("end", () => {
|
|
3621
3629
|
De.value = !1;
|
|
@@ -3623,12 +3631,12 @@ var $t = {
|
|
|
3623
3631
|
}
|
|
3624
3632
|
let We = n(() => Math.max(12, p.focusZoomLevel)), X = n(() => p.zoom && (J() ? $.isFullscreen.value || Oe.value || !p.touchExpand : !0)), Ke = n(() => p.zoom && !J() && (Oe.value || De.value || $.isFullscreen.value)), qe = n(() => p.zoom && p.zoomHint && !Oe.value && !$.isFullscreen.value && (J() && p.touchExpand || !De.value)), Z = n(() => J() ? "Double tap to zoom" : "Double click to zoom"), Ye = n(() => {
|
|
3625
3633
|
let e = {};
|
|
3626
|
-
return $.isFullscreen.value || ke.value ? e["touch-action"] = "none" : p.zoom && !Oe.value && J() && (e["touch-action"] = p.touchExpand ? "manipulation" : "pan-x pan-y"), (De.value || $.isFullscreen.value || p.zoom && Oe.value) && (e["will-change"] = "transform"), Object.keys(e).length ? e : void 0;
|
|
3634
|
+
return $.isFullscreen.value || ke.value ? e["touch-action"] = "none" : p.zoom && !Oe.value && J() && (e["touch-action"] = p.touchExpand ? "manipulation" : "pan-x pan-y"), (De.value || $.isFullscreen.value || p.zoom && (Oe.value || J())) && (e["will-change"] = "transform"), Object.keys(e).length ? e : void 0;
|
|
3627
3635
|
});
|
|
3628
3636
|
function Xe(e) {
|
|
3629
3637
|
if (!k.value || !V) return;
|
|
3630
3638
|
let t = F(k.value);
|
|
3631
|
-
t.interrupt(),
|
|
3639
|
+
t.interrupt(), Vt(), t.transition().duration(250).call(V.scaleBy, e);
|
|
3632
3640
|
}
|
|
3633
3641
|
function Ze(e, t) {
|
|
3634
3642
|
let n = k.value, r = Lr, i = nt.value / 2, a = rt.value / 2, o = null;
|
|
@@ -3870,18 +3878,29 @@ var $t = {
|
|
|
3870
3878
|
if (!n) return;
|
|
3871
3879
|
let r = ie.value?.getBoundingClientRect(), { left: i, top: a } = H(e, t, xe.width, xe.height, p.tooltipClamp, r);
|
|
3872
3880
|
n.style.transform = `translate3d(${i}px, ${a}px, 0) translateY(-50%)`;
|
|
3881
|
+
let o = typeof window < "u" ? window.visualViewport : null;
|
|
3882
|
+
if (!o || o.scale <= 1.01 && o.offsetTop < 1 && o.offsetLeft < 1) return;
|
|
3883
|
+
let s = n.getBoundingClientRect(), c = s.left - i, l = s.top + s.height / 2 - a;
|
|
3884
|
+
(Math.abs(c) > 1 || Math.abs(l) > 1) && (n.style.transform = `translate3d(${i - c}px, ${a - l}px, 0) translateY(-50%)`);
|
|
3873
3885
|
}
|
|
3874
|
-
|
|
3886
|
+
let Rt = n(() => $.isFullscreen.value && J() ? "sheet" : "float");
|
|
3887
|
+
function zt(e, t, n) {
|
|
3875
3888
|
let r = ge.get(e);
|
|
3876
3889
|
if (!r) return;
|
|
3877
|
-
let i = M.value
|
|
3878
|
-
|
|
3890
|
+
let i = M.value;
|
|
3891
|
+
if (!i) return;
|
|
3892
|
+
if (i.setData(r), Ce = !0, Rt.value === "sheet") {
|
|
3893
|
+
i.setOpen(!0);
|
|
3894
|
+
return;
|
|
3895
|
+
}
|
|
3896
|
+
let a = i.getEl();
|
|
3897
|
+
a && (Se = {
|
|
3879
3898
|
x: t,
|
|
3880
3899
|
y: n
|
|
3881
|
-
},
|
|
3900
|
+
}, Lt(t, n), a.style.visibility = "visible");
|
|
3882
3901
|
}
|
|
3883
|
-
function
|
|
3884
|
-
Ce
|
|
3902
|
+
function Bt(e, t) {
|
|
3903
|
+
!Ce || Rt.value === "sheet" || (Ae = e, je = t, !Me && (Me = requestAnimationFrame(() => {
|
|
3885
3904
|
Me = 0;
|
|
3886
3905
|
let e = M.value?.getEl();
|
|
3887
3906
|
!e || !Ce || (Se = {
|
|
@@ -3890,59 +3909,59 @@ var $t = {
|
|
|
3890
3909
|
}, e.style.transform = `translate3d(${Ae + 16}px, ${je}px, 0) translateY(-50%)`);
|
|
3891
3910
|
})));
|
|
3892
3911
|
}
|
|
3893
|
-
function
|
|
3912
|
+
function Vt() {
|
|
3894
3913
|
if (!Ce) return;
|
|
3895
|
-
Ce = !1, Se = null;
|
|
3914
|
+
Ce = !1, Se = null, M.value?.setOpen(!1);
|
|
3896
3915
|
let e = M.value?.getEl();
|
|
3897
3916
|
e && (e.style.visibility = "hidden");
|
|
3898
3917
|
}
|
|
3899
|
-
function
|
|
3918
|
+
function Ht(e, t) {
|
|
3900
3919
|
t === "dashed" ? (e.setAttribute("stroke-dasharray", "8 4"), e.removeAttribute("stroke-linecap")) : t === "dotted" ? (e.setAttribute("stroke-dasharray", "0 5"), e.setAttribute("stroke-linecap", "round")) : (e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap"));
|
|
3901
3920
|
}
|
|
3902
|
-
function
|
|
3921
|
+
function Ut() {
|
|
3903
3922
|
return Te.value * Ee.value || 1;
|
|
3904
3923
|
}
|
|
3905
|
-
function
|
|
3924
|
+
function Wt(e) {
|
|
3906
3925
|
return e?.strokeWidth ?? ht.value + 1;
|
|
3907
3926
|
}
|
|
3908
|
-
function
|
|
3909
|
-
let e =
|
|
3927
|
+
function Gt() {
|
|
3928
|
+
let e = Ut(), t = ht.value;
|
|
3910
3929
|
j.value?.setAttribute("stroke-width", String(t / e)), _e?.setAttribute("stroke-width", String(1 / e)), ae.value?.setAttribute("stroke-width", String((t + 1.5) / e));
|
|
3911
3930
|
for (let { el: t, strokeWidth: n } of ve.values()) n == null ? t.removeAttribute("stroke-width") : t.setAttribute("stroke-width", String(n / e));
|
|
3912
|
-
for (let [t, n] of B) t.setAttribute("stroke-width", String(
|
|
3913
|
-
z && !B.has(z) && z.setAttribute("stroke-width", String(
|
|
3931
|
+
for (let [t, n] of B) t.setAttribute("stroke-width", String(Wt(n) / e));
|
|
3932
|
+
z && !B.has(z) && z.setAttribute("stroke-width", String(Wt() / e));
|
|
3914
3933
|
}
|
|
3915
|
-
function
|
|
3916
|
-
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(
|
|
3934
|
+
function Kt(e, t) {
|
|
3935
|
+
e.parentNode?.appendChild(e), e.setAttribute("stroke-width", String(Wt(t) / Ut())), e.style.stroke = t?.stroke ?? Br, Ht(e, t?.style);
|
|
3917
3936
|
}
|
|
3918
|
-
function
|
|
3937
|
+
function qt(e) {
|
|
3919
3938
|
e.removeAttribute("stroke-width"), e.style.stroke = "", e.setAttribute("stroke", p.strokeColor), e.removeAttribute("stroke-dasharray"), e.removeAttribute("stroke-linecap");
|
|
3920
3939
|
}
|
|
3921
|
-
function
|
|
3922
|
-
z !== e && (z && !B.has(z) &&
|
|
3940
|
+
function Jt(e) {
|
|
3941
|
+
z !== e && (z && !B.has(z) && qt(z), z = e, Kt(e, B.get(e)));
|
|
3923
3942
|
}
|
|
3924
|
-
function
|
|
3943
|
+
function Q() {
|
|
3925
3944
|
if (z) {
|
|
3926
3945
|
let e = B.get(z);
|
|
3927
|
-
e == null ?
|
|
3946
|
+
e == null ? qt(z) : Kt(z, e), z = null, D("stateHover", null);
|
|
3928
3947
|
}
|
|
3929
|
-
|
|
3948
|
+
Vt();
|
|
3930
3949
|
}
|
|
3931
|
-
function
|
|
3950
|
+
function Yt(e) {
|
|
3932
3951
|
let t = e;
|
|
3933
3952
|
for (; t && !t.dataset?.featId;) t = t.parentElement;
|
|
3934
3953
|
return t ? t.dataset.featId ?? null : null;
|
|
3935
3954
|
}
|
|
3936
|
-
function
|
|
3955
|
+
function Xt(e) {
|
|
3937
3956
|
D("stateClick", {
|
|
3938
3957
|
id: e.id,
|
|
3939
3958
|
name: e.name,
|
|
3940
3959
|
value: e.value
|
|
3941
3960
|
}), D("update:focus", Be(yt.value).has(e.id) ? null : e.id);
|
|
3942
3961
|
}
|
|
3943
|
-
function
|
|
3962
|
+
function Zt(e) {
|
|
3944
3963
|
if (e.type === "mouseover" && ye) return;
|
|
3945
|
-
let t = e, n =
|
|
3964
|
+
let t = e, n = Yt(t.target);
|
|
3946
3965
|
if (!n) return;
|
|
3947
3966
|
let r = ge.get(n);
|
|
3948
3967
|
if (!r) return;
|
|
@@ -3952,17 +3971,17 @@ var $t = {
|
|
|
3952
3971
|
value: r.value
|
|
3953
3972
|
};
|
|
3954
3973
|
e.type === "click" ? p.zoom ? (window.clearTimeout(U), U = 0, t.detail <= 1 && (U = window.setTimeout(() => {
|
|
3955
|
-
U = 0,
|
|
3956
|
-
}, Nr))) :
|
|
3957
|
-
}
|
|
3958
|
-
function Zt(e) {
|
|
3959
|
-
ye || zt(e.clientX, e.clientY);
|
|
3974
|
+
U = 0, Xt(r);
|
|
3975
|
+
}, Nr))) : Xt(r) : e.type === "mouseover" && (Jt(R.get(n)), I.value && zt(n, t.clientX, t.clientY), D("stateHover", i));
|
|
3960
3976
|
}
|
|
3961
3977
|
function Qt(e) {
|
|
3962
|
-
|
|
3963
|
-
t && A.value?.contains(t) || Jt();
|
|
3978
|
+
ye || Bt(e.clientX, e.clientY);
|
|
3964
3979
|
}
|
|
3965
3980
|
function $t(e) {
|
|
3981
|
+
let t = e.relatedTarget;
|
|
3982
|
+
t && A.value?.contains(t) || Q();
|
|
3983
|
+
}
|
|
3984
|
+
function en(e) {
|
|
3966
3985
|
if (e.touches.length !== 1) {
|
|
3967
3986
|
Ne = null;
|
|
3968
3987
|
return;
|
|
@@ -3972,10 +3991,10 @@ var $t = {
|
|
|
3972
3991
|
x: t.clientX,
|
|
3973
3992
|
y: t.clientY,
|
|
3974
3993
|
time: e.timeStamp,
|
|
3975
|
-
featId:
|
|
3994
|
+
featId: Yt(e.target)
|
|
3976
3995
|
};
|
|
3977
3996
|
}
|
|
3978
|
-
function
|
|
3997
|
+
function tn(e) {
|
|
3979
3998
|
let t = Ne;
|
|
3980
3999
|
if (Ne = null, !t || e.touches.length > 0) return;
|
|
3981
4000
|
let n = e.changedTouches[0];
|
|
@@ -3993,37 +4012,40 @@ var $t = {
|
|
|
3993
4012
|
}
|
|
3994
4013
|
let i = t.featId ? ge.get(t.featId) : void 0;
|
|
3995
4014
|
if (!i) {
|
|
3996
|
-
|
|
4015
|
+
Q();
|
|
3997
4016
|
return;
|
|
3998
4017
|
}
|
|
3999
|
-
|
|
4000
|
-
U = 0,
|
|
4018
|
+
nn(i, n.clientX, n.clientY), window.clearTimeout(U), U = window.setTimeout(() => {
|
|
4019
|
+
U = 0, Xt(i);
|
|
4001
4020
|
}, Nr);
|
|
4002
4021
|
return;
|
|
4003
4022
|
}
|
|
4004
4023
|
if (!t.featId) {
|
|
4005
|
-
|
|
4024
|
+
Q();
|
|
4006
4025
|
return;
|
|
4007
4026
|
}
|
|
4008
4027
|
let r = ge.get(t.featId);
|
|
4009
|
-
r && (e.preventDefault(),
|
|
4028
|
+
r && (e.preventDefault(), nn(r, n.clientX, n.clientY), Xt(r));
|
|
4010
4029
|
}
|
|
4011
|
-
function
|
|
4030
|
+
function nn(e, t, n) {
|
|
4012
4031
|
let r = R.get(e.id);
|
|
4013
|
-
r &&
|
|
4032
|
+
if (r && Jt(r), D("stateHover", {
|
|
4014
4033
|
id: e.id,
|
|
4015
4034
|
name: e.name,
|
|
4016
4035
|
value: e.value
|
|
4017
|
-
}), I.value
|
|
4036
|
+
}), I.value) if (r) {
|
|
4037
|
+
let t = r.getBoundingClientRect();
|
|
4038
|
+
zt(e.id, t.left + t.width / 2, t.top + t.height / 2);
|
|
4039
|
+
} else zt(e.id, t, n);
|
|
4018
4040
|
}
|
|
4019
|
-
function
|
|
4041
|
+
function rn() {
|
|
4020
4042
|
Ne = null;
|
|
4021
4043
|
}
|
|
4022
|
-
function
|
|
4044
|
+
function an(e) {
|
|
4023
4045
|
let t = document.createElementNS(Ar, "path");
|
|
4024
4046
|
return e && t.setAttribute("d", e), t;
|
|
4025
4047
|
}
|
|
4026
|
-
function
|
|
4048
|
+
function on() {
|
|
4027
4049
|
let e = j.value, t = ae.value;
|
|
4028
4050
|
if (!e || !t) return;
|
|
4029
4051
|
for (; e.firstChild;) e.removeChild(e.firstChild);
|
|
@@ -4033,7 +4055,7 @@ var $t = {
|
|
|
4033
4055
|
if (r.length === 0) return;
|
|
4034
4056
|
let i = p.strokeColor, a = !I.value, o = document.createDocumentFragment();
|
|
4035
4057
|
for (let e of r) {
|
|
4036
|
-
let t = String(e.id), r = Nt(e), s = jt(t), c =
|
|
4058
|
+
let t = String(e.id), r = Nt(e), s = jt(t), c = an(n(e));
|
|
4037
4059
|
if (c.setAttribute("class", "state-path"), c.setAttribute("data-feat-id", t), c.setAttribute("fill", Mt(t)), c.setAttribute("stroke", i), a) {
|
|
4038
4060
|
let e = document.createElementNS(Ar, "title");
|
|
4039
4061
|
e.textContent = Ft(r, s), c.appendChild(e);
|
|
@@ -4047,12 +4069,12 @@ var $t = {
|
|
|
4047
4069
|
}
|
|
4048
4070
|
let s = ft.value;
|
|
4049
4071
|
if (s) {
|
|
4050
|
-
let e =
|
|
4072
|
+
let e = an(n(s));
|
|
4051
4073
|
e.setAttribute("fill", "none"), e.setAttribute("stroke", i), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("pointer-events", "none"), o.appendChild(e), _e = e;
|
|
4052
4074
|
}
|
|
4053
|
-
e.appendChild(o),
|
|
4075
|
+
e.appendChild(o), Gt();
|
|
4054
4076
|
}
|
|
4055
|
-
function
|
|
4077
|
+
function sn() {
|
|
4056
4078
|
let e = !I.value;
|
|
4057
4079
|
for (let [t, n] of R) {
|
|
4058
4080
|
let r = jt(t), i = ge.get(t);
|
|
@@ -4062,14 +4084,14 @@ var $t = {
|
|
|
4062
4084
|
}
|
|
4063
4085
|
}
|
|
4064
4086
|
}
|
|
4065
|
-
function sn() {
|
|
4066
|
-
for (let e of R.values()) e === z || B.has(e) || Kt(e);
|
|
4067
|
-
_e && _e.setAttribute("stroke", p.strokeColor), Wt();
|
|
4068
|
-
}
|
|
4069
4087
|
function cn() {
|
|
4088
|
+
for (let e of R.values()) e === z || B.has(e) || qt(e);
|
|
4089
|
+
_e && _e.setAttribute("stroke", p.strokeColor), Gt();
|
|
4090
|
+
}
|
|
4091
|
+
function ln() {
|
|
4070
4092
|
return typeof p.menu == "string" ? p.menu : "choropleth";
|
|
4071
4093
|
}
|
|
4072
|
-
let
|
|
4094
|
+
let un = n(() => p.legend && (Ct.value || wt.value || p.data)), dn = n(() => p.colorScale.slice().sort((e, t) => e.min - t.min)), fn = n(() => {
|
|
4073
4095
|
let e = [];
|
|
4074
4096
|
for (let t = 0; t <= 10; t++) {
|
|
4075
4097
|
let n = t / 10;
|
|
@@ -4079,34 +4101,34 @@ var $t = {
|
|
|
4079
4101
|
});
|
|
4080
4102
|
}
|
|
4081
4103
|
return e;
|
|
4082
|
-
}),
|
|
4104
|
+
}), pn = new Intl.NumberFormat("en-US", {
|
|
4083
4105
|
notation: "compact",
|
|
4084
4106
|
maximumFractionDigits: 1
|
|
4085
|
-
}),
|
|
4107
|
+
}), mn = n(() => {
|
|
4086
4108
|
let { min: e, max: t } = St.value, n = t - e, r = [];
|
|
4087
4109
|
for (let t = 1; t <= 3; t++) {
|
|
4088
|
-
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ?
|
|
4110
|
+
let i = t / 4, a = e + n * i, o = Math.abs(a) >= 1e3 ? pn.format(a) : Number.isInteger(a) ? String(a) : a.toFixed(1).replace(/\.0$/, "");
|
|
4089
4111
|
r.push({
|
|
4090
4112
|
value: o,
|
|
4091
4113
|
pct: i * 100
|
|
4092
4114
|
});
|
|
4093
4115
|
}
|
|
4094
4116
|
return r;
|
|
4095
|
-
}),
|
|
4117
|
+
}), hn = n(() => {
|
|
4096
4118
|
let e = [];
|
|
4097
4119
|
if (Ct.value) for (let t of p.colorScale) e.push({
|
|
4098
4120
|
key: t.value,
|
|
4099
4121
|
color: t.color,
|
|
4100
4122
|
label: t.value
|
|
4101
4123
|
});
|
|
4102
|
-
else if (wt.value) for (let t of
|
|
4124
|
+
else if (wt.value) for (let t of dn.value) e.push({
|
|
4103
4125
|
key: String(t.min),
|
|
4104
4126
|
color: t.color,
|
|
4105
4127
|
label: t.label ?? String(t.min)
|
|
4106
4128
|
});
|
|
4107
4129
|
return e;
|
|
4108
|
-
}),
|
|
4109
|
-
let e =
|
|
4130
|
+
}), gn = n(() => `linear-gradient(to right, ${fn.value.map((e) => `${e.color} ${e.offset}`).join(", ")})`), $ = Ge({ target: () => p.fullscreenTarget }), _n = n(() => {
|
|
4131
|
+
let e = ln();
|
|
4110
4132
|
return [
|
|
4111
4133
|
$.menuItem.value,
|
|
4112
4134
|
{
|
|
@@ -4127,17 +4149,17 @@ var $t = {
|
|
|
4127
4149
|
dt.value,
|
|
4128
4150
|
mt.value,
|
|
4129
4151
|
I.value
|
|
4130
|
-
], () =>
|
|
4152
|
+
], () => on()), T(() => [
|
|
4131
4153
|
xt.value,
|
|
4132
4154
|
p.colorScale,
|
|
4133
4155
|
p.noDataColor,
|
|
4134
4156
|
p.dataGeoType
|
|
4135
|
-
], () =>
|
|
4157
|
+
], () => sn()), T(() => [p.strokeColor, ht.value], () => cn()), T(() => [
|
|
4136
4158
|
yt.value,
|
|
4137
4159
|
mt.value,
|
|
4138
4160
|
st.value
|
|
4139
4161
|
], () => Y(), { flush: "post" }), T(() => $.isFullscreen.value, (e) => {
|
|
4140
|
-
if (e || !J() || !k.value || !V) return;
|
|
4162
|
+
if (Vt(), e || !J() || !k.value || !V) return;
|
|
4141
4163
|
let t = F(k.value);
|
|
4142
4164
|
t.interrupt(), V.transform(t, le);
|
|
4143
4165
|
}), (n, l) => (_(), r(t, {
|
|
@@ -4157,7 +4179,7 @@ var $t = {
|
|
|
4157
4179
|
}), [
|
|
4158
4180
|
c.menu || S($).isFullscreen.value ? (_(), r(he, {
|
|
4159
4181
|
key: 0,
|
|
4160
|
-
items:
|
|
4182
|
+
items: _n.value,
|
|
4161
4183
|
"is-fullscreen": S($).isFullscreen.value,
|
|
4162
4184
|
onClose: S($).exit
|
|
4163
4185
|
}, null, 8, [
|
|
@@ -4166,15 +4188,15 @@ var $t = {
|
|
|
4166
4188
|
"onClose"
|
|
4167
4189
|
])) : i("", !0),
|
|
4168
4190
|
o("div", Sr, b(S($).isFullscreen.value ? "Map expanded to fill window" : ""), 1),
|
|
4169
|
-
c.title ||
|
|
4191
|
+
c.title || un.value ? (_(), a("div", Cr, [c.title ? (_(), a("div", {
|
|
4170
4192
|
key: 0,
|
|
4171
4193
|
class: "choropleth-title",
|
|
4172
4194
|
style: h(L.value)
|
|
4173
|
-
}, b(c.title), 5)) : i("", !0),
|
|
4195
|
+
}, b(c.title), 5)) : i("", !0), un.value ? (_(), a("div", {
|
|
4174
4196
|
key: 1,
|
|
4175
4197
|
class: "choropleth-legend",
|
|
4176
4198
|
style: h(me.value)
|
|
4177
|
-
}, [c.legendTitle ? (_(), a("span", wr, b(c.legendTitle), 1)) : i("", !0), Ct.value || wt.value ? (_(!0), a(e, { key: 1 }, y(
|
|
4199
|
+
}, [c.legendTitle ? (_(), a("span", wr, b(c.legendTitle), 1)) : i("", !0), Ct.value || wt.value ? (_(!0), a(e, { key: 1 }, y(hn.value, (e) => (_(), a("span", {
|
|
4178
4200
|
key: e.key,
|
|
4179
4201
|
class: "choropleth-legend-item"
|
|
4180
4202
|
}, [o("span", {
|
|
@@ -4182,8 +4204,8 @@ var $t = {
|
|
|
4182
4204
|
style: h({ background: e.color })
|
|
4183
4205
|
}, null, 4), s(" " + b(e.label), 1)]))), 128)) : (_(), a("div", Tr, [o("div", {
|
|
4184
4206
|
class: "choropleth-legend-gradient",
|
|
4185
|
-
style: h({ background:
|
|
4186
|
-
}, null, 4), o("div", Er, [(_(!0), a(e, null, y(
|
|
4207
|
+
style: h({ background: gn.value })
|
|
4208
|
+
}, null, 4), o("div", Er, [(_(!0), a(e, null, y(mn.value, (e) => (_(), a("span", {
|
|
4187
4209
|
key: e.value,
|
|
4188
4210
|
style: h({ left: e.pct + "%" })
|
|
4189
4211
|
}, b(e.value), 5))), 128))])]))], 4)) : i("", !0)])) : i("", !0),
|
|
@@ -4222,17 +4244,18 @@ var $t = {
|
|
|
4222
4244
|
I.value ? (_(), r(br, {
|
|
4223
4245
|
key: 4,
|
|
4224
4246
|
ref_key: "tooltipChildRef",
|
|
4225
|
-
ref: M
|
|
4247
|
+
ref: M,
|
|
4248
|
+
mode: Rt.value
|
|
4226
4249
|
}, {
|
|
4227
4250
|
default: E((t) => [te(n.$slots, "tooltip", m(u(O(t))), () => [c.tooltipFormat ? (_(), a("span", {
|
|
4228
4251
|
key: 0,
|
|
4229
4252
|
innerHTML: c.tooltipFormat(t)
|
|
4230
4253
|
}, null, 8, kr)) : t.value == null ? (_(), a(e, { key: 1 }, [s(b(t.name), 1)], 64)) : (_(), a(e, { key: 2 }, [s(b(t.name) + ": " + b(Pt(t.value)), 1)], 64))], !0)]),
|
|
4231
4254
|
_: 3
|
|
4232
|
-
},
|
|
4255
|
+
}, 8, ["mode"])) : i("", !0)
|
|
4233
4256
|
], 16, xr)], 8, ["to", "disabled"]));
|
|
4234
4257
|
}
|
|
4235
|
-
}), [["__scopeId", "data-v-
|
|
4258
|
+
}), [["__scopeId", "data-v-1b0772ac"]]), Hr = /* @__PURE__ */ L(/* @__PURE__ */ l({
|
|
4236
4259
|
__name: "ChartTooltip",
|
|
4237
4260
|
props: {
|
|
4238
4261
|
x: {},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cfasim-ui/charts",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Chart visualization components for cfasim-ui",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"d3-zoom": "^3.0.0",
|
|
39
39
|
"reka-ui": "^2.9.2",
|
|
40
40
|
"topojson-client": "^3.1.0",
|
|
41
|
-
"@cfasim-ui/shared": "0.7.
|
|
41
|
+
"@cfasim-ui/shared": "0.7.4"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"vue": "^3.5.0"
|