vue-chrts 2.0.0 → 2.1.0-beta-3
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/components/AreaChart/AreaChart.js +141 -112
- package/dist/components/AreaChart/types.d.ts +33 -1
- package/dist/components/BarChart/BarChart.js +76 -65
- package/dist/components/BarChart/types.d.ts +9 -1
- package/dist/components/BubbleChart/BubbleChart.js +55 -45
- package/dist/components/BubbleChart/types.d.ts +9 -1
- package/dist/components/DagreGraph/DagreGraph.js +171 -0
- package/dist/components/DagreGraph/DagreGraph.vue.d.ts +33 -0
- package/dist/components/DagreGraph/DagreGraph2.js +4 -0
- package/dist/components/DagreGraph/types.d.ts +253 -0
- package/dist/components/DonutChart/DonutChart.js +69 -59
- package/dist/components/DonutChart/types.d.ts +14 -2
- package/dist/components/DualChart/DualChart.js +216 -0
- package/dist/components/DualChart/DualChart.vue.d.ts +21 -0
- package/dist/components/DualChart/DualChart2.js +4 -0
- package/dist/components/DualChart/types.d.ts +195 -0
- package/dist/components/GanttChart/GanttChart.js +58 -48
- package/dist/components/GanttChart/types.d.ts +9 -1
- package/dist/components/LineChart/LineChart.js +17 -9
- package/dist/components/Maps/DottedMap/DottedMap.js +170 -0
- package/dist/components/Maps/DottedMap/DottedMap.vue.d.ts +52 -0
- package/dist/components/Maps/DottedMap/DottedMap2.js +4 -0
- package/dist/components/Maps/DottedMap/MapLegend.vue.d.ts +6 -0
- package/dist/components/Maps/DottedMap/MapZoomControls.js +44 -0
- package/dist/components/Maps/DottedMap/MapZoomControls.vue.d.ts +13 -0
- package/dist/components/Maps/DottedMap/MapZoomControls2.js +4 -0
- package/dist/components/Maps/DottedMap/core.js +122 -0
- package/dist/components/Maps/DottedMap/core.vue.d.ts +36 -0
- package/dist/components/Maps/DottedMap/core2.js +4 -0
- package/dist/components/Maps/DottedMap/mapUtils.d.ts +49 -0
- package/dist/components/Maps/DottedMap/mapUtils.js +130 -0
- package/dist/components/Maps/DottedMap/pins.d.ts +9 -0
- package/dist/components/Maps/DottedMap/pins.js +58 -0
- package/dist/components/Maps/DottedMap/regions.d.ts +4 -0
- package/dist/components/Maps/DottedMap/regions.js +66 -0
- package/dist/components/Maps/DottedMap/types.d.ts +127 -0
- package/dist/components/Maps/DottedMap/useMapPanZoom.d.ts +22 -0
- package/dist/components/Maps/DottedMap/useMapPanZoom.js +41 -0
- package/dist/components/Maps/TopoJSONMap/TopoJSONMap.js +170 -0
- package/dist/components/Maps/TopoJSONMap/TopoJSONMap.vue.d.ts +30 -0
- package/dist/components/Maps/TopoJSONMap/TopoJSONMap2.js +4 -0
- package/dist/components/Maps/TopoJSONMap/data.d.ts +13 -0
- package/dist/components/Maps/TopoJSONMap/types.d.ts +40 -0
- package/dist/components/Maps/types.d.ts +48 -0
- package/dist/components/SankeyChart/SankeyChart.js +133 -0
- package/dist/components/SankeyChart/SankeyChart.vue.d.ts +22 -0
- package/dist/components/SankeyChart/SankeyChart2.js +4 -0
- package/dist/components/SankeyChart/types.d.ts +116 -0
- package/dist/components/Tooltip.js +32 -27
- package/dist/data/countries.geo.json.js +9 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.js +25 -12
- package/dist/node_modules/.pnpm/@turf_boolean-point-in-polygon@7.3.1/node_modules/@turf/boolean-point-in-polygon/dist/esm/index.js +28 -0
- package/dist/node_modules/.pnpm/@turf_invariant@7.3.1/node_modules/@turf/invariant/dist/esm/index.js +20 -0
- package/dist/node_modules/.pnpm/mgrs@1.0.0/node_modules/mgrs/mgrs.js +222 -0
- package/dist/node_modules/.pnpm/point-in-polygon-hao@1.2.4/node_modules/point-in-polygon-hao/dist/esm/index.js +25 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/Point.js +24 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/Proj.js +46 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/adjust_axis.js +31 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/checkSanity.js +15 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/adjust_lat.js +8 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/adjust_lon.js +8 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/adjust_zone.js +13 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/asinhy.js +9 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/asinz.js +6 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/clens.js +8 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/clens_cmplx.js +10 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/cosh.js +7 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/e0fn.js +6 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/e1fn.js +6 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/e2fn.js +6 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/e3fn.js +6 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/gN.js +7 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/gatg.js +8 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/hypot.js +8 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/imlfn.js +11 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/iqsfnz.js +13 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/log1py.js +7 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/mlfn.js +6 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/msfnz.js +7 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/phi2z.js +10 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/pj_enfn.js +10 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/pj_inv_mlfn.js +14 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/pj_mlfn.js +6 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/qsfnz.js +7 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/sign.js +6 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/sinh.js +7 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/srat.js +6 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/toPoint.js +10 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/tsfnz.js +8 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/vincenty.js +33 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/Datum.js +1278 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/Ellipsoid.js +226 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/PrimeMeridian.js +17 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/units.js +25 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/values.js +22 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/core.js +65 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/datum.js +8 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/datumUtils.js +82 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/datum_transform.js +94 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/defs.js +39 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/deriveConstants.js +30 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/extend.js +12 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/global.js +9 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/index.js +25 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/match.js +11 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/nadgrid.js +128 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/parseCode.js +47 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projString.js +119 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/aea.js +43 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/aeqd.js +36 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/bonne.js +55 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/cass.js +52 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/cea.js +36 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/eqc.js +27 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/eqdc.js +48 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/eqearth.js +30 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/etmerc.js +54 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/gauss.js +27 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/geocent.js +26 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/geos.js +49 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/gnom.js +28 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/krovak.js +31 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/laea.js +134 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/lcc.js +61 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/longlat.js +19 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/merc.js +49 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/mill.js +26 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/moll.js +37 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/nzmg.js +48 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/ob_tran.js +173 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/omerc.js +58 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/ortho.js +28 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/poly.js +68 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/qsc.js +67 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/robin.js +104 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/sinu.js +47 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/somerc.js +34 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/stere.js +46 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/sterea.js +33 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/tmerc.js +60 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/tpers.js +110 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/utm.js +22 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/vandg.js +34 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections.js +34 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/transform.js +49 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/projs.js +38 -0
- package/dist/node_modules/.pnpm/robust-predicates@3.0.2/node_modules/robust-predicates/esm/orient2d.js +23 -0
- package/dist/node_modules/.pnpm/robust-predicates@3.0.2/node_modules/robust-predicates/esm/util.js +30 -0
- package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/PROJJSONBuilder2015.js +9 -0
- package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/PROJJSONBuilder2019.js +20 -0
- package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/PROJJSONBuilderBase.js +171 -0
- package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/buildPROJJSON.js +11 -0
- package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/detectWKTVersion.js +7 -0
- package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/index.js +104 -0
- package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/parser.js +117 -0
- package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/process.js +89 -0
- package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/transformPROJJSON.js +73 -0
- package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/util.js +12 -0
- package/dist/types.d.ts +21 -1
- package/dist/utils/geoJsonToGrid.d.ts +14 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.js +35 -31
- package/package.json +15 -9
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Position as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { VisXYContainer as
|
|
6
|
-
import { LegendPosition as
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as I, useSlots as K, useTemplateRef as q, ref as J, getCurrentInstance as Q, computed as d, createElementBlock as f, openBlock as c, normalizeClass as Z, normalizeStyle as p, createVNode as k, createCommentVNode as u, createElementVNode as _, unref as l, withCtx as ee, createBlock as y, Fragment as T, renderList as te, mergeProps as v, renderSlot as B } from "vue";
|
|
2
|
+
import { Position as O, CurveType as h } from "@unovis/ts";
|
|
3
|
+
import { createScopedMarkers as ie } from "../../utils.js";
|
|
4
|
+
import oe from "../Tooltip.js";
|
|
5
|
+
import { VisXYContainer as ne, VisTooltip as ae, VisArea as D, VisLine as M, VisAxis as w, VisCrosshair as re, VisBulletLegend as le } from "@unovis/vue";
|
|
6
|
+
import { LegendPosition as se } from "../../types.js";
|
|
7
|
+
const ce = ["id"], de = {
|
|
8
8
|
ref: "slotWrapper",
|
|
9
9
|
style: { display: "none" }
|
|
10
|
-
},
|
|
10
|
+
}, S = 0.5, C = "#3b82f6", ve = /* @__PURE__ */ I({
|
|
11
11
|
__name: "AreaChart",
|
|
12
12
|
props: {
|
|
13
13
|
data: {},
|
|
@@ -31,10 +31,16 @@ const ne = ["id"], oe = {
|
|
|
31
31
|
xNumTicks: {},
|
|
32
32
|
xExplicitTicks: {},
|
|
33
33
|
minMaxTicksOnly: { type: Boolean },
|
|
34
|
+
xMinMaxTicksOnly: { type: Boolean },
|
|
35
|
+
yMinMaxTicksOnly: { type: Boolean },
|
|
36
|
+
minMaxTicksOnlyShowGridLines: { type: Boolean },
|
|
37
|
+
xMinMaxTicksOnlyShowGridLines: { type: Boolean },
|
|
38
|
+
yMinMaxTicksOnlyShowGridLines: { type: Boolean },
|
|
34
39
|
yNumTicks: {},
|
|
40
|
+
yExplicitTicks: {},
|
|
35
41
|
hideLegend: { type: Boolean, default: !1 },
|
|
36
42
|
hideTooltip: { type: Boolean },
|
|
37
|
-
legendPosition: { default:
|
|
43
|
+
legendPosition: { default: se.BottomCenter },
|
|
38
44
|
legendStyle: { default: void 0 },
|
|
39
45
|
xDomainLine: { type: Boolean },
|
|
40
46
|
yDomainLine: { type: Boolean },
|
|
@@ -51,131 +57,150 @@ const ne = ["id"], oe = {
|
|
|
51
57
|
yAxisConfig: {},
|
|
52
58
|
yDomain: {},
|
|
53
59
|
xDomain: {},
|
|
54
|
-
stacked: { type: Boolean }
|
|
60
|
+
stacked: { type: Boolean },
|
|
61
|
+
duration: { default: 600 },
|
|
62
|
+
tooltip: { default: () => ({
|
|
63
|
+
followCursor: !0
|
|
64
|
+
}) }
|
|
55
65
|
},
|
|
56
66
|
emits: ["click"],
|
|
57
|
-
setup(e, { emit:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
67
|
+
setup(e, { emit: G }) {
|
|
68
|
+
var b;
|
|
69
|
+
const V = G, t = e, j = K(), L = q("slotWrapper"), m = J(), A = `area-${((b = Q()) == null ? void 0 : b.uid) ?? Math.random().toString(36).slice(2)}`, g = d(() => {
|
|
70
|
+
const i = Object.values(t.categories).map(
|
|
71
|
+
(a, n) => `var(--vis-color${n})`
|
|
61
72
|
);
|
|
62
|
-
return Object.values(
|
|
63
|
-
(
|
|
73
|
+
return Object.values(t.categories).map(
|
|
74
|
+
(a, n) => a.color ?? i[n]
|
|
64
75
|
);
|
|
65
|
-
}), N = d(() => {
|
|
76
|
+
}), F = d(() => t.yNumTicks !== void 0 ? t.yNumTicks : Math.max(2, Object.keys(t.categories ?? {}).length)), N = d(() => {
|
|
66
77
|
var i;
|
|
67
|
-
return (i =
|
|
68
|
-
}),
|
|
69
|
-
|
|
70
|
-
|
|
78
|
+
return (i = t.markerConfig) != null && i.config ? ie(t.markerConfig, A) : "";
|
|
79
|
+
}), W = d(() => {
|
|
80
|
+
var a;
|
|
81
|
+
if (!((a = t.markerConfig) != null && a.config)) return {};
|
|
82
|
+
const i = {};
|
|
83
|
+
for (const n of Object.keys(t.markerConfig.config))
|
|
84
|
+
i[`--vis-marker-${n}`] = `url("#${t.markerConfig.id}--${A}--${n}")`;
|
|
85
|
+
return i;
|
|
86
|
+
}), E = d(() => t.legendPosition.startsWith("top")), P = d(() => t.legendPosition.includes("left") ? "flex-start" : t.legendPosition.includes("right") ? "flex-end" : "center"), X = d(() => {
|
|
87
|
+
const i = (n, o) => {
|
|
88
|
+
var r;
|
|
71
89
|
return `
|
|
72
|
-
<linearGradient id="gradient${
|
|
73
|
-
${((
|
|
74
|
-
(s) => `<stop offset="${s.offset}" stop-color="${
|
|
90
|
+
<linearGradient id="gradient${n}-${o}" gradientTransform="rotate(90)">
|
|
91
|
+
${((r = t.gradientStops) == null ? void 0 : r.map(
|
|
92
|
+
(s) => `<stop offset="${s.offset}" stop-color="${o}" stop-opacity="${s.stopOpacity}" />`
|
|
75
93
|
).join("")) ?? ""}
|
|
76
|
-
<stop offset="100%" stop-color="${
|
|
94
|
+
<stop offset="100%" stop-color="${o}" stop-opacity="0" />
|
|
77
95
|
</linearGradient>
|
|
78
96
|
`;
|
|
79
|
-
},
|
|
80
|
-
var
|
|
97
|
+
}, a = (n, o) => {
|
|
98
|
+
var r;
|
|
81
99
|
return `
|
|
82
|
-
<linearGradient id="gradient${
|
|
100
|
+
<linearGradient id="gradient${n}-${o}" gradientTransform="rotate(90)">
|
|
83
101
|
|
|
84
|
-
${((
|
|
102
|
+
${((r = t.gradientStops) == null ? void 0 : r.map(
|
|
85
103
|
(s) => `
|
|
86
|
-
<stop offset="${s.offset}" style="stop-color:var(${
|
|
104
|
+
<stop offset="${s.offset}" style="stop-color:var(${o});stop-opacity:${s.stopOpacity}" />
|
|
87
105
|
`
|
|
88
106
|
).join("")) ?? ""}
|
|
89
107
|
</linearGradient>
|
|
90
108
|
`;
|
|
91
109
|
};
|
|
92
110
|
return g.value.map(
|
|
93
|
-
(
|
|
111
|
+
(n, o) => n != null && n.includes("#") ? i(o, n) : a(o, n ?? C)
|
|
94
112
|
).join("");
|
|
95
113
|
});
|
|
96
|
-
function
|
|
97
|
-
var
|
|
114
|
+
function Y(i) {
|
|
115
|
+
var a;
|
|
98
116
|
return {
|
|
99
|
-
y: (
|
|
100
|
-
color: ((
|
|
117
|
+
y: (n) => Number(n[i]),
|
|
118
|
+
color: ((a = t.categories[i]) == null ? void 0 : a.color) ?? C
|
|
101
119
|
};
|
|
102
120
|
}
|
|
103
|
-
const
|
|
104
|
-
(i) => (
|
|
105
|
-
)),
|
|
106
|
-
const i = Object.keys(
|
|
107
|
-
return i.map((
|
|
108
|
-
let
|
|
109
|
-
for (let s = 0; s <=
|
|
110
|
-
|
|
111
|
-
return
|
|
121
|
+
const z = d(() => Object.keys(t.categories).map(
|
|
122
|
+
(i) => (a) => Number(a[i])
|
|
123
|
+
)), R = d(() => {
|
|
124
|
+
const i = Object.keys(t.categories);
|
|
125
|
+
return i.map((a, n) => (o) => {
|
|
126
|
+
let r = 0;
|
|
127
|
+
for (let s = 0; s <= n; s++)
|
|
128
|
+
r += Number(o[i[s]]) || 0;
|
|
129
|
+
return r;
|
|
112
130
|
});
|
|
113
|
-
}),
|
|
114
|
-
function
|
|
115
|
-
return typeof window > "u" ? "" :
|
|
131
|
+
}), $ = d(() => (i, a) => g.value[a] ?? C);
|
|
132
|
+
function U(i) {
|
|
133
|
+
return typeof window > "u" ? "" : L.value ? L.value.innerHTML : "";
|
|
116
134
|
}
|
|
117
|
-
function
|
|
118
|
-
return m.value = i,
|
|
135
|
+
function H(i) {
|
|
136
|
+
return m.value = i, U();
|
|
119
137
|
}
|
|
120
|
-
return (i,
|
|
121
|
-
var
|
|
138
|
+
return (i, a) => {
|
|
139
|
+
var n;
|
|
122
140
|
return c(), f("div", {
|
|
123
141
|
style: p({
|
|
124
142
|
display: "flex",
|
|
125
|
-
flexDirection:
|
|
126
|
-
gap: "var(--vis-legend-spacing)"
|
|
143
|
+
flexDirection: E.value ? "column-reverse" : "column",
|
|
144
|
+
gap: "var(--vis-legend-spacing)",
|
|
145
|
+
...W.value
|
|
127
146
|
}),
|
|
128
|
-
class:
|
|
129
|
-
id: (
|
|
130
|
-
onClick:
|
|
147
|
+
class: Z({ "stacked-area-chart": e.stacked }),
|
|
148
|
+
id: (n = e.markerConfig) == null ? void 0 : n.id,
|
|
149
|
+
onClick: a[0] || (a[0] = (o) => V("click", o, m.value))
|
|
131
150
|
}, [
|
|
132
|
-
|
|
151
|
+
k(l(ne), {
|
|
133
152
|
data: e.data,
|
|
134
153
|
height: e.height,
|
|
154
|
+
duration: e.duration,
|
|
135
155
|
padding: e.padding,
|
|
136
|
-
"svg-defs":
|
|
156
|
+
"svg-defs": X.value + N.value,
|
|
137
157
|
"y-domain": e.yDomain,
|
|
138
158
|
"x-domain": e.xDomain
|
|
139
159
|
}, {
|
|
140
|
-
default:
|
|
141
|
-
e.hideTooltip ?
|
|
160
|
+
default: ee(() => [
|
|
161
|
+
e.hideTooltip ? u("", !0) : (c(), y(l(ae), {
|
|
142
162
|
key: 0,
|
|
143
|
-
"horizontal-placement":
|
|
144
|
-
"vertical-placement":
|
|
145
|
-
|
|
163
|
+
"horizontal-placement": l(O).Right,
|
|
164
|
+
"vertical-placement": l(O).Top,
|
|
165
|
+
"follow-cursor": t.tooltip.followCursor,
|
|
166
|
+
"show-delay": t.tooltip.showDelay,
|
|
167
|
+
"hide-delay": t.tooltip.hideDelay
|
|
168
|
+
}, null, 8, ["horizontal-placement", "vertical-placement", "follow-cursor", "show-delay", "hide-delay"])),
|
|
146
169
|
e.stacked ? (c(), f(T, { key: 1 }, [
|
|
147
|
-
u(
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
170
|
+
e.hideArea ? u("", !0) : (c(), y(l(D), {
|
|
171
|
+
key: 0,
|
|
172
|
+
x: (o, r) => r,
|
|
173
|
+
y: z.value,
|
|
174
|
+
color: $.value,
|
|
175
|
+
opacity: S,
|
|
176
|
+
"curve-type": e.curveType ?? l(h).MonotoneX
|
|
177
|
+
}, null, 8, ["x", "y", "color", "curve-type"])),
|
|
178
|
+
k(l(M), {
|
|
179
|
+
x: (o, r) => r,
|
|
180
|
+
y: R.value,
|
|
181
|
+
color: $.value,
|
|
182
|
+
"curve-type": e.curveType ?? l(h).MonotoneX,
|
|
159
183
|
"line-width": e.lineWidth
|
|
160
184
|
}, null, 8, ["x", "y", "color", "curve-type", "line-width"])
|
|
161
|
-
], 64)) : (c(!0), f(T, { key: 2 },
|
|
162
|
-
u(
|
|
185
|
+
], 64)) : (c(!0), f(T, { key: 2 }, te(Object.keys(t.categories), (o, r) => (c(), f(T, { key: o }, [
|
|
186
|
+
e.hideArea ? u("", !0) : (c(), y(l(D), v({
|
|
187
|
+
key: 0,
|
|
163
188
|
x: (s, x) => x
|
|
164
|
-
}, { ref_for: !0 },
|
|
165
|
-
color: `url(#gradient${
|
|
166
|
-
opacity:
|
|
167
|
-
"curve-type": e.curveType ??
|
|
168
|
-
}), null, 16, ["x", "color", "
|
|
169
|
-
|
|
189
|
+
}, { ref_for: !0 }, Y(o), {
|
|
190
|
+
color: `url(#gradient${r}-${g.value[r]})`,
|
|
191
|
+
opacity: S,
|
|
192
|
+
"curve-type": e.curveType ?? l(h).MonotoneX
|
|
193
|
+
}), null, 16, ["x", "color", "curve-type"])),
|
|
194
|
+
k(l(M), {
|
|
170
195
|
x: (s, x) => x,
|
|
171
|
-
y: (s) => s[
|
|
172
|
-
color: g.value[
|
|
173
|
-
"curve-type": e.curveType ??
|
|
196
|
+
y: (s) => s[o],
|
|
197
|
+
color: g.value[r],
|
|
198
|
+
"curve-type": e.curveType ?? l(h).MonotoneX,
|
|
174
199
|
"line-width": e.lineWidth,
|
|
175
|
-
lineDashArray: e.lineDashArray ? e.lineDashArray[
|
|
200
|
+
lineDashArray: e.lineDashArray ? e.lineDashArray[r] : void 0
|
|
176
201
|
}, null, 8, ["x", "y", "color", "curve-type", "line-width", "lineDashArray"])
|
|
177
202
|
], 64))), 128)),
|
|
178
|
-
e.hideXAxis ?
|
|
203
|
+
e.hideXAxis ? u("", !0) : (c(), y(l(w), v({
|
|
179
204
|
key: 3,
|
|
180
205
|
type: "x",
|
|
181
206
|
label: e.xLabel,
|
|
@@ -186,57 +211,61 @@ const ne = ["id"], oe = {
|
|
|
186
211
|
"grid-line": e.xGridLine,
|
|
187
212
|
"domain-line": e.xDomainLine,
|
|
188
213
|
"tick-line": e.xTickLine,
|
|
189
|
-
"min-max-ticks-only": e.minMaxTicksOnly
|
|
190
|
-
|
|
191
|
-
e.
|
|
214
|
+
"min-max-ticks-only": e.minMaxTicksOnly,
|
|
215
|
+
duration: e.duration
|
|
216
|
+
}, e.xAxisConfig), null, 16, ["label", "num-ticks", "tick-format", "tick-values", "grid-line", "domain-line", "tick-line", "min-max-ticks-only", "duration"])),
|
|
217
|
+
e.hideYAxis ? u("", !0) : (c(), y(l(w), v({
|
|
192
218
|
key: 4,
|
|
193
219
|
type: "y",
|
|
194
220
|
label: e.yLabel,
|
|
195
|
-
"num-ticks":
|
|
221
|
+
"num-ticks": F.value,
|
|
196
222
|
"tick-format": e.yFormatter,
|
|
223
|
+
"tick-values": e.yExplicitTicks,
|
|
197
224
|
"grid-line": e.yGridLine,
|
|
198
225
|
"domain-line": e.yDomainLine,
|
|
199
|
-
"tick-line": e.yTickLine
|
|
200
|
-
|
|
201
|
-
e.
|
|
226
|
+
"tick-line": e.yTickLine,
|
|
227
|
+
duration: e.duration
|
|
228
|
+
}, e.yAxisConfig), null, 16, ["label", "num-ticks", "tick-format", "tick-values", "grid-line", "domain-line", "tick-line", "duration"])),
|
|
229
|
+
e.hideTooltip ? u("", !0) : (c(), y(l(re), v({ key: 5 }, e.crosshairConfig, { template: H }), null, 16))
|
|
202
230
|
]),
|
|
203
231
|
_: 1
|
|
204
|
-
}, 8, ["data", "height", "padding", "svg-defs", "y-domain", "x-domain"]),
|
|
205
|
-
|
|
232
|
+
}, 8, ["data", "height", "duration", "padding", "svg-defs", "y-domain", "x-domain"]),
|
|
233
|
+
t.hideLegend ? u("", !0) : (c(), f("div", {
|
|
206
234
|
key: 0,
|
|
207
235
|
style: p({
|
|
208
236
|
display: "flex",
|
|
209
|
-
justifyContent:
|
|
237
|
+
justifyContent: P.value
|
|
210
238
|
})
|
|
211
239
|
}, [
|
|
212
|
-
|
|
240
|
+
k(l(le), {
|
|
213
241
|
style: p([
|
|
214
|
-
|
|
242
|
+
t.legendStyle,
|
|
215
243
|
"display: flex; gap: var(--vis-legend-spacing);"
|
|
216
244
|
]),
|
|
217
|
-
items: Object.values(
|
|
218
|
-
...
|
|
219
|
-
color: Array.isArray(
|
|
245
|
+
items: Object.values(t.categories).map((o) => ({
|
|
246
|
+
...o,
|
|
247
|
+
color: Array.isArray(o.color) ? o.color[0] : o.color
|
|
220
248
|
}))
|
|
221
249
|
}, null, 8, ["style", "items"])
|
|
222
250
|
], 4)),
|
|
223
|
-
|
|
224
|
-
|
|
251
|
+
_("div", de, [
|
|
252
|
+
l(j).tooltip ? B(i.$slots, "tooltip", {
|
|
225
253
|
key: 0,
|
|
226
254
|
values: m.value
|
|
227
|
-
}) : m.value ?
|
|
228
|
-
|
|
255
|
+
}) : m.value ? B(i.$slots, "fallback", { key: 1 }, () => [
|
|
256
|
+
k(oe, {
|
|
229
257
|
data: m.value,
|
|
258
|
+
followCursor: !1,
|
|
230
259
|
categories: e.categories,
|
|
231
|
-
"title-formatter":
|
|
232
|
-
yFormatter:
|
|
260
|
+
"title-formatter": t.tooltipTitleFormatter,
|
|
261
|
+
yFormatter: t.yFormatter
|
|
233
262
|
}, null, 8, ["data", "categories", "title-formatter", "yFormatter"])
|
|
234
|
-
]) :
|
|
263
|
+
]) : u("", !0)
|
|
235
264
|
], 512)
|
|
236
|
-
], 14,
|
|
265
|
+
], 14, ce);
|
|
237
266
|
};
|
|
238
267
|
}
|
|
239
268
|
});
|
|
240
269
|
export {
|
|
241
|
-
|
|
270
|
+
ve as default
|
|
242
271
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { axisFormatter, CrosshairConfig, LegendPosition, MarkerConfig, AxisConfig } from '../../types';
|
|
1
|
+
import { axisFormatter, CrosshairConfig, LegendPosition, MarkerConfig, AxisConfig, TooltipConfig } from '../../types';
|
|
2
2
|
import { BulletLegendItemInterface, CurveType } from '@unovis/ts';
|
|
3
3
|
export interface AreaChartProps<T> {
|
|
4
4
|
/**
|
|
@@ -92,10 +92,34 @@ export interface AreaChartProps<T> {
|
|
|
92
92
|
* Force only first and last ticks on the x-axis.
|
|
93
93
|
*/
|
|
94
94
|
minMaxTicksOnly?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Force only first and last ticks on the x-axis.
|
|
97
|
+
*/
|
|
98
|
+
xMinMaxTicksOnly?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Force only first and last ticks on the y-axis.
|
|
101
|
+
*/
|
|
102
|
+
yMinMaxTicksOnly?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Show grid lines for the min and max axis ticks.
|
|
105
|
+
*/
|
|
106
|
+
minMaxTicksOnlyShowGridLines?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Show grid lines for the min and max x-axis ticks.
|
|
109
|
+
*/
|
|
110
|
+
xMinMaxTicksOnlyShowGridLines?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Show grid lines for the min and max y-axis ticks.
|
|
113
|
+
*/
|
|
114
|
+
yMinMaxTicksOnlyShowGridLines?: boolean;
|
|
95
115
|
/**
|
|
96
116
|
* The desired number of ticks on the y-axis.
|
|
97
117
|
*/
|
|
98
118
|
yNumTicks?: number;
|
|
119
|
+
/**
|
|
120
|
+
* Force specific ticks on the y-axis.
|
|
121
|
+
*/
|
|
122
|
+
yExplicitTicks?: (number | string | Date)[];
|
|
99
123
|
/**
|
|
100
124
|
* If `true`, hides the chart legend.
|
|
101
125
|
*/
|
|
@@ -170,4 +194,12 @@ export interface AreaChartProps<T> {
|
|
|
170
194
|
* When false (default), areas are overlaid on top of each other.
|
|
171
195
|
*/
|
|
172
196
|
stacked?: boolean;
|
|
197
|
+
/**
|
|
198
|
+
* Animation duration in milliseconds for the chart components.
|
|
199
|
+
*/
|
|
200
|
+
duration?: number;
|
|
201
|
+
/**
|
|
202
|
+
* Configuration object for the chart tooltip.
|
|
203
|
+
*/
|
|
204
|
+
tooltip?: TooltipConfig;
|
|
173
205
|
}
|