nuxt-charts 3.0.0 → 3.1.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/README.md +53 -6
- package/dist/module.json +1 -1
- package/dist/module.mjs +56 -3
- package/dist/runtime/assets/components.css +1 -1
- package/dist/runtime/assets/theme.css +1 -1
- package/dist/runtime/components/AreaChart.vue +1 -0
- package/dist/runtime/components/BarChart.vue +1 -0
- package/dist/runtime/components/DataChart.vue +91 -0
- package/dist/runtime/components/DataChart.vue.d.ts +27 -0
- package/dist/runtime/components/DottedMap.vue +261 -0
- package/dist/runtime/components/DottedMap.vue.d.ts +45 -0
- package/dist/runtime/components/LineChart.vue +1 -0
- package/dist/runtime/components/MetricChart.vue +322 -0
- package/dist/runtime/components/MetricChart.vue.d.ts +54 -0
- package/dist/runtime/components/TopoJSONMap.vue +273 -0
- package/dist/runtime/components/TopoJSONMap.vue.d.ts +45 -0
- package/dist/runtime/components/internal/CartesianFrame.vue +73 -4
- package/dist/runtime/components/internal/CartesianFrame.vue.d.ts +5 -0
- package/dist/runtime/components/internal/ChartAccessibility.vue.d.ts +1 -1
- package/dist/runtime/components/internal/CubeBarShape.vue.d.ts +1 -1
- package/dist/runtime/components/internal/MapCanvas.vue +297 -0
- package/dist/runtime/components/internal/MapCanvas.vue.d.ts +79 -0
- package/dist/runtime/components/internal/VariantBarShape.vue.d.ts +2 -2
- package/dist/runtime/data/world.json +182 -0
- package/dist/runtime/maps.d.ts +2 -0
- package/dist/runtime/maps.js +1 -0
- package/dist/runtime/spec/csv.d.ts +14 -0
- package/dist/runtime/spec/csv.js +13 -0
- package/dist/runtime/spec/index.d.ts +11 -0
- package/dist/runtime/spec/index.js +5 -0
- package/dist/runtime/spec/metric.d.ts +130 -0
- package/dist/runtime/spec/metric.js +63 -0
- package/dist/runtime/spec/resolve.d.ts +44 -0
- package/dist/runtime/spec/resolve.js +41 -0
- package/dist/runtime/spec/transform.d.ts +58 -0
- package/dist/runtime/spec/transform.js +199 -0
- package/dist/runtime/spec/types.d.ts +132 -0
- package/dist/runtime/spec/types.js +2 -0
- package/dist/runtime/types/charts.d.ts +131 -0
- package/dist/runtime/types/maps.d.ts +237 -0
- package/dist/runtime/types/maps.js +0 -0
- package/dist/runtime/types.d.ts +3 -0
- package/dist/runtime/utils/axis.d.ts +18 -0
- package/dist/runtime/utils/axis.js +44 -1
- package/dist/runtime/utils/dottedMap.d.ts +14 -0
- package/dist/runtime/utils/dottedMap.js +69 -0
- package/dist/runtime/utils/maps.d.ts +33 -0
- package/dist/runtime/utils/maps.js +77 -0
- package/package.json +23 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# nuxt-charts
|
|
2
2
|
|
|
3
|
-
Beautiful chart components for Nuxt — Area, Bar, Line, Donut, Bubble, Radar, Radial Bar, Funnel, Sankey, Candlestick and
|
|
3
|
+
Beautiful chart and map components for Nuxt — Area, Bar, Line, Donut, Bubble, Radar, Radial Bar, Funnel, Sankey, Candlestick, Status Tracker, Dotted Map, and TopoJSON Map.
|
|
4
4
|
|
|
5
5
|
Powered by [vccs](https://vue-charts.com) (Vue port of Recharts). Drop-in config-prop API from nuxt-charts v2.
|
|
6
6
|
|
|
@@ -12,8 +12,8 @@ the same components work in any Nuxt project.
|
|
|
12
12
|
## Install
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
#
|
|
16
|
-
pnpm add nuxt-charts@
|
|
15
|
+
# v3
|
|
16
|
+
pnpm add nuxt-charts@next
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
```ts
|
|
@@ -37,6 +37,51 @@ export default defineNuxtConfig({
|
|
|
37
37
|
| `SankeyChart` | New in v3 |
|
|
38
38
|
| `CandlestickChart` | New in v3 |
|
|
39
39
|
| `StatusTrackerChart` | New in v3 |
|
|
40
|
+
| `DottedMap` | D3 dotted geography, pins, regional filters, and country colors |
|
|
41
|
+
| `TopoJSONMap` | D3 choropleths, points, routes, projections, and heatmaps |
|
|
42
|
+
|
|
43
|
+
### Maps
|
|
44
|
+
|
|
45
|
+
Maps include world geometry and need no external data fetch or Unovis dependency:
|
|
46
|
+
|
|
47
|
+
```vue
|
|
48
|
+
<script setup lang="ts">
|
|
49
|
+
const pins = [{ lat: 52.3676, lng: 4.9041, label: "Amsterdam" }];
|
|
50
|
+
const data = {
|
|
51
|
+
areas: [{ id: "NLD", value: 94 }, { id: "USA", value: 91 }],
|
|
52
|
+
points: [
|
|
53
|
+
{ id: "ams", latitude: 52.3676, longitude: 4.9041, label: "Amsterdam" },
|
|
54
|
+
{ id: "nyc", latitude: 40.7128, longitude: -74.006, label: "New York" },
|
|
55
|
+
],
|
|
56
|
+
links: [{ source: "ams", target: "nyc" }],
|
|
57
|
+
};
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<template>
|
|
61
|
+
<DottedMap :pins="pins" :height="360" :map-height="75" />
|
|
62
|
+
<TopoJSONMap :data="data" value="value" projection="equalEarth" show-point-labels />
|
|
63
|
+
</template>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Use `topoJson`/`geoJson` for custom geography, `mapFeatureKey` to select a
|
|
67
|
+
TopoJSON object, and `featureId` to match area IDs to a property. The bundled
|
|
68
|
+
map accepts ISO alpha-2, alpha-3, and numeric country IDs. `areaColor`, point
|
|
69
|
+
styles, and link styles accept values or typed accessor functions. Named
|
|
70
|
+
projections, configured D3 projections, and projection factories are supported.
|
|
71
|
+
|
|
72
|
+
Both components render SVG during SSR, resize to their containers, and share
|
|
73
|
+
chart themes, tooltip/legend variants, loading/error states, and accessibility.
|
|
74
|
+
Drag, pinch, double-click, and keyboard zoom work by default; `zoomOnScroll`
|
|
75
|
+
enables wheel zoom and `showControls` adds zoom/reset buttons. Exposed methods:
|
|
76
|
+
`zoomIn`, `zoomOut`, `zoomTo`, `resetView`; TopoJSONMap also exposes
|
|
77
|
+
`fitToPoints` and `zoomToFeature`. `zoomOnClick` is opt-in.
|
|
78
|
+
|
|
79
|
+
Slots provide typed tooltips, legends, SVG overlays, and custom marks
|
|
80
|
+
(`pin`/`dot` or `feature`/`point`/`link`). `getMap` and `getPin` are
|
|
81
|
+
auto-imported for precomputation and exported from `nuxt-charts/maps`.
|
|
82
|
+
|
|
83
|
+
See [Dotted Map](https://nuxtcharts.com/docs/maps/dotted-map) and
|
|
84
|
+
[TopoJSON Map](https://nuxtcharts.com/docs/maps/topojson-map) for the full API.
|
|
40
85
|
|
|
41
86
|
### New cross-cutting props (cartesian charts)
|
|
42
87
|
|
|
@@ -146,8 +191,7 @@ several charts on one page never collide.
|
|
|
146
191
|
### Deferred / removed
|
|
147
192
|
|
|
148
193
|
- **`DualChart`** — planned for v3.1 (maps onto the `vccs` `ComposedChart`).
|
|
149
|
-
- **`GanttChart`, `DagreGraph
|
|
150
|
-
d3-geo specific and have no `vccs` equivalent.
|
|
194
|
+
- **`GanttChart`, `DagreGraph`** — removed in v3. They were Unovis-specific.
|
|
151
195
|
|
|
152
196
|
## Module options
|
|
153
197
|
|
|
@@ -212,13 +256,16 @@ with `--vc-*` variables (or the backwards-compatible `--chart-color-0` through
|
|
|
212
256
|
`SankeyChartProps`, `SankeyInputNode`, `SankeyInputLink`,
|
|
213
257
|
`StatusTrackerChartProps`, `StatusTrackerDatum`, `BulletLegendItemInterface`,
|
|
214
258
|
`AxisConfig`, `ValueLabel`, `ReferenceLineConfig`, `NumericKeys`
|
|
259
|
+
- Map types: `DottedMapProps`, `TopoJSONMapProps`, `MapData`, `MapArea`,
|
|
260
|
+
`MapFeature`, `MapPoint`, `MapLink`, `MapPin`, `MapDot`, `MapGeometry`,
|
|
261
|
+
`MapProjection`, `MapRegion`, `MapZoom`, `PrecomputedMap`
|
|
215
262
|
- Style variant unions: `BarVariant`, `AreaFillVariant`, `StrokeVariant`,
|
|
216
263
|
`DotVariant`, `DitherVariant`, `BackgroundVariant`, `LegendIndicatorVariant`,
|
|
217
264
|
`TooltipVariant`, `TooltipRoundness`, `RadarVariant`, `RadialVariant`
|
|
218
265
|
|
|
219
266
|
## Migrating from v2
|
|
220
267
|
|
|
221
|
-
See the [Upgrade to v3](https://nuxtcharts.com/docs/getting-started/upgrade-to-v3) guide.
|
|
268
|
+
See the [Upgrade to v3](https://nuxtcharts.com/docs/getting-started/upgrade-to-v3) guide. Maps now use D3 and include world geometry. Gantt, dual, and dagre charts remain deferred or removed.
|
|
222
269
|
|
|
223
270
|
## License
|
|
224
271
|
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -11,7 +11,12 @@ const COMPONENTS = {
|
|
|
11
11
|
FunnelChart: "FunnelChart",
|
|
12
12
|
SankeyChart: "SankeyChart",
|
|
13
13
|
CandlestickChart: "CandlestickChart",
|
|
14
|
-
StatusTrackerChart: "StatusTrackerChart"
|
|
14
|
+
StatusTrackerChart: "StatusTrackerChart",
|
|
15
|
+
DottedMap: "DottedMap",
|
|
16
|
+
TopoJSONMap: "TopoJSONMap",
|
|
17
|
+
// Data-aware primitive: renders a serializable `ChartSpec` over raw rows by
|
|
18
|
+
// delegating to the adapters above.
|
|
19
|
+
DataChart: "DataChart"
|
|
15
20
|
};
|
|
16
21
|
const resolveComponents = (config, resolverUrl) => {
|
|
17
22
|
const { prefix, include, global } = config;
|
|
@@ -23,7 +28,7 @@ const resolveComponents = (config, resolverUrl) => {
|
|
|
23
28
|
addComponent({
|
|
24
29
|
name: `${prefix}${name}`,
|
|
25
30
|
filePath: resolve(`./runtime/components/${COMPONENTS[name]}.vue`),
|
|
26
|
-
mode: "client",
|
|
31
|
+
mode: name === "DottedMap" || name === "TopoJSONMap" ? "all" : "client",
|
|
27
32
|
global
|
|
28
33
|
});
|
|
29
34
|
}
|
|
@@ -77,7 +82,55 @@ const resolveImports = (config, resolverUrl) => {
|
|
|
77
82
|
"TooltipVariant",
|
|
78
83
|
"TooltipRoundness",
|
|
79
84
|
"RadarVariant",
|
|
80
|
-
"RadialVariant"
|
|
85
|
+
"RadialVariant",
|
|
86
|
+
"DottedMapProps",
|
|
87
|
+
"TopoJSONMapProps",
|
|
88
|
+
"MapsData",
|
|
89
|
+
"MapData",
|
|
90
|
+
"MapArea",
|
|
91
|
+
"MapFeature",
|
|
92
|
+
"MapPoint",
|
|
93
|
+
"MapLink",
|
|
94
|
+
"MapPin",
|
|
95
|
+
"MapDot",
|
|
96
|
+
"MapRegion",
|
|
97
|
+
"MapRegionName",
|
|
98
|
+
"MapGeometry",
|
|
99
|
+
"MapProjection",
|
|
100
|
+
"MapProjectionName",
|
|
101
|
+
"MapLegendItem",
|
|
102
|
+
"MapZoom",
|
|
103
|
+
"MapAccessor",
|
|
104
|
+
"MapInteractionKind",
|
|
105
|
+
"MapBaseProps",
|
|
106
|
+
"MapMarkSlot",
|
|
107
|
+
"MapOverlaySlot",
|
|
108
|
+
"MapTooltipSlot",
|
|
109
|
+
"DottedMapTooltipSlot",
|
|
110
|
+
"PrecomputedMap"
|
|
111
|
+
]
|
|
112
|
+
});
|
|
113
|
+
addImportsSources({
|
|
114
|
+
from: resolve("./runtime/utils/dottedMap"),
|
|
115
|
+
imports: ["getMap", "getPin"]
|
|
116
|
+
});
|
|
117
|
+
addImportsSources({
|
|
118
|
+
from: resolve("./runtime/spec"),
|
|
119
|
+
imports: ["transform", "toCsv", "validateSpec", "seriesLabel", "formatBucket"]
|
|
120
|
+
});
|
|
121
|
+
addImportsSources({
|
|
122
|
+
from: resolve("./runtime/spec"),
|
|
123
|
+
type: true,
|
|
124
|
+
imports: [
|
|
125
|
+
"ChartSpec",
|
|
126
|
+
"SpecChartType",
|
|
127
|
+
"SpecAggregate",
|
|
128
|
+
"SpecInterval",
|
|
129
|
+
"SpecCompare",
|
|
130
|
+
"SpecDimensions",
|
|
131
|
+
"SpecTransform",
|
|
132
|
+
"SpecDatum",
|
|
133
|
+
"TransformResult"
|
|
81
134
|
]
|
|
82
135
|
});
|
|
83
136
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer vue-chrts{.vc-tooltip{background:var(--vc-tooltip-bg,oklch(1 0 0));border:1px solid var(--vc-tooltip-border,oklch(.922 0 0));border-radius:var(--vc-tooltip-radius,.5rem);box-shadow:var(--vc-tooltip-shadow,0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1));color:var(--vc-tooltip-fg,oklch(.205 0 0));font-size:var(--vc-legend-size,.75rem);line-height:1.5;min-width:8rem;padding:var(--vc-tooltip-padding,.375rem .625rem);pointer-events:none}.vc-tooltip--frosted-glass{backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);background:color-mix(in oklab,var(--vc-tooltip-bg,oklch(1 0 0)) 70%,transparent)}.vc-tooltip--sm{border-radius:.125rem}.vc-tooltip--md{border-radius:.375rem}.vc-tooltip--lg{border-radius:.5rem}.vc-tooltip--xl{border-radius:.75rem}.vc-tooltip__label{color:var(--vc-tooltip-fg,oklch(.205 0 0));font-weight:500;margin:0 0 .25rem}.vc-tooltip__list{display:flex;flex-direction:column;gap:.125rem;list-style:none;margin:0;padding:0}.vc-tooltip__item{align-items:center;display:flex;gap:.375rem}.vc-tooltip__dot{border-radius:9999px;display:inline-block;flex-shrink:0;height:.5rem;width:.5rem}.vc-tooltip__name{color:var(--vc-tooltip-muted,oklch(.556 0 0))}.vc-tooltip__value{color:var(--vc-tooltip-fg,oklch(.205 0 0));font-variant-numeric:tabular-nums;font-weight:500;margin-left:auto}.vc-legend{flex-wrap:wrap;font-size:var(--vc-legend-size,.75rem);font-weight:var(--vc-legend-weight,400);gap:var(--vc-legend-gap,.75rem);justify-content:center;line-height:1.5;list-style:none;margin:0;padding:0}.vc-legend,.vc-legend__item{align-items:center;display:flex}.vc-legend__item{gap:.375rem}.vc-legend__item--inactive{opacity:.4}.vc-legend__dot{border-radius:9999px;display:inline-block;flex-shrink:0;height:var(--vc-legend-dot-size,.5rem);width:var(--vc-legend-dot-size,.5rem)}.vc-legend__dot--square{border-radius:0}.vc-legend__dot--rounded-square{border-radius:2px}.vc-legend__dot--circle{border-radius:9999px}.vc-legend__dot--vertical-bar{border-radius:2px;height:calc(var(--vc-legend-dot-size, .5rem)*1.5);width:calc(var(--vc-legend-dot-size, .5rem)*.5)}.vc-legend__dot--horizontal-bar{border-radius:2px;height:calc(var(--vc-legend-dot-size, .5rem)*.5);width:calc(var(--vc-legend-dot-size, .5rem)*1.5)}.vc-legend__dot--circle-outline,.vc-legend__dot--rounded-square-outline{box-sizing:border-box;height:calc(var(--vc-legend-dot-size, .5rem)*1.25);-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;padding:1.5px;width:calc(var(--vc-legend-dot-size, .5rem)*1.25)}.vc-legend__dot--circle-outline{border-radius:9999px}.vc-legend__dot--rounded-square-outline{border-radius:3px}.vc-legend__label{color:var(--vc-legend-color,oklch(.556 0 0))}.vc-skeleton{align-items:stretch;box-sizing:border-box;color:var(--vc-tick-color,oklch(.556 0 0));display:flex;overflow:hidden;padding:8% 4%;position:relative;width:100%}.vc-skeleton__bars{align-items:flex-end;display:flex;gap:2%;height:100%;width:100%}.vc-skeleton__bar{background:currentColor;border-radius:2px 2px 0 0;flex:1;opacity:.14}.vc-skeleton__wave{height:100%;opacity:.14;width:100%}.vc-skeleton__ring{aspect-ratio:1;border:1.75rem solid;border-radius:9999px;height:100%;margin:auto;opacity:.14}.vc-skeleton__shimmer{animation:vc-skeleton-sweep 1.8s linear infinite;background:linear-gradient(105deg,transparent 35%,currentColor 50%,transparent 65%);inset:0;opacity:.1;position:absolute}@keyframes vc-skeleton-sweep{0%{transform:translateX(-100%)}to{transform:translateX(100%)}}.vc-skeleton__pill{align-items:center;background:var(--vc-surface-bg,oklch(1 0 0));border:1px solid var(--vc-tooltip-border,oklch(.922 0 0));border-radius:.375rem;color:var(--vc-tick-color,oklch(.556 0 0));display:flex;font-size:var(--vc-legend-size,.75rem);gap:.375rem;height:-moz-fit-content;height:fit-content;inset:0;line-height:1.5;margin:auto;padding:.125rem .5rem;position:absolute;width:-moz-fit-content;width:fit-content}.vc-skeleton__spinner{animation:vc-skeleton-spin .7s linear infinite;border:1px solid var(--vc-tooltip-border,oklch(.922 0 0));border-radius:9999px;border-top:1px solid;height:.75rem;width:.75rem}@keyframes vc-skeleton-spin{to{transform:rotate(1turn)}}@media (prefers-reduced-motion:reduce){.vc-skeleton__shimmer,.vc-skeleton__spinner{animation:none}}.vc-candlestick-chart{cursor:crosshair;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.vc-candlestick-chart__svg{display:block;overflow:visible;width:100%}.vc-funnel-layered{position:relative;width:100%}.vc-funnel{position:relative}.vc-funnel-layered__tooltip{align-items:center;background:var(--vc-tooltip-bg,oklch(1 0 0));border:1px solid var(--vc-tooltip-border,oklch(.922 0 0));border-radius:var(--vc-tooltip-radius,.5rem);box-shadow:var(--vc-tooltip-shadow,0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1));color:var(--vc-tooltip-fg,oklch(.205 0 0));display:flex;font-size:var(--vc-legend-size,.75rem);gap:.375rem;padding:var(--vc-tooltip-padding,.375rem .625rem);pointer-events:none;position:absolute;transform:translate(-50%,calc(-100% - 10px));white-space:nowrap}.vc-funnel-layered__name{color:var(--vc-tooltip-muted,oklch(.556 0 0))}.vc-funnel-layered__value{font-variant-numeric:tabular-nums;font-weight:600}.vc-funnel-layered__dot{border-radius:9999px;display:inline-block;flex-shrink:0;height:var(--vc-legend-dot-size,.5rem);width:var(--vc-legend-dot-size,.5rem)}.vc-funnel-layered-shape{opacity:.96;transition:opacity .15s}.vc-funnel-layered-shape:hover{opacity:1}.vc-funnel .v-charts-label-list .v-charts-label{fill:var(--vc-funnel-value-color,oklch(.205 0 0));font-size:var(--vc-funnel-value-size,.75rem);font-variant-numeric:tabular-nums;font-weight:var(--vc-funnel-value-weight,600)}.vc-funnel-classic-shape{cursor:default}.vc-funnel-classic-shape__shadow{opacity:var(--vc-funnel-shadow-opacity,.16)}.vc-funnel-classic-shape__body{opacity:var(--vc-funnel-shape-opacity,.92);transition:opacity .15s ease}.vc-funnel-classic-shape__highlight{fill:none;stroke:hsla(0,0%,100%,.24);stroke-width:1;vector-effect:non-scaling-stroke}.vc-funnel-classic-shape:hover .vc-funnel-classic-shape__body{opacity:var(--vc-funnel-shape-hover-opacity,1)}.vc-funnel-classic-shape__name,.vc-funnel-classic-shape__value{font-family:inherit;paint-order:stroke;pointer-events:none;stroke:rgba(0,0,0,.12);stroke-linejoin:round;stroke-width:2px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.vc-funnel-classic-shape__value{fill:var(--vc-funnel-inside-value-color,#fff);font-variant-numeric:tabular-nums}.vc-funnel-classic-shape__name{fill:var(--vc-funnel-inside-label-color,#fff);opacity:.78}.vc-funnel-layered-shape__divider{stroke:var(--vc-surface-bg,oklch(1 0 0))}.vc-funnel-layered-shape__badge-text,.vc-funnel-layered-shape__name,.vc-funnel-layered-shape__value{font-family:inherit;pointer-events:none;stroke:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.vc-funnel-layered-shape__value{fill:var(--vc-funnel-value-color,var(--vc-axis-label-color,oklch(.205 0 0)));font-variant-numeric:tabular-nums;font-weight:var(--vc-funnel-value-weight,600)}.vc-funnel-layered-shape__badge{fill:var(--vc-funnel-badge-bg,var(--vc-surface-bg,oklch(1 0 0)));fill-opacity:var(--vc-funnel-badge-opacity,.82);stroke:var(--vc-funnel-badge-border,var(--vc-axis-line-color,oklch(.922 0 0)));stroke-opacity:.7}.vc-funnel-layered-shape__badge-text{fill:var(--vc-funnel-badge-color,var(--vc-tick-color,oklch(.556 0 0)));font-variant-numeric:tabular-nums;font-weight:var(--vc-funnel-badge-weight,600)}.vc-funnel-layered-shape__name{fill:var(--vc-funnel-label-color,var(--vc-tick-color,oklch(.556 0 0)));font-weight:var(--vc-funnel-label-weight,500)}.vc-status-tracker{color:var(--vc-axis-label-color,var(--ui-text-highlighted,var(--foreground,oklch(.205 0 0))));font-family:inherit;width:100%}.vc-status-tracker__header{align-items:baseline;display:flex;gap:1rem;justify-content:space-between;margin-bottom:.75rem}.vc-status-tracker__summary,.vc-status-tracker__title{font-size:.875rem;line-height:1.25rem;margin:0}.vc-status-tracker__title{font-weight:600}.vc-status-tracker__summary{color:var(--vc-tick-color,var(--ui-text-muted,var(--muted-foreground,oklch(.556 0 0))));font-variant-numeric:tabular-nums}.vc-status-tracker__track{display:flex;overflow:hidden;width:100%}.vc-status-tracker__bar{display:block;flex:0 0 auto;height:100%;min-width:1px;transition:opacity .16s ease}.vc-status-tracker__bar:hover{opacity:.78}.vc-status-tracker__bar--rounded-start{border-bottom-left-radius:.25rem;border-top-left-radius:.25rem}.vc-status-tracker__bar--rounded-end{border-bottom-right-radius:.25rem;border-top-right-radius:.25rem}.vc-status-tracker__bar--empty:hover{opacity:1}.vc-status-tracker__labels{gap:1rem;justify-content:space-between;margin-top:.5rem}.vc-status-tracker__labels,.vc-status-tracker__legend{color:var(--vc-legend-color,oklch(.556 0 0));display:flex;font-size:var(--vc-legend-size,.75rem);line-height:1rem}.vc-status-tracker__legend{flex-wrap:wrap;gap:.5rem 1rem;list-style:none;margin:var(--vc-legend-inset,.75rem) 0 0;padding:0}.vc-status-tracker__legend-item{align-items:center;display:inline-flex;gap:.375rem}.vc-status-tracker__legend-dot{border-radius:9999px;flex:0 0 auto;height:var(--vc-legend-dot-size,.5rem);width:var(--vc-legend-dot-size,.5rem)}}.vc-sr-only{height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important;clip:rect(0,0,0,0)!important;border:0!important;white-space:nowrap!important}.vc-empty-state{color:var(--vc-tick-color);display:grid;font-size:var(--vc-legend-size);place-items:center}
|
|
1
|
+
@layer vue-chrts{.vc-tooltip{background:var(--vc-tooltip-bg,oklch(1 0 0));border:1px solid var(--vc-tooltip-border,oklch(.922 0 0));border-radius:var(--vc-tooltip-radius,.5rem);box-shadow:var(--vc-tooltip-shadow,0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1));color:var(--vc-tooltip-fg,oklch(.205 0 0));font-size:var(--vc-legend-size,.75rem);line-height:1.5;min-width:8rem;padding:var(--vc-tooltip-padding,.375rem .625rem);pointer-events:none}.vc-tooltip--frosted-glass{backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);background:color-mix(in oklab,var(--vc-tooltip-bg,oklch(1 0 0)) 70%,transparent)}.vc-tooltip--sm{border-radius:.125rem}.vc-tooltip--md{border-radius:.375rem}.vc-tooltip--lg{border-radius:.5rem}.vc-tooltip--xl{border-radius:.75rem}.vc-tooltip__label{color:var(--vc-tooltip-fg,oklch(.205 0 0));font-weight:500;margin:0 0 .25rem}.vc-tooltip__list{display:flex;flex-direction:column;gap:.125rem;list-style:none;margin:0;padding:0}.vc-tooltip__item{align-items:center;display:flex;gap:.375rem}.vc-tooltip__dot{border-radius:9999px;display:inline-block;flex-shrink:0;height:.5rem;width:.5rem}.vc-tooltip__name{color:var(--vc-tooltip-muted,oklch(.556 0 0))}.vc-tooltip__value{color:var(--vc-tooltip-fg,oklch(.205 0 0));font-variant-numeric:tabular-nums;font-weight:500;margin-left:auto}.vc-legend{flex-wrap:wrap;font-size:var(--vc-legend-size,.75rem);font-weight:var(--vc-legend-weight,400);gap:var(--vc-legend-gap,.75rem);justify-content:center;line-height:1.5;list-style:none;margin:0;padding:0}.vc-legend,.vc-legend__item{align-items:center;display:flex}.vc-legend__item{gap:.375rem}.vc-legend__item--inactive{opacity:.4}.vc-legend__dot{border-radius:9999px;display:inline-block;flex-shrink:0;height:var(--vc-legend-dot-size,.5rem);width:var(--vc-legend-dot-size,.5rem)}.vc-legend__dot--square{border-radius:0}.vc-legend__dot--rounded-square{border-radius:2px}.vc-legend__dot--circle{border-radius:9999px}.vc-legend__dot--vertical-bar{border-radius:2px;height:calc(var(--vc-legend-dot-size, .5rem)*1.5);width:calc(var(--vc-legend-dot-size, .5rem)*.5)}.vc-legend__dot--horizontal-bar{border-radius:2px;height:calc(var(--vc-legend-dot-size, .5rem)*.5);width:calc(var(--vc-legend-dot-size, .5rem)*1.5)}.vc-legend__dot--circle-outline,.vc-legend__dot--rounded-square-outline{box-sizing:border-box;height:calc(var(--vc-legend-dot-size, .5rem)*1.25);-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;padding:1.5px;width:calc(var(--vc-legend-dot-size, .5rem)*1.25)}.vc-legend__dot--circle-outline{border-radius:9999px}.vc-legend__dot--rounded-square-outline{border-radius:3px}.vc-legend__label{color:var(--vc-legend-color,oklch(.556 0 0))}.vc-skeleton{align-items:stretch;box-sizing:border-box;color:var(--vc-tick-color,oklch(.556 0 0));display:flex;overflow:hidden;padding:8% 4%;position:relative;width:100%}.vc-skeleton__bars{align-items:flex-end;display:flex;gap:2%;height:100%;width:100%}.vc-skeleton__bar{background:currentColor;border-radius:2px 2px 0 0;flex:1;opacity:.14}.vc-skeleton__wave{height:100%;opacity:.14;width:100%}.vc-skeleton__ring{aspect-ratio:1;border:1.75rem solid;border-radius:9999px;height:100%;margin:auto;opacity:.14}.vc-skeleton__shimmer{animation:vc-skeleton-sweep 1.8s linear infinite;background:linear-gradient(105deg,transparent 35%,currentColor 50%,transparent 65%);inset:0;opacity:.1;position:absolute}@keyframes vc-skeleton-sweep{0%{transform:translateX(-100%)}to{transform:translateX(100%)}}.vc-skeleton__pill{align-items:center;background:var(--vc-surface-bg,oklch(1 0 0));border:1px solid var(--vc-tooltip-border,oklch(.922 0 0));border-radius:.375rem;color:var(--vc-tick-color,oklch(.556 0 0));display:flex;font-size:var(--vc-legend-size,.75rem);gap:.375rem;height:-moz-fit-content;height:fit-content;inset:0;line-height:1.5;margin:auto;padding:.125rem .5rem;position:absolute;width:-moz-fit-content;width:fit-content}.vc-skeleton__spinner{animation:vc-skeleton-spin .7s linear infinite;border:1px solid var(--vc-tooltip-border,oklch(.922 0 0));border-radius:9999px;border-top:1px solid;height:.75rem;width:.75rem}@keyframes vc-skeleton-spin{to{transform:rotate(1turn)}}@media (prefers-reduced-motion:reduce){.vc-skeleton__shimmer,.vc-skeleton__spinner{animation:none}}.vc-candlestick-chart{cursor:crosshair;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.vc-candlestick-chart__svg{display:block;overflow:visible;width:100%}.vc-funnel-layered{position:relative;width:100%}.vc-funnel{position:relative}.vc-funnel-layered__tooltip{align-items:center;background:var(--vc-tooltip-bg,oklch(1 0 0));border:1px solid var(--vc-tooltip-border,oklch(.922 0 0));border-radius:var(--vc-tooltip-radius,.5rem);box-shadow:var(--vc-tooltip-shadow,0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1));color:var(--vc-tooltip-fg,oklch(.205 0 0));display:flex;font-size:var(--vc-legend-size,.75rem);gap:.375rem;padding:var(--vc-tooltip-padding,.375rem .625rem);pointer-events:none;position:absolute;transform:translate(-50%,calc(-100% - 10px));white-space:nowrap}.vc-funnel-layered__name{color:var(--vc-tooltip-muted,oklch(.556 0 0))}.vc-funnel-layered__value{font-variant-numeric:tabular-nums;font-weight:600}.vc-funnel-layered__dot{border-radius:9999px;display:inline-block;flex-shrink:0;height:var(--vc-legend-dot-size,.5rem);width:var(--vc-legend-dot-size,.5rem)}.vc-funnel-layered-shape{opacity:.96;transition:opacity .15s}.vc-funnel-layered-shape:hover{opacity:1}.vc-funnel .v-charts-label-list .v-charts-label{fill:var(--vc-funnel-value-color,oklch(.205 0 0));font-size:var(--vc-funnel-value-size,.75rem);font-variant-numeric:tabular-nums;font-weight:var(--vc-funnel-value-weight,600)}.vc-funnel-classic-shape{cursor:default}.vc-funnel-classic-shape__shadow{opacity:var(--vc-funnel-shadow-opacity,.16)}.vc-funnel-classic-shape__body{opacity:var(--vc-funnel-shape-opacity,.92);transition:opacity .15s ease}.vc-funnel-classic-shape__highlight{fill:none;stroke:hsla(0,0%,100%,.24);stroke-width:1;vector-effect:non-scaling-stroke}.vc-funnel-classic-shape:hover .vc-funnel-classic-shape__body{opacity:var(--vc-funnel-shape-hover-opacity,1)}.vc-funnel-classic-shape__name,.vc-funnel-classic-shape__value{font-family:inherit;paint-order:stroke;pointer-events:none;stroke:rgba(0,0,0,.12);stroke-linejoin:round;stroke-width:2px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.vc-funnel-classic-shape__value{fill:var(--vc-funnel-inside-value-color,#fff);font-variant-numeric:tabular-nums}.vc-funnel-classic-shape__name{fill:var(--vc-funnel-inside-label-color,#fff);opacity:.78}.vc-funnel-layered-shape__divider{stroke:var(--vc-surface-bg,oklch(1 0 0))}.vc-funnel-layered-shape__badge-text,.vc-funnel-layered-shape__name,.vc-funnel-layered-shape__value{font-family:inherit;pointer-events:none;stroke:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.vc-funnel-layered-shape__value{fill:var(--vc-funnel-value-color,var(--vc-axis-label-color,oklch(.205 0 0)));font-variant-numeric:tabular-nums;font-weight:var(--vc-funnel-value-weight,600)}.vc-funnel-layered-shape__badge{fill:var(--vc-funnel-badge-bg,var(--vc-surface-bg,oklch(1 0 0)));fill-opacity:var(--vc-funnel-badge-opacity,.82);stroke:var(--vc-funnel-badge-border,var(--vc-axis-line-color,oklch(.922 0 0)));stroke-opacity:.7}.vc-funnel-layered-shape__badge-text{fill:var(--vc-funnel-badge-color,var(--vc-tick-color,oklch(.556 0 0)));font-variant-numeric:tabular-nums;font-weight:var(--vc-funnel-badge-weight,600)}.vc-funnel-layered-shape__name{fill:var(--vc-funnel-label-color,var(--vc-tick-color,oklch(.556 0 0)));font-weight:var(--vc-funnel-label-weight,500)}.vc-status-tracker{color:var(--vc-axis-label-color,var(--ui-text-highlighted,var(--foreground,oklch(.205 0 0))));font-family:inherit;width:100%}.vc-status-tracker__header{align-items:baseline;display:flex;gap:1rem;justify-content:space-between;margin-bottom:.75rem}.vc-status-tracker__summary,.vc-status-tracker__title{font-size:.875rem;line-height:1.25rem;margin:0}.vc-status-tracker__title{font-weight:600}.vc-status-tracker__summary{color:var(--vc-tick-color,var(--ui-text-muted,var(--muted-foreground,oklch(.556 0 0))));font-variant-numeric:tabular-nums}.vc-status-tracker__track{display:flex;overflow:hidden;width:100%}.vc-status-tracker__bar{display:block;flex:0 0 auto;height:100%;min-width:1px;transition:opacity .16s ease}.vc-status-tracker__bar:hover{opacity:.78}.vc-status-tracker__bar--rounded-start{border-bottom-left-radius:.25rem;border-top-left-radius:.25rem}.vc-status-tracker__bar--rounded-end{border-bottom-right-radius:.25rem;border-top-right-radius:.25rem}.vc-status-tracker__bar--empty:hover{opacity:1}.vc-status-tracker__labels{gap:1rem;justify-content:space-between;margin-top:.5rem}.vc-status-tracker__labels,.vc-status-tracker__legend{color:var(--vc-legend-color,oklch(.556 0 0));display:flex;font-size:var(--vc-legend-size,.75rem);line-height:1rem}.vc-status-tracker__legend{flex-wrap:wrap;gap:.5rem 1rem;list-style:none;margin:var(--vc-legend-inset,.75rem) 0 0;padding:0}.vc-status-tracker__legend-item{align-items:center;display:inline-flex;gap:.375rem}.vc-status-tracker__legend-dot{border-radius:9999px;flex:0 0 auto;height:var(--vc-legend-dot-size,.5rem);width:var(--vc-legend-dot-size,.5rem)}}.vc-sr-only{height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important;clip:rect(0,0,0,0)!important;border:0!important;white-space:nowrap!important}.vc-empty-state{color:var(--vc-tick-color);display:grid;font-size:var(--vc-legend-size);place-items:center}@layer vue-chrts{.vc-map{display:flex;gap:var(--vc-legend-inset)}.vc-map__viewport{overflow:hidden;position:relative;width:100%}.vc-map__svg{display:block;height:100%;width:100%}.vc-map__svg--zoomable{cursor:grab;touch-action:none}.vc-map__svg--zoomable:active{cursor:grabbing}.vc-map__svg:focus-visible{outline:2px solid var(--vc-series-0);outline-offset:-2px}.vc-map__mark:focus-visible{filter:brightness(1.25);outline:none}.vc-map__mark:focus-visible>circle,.vc-map__mark:focus-visible>path{stroke:var(--vc-axis-label-color);stroke-width:2}.vc-map__label{fill:var(--vc-axis-label-color);font:var(--vc-tick-weight) var(--vc-tick-size) var(--vc-font-family);paint-order:stroke;pointer-events:none;stroke:var(--vc-surface-bg);stroke-width:3px}.vc-map__tooltip{max-width:min(280px,90%);pointer-events:none;position:absolute;z-index:2}.vc-map__legend{display:flex}.vc-map__controls{background:var(--vc-surface-bg);border:1px solid var(--vc-tooltip-border);border-radius:var(--vc-tooltip-radius);bottom:12px;display:flex;position:absolute;right:12px}.vc-map__controls button{background:transparent;border:0;color:var(--vc-axis-label-color);cursor:pointer;font:inherit;height:32px;width:32px}.vc-map__controls button:hover{background:var(--vc-hover-fill)}.vc-map__controls button:focus-visible{outline:2px solid var(--vc-series-0);outline-offset:-2px}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer vue-chrts{.vue-chrts :focus,.vue-chrts :focus-visible,.vue-chrts:focus,.vue-chrts:focus-visible{outline:none}.vue-chrts{--vc-font-family:var(--font-sans,ui-sans-serif,system-ui,sans-serif);--vc-series-0:var(--chart-color-0,var(--ui-primary,oklch(0.63 0.18 155)));--vc-series-1:var(--chart-color-1,var(--ui-secondary,oklch(0.62 0.19 255)));--vc-series-2:var(--chart-color-2,var(--ui-success,oklch(0.64 0.17 145)));--vc-series-3:var(--chart-color-3,var(--ui-info,oklch(0.68 0.15 235)));--vc-series-4:var(--chart-color-4,var(--ui-warning,oklch(0.75 0.16 75)));--vc-series-5:var(--chart-color-5,var(--ui-error,oklch(0.63 0.22 25)));--vc-series-6:var(--chart-color-6,oklch(0.66 0.18 305));--vc-series-7:var(--chart-color-7,oklch(0.7 0.15 195));font-family:var(--vc-font-family);--vc-grid-color:var(--ui-border,var(--border,oklch(0.922 0 0)));--vc-grid-dash:3 3;--vc-grid-width:1px;--vc-axis-line-color:var(--ui-border,var(--border,oklch(0.922 0 0)));--vc-axis-line-width:1px;--vc-surface-bg:var(--ui-bg,var(--background,oklch(1 0 0)));--vc-reference-line-color:var(--ui-text-muted,var(--muted-foreground,oklch(0.556 0 0)));--vc-candle-up:var(--ui-success,oklch(0.696 0.17 162.48));--vc-candle-down:var(--ui-error,oklch(0.637 0.237 25.331));--vc-bg-pattern-color:var(--vc-grid-color);--vc-legend-size:0.75rem;--vc-legend-weight:400;--vc-tick-color:var(--ui-text-muted,var(--muted-foreground,oklch(0.556 0 0)));--vc-tick-size:var(--vc-legend-size);--vc-tick-weight:var(--vc-legend-weight);--vc-axis-label-color:var(--ui-text-highlighted,var(--foreground,oklch(0.205 0 0)));--vc-axis-label-size:var(--vc-legend-size);--vc-axis-label-weight:500}.vue-chrts .v-charts-cartesian-axis .v-charts-label{fill:var(--vc-axis-label-color);font-size:var(--vc-axis-label-size);font-weight:var(--vc-axis-label-weight)}.vue-chrts{--vc-legend-gap:0.75rem;--vc-legend-inset:0.75rem;--vc-legend-color:var(--ui-text-muted,var(--muted-foreground,oklch(0.556 0 0)));--vc-legend-dot-size:0.5rem;--vc-funnel-value-size:var(--vc-legend-size);--vc-funnel-value-color:var(--vc-axis-label-color);--vc-funnel-value-weight:600;--vc-funnel-label-color:var(--vc-tick-color);--vc-funnel-label-weight:500;--vc-funnel-badge-bg:var(--vc-surface-bg);--vc-funnel-badge-color:var(--vc-tick-color);--vc-funnel-badge-border:var(--vc-axis-line-color);--vc-funnel-badge-weight:600;--vc-funnel-badge-opacity:0.82;--vc-hover-fill:color-mix(in oklab,var(--ui-text-highlighted,var(--foreground,oklch(0.205 0 0))) 6%,transparent);--vc-hover-stroke:transparent;--vc-hover-radius:6px;--vc-tooltip-bg:var(--ui-bg-elevated,var(--popover,oklch(1 0 0)));--vc-tooltip-fg:var(--ui-text-highlighted,var(--popover-foreground,oklch(0.205 0 0)));--vc-tooltip-muted:var(--ui-text-muted,var(--muted-foreground,oklch(0.556 0 0)));--vc-tooltip-border:var(--ui-border,var(--border,oklch(0.922 0 0)));--vc-tooltip-radius:var(--ui-radius,0.5rem);--vc-tooltip-padding:0.375rem 0.625rem;--vc-tooltip-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1)}.vue-chrts .v-charts-xAxis .v-charts-cartesian-axis-tick-value{fill:var(--vc-x-tick-color,var(--vc-tick-color));font-size:var(--vc-x-tick-size,var(--vc-tick-size));font-weight:var(--vc-x-tick-weight,var(--vc-tick-weight))}.vue-chrts .v-charts-yAxis .v-charts-cartesian-axis-tick-value{fill:var(--vc-y-tick-color,var(--vc-tick-color));font-size:var(--vc-y-tick-size,var(--vc-tick-size));font-weight:var(--vc-y-tick-weight,var(--vc-tick-weight))}.vue-chrts .v-charts-polar-angle-axis-tick-value,.vue-chrts .v-charts-polar-radius-axis-tick-value{fill:var(--vc-tick-color);font-size:var(--vc-tick-size);font-weight:var(--vc-tick-weight)}.vue-chrts.vc-dash-animated .v-charts-area-curve,.vue-chrts.vc-dash-animated .v-charts-line-curve{animation:vc-dash-march 1s linear infinite}@keyframes vc-dash-march{to{stroke-dashoffset:-6}}@media (prefers-reduced-motion:reduce){.vue-chrts.vc-dash-animated .v-charts-area-curve,.vue-chrts.vc-dash-animated .v-charts-line-curve{animation:none}}.vue-chrts:is(.dark,[data-theme=dark],.dark *,[data-theme=dark] *),:is(.dark,[data-theme=dark]) .vue-chrts{--vc-grid-color:var(--ui-border,var(--border,oklch(0.269 0 0)));--vc-axis-line-color:var(--ui-border,var(--border,oklch(0.269 0 0)));--vc-surface-bg:var(--ui-bg,var(--background,oklch(0.145 0 0)));--vc-tick-color:var(--ui-text-muted,var(--muted-foreground,oklch(0.708 0 0)));--vc-axis-label-color:var(--ui-text-highlighted,var(--foreground,oklch(0.985 0 0)));--vc-legend-color:var(--ui-text-muted,var(--muted-foreground,oklch(0.708 0 0)));--vc-hover-fill:color-mix(in oklab,var(--ui-text-highlighted,oklch(0.985 0 0)) 8%,transparent);--vc-tooltip-bg:var(--ui-bg-elevated,var(--popover,oklch(0.205 0 0)));--vc-tooltip-fg:var(--ui-text-highlighted,var(--popover-foreground,oklch(0.985 0 0)));--vc-tooltip-muted:var(--ui-text-muted,var(--muted-foreground,oklch(0.708 0 0)));--vc-tooltip-border:var(--ui-border,var(--border,oklch(0.269 0 0)))}}
|
|
1
|
+
@layer vue-chrts{.vue-chrts :focus,.vue-chrts :focus-visible,.vue-chrts:focus,.vue-chrts:focus-visible{outline:none}.vue-chrts{--vc-map-feature-color:var(--ui-bg-accented,var(--vc-grid-color));--vc-map-boundary-color:var(--ui-border-accented,var(--vc-surface-bg));--vc-map-dot-color:var(--ui-text-dimmed,var(--vc-tick-color));--vc-font-family:var(--font-sans,ui-sans-serif,system-ui,sans-serif);--vc-series-0:var(--chart-color-0,var(--ui-primary,oklch(0.63 0.18 155)));--vc-series-1:var(--chart-color-1,var(--ui-secondary,oklch(0.62 0.19 255)));--vc-series-2:var(--chart-color-2,var(--ui-success,oklch(0.64 0.17 145)));--vc-series-3:var(--chart-color-3,var(--ui-info,oklch(0.68 0.15 235)));--vc-series-4:var(--chart-color-4,var(--ui-warning,oklch(0.75 0.16 75)));--vc-series-5:var(--chart-color-5,var(--ui-error,oklch(0.63 0.22 25)));--vc-series-6:var(--chart-color-6,oklch(0.66 0.18 305));--vc-series-7:var(--chart-color-7,oklch(0.7 0.15 195));font-family:var(--vc-font-family);--vc-grid-color:var(--ui-border,var(--border,oklch(0.922 0 0)));--vc-grid-dash:3 3;--vc-grid-width:1px;--vc-axis-line-color:var(--ui-border,var(--border,oklch(0.922 0 0)));--vc-axis-line-width:1px;--vc-surface-bg:var(--ui-bg,var(--background,oklch(1 0 0)));--vc-reference-line-color:var(--ui-text-muted,var(--muted-foreground,oklch(0.556 0 0)));--vc-candle-up:var(--ui-success,oklch(0.696 0.17 162.48));--vc-candle-down:var(--ui-error,oklch(0.637 0.237 25.331));--vc-bg-pattern-color:var(--vc-grid-color);--vc-legend-size:0.75rem;--vc-legend-weight:400;--vc-tick-color:var(--ui-text-muted,var(--muted-foreground,oklch(0.556 0 0)));--vc-tick-size:var(--vc-legend-size);--vc-tick-weight:var(--vc-legend-weight);--vc-axis-label-color:var(--ui-text-highlighted,var(--foreground,oklch(0.205 0 0)));--vc-axis-label-size:var(--vc-legend-size);--vc-axis-label-weight:500}.vue-chrts .v-charts-cartesian-axis .v-charts-label{fill:var(--vc-axis-label-color);font-size:var(--vc-axis-label-size);font-weight:var(--vc-axis-label-weight)}.vue-chrts{--vc-legend-gap:0.75rem;--vc-legend-inset:0.75rem;--vc-legend-color:var(--ui-text-muted,var(--muted-foreground,oklch(0.556 0 0)));--vc-legend-dot-size:0.5rem;--vc-funnel-value-size:var(--vc-legend-size);--vc-funnel-value-color:var(--vc-axis-label-color);--vc-funnel-value-weight:600;--vc-funnel-label-color:var(--vc-tick-color);--vc-funnel-label-weight:500;--vc-funnel-badge-bg:var(--vc-surface-bg);--vc-funnel-badge-color:var(--vc-tick-color);--vc-funnel-badge-border:var(--vc-axis-line-color);--vc-funnel-badge-weight:600;--vc-funnel-badge-opacity:0.82;--vc-hover-fill:color-mix(in oklab,var(--ui-text-highlighted,var(--foreground,oklch(0.205 0 0))) 6%,transparent);--vc-hover-stroke:transparent;--vc-hover-radius:6px;--vc-tooltip-bg:var(--ui-bg-elevated,var(--popover,oklch(1 0 0)));--vc-tooltip-fg:var(--ui-text-highlighted,var(--popover-foreground,oklch(0.205 0 0)));--vc-tooltip-muted:var(--ui-text-muted,var(--muted-foreground,oklch(0.556 0 0)));--vc-tooltip-border:var(--ui-border,var(--border,oklch(0.922 0 0)));--vc-tooltip-radius:var(--ui-radius,0.5rem);--vc-tooltip-padding:0.375rem 0.625rem;--vc-tooltip-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1)}.vue-chrts .v-charts-xAxis .v-charts-cartesian-axis-tick-value{fill:var(--vc-x-tick-color,var(--vc-tick-color));font-size:var(--vc-x-tick-size,var(--vc-tick-size));font-weight:var(--vc-x-tick-weight,var(--vc-tick-weight))}.vue-chrts .v-charts-yAxis .v-charts-cartesian-axis-tick-value{fill:var(--vc-y-tick-color,var(--vc-tick-color));font-size:var(--vc-y-tick-size,var(--vc-tick-size));font-weight:var(--vc-y-tick-weight,var(--vc-tick-weight))}.vue-chrts .v-charts-polar-angle-axis-tick-value,.vue-chrts .v-charts-polar-radius-axis-tick-value{fill:var(--vc-tick-color);font-size:var(--vc-tick-size);font-weight:var(--vc-tick-weight)}.vue-chrts.vc-dash-animated .v-charts-area-curve,.vue-chrts.vc-dash-animated .v-charts-line-curve{animation:vc-dash-march 1s linear infinite}@keyframes vc-dash-march{to{stroke-dashoffset:-6}}@media (prefers-reduced-motion:reduce){.vue-chrts.vc-dash-animated .v-charts-area-curve,.vue-chrts.vc-dash-animated .v-charts-line-curve{animation:none}}.vue-chrts:is(.dark,[data-theme=dark],.dark *,[data-theme=dark] *),:is(.dark,[data-theme=dark]) .vue-chrts{--vc-grid-color:var(--ui-border,var(--border,oklch(0.269 0 0)));--vc-axis-line-color:var(--ui-border,var(--border,oklch(0.269 0 0)));--vc-surface-bg:var(--ui-bg,var(--background,oklch(0.145 0 0)));--vc-tick-color:var(--ui-text-muted,var(--muted-foreground,oklch(0.708 0 0)));--vc-axis-label-color:var(--ui-text-highlighted,var(--foreground,oklch(0.985 0 0)));--vc-legend-color:var(--ui-text-muted,var(--muted-foreground,oklch(0.708 0 0)));--vc-hover-fill:color-mix(in oklab,var(--ui-text-highlighted,oklch(0.985 0 0)) 8%,transparent);--vc-tooltip-bg:var(--ui-bg-elevated,var(--popover,oklch(0.205 0 0)));--vc-tooltip-fg:var(--ui-text-highlighted,var(--popover-foreground,oklch(0.985 0 0)));--vc-tooltip-muted:var(--ui-text-muted,var(--muted-foreground,oklch(0.708 0 0)));--vc-tooltip-border:var(--ui-border,var(--border,oklch(0.269 0 0)))}}
|
|
@@ -155,6 +155,7 @@ defineSlots();
|
|
|
155
155
|
:x-axis-key="xAxisKey"
|
|
156
156
|
:container-props="chartContainerProps"
|
|
157
157
|
:percent-axis="stacked === true && percent === true"
|
|
158
|
+
:value-stacked="stacked === true"
|
|
158
159
|
:frame-class="frameClass"
|
|
159
160
|
skeleton-shape="wave"
|
|
160
161
|
v-bind="props"
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import AreaChart from "./AreaChart.vue";
|
|
4
|
+
import BarChart from "./BarChart.vue";
|
|
5
|
+
import LineChart from "./LineChart.vue";
|
|
6
|
+
import { transform } from "../spec/transform";
|
|
7
|
+
import { formatBucket, specCategories, seriesLabel, validateSpec } from "../spec/resolve";
|
|
8
|
+
import { VALUE_KEY } from "../spec/types";
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
data: { type: Array, required: true },
|
|
11
|
+
spec: { type: Object, required: true },
|
|
12
|
+
height: { type: Number, required: false, default: 260 },
|
|
13
|
+
locale: { type: String, required: false },
|
|
14
|
+
hideLegend: { type: Boolean, required: false },
|
|
15
|
+
stacked: { type: Boolean, required: false },
|
|
16
|
+
theme: { type: Object, required: false },
|
|
17
|
+
valueFormatter: { type: Function, required: false },
|
|
18
|
+
ariaLabel: { type: String, required: false },
|
|
19
|
+
ariaDescription: { type: String, required: false },
|
|
20
|
+
accessibleDataTable: { type: Boolean, required: false },
|
|
21
|
+
maxDataPoints: { type: Number, required: false },
|
|
22
|
+
emptyLabel: { type: String, required: false },
|
|
23
|
+
error: { type: String, required: false },
|
|
24
|
+
legendVariant: { type: String, required: false },
|
|
25
|
+
tooltipVariant: { type: String, required: false },
|
|
26
|
+
tooltipRoundness: { type: String, required: false },
|
|
27
|
+
loading: { type: Boolean, required: false },
|
|
28
|
+
loadingLabel: { type: String, required: false }
|
|
29
|
+
});
|
|
30
|
+
const specError = computed(() => validateSpec(props.spec));
|
|
31
|
+
const result = computed(() => {
|
|
32
|
+
if (specError.value) return { data: [], series: [], total: 0 };
|
|
33
|
+
return transform(props.data ?? [], props.spec);
|
|
34
|
+
});
|
|
35
|
+
const chartData = computed(
|
|
36
|
+
() => result.value.data.map((datum) => ({
|
|
37
|
+
...datum,
|
|
38
|
+
x: formatBucket(datum.x, props.spec.transform?.interval, props.locale)
|
|
39
|
+
}))
|
|
40
|
+
);
|
|
41
|
+
const categories = computed(() => specCategories(result.value.series, props.spec));
|
|
42
|
+
const yFormatter = computed(
|
|
43
|
+
() => props.valueFormatter ? (tick) => props.valueFormatter(tick) : void 0
|
|
44
|
+
);
|
|
45
|
+
const common = computed(() => ({
|
|
46
|
+
data: chartData.value,
|
|
47
|
+
height: props.height,
|
|
48
|
+
categories: categories.value,
|
|
49
|
+
xAxis: "x",
|
|
50
|
+
stacked: props.stacked,
|
|
51
|
+
hideLegend: props.hideLegend,
|
|
52
|
+
yFormatter: yFormatter.value,
|
|
53
|
+
theme: props.theme,
|
|
54
|
+
error: specError.value ?? props.error,
|
|
55
|
+
loading: props.loading,
|
|
56
|
+
loadingLabel: props.loadingLabel,
|
|
57
|
+
emptyLabel: props.emptyLabel,
|
|
58
|
+
ariaLabel: props.ariaLabel ?? props.spec.label ?? seriesLabel(VALUE_KEY, props.spec),
|
|
59
|
+
ariaDescription: props.ariaDescription,
|
|
60
|
+
legendVariant: props.legendVariant,
|
|
61
|
+
tooltipVariant: props.tooltipVariant,
|
|
62
|
+
tooltipRoundness: props.tooltipRoundness
|
|
63
|
+
}));
|
|
64
|
+
const barSeriesKeys = computed(() => result.value.series);
|
|
65
|
+
defineExpose({ result });
|
|
66
|
+
defineSlots();
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<template>
|
|
70
|
+
<BarChart
|
|
71
|
+
v-if="spec.type === 'bar'"
|
|
72
|
+
v-bind="common"
|
|
73
|
+
:y-axis="barSeriesKeys"
|
|
74
|
+
>
|
|
75
|
+
<template v-if="$slots.tooltip" #tooltip="scope">
|
|
76
|
+
<slot name="tooltip" v-bind="scope" />
|
|
77
|
+
</template>
|
|
78
|
+
</BarChart>
|
|
79
|
+
|
|
80
|
+
<AreaChart v-else-if="spec.type === 'area'" v-bind="common">
|
|
81
|
+
<template v-if="$slots.tooltip" #tooltip="scope">
|
|
82
|
+
<slot name="tooltip" v-bind="scope" />
|
|
83
|
+
</template>
|
|
84
|
+
</AreaChart>
|
|
85
|
+
|
|
86
|
+
<LineChart v-else v-bind="common">
|
|
87
|
+
<template v-if="$slots.tooltip" #tooltip="scope">
|
|
88
|
+
<slot name="tooltip" v-bind="scope" />
|
|
89
|
+
</template>
|
|
90
|
+
</LineChart>
|
|
91
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type SpecDatum } from "../spec/types.js";
|
|
2
|
+
import type { DataChartProps } from "../types/charts.js";
|
|
3
|
+
import type { TransformResult } from "../spec/transform.js";
|
|
4
|
+
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
5
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<DataChartProps<T>> & (typeof globalThis extends {
|
|
6
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
7
|
+
} ? P : {});
|
|
8
|
+
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
9
|
+
result: import("vue").ComputedRef<TransformResult>;
|
|
10
|
+
}>) => void;
|
|
11
|
+
attrs: any;
|
|
12
|
+
slots: {
|
|
13
|
+
tooltip?: (props: {
|
|
14
|
+
values: SpecDatum | undefined;
|
|
15
|
+
}) => unknown;
|
|
16
|
+
};
|
|
17
|
+
emit: {};
|
|
18
|
+
}>) => import("vue").VNode & {
|
|
19
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
20
|
+
};
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
24
|
+
[K in keyof T]: T[K];
|
|
25
|
+
} : {
|
|
26
|
+
[K in keyof T as K]: T[K];
|
|
27
|
+
}) & {};
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, shallowRef } from "vue";
|
|
3
|
+
import { geoGraticule10, geoPath } from "d3-geo";
|
|
4
|
+
import { containsMapPoint, createMapProjection, DEFAULT_MAP_REGION, inRegion, MAP_REGIONS, mapFeatures, mapValue, projectMapPoint, regionGeometry } from "../utils/maps";
|
|
5
|
+
import { filterMapCountries, generateMapDots, getPin } from "../utils/dottedMap";
|
|
6
|
+
import { sampleData } from "../utils/data";
|
|
7
|
+
import MapCanvas from "./internal/MapCanvas.vue";
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
geoJson: { type: Object, required: false },
|
|
10
|
+
mapFeatureKey: { type: String, required: false },
|
|
11
|
+
regionName: { type: String, required: false },
|
|
12
|
+
region: { type: Object, required: false },
|
|
13
|
+
countries: { type: Array, required: false },
|
|
14
|
+
pins: { type: Array, required: false },
|
|
15
|
+
mapHeight: { type: Number, required: false },
|
|
16
|
+
mapWidth: { type: Number, required: false },
|
|
17
|
+
grid: { type: String, required: false },
|
|
18
|
+
shape: { type: String, required: false },
|
|
19
|
+
dotSize: { type: Number, required: false },
|
|
20
|
+
color: { type: String, required: false },
|
|
21
|
+
countryColors: { type: Object, required: false },
|
|
22
|
+
strokeColor: { type: String, required: false },
|
|
23
|
+
strokeWidth: { type: Number, required: false },
|
|
24
|
+
strokeOpacity: { type: Number, required: false },
|
|
25
|
+
avoidOuterPins: { type: Boolean, required: false },
|
|
26
|
+
precomputedMap: { type: [String, Object], required: false },
|
|
27
|
+
defaultZoom: { type: Number, required: false },
|
|
28
|
+
showLegend: { type: Boolean, required: false },
|
|
29
|
+
legend: { type: Array, required: false },
|
|
30
|
+
maxHeight: { type: [Number, String], required: false },
|
|
31
|
+
pinColor: { type: [String, Function], required: false },
|
|
32
|
+
pinSize: { type: [Number, Function], required: false },
|
|
33
|
+
showPinLabels: { type: Boolean, required: false },
|
|
34
|
+
tooltipTitleFormatter: { type: Function, required: false },
|
|
35
|
+
height: { type: [Number, String], required: false },
|
|
36
|
+
width: { type: [Number, String], required: false },
|
|
37
|
+
projection: { type: [String, Function, Object], required: false },
|
|
38
|
+
fitView: { type: Boolean, required: false },
|
|
39
|
+
fitViewPadding: { type: Number, required: false },
|
|
40
|
+
padding: { type: [Number, Object], required: false },
|
|
41
|
+
disableZoom: { type: Boolean, required: false },
|
|
42
|
+
zoomFactor: { type: Number, required: false },
|
|
43
|
+
zoomExtent: { type: Array, required: false },
|
|
44
|
+
zoomOnScroll: { type: Boolean, required: false },
|
|
45
|
+
zoomDuration: { type: Number, required: false },
|
|
46
|
+
duration: { type: Number, required: false },
|
|
47
|
+
showControls: { type: Boolean, required: false },
|
|
48
|
+
hideTooltip: { type: Boolean, required: false },
|
|
49
|
+
hideLegend: { type: Boolean, required: false },
|
|
50
|
+
categories: { type: Object, required: false },
|
|
51
|
+
legendPosition: { type: String, required: false },
|
|
52
|
+
legendStyle: { type: [String, Object], required: false },
|
|
53
|
+
backgroundColor: { type: String, required: false },
|
|
54
|
+
theme: { type: Object, required: false },
|
|
55
|
+
showGraticule: { type: Boolean, required: false },
|
|
56
|
+
showSphere: { type: Boolean, required: false },
|
|
57
|
+
graticuleColor: { type: String, required: false },
|
|
58
|
+
sphereColor: { type: String, required: false },
|
|
59
|
+
ariaLabel: { type: String, required: false },
|
|
60
|
+
ariaDescription: { type: String, required: false },
|
|
61
|
+
accessibleDataTable: { type: Boolean, required: false },
|
|
62
|
+
maxDataPoints: { type: Number, required: false },
|
|
63
|
+
emptyLabel: { type: String, required: false },
|
|
64
|
+
error: { type: String, required: false },
|
|
65
|
+
legendVariant: { type: String, required: false },
|
|
66
|
+
tooltipVariant: { type: String, required: false },
|
|
67
|
+
tooltipRoundness: { type: String, required: false },
|
|
68
|
+
loading: { type: Boolean, required: false },
|
|
69
|
+
loadingLabel: { type: String, required: false }
|
|
70
|
+
});
|
|
71
|
+
defineSlots();
|
|
72
|
+
const emit = defineEmits(["pin-click", "point-click", "mouseenter", "mouseleave", "zoom"]);
|
|
73
|
+
const canvas = shallowRef();
|
|
74
|
+
const size = shallowRef([960, typeof props.height === "number" ? props.height : 400]);
|
|
75
|
+
const precomputed = computed(() => {
|
|
76
|
+
try {
|
|
77
|
+
if (!props.precomputedMap) return { map: void 0, error: void 0 };
|
|
78
|
+
const map = typeof props.precomputedMap === "string" ? JSON.parse(props.precomputedMap) : props.precomputedMap;
|
|
79
|
+
if (!(map.width > 0 && map.height > 0 && map.points)) {
|
|
80
|
+
throw new Error("Precomputed map must contain width, height, and points.");
|
|
81
|
+
}
|
|
82
|
+
return { map, error: void 0 };
|
|
83
|
+
} catch (error) {
|
|
84
|
+
return { map: void 0, error: error instanceof Error ? error.message : "Invalid precomputed map" };
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
const countries = computed(() => props.countries ?? precomputed.value.map?.countries ?? (props.regionName === "usa" ? ["USA"] : void 0));
|
|
88
|
+
const region = computed(() => {
|
|
89
|
+
if (props.region) return props.region;
|
|
90
|
+
if (precomputed.value.map?.region) return precomputed.value.map.region;
|
|
91
|
+
if (props.regionName && props.regionName !== "world") return MAP_REGIONS[props.regionName];
|
|
92
|
+
return !countries.value?.length && !props.geoJson ? DEFAULT_MAP_REGION : void 0;
|
|
93
|
+
});
|
|
94
|
+
const geometry = computed(() => {
|
|
95
|
+
try {
|
|
96
|
+
return {
|
|
97
|
+
collection: filterMapCountries(mapFeatures(props.geoJson, props.mapFeatureKey), countries.value),
|
|
98
|
+
error: void 0
|
|
99
|
+
};
|
|
100
|
+
} catch (error) {
|
|
101
|
+
return {
|
|
102
|
+
collection: { type: "FeatureCollection", features: [] },
|
|
103
|
+
error: error instanceof Error ? error.message : "Invalid map geometry"
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
const precomputedLayout = computed(() => {
|
|
108
|
+
const map = precomputed.value.map;
|
|
109
|
+
const scale = map ? Math.min(size.value[0] / map.width, size.value[1] / map.height) : 1;
|
|
110
|
+
return {
|
|
111
|
+
scale,
|
|
112
|
+
x: map ? (size.value[0] - map.width * scale) / 2 : 0,
|
|
113
|
+
y: map ? (size.value[1] - map.height * scale) / 2 : 0
|
|
114
|
+
};
|
|
115
|
+
});
|
|
116
|
+
const view = computed(() => {
|
|
117
|
+
const map = precomputed.value.map;
|
|
118
|
+
const land = geometry.value.collection;
|
|
119
|
+
const fitGeometry = region.value ? regionGeometry(region.value) : land.features.length ? land : { type: "Sphere" };
|
|
120
|
+
const projection = createMapProjection(
|
|
121
|
+
props.projection ?? map?.projection ?? "mercator",
|
|
122
|
+
fitGeometry,
|
|
123
|
+
size.value[0],
|
|
124
|
+
size.value[1],
|
|
125
|
+
props,
|
|
126
|
+
region.value
|
|
127
|
+
);
|
|
128
|
+
const layout = precomputedLayout.value;
|
|
129
|
+
if (map?.scale !== void 0 && map.translate) {
|
|
130
|
+
projection.scale(map.scale * layout.scale).translate([
|
|
131
|
+
map.translate[0] * layout.scale + layout.x,
|
|
132
|
+
map.translate[1] * layout.scale + layout.y
|
|
133
|
+
]);
|
|
134
|
+
} else if (map?.X_MIN !== void 0 && map.Y_MAX !== void 0 && map.X_RANGE) {
|
|
135
|
+
const scale = map.width * 6378137 / map.X_RANGE;
|
|
136
|
+
projection.scale(scale * layout.scale).translate([
|
|
137
|
+
-map.X_MIN * map.width / map.X_RANGE * layout.scale + layout.x,
|
|
138
|
+
map.Y_MAX / 6378137 * scale * layout.scale + layout.y
|
|
139
|
+
]);
|
|
140
|
+
}
|
|
141
|
+
return { projection, path: geoPath(projection) };
|
|
142
|
+
});
|
|
143
|
+
const grid = computed(() => {
|
|
144
|
+
try {
|
|
145
|
+
const map = precomputed.value.map;
|
|
146
|
+
if (map) {
|
|
147
|
+
const layout = precomputedLayout.value;
|
|
148
|
+
const dots2 = Object.values(map.points).map((dot) => ({
|
|
149
|
+
...dot,
|
|
150
|
+
x: dot.x * layout.scale + layout.x,
|
|
151
|
+
y: dot.y * layout.scale + layout.y
|
|
152
|
+
}));
|
|
153
|
+
return { dots: dots2, spacing: layout.scale, error: void 0 };
|
|
154
|
+
}
|
|
155
|
+
const spacing = props.mapWidth ? size.value[0] / Math.max(1, props.mapWidth) : size.value[1] / Math.max(1, props.mapHeight ?? 60);
|
|
156
|
+
const dots = generateMapDots(
|
|
157
|
+
geometry.value.collection,
|
|
158
|
+
view.value.projection,
|
|
159
|
+
size.value[0],
|
|
160
|
+
size.value[1],
|
|
161
|
+
{ ...props, region: region.value }
|
|
162
|
+
);
|
|
163
|
+
return { dots, spacing, error: void 0 };
|
|
164
|
+
} catch (error) {
|
|
165
|
+
return { dots: [], spacing: 1, error: error instanceof Error ? error.message : "Invalid dotted map data" };
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
function hexagon(x, y, radius) {
|
|
169
|
+
return Array.from({ length: 6 }, (_, index) => {
|
|
170
|
+
const angle = Math.PI / 3 * index;
|
|
171
|
+
return `${x + Math.cos(angle) * radius},${y + Math.sin(angle) * radius}`;
|
|
172
|
+
}).join(" ");
|
|
173
|
+
}
|
|
174
|
+
const marks = computed(() => {
|
|
175
|
+
const spacing = grid.value.spacing;
|
|
176
|
+
const dots = grid.value.dots.map((dot, index) => {
|
|
177
|
+
const radius = (dot.svgOptions?.radius ?? props.dotSize ?? 0.3) * spacing;
|
|
178
|
+
return {
|
|
179
|
+
key: `dot-${index}`,
|
|
180
|
+
kind: "dot",
|
|
181
|
+
values: dot,
|
|
182
|
+
x: dot.x,
|
|
183
|
+
y: dot.y,
|
|
184
|
+
radius,
|
|
185
|
+
polygon: props.shape === "hexagon" ? hexagon(dot.x, dot.y, radius) : void 0,
|
|
186
|
+
color: dot.svgOptions?.color ?? props.countryColors?.[dot.countryId ?? ""] ?? props.color ?? "var(--vc-map-dot-color)",
|
|
187
|
+
stroke: dot.svgOptions?.strokeColor ?? props.strokeColor,
|
|
188
|
+
strokeWidth: (dot.svgOptions?.strokeWidth ?? props.strokeWidth ?? 0) * spacing,
|
|
189
|
+
strokeOpacity: dot.svgOptions?.strokeOpacity ?? props.strokeOpacity ?? 1,
|
|
190
|
+
label: dot.label ?? dot.countryId
|
|
191
|
+
};
|
|
192
|
+
});
|
|
193
|
+
const pins = sampleData(props.pins ?? [], props.maxDataPoints ?? 2e3).flatMap((pin, index) => {
|
|
194
|
+
const coordinates = [pin.lng, pin.lat];
|
|
195
|
+
if (!inRegion(coordinates, region.value)) return [];
|
|
196
|
+
if (props.avoidOuterPins && !containsMapPoint(geometry.value.collection, coordinates)) return [];
|
|
197
|
+
let p = projectMapPoint(view.value.projection, coordinates);
|
|
198
|
+
if (!p) return [];
|
|
199
|
+
if (precomputed.value.map) {
|
|
200
|
+
const dot = getPin(precomputed.value.map, pin);
|
|
201
|
+
const layout = precomputedLayout.value;
|
|
202
|
+
p = [dot.x * layout.scale + layout.x, dot.y * layout.scale + layout.y];
|
|
203
|
+
}
|
|
204
|
+
const label = pin.label ?? String(pin.data?.name ?? pin.data?.city ?? pin.id ?? "Location");
|
|
205
|
+
return [{
|
|
206
|
+
key: `pin-${pin.id ?? index}`,
|
|
207
|
+
kind: "pin",
|
|
208
|
+
values: pin,
|
|
209
|
+
x: p[0],
|
|
210
|
+
y: p[1],
|
|
211
|
+
radius: mapValue(props.pinSize, pin, index, pin.radius ?? (pin.svgOptions?.radius === void 0 ? 5 : pin.svgOptions.radius * spacing)),
|
|
212
|
+
color: mapValue(props.pinColor, pin, index, pin.color ?? pin.svgOptions?.color ?? "var(--vc-series-0)"),
|
|
213
|
+
stroke: pin.svgOptions?.strokeColor ?? "var(--vc-surface-bg)",
|
|
214
|
+
strokeWidth: pin.svgOptions?.strokeWidth ?? 1,
|
|
215
|
+
strokeOpacity: pin.svgOptions?.strokeOpacity ?? 1,
|
|
216
|
+
label,
|
|
217
|
+
showLabel: props.showPinLabels
|
|
218
|
+
}];
|
|
219
|
+
});
|
|
220
|
+
return [...dots, ...pins];
|
|
221
|
+
});
|
|
222
|
+
const categories = computed(() => props.categories ?? (props.legend ? Object.fromEntries(props.legend.map((item, index) => [String(index), { name: item.label, color: item.color }])) : void 0));
|
|
223
|
+
function click(mark, event) {
|
|
224
|
+
if (mark.kind === "pin") emit("pin-click", mark.values, event);
|
|
225
|
+
else emit("point-click", event, mark.values);
|
|
226
|
+
}
|
|
227
|
+
defineExpose({
|
|
228
|
+
zoomIn: () => canvas.value?.zoomIn(),
|
|
229
|
+
zoomOut: () => canvas.value?.zoomOut(),
|
|
230
|
+
zoomTo: (k) => canvas.value?.zoomTo(k),
|
|
231
|
+
resetView: () => canvas.value?.resetView()
|
|
232
|
+
});
|
|
233
|
+
</script>
|
|
234
|
+
|
|
235
|
+
<template>
|
|
236
|
+
<MapCanvas
|
|
237
|
+
ref="canvas"
|
|
238
|
+
v-bind="props"
|
|
239
|
+
:style="{ maxHeight: typeof maxHeight === 'number' ? `${maxHeight}px` : maxHeight }"
|
|
240
|
+
:marks="marks"
|
|
241
|
+
:size="size"
|
|
242
|
+
:geometry-error="geometry.error ?? precomputed.error ?? grid.error"
|
|
243
|
+
:categories="categories"
|
|
244
|
+
:hide-legend="hideLegend || showLegend === false"
|
|
245
|
+
:zoom-factor="zoomFactor ?? defaultZoom"
|
|
246
|
+
:sphere="showSphere ? view.path({ type: 'Sphere' }) ?? void 0 : void 0"
|
|
247
|
+
:graticule="showGraticule ? view.path(geoGraticule10()) ?? void 0 : void 0"
|
|
248
|
+
:tooltip-title="tooltipTitleFormatter ? (datum) => tooltipTitleFormatter(datum) : void 0"
|
|
249
|
+
@resize="size = $event"
|
|
250
|
+
@click="click"
|
|
251
|
+
@mouseenter="(mark, event) => emit('mouseenter', mark.values, event)"
|
|
252
|
+
@mouseleave="(mark, event) => emit('mouseleave', mark.values, event)"
|
|
253
|
+
@zoom="emit('zoom', $event)"
|
|
254
|
+
>
|
|
255
|
+
<template v-if="$slots.tooltip" #tooltip="scope"><slot name="tooltip" v-bind="scope" /></template>
|
|
256
|
+
<template v-if="$slots.pin" #pin="scope"><slot name="pin" v-bind="scope" :values="scope.values" :projection="view.projection" :points="grid.dots" /></template>
|
|
257
|
+
<template v-if="$slots.dot" #dot="scope"><slot name="dot" v-bind="scope" :values="scope.values" :projection="view.projection" :points="grid.dots" /></template>
|
|
258
|
+
<template v-if="$slots.legend" #legend="scope"><slot name="legend" v-bind="scope" /></template>
|
|
259
|
+
<template v-if="$slots.default" #default="scope"><slot v-bind="scope" :projection="view.projection" :points="grid.dots" /></template>
|
|
260
|
+
</MapCanvas>
|
|
261
|
+
</template>
|