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
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { defineComponent as N, useSlots as W, useTemplateRef as E, ref as G, computed as c, createElementBlock as m, openBlock as r, normalizeStyle as f, createVNode as x, createCommentVNode as s, createElementVNode as z, unref as a, withCtx as H, createBlock as d, Fragment as X, renderList as j, mergeProps as k, renderSlot as A } from "vue";
|
|
2
|
+
import { Orientation as y, CurveType as p, Position as L, StackedBar as q, GroupedBar as $ } from "@unovis/ts";
|
|
3
|
+
import { VisXYContainer as R, VisTooltip as U, VisGroupedBar as I, VisStackedBar as J, VisLine as K, VisAxis as B, VisCrosshair as Q, VisBulletLegend as Z } from "@unovis/vue";
|
|
4
|
+
import _ from "../Tooltip.js";
|
|
5
|
+
import { LegendPosition as ee } from "../../types.js";
|
|
6
|
+
const te = {
|
|
7
|
+
ref: "slotWrapper",
|
|
8
|
+
style: { display: "none" }
|
|
9
|
+
}, de = /* @__PURE__ */ N({
|
|
10
|
+
__name: "DualChart",
|
|
11
|
+
props: {
|
|
12
|
+
data: {},
|
|
13
|
+
height: {},
|
|
14
|
+
xLabel: {},
|
|
15
|
+
yLabel: {},
|
|
16
|
+
yLabelSecondary: {},
|
|
17
|
+
padding: { default: () => ({
|
|
18
|
+
top: 5,
|
|
19
|
+
right: 5,
|
|
20
|
+
bottom: 5,
|
|
21
|
+
left: 5
|
|
22
|
+
}) },
|
|
23
|
+
barCategories: {},
|
|
24
|
+
lineCategories: {},
|
|
25
|
+
barYAxis: {},
|
|
26
|
+
lineYAxis: {},
|
|
27
|
+
xFormatter: {},
|
|
28
|
+
yFormatter: {},
|
|
29
|
+
tooltipTitleFormatter: {},
|
|
30
|
+
curveType: { default: p.MonotoneX },
|
|
31
|
+
lineWidth: { default: 2 },
|
|
32
|
+
xNumTicks: {},
|
|
33
|
+
xExplicitTicks: {},
|
|
34
|
+
minMaxTicksOnly: { type: Boolean },
|
|
35
|
+
yNumTicks: {},
|
|
36
|
+
hideLegend: { type: Boolean, default: !1 },
|
|
37
|
+
hideTooltip: { type: Boolean, default: !1 },
|
|
38
|
+
legendPosition: { default: ee.BottomCenter },
|
|
39
|
+
legendStyle: { default: void 0 },
|
|
40
|
+
xDomainLine: { type: Boolean },
|
|
41
|
+
yDomainLine: { type: Boolean },
|
|
42
|
+
xTickLine: { type: Boolean },
|
|
43
|
+
yTickLine: { type: Boolean },
|
|
44
|
+
xGridLine: { type: Boolean },
|
|
45
|
+
yGridLine: { type: Boolean, default: !0 },
|
|
46
|
+
hideXAxis: { type: Boolean },
|
|
47
|
+
hideYAxis: { type: Boolean },
|
|
48
|
+
crosshairConfig: {},
|
|
49
|
+
xAxisConfig: {},
|
|
50
|
+
yAxisConfig: {},
|
|
51
|
+
yDomain: {},
|
|
52
|
+
xDomain: {},
|
|
53
|
+
stacked: { type: Boolean },
|
|
54
|
+
groupPadding: { default: 0 },
|
|
55
|
+
barPadding: { default: 0.2 },
|
|
56
|
+
radius: {},
|
|
57
|
+
orientation: { default: y.Vertical },
|
|
58
|
+
duration: { default: 600 },
|
|
59
|
+
tooltip: { default: () => ({
|
|
60
|
+
followCursor: !0
|
|
61
|
+
}) }
|
|
62
|
+
},
|
|
63
|
+
emits: ["click"],
|
|
64
|
+
setup(e, { emit: Y }) {
|
|
65
|
+
const w = Y, t = e, P = W(), g = E("slotWrapper"), u = G();
|
|
66
|
+
if (!t.barYAxis || t.barYAxis.length === 0)
|
|
67
|
+
throw console.error("[DualChart] barYAxis prop is required and must contain at least one field key"), new Error("DualChart: 'barYAxis' is required and must contain at least one field key. Provide an array of property keys from your data type (e.g., ['revenue', 'costs'])");
|
|
68
|
+
if (!t.lineYAxis || t.lineYAxis.length === 0)
|
|
69
|
+
throw console.error("[DualChart] lineYAxis prop is required and must contain at least one field key"), new Error("DualChart: 'lineYAxis' is required and must contain at least one field key. Provide an array of property keys from your data type (e.g., ['profit', 'target'])");
|
|
70
|
+
const h = c(() => t.barYAxis.map((n) => (l) => l[n])), V = c(() => t.lineYAxis.map((n) => (l) => l[n])), v = (n, l) => {
|
|
71
|
+
var i;
|
|
72
|
+
return (i = Object.values(t.barCategories)[l]) == null ? void 0 : i.color;
|
|
73
|
+
}, C = c(() => ({
|
|
74
|
+
...t.barCategories,
|
|
75
|
+
...t.lineCategories
|
|
76
|
+
})), D = c(() => t.legendPosition.startsWith("top")), F = c(() => t.legendPosition.includes("left") ? "flex-start" : t.legendPosition.includes("right") ? "flex-end" : "center");
|
|
77
|
+
function b(n) {
|
|
78
|
+
u.value = n;
|
|
79
|
+
}
|
|
80
|
+
function M(n) {
|
|
81
|
+
return typeof window > "u" ? "" : g.value ? g.value.innerHTML : "";
|
|
82
|
+
}
|
|
83
|
+
function O(n) {
|
|
84
|
+
return u.value = n, M();
|
|
85
|
+
}
|
|
86
|
+
return (n, l) => (r(), m("div", {
|
|
87
|
+
style: f({
|
|
88
|
+
display: "flex",
|
|
89
|
+
flexDirection: D.value ? "column-reverse" : "column",
|
|
90
|
+
gap: "var(--vis-legend-spacing)"
|
|
91
|
+
}),
|
|
92
|
+
onClick: l[0] || (l[0] = (i) => w("click", i, u.value))
|
|
93
|
+
}, [
|
|
94
|
+
x(a(R), {
|
|
95
|
+
padding: e.padding,
|
|
96
|
+
height: e.height,
|
|
97
|
+
duration: e.duration,
|
|
98
|
+
data: e.data
|
|
99
|
+
}, {
|
|
100
|
+
default: H(() => [
|
|
101
|
+
e.hideTooltip ? s("", !0) : (r(), d(a(U), {
|
|
102
|
+
key: 0,
|
|
103
|
+
followCursor: t.tooltip.followCursor,
|
|
104
|
+
"show-delay": t.tooltip.showDelay,
|
|
105
|
+
"hide-delay": t.tooltip.hideDelay,
|
|
106
|
+
triggers: {
|
|
107
|
+
[a($).selectors.bar]: (i) => {
|
|
108
|
+
var o;
|
|
109
|
+
return b(i), i ? (o = g.value) == null ? void 0 : o.innerHTML : "";
|
|
110
|
+
},
|
|
111
|
+
[a(q).selectors.bar]: (i) => {
|
|
112
|
+
var o;
|
|
113
|
+
return b(i), i ? (o = g.value) == null ? void 0 : o.innerHTML : "";
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"horizontal-placement": a(L).Right,
|
|
117
|
+
"vertical-placement": a(L).Top
|
|
118
|
+
}, null, 8, ["followCursor", "show-delay", "hide-delay", "triggers", "horizontal-placement", "vertical-placement"])),
|
|
119
|
+
e.stacked ? (r(), d(a(J), {
|
|
120
|
+
key: 2,
|
|
121
|
+
data: e.data,
|
|
122
|
+
x: (i, o) => o,
|
|
123
|
+
y: h.value,
|
|
124
|
+
color: v,
|
|
125
|
+
"rounded-corners": e.radius ?? 0,
|
|
126
|
+
"group-padding": e.groupPadding ?? 0,
|
|
127
|
+
"bar-padding": e.barPadding ?? 0.2,
|
|
128
|
+
orientation: e.orientation ?? a(y).Vertical
|
|
129
|
+
}, null, 8, ["data", "x", "y", "rounded-corners", "group-padding", "bar-padding", "orientation"])) : (r(), d(a(I), {
|
|
130
|
+
key: 1,
|
|
131
|
+
data: e.data,
|
|
132
|
+
x: (i, o) => o,
|
|
133
|
+
y: h.value,
|
|
134
|
+
color: v,
|
|
135
|
+
"rounded-corners": e.radius ?? 0,
|
|
136
|
+
"group-padding": e.groupPadding ?? 0,
|
|
137
|
+
"bar-padding": e.barPadding ?? 0.2,
|
|
138
|
+
orientation: e.orientation ?? a(y).Vertical
|
|
139
|
+
}, null, 8, ["data", "x", "y", "rounded-corners", "group-padding", "bar-padding", "orientation"])),
|
|
140
|
+
(r(!0), m(X, null, j(V.value, (i, o) => {
|
|
141
|
+
var T;
|
|
142
|
+
return r(), d(a(K), {
|
|
143
|
+
key: `line-${o}`,
|
|
144
|
+
data: e.data,
|
|
145
|
+
x: (ie, S) => S,
|
|
146
|
+
y: i,
|
|
147
|
+
color: (T = Object.values(t.lineCategories)[o]) == null ? void 0 : T.color,
|
|
148
|
+
"curve-type": e.curveType ?? a(p).MonotoneX,
|
|
149
|
+
"line-width": e.lineWidth
|
|
150
|
+
}, null, 8, ["data", "x", "y", "color", "curve-type", "line-width"]);
|
|
151
|
+
}), 128)),
|
|
152
|
+
e.hideXAxis ? s("", !0) : (r(), d(a(B), k({
|
|
153
|
+
key: 3,
|
|
154
|
+
type: "x",
|
|
155
|
+
"tick-format": e.xFormatter,
|
|
156
|
+
label: e.xLabel,
|
|
157
|
+
"grid-line": e.xGridLine,
|
|
158
|
+
"domain-line": !!e.xDomainLine,
|
|
159
|
+
"tick-line": e.xTickLine,
|
|
160
|
+
"num-ticks": e.xNumTicks,
|
|
161
|
+
"tick-values": e.xExplicitTicks,
|
|
162
|
+
minMaxTicksOnly: e.minMaxTicksOnly,
|
|
163
|
+
duration: e.duration
|
|
164
|
+
}, e.xAxisConfig), null, 16, ["tick-format", "label", "grid-line", "domain-line", "tick-line", "num-ticks", "tick-values", "minMaxTicksOnly", "duration"])),
|
|
165
|
+
e.hideYAxis ? s("", !0) : (r(), d(a(B), k({
|
|
166
|
+
key: 4,
|
|
167
|
+
type: "y",
|
|
168
|
+
label: e.yLabel,
|
|
169
|
+
"grid-line": e.orientation !== a(y).Horizontal && e.yGridLine,
|
|
170
|
+
"domain-line": !!e.yDomainLine,
|
|
171
|
+
"tick-format": e.yFormatter,
|
|
172
|
+
"num-ticks": e.yNumTicks,
|
|
173
|
+
"tick-line": e.yTickLine,
|
|
174
|
+
duration: e.duration
|
|
175
|
+
}, e.yAxisConfig), null, 16, ["label", "grid-line", "domain-line", "tick-format", "num-ticks", "tick-line", "duration"])),
|
|
176
|
+
e.hideTooltip ? s("", !0) : (r(), d(a(Q), k({ key: 5 }, e.crosshairConfig, { template: O }), null, 16))
|
|
177
|
+
]),
|
|
178
|
+
_: 1
|
|
179
|
+
}, 8, ["padding", "height", "duration", "data"]),
|
|
180
|
+
t.hideLegend ? s("", !0) : (r(), m("div", {
|
|
181
|
+
key: 0,
|
|
182
|
+
style: f({
|
|
183
|
+
display: "flex",
|
|
184
|
+
justifyContent: F.value
|
|
185
|
+
})
|
|
186
|
+
}, [
|
|
187
|
+
x(a(Z), {
|
|
188
|
+
style: f([
|
|
189
|
+
t.legendStyle,
|
|
190
|
+
"display: flex; gap: var(--vis-legend-spacing);"
|
|
191
|
+
]),
|
|
192
|
+
items: Object.values(C.value).map((i) => ({
|
|
193
|
+
...i,
|
|
194
|
+
color: Array.isArray(i.color) ? i.color[0] : i.color
|
|
195
|
+
}))
|
|
196
|
+
}, null, 8, ["style", "items"])
|
|
197
|
+
], 4)),
|
|
198
|
+
z("div", te, [
|
|
199
|
+
a(P).tooltip ? A(n.$slots, "tooltip", {
|
|
200
|
+
key: 0,
|
|
201
|
+
values: u.value
|
|
202
|
+
}) : u.value ? A(n.$slots, "fallback", { key: 1 }, () => [
|
|
203
|
+
x(_, {
|
|
204
|
+
data: u.value,
|
|
205
|
+
categories: C.value,
|
|
206
|
+
"title-formatter": t.tooltipTitleFormatter,
|
|
207
|
+
yFormatter: t.orientation === a(y).Horizontal ? t.xFormatter : t.yFormatter
|
|
208
|
+
}, null, 8, ["data", "categories", "title-formatter", "yFormatter"])
|
|
209
|
+
]) : s("", !0)
|
|
210
|
+
], 512)
|
|
211
|
+
], 4));
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
export {
|
|
215
|
+
de as default
|
|
216
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DualChartProps } from './types';
|
|
2
|
+
declare const _default: <T extends {}>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
4
|
+
readonly onClick?: ((event: MouseEvent, values?: T | undefined) => any) | undefined;
|
|
5
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onClick"> & DualChartProps<T> & Partial<{}>> & import('vue').PublicProps;
|
|
6
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
7
|
+
attrs: any;
|
|
8
|
+
slots: {
|
|
9
|
+
tooltip?(_: {
|
|
10
|
+
values: T | undefined;
|
|
11
|
+
}): any;
|
|
12
|
+
fallback?(_: {}): any;
|
|
13
|
+
};
|
|
14
|
+
emit: (e: "click", event: MouseEvent, values?: T) => void;
|
|
15
|
+
}>) => import('vue').VNode & {
|
|
16
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
17
|
+
};
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_PrettifyLocal<T> = {
|
|
20
|
+
[K in keyof T]: T[K];
|
|
21
|
+
} & {};
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { axisFormatter, CrosshairConfig, LegendPosition, AxisConfig, BulletLegendItemInterface, Orientation, TooltipConfig } from '../../types';
|
|
2
|
+
import { CurveType } from '@unovis/ts';
|
|
3
|
+
export interface DualChartProps<T> {
|
|
4
|
+
/**
|
|
5
|
+
* The data to be displayed in the dual chart.
|
|
6
|
+
* Each element of the array represents a data point.
|
|
7
|
+
* The structure of 'T' should be compatible with the chart's rendering logic.
|
|
8
|
+
*/
|
|
9
|
+
data: T[];
|
|
10
|
+
/**
|
|
11
|
+
* The height of the chart in pixels.
|
|
12
|
+
*/
|
|
13
|
+
height: number;
|
|
14
|
+
/**
|
|
15
|
+
* Optional label for the x-axis.
|
|
16
|
+
*/
|
|
17
|
+
xLabel?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Optional label for the y-axis (used for both bar and line by default).
|
|
20
|
+
*/
|
|
21
|
+
yLabel?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Optional label for the secondary y-axis (line chart).
|
|
24
|
+
*/
|
|
25
|
+
yLabelSecondary?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Optional padding applied to the chart.
|
|
28
|
+
* Allows specifying individual padding values for the top, right, bottom, and left sides.
|
|
29
|
+
*/
|
|
30
|
+
padding?: {
|
|
31
|
+
top: number;
|
|
32
|
+
right: number;
|
|
33
|
+
bottom: number;
|
|
34
|
+
left: number;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* A record mapping bar category keys to `BulletLegendItemInterface` objects.
|
|
38
|
+
* This defines the visual representation and labels for bar categories in the chart's legend.
|
|
39
|
+
*/
|
|
40
|
+
barCategories: Record<string, BulletLegendItemInterface>;
|
|
41
|
+
/**
|
|
42
|
+
* A record mapping line category keys to `BulletLegendItemInterface` objects.
|
|
43
|
+
* This defines the visual representation and labels for line categories in the chart's legend.
|
|
44
|
+
*/
|
|
45
|
+
lineCategories: Record<string, BulletLegendItemInterface>;
|
|
46
|
+
/**
|
|
47
|
+
* An array of property keys from the data object type 'T' to be used for the bar chart y-axis values.
|
|
48
|
+
*/
|
|
49
|
+
barYAxis: (keyof T)[];
|
|
50
|
+
/**
|
|
51
|
+
* An array of property keys from the data object type 'T' to be used for the line chart y-axis values.
|
|
52
|
+
*/
|
|
53
|
+
lineYAxis: (keyof T)[];
|
|
54
|
+
/**
|
|
55
|
+
* @param {number|Date} tick - The value of the tick. This can be a number or a Date object depending on the scale of the x-axis.
|
|
56
|
+
* @param {number} i - The index of the tick in the `ticks` array.
|
|
57
|
+
* @param {(number[]|Date[])} ticks - An array of all tick values for the x-axis.
|
|
58
|
+
* @returns {string} The formatted string representation of the tick.
|
|
59
|
+
*/
|
|
60
|
+
xFormatter?: axisFormatter;
|
|
61
|
+
/**
|
|
62
|
+
* @param {number|Date} tick - The value of the tick. This can be a number or a Date object depending on the scale of the y-axis.
|
|
63
|
+
* @param {number} i - The index of the tick in the `ticks` array.
|
|
64
|
+
* @param {(number[]|Date[])} ticks - An array of all tick values for the y-axis.
|
|
65
|
+
* @returns {string} The formatted string representation of the tick.
|
|
66
|
+
*/
|
|
67
|
+
yFormatter?: axisFormatter;
|
|
68
|
+
/**
|
|
69
|
+
* Use custom formatter for tooltip titles
|
|
70
|
+
*/
|
|
71
|
+
tooltipTitleFormatter?: (data: T) => string | number;
|
|
72
|
+
/**
|
|
73
|
+
* The type of curve to use for the line chart lines.
|
|
74
|
+
* See `CurveType` for available options.
|
|
75
|
+
*/
|
|
76
|
+
curveType?: CurveType;
|
|
77
|
+
/**
|
|
78
|
+
* The width of the line in pixels. Default is 2px.
|
|
79
|
+
*/
|
|
80
|
+
lineWidth?: number;
|
|
81
|
+
/**
|
|
82
|
+
* The desired number of ticks on the x-axis.
|
|
83
|
+
*/
|
|
84
|
+
xNumTicks?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Force specific ticks on the x-axis.
|
|
87
|
+
*/
|
|
88
|
+
xExplicitTicks?: (number | string | Date)[];
|
|
89
|
+
/**
|
|
90
|
+
* Force only first and last ticks on the x-axis.
|
|
91
|
+
*/
|
|
92
|
+
minMaxTicksOnly?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* The desired number of ticks on the y-axis.
|
|
95
|
+
*/
|
|
96
|
+
yNumTicks?: number;
|
|
97
|
+
/**
|
|
98
|
+
* If `true`, hides the chart legend.
|
|
99
|
+
*/
|
|
100
|
+
hideLegend?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* If `true`, hides the chart tooltip.
|
|
103
|
+
*/
|
|
104
|
+
hideTooltip?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Optional position for the legend, if applicable.
|
|
107
|
+
* See `LegendPosition` for available options.
|
|
108
|
+
*/
|
|
109
|
+
legendPosition?: LegendPosition;
|
|
110
|
+
/**
|
|
111
|
+
* Optional style object for the legend container. Allows custom CSS styling.
|
|
112
|
+
*/
|
|
113
|
+
legendStyle?: string | Record<string, string>;
|
|
114
|
+
/**
|
|
115
|
+
* If `true`, displays a domain line (axis line) along the x-axis.
|
|
116
|
+
*/
|
|
117
|
+
xDomainLine?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* If `true`, displays a domain line (axis line) along the y-axis.
|
|
120
|
+
*/
|
|
121
|
+
yDomainLine?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* If `true`, displays tick lines on the x-axis.
|
|
124
|
+
*/
|
|
125
|
+
xTickLine?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* If `true`, displays tick lines on the y-axis.
|
|
128
|
+
*/
|
|
129
|
+
yTickLine?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* If `true`, displays grid lines along the x-axis.
|
|
132
|
+
*/
|
|
133
|
+
xGridLine?: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* If `true`, displays grid lines along the y-axis.
|
|
136
|
+
*/
|
|
137
|
+
yGridLine?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* If `true`, hide the x-axis.
|
|
140
|
+
*/
|
|
141
|
+
hideXAxis?: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* If `true`, hide the y-axis.
|
|
144
|
+
*/
|
|
145
|
+
hideYAxis?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Crosshair configuration object for customizing the appearance of the crosshair line.
|
|
148
|
+
*/
|
|
149
|
+
crosshairConfig?: CrosshairConfig;
|
|
150
|
+
/**
|
|
151
|
+
* Axis configuration object for customizing the appearance of the axes.
|
|
152
|
+
*/
|
|
153
|
+
xAxisConfig?: AxisConfig;
|
|
154
|
+
/**
|
|
155
|
+
* Axis configuration object for customizing the appearance of the axes.
|
|
156
|
+
*/
|
|
157
|
+
yAxisConfig?: AxisConfig;
|
|
158
|
+
/**
|
|
159
|
+
* The domain for the y-axis, specified as a tuple of two values.
|
|
160
|
+
*/
|
|
161
|
+
yDomain?: [number | undefined, number | undefined];
|
|
162
|
+
/**
|
|
163
|
+
* The domain for the x-axis, specified as a tuple of two values.
|
|
164
|
+
*/
|
|
165
|
+
xDomain?: [number | undefined, number | undefined];
|
|
166
|
+
/**
|
|
167
|
+
* If `true`, creates stacked bars.
|
|
168
|
+
*/
|
|
169
|
+
stacked?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* The padding between groups of bars in pixels.
|
|
172
|
+
*/
|
|
173
|
+
groupPadding?: number;
|
|
174
|
+
/**
|
|
175
|
+
* Fractional padding between the bars in the range of [0,1). Default: 0.2
|
|
176
|
+
*/
|
|
177
|
+
barPadding?: number;
|
|
178
|
+
/**
|
|
179
|
+
* Rounded corners for top bars. Boolean or number (to set the radius in pixels). Default: 2
|
|
180
|
+
*/
|
|
181
|
+
radius?: number;
|
|
182
|
+
/**
|
|
183
|
+
* The orientation of the bars (vertical or horizontal).
|
|
184
|
+
* See `Orientation` for available options.
|
|
185
|
+
*/
|
|
186
|
+
orientation?: Orientation;
|
|
187
|
+
/**
|
|
188
|
+
* Animation duration in milliseconds for the chart components.
|
|
189
|
+
*/
|
|
190
|
+
duration?: number;
|
|
191
|
+
/**
|
|
192
|
+
* Configuration object for the chart tooltip.
|
|
193
|
+
*/
|
|
194
|
+
tooltip?: TooltipConfig;
|
|
195
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as W, useSlots as B, useTemplateRef as V, ref as A, computed as d, createElementBlock as p, openBlock as c, normalizeStyle as u, createVNode as n, createCommentVNode as g, createElementVNode as F, unref as i, withCtx as H, createBlock as P, mergeProps as S, renderSlot as y } from "vue";
|
|
2
2
|
import { Timeline as x } from "@unovis/ts";
|
|
3
|
-
import { dateFormatter as
|
|
3
|
+
import { dateFormatter as D } from "../../utils.js";
|
|
4
4
|
import N from "../Tooltip.js";
|
|
5
|
-
import { VisXYContainer as j, VisTimeline as O, VisTooltip as $, VisAxis as
|
|
6
|
-
import { LegendPosition as
|
|
7
|
-
const
|
|
5
|
+
import { VisXYContainer as j, VisTimeline as O, VisTooltip as $, VisAxis as G, VisBulletLegend as M } from "@unovis/vue";
|
|
6
|
+
import { LegendPosition as E } from "../../types.js";
|
|
7
|
+
const J = /* @__PURE__ */ W({
|
|
8
8
|
__name: "GanttChart",
|
|
9
9
|
props: {
|
|
10
10
|
data: {},
|
|
@@ -23,7 +23,7 @@ const I = /* @__PURE__ */ B({
|
|
|
23
23
|
crosshairConfig: {},
|
|
24
24
|
lineWidth: { default: 12 },
|
|
25
25
|
rowHeight: { default: 24 },
|
|
26
|
-
legendPosition: { default:
|
|
26
|
+
legendPosition: { default: E.TopRight },
|
|
27
27
|
legendStyle: {},
|
|
28
28
|
hideLegend: { type: Boolean },
|
|
29
29
|
xTickLine: { type: Boolean },
|
|
@@ -33,81 +33,91 @@ const I = /* @__PURE__ */ B({
|
|
|
33
33
|
xGridLine: { type: Boolean },
|
|
34
34
|
xDomainLine: { type: Boolean },
|
|
35
35
|
xAxisConfig: {},
|
|
36
|
-
yAxisConfig: {}
|
|
36
|
+
yAxisConfig: {},
|
|
37
|
+
duration: { default: 600 },
|
|
38
|
+
tooltip: { default: () => ({
|
|
39
|
+
followCursor: !0
|
|
40
|
+
}) }
|
|
37
41
|
},
|
|
38
42
|
emits: ["click", "scroll", "labelHover"],
|
|
39
|
-
setup(
|
|
40
|
-
const e =
|
|
43
|
+
setup(l, { emit: k }) {
|
|
44
|
+
const e = l, s = k, T = B(), m = V("slotWrapper"), r = A(), v = d(() => e.legendPosition.startsWith("top")), b = d(() => e.legendPosition.includes("left") ? "flex-start" : e.legendPosition.includes("right") ? "flex-end" : "center");
|
|
41
45
|
x.selectors.label + "";
|
|
42
|
-
function
|
|
43
|
-
r.value =
|
|
46
|
+
function f(o) {
|
|
47
|
+
r.value = o, s("labelHover", o);
|
|
44
48
|
}
|
|
45
|
-
function
|
|
46
|
-
s("click", t, { index: a, item:
|
|
49
|
+
function C(o, a, t) {
|
|
50
|
+
s("click", t, { index: a, item: o });
|
|
47
51
|
}
|
|
48
|
-
function
|
|
49
|
-
s("scroll",
|
|
52
|
+
function L(o) {
|
|
53
|
+
s("scroll", o.deltaY);
|
|
50
54
|
}
|
|
51
|
-
const
|
|
52
|
-
const
|
|
55
|
+
const w = d(() => {
|
|
56
|
+
const o = Object.values(e.categories).map(
|
|
53
57
|
(a, t) => `var(--vis-color${t})`
|
|
54
58
|
);
|
|
55
59
|
return Object.values(e.categories).map(
|
|
56
|
-
(a, t) => a.color ??
|
|
60
|
+
(a, t) => a.color ?? o[t]
|
|
57
61
|
);
|
|
58
62
|
});
|
|
59
|
-
return (
|
|
60
|
-
style:
|
|
63
|
+
return (o, a) => (c(), p("div", {
|
|
64
|
+
style: u({
|
|
61
65
|
display: "flex",
|
|
62
66
|
flexDirection: v.value ? "column-reverse" : "column",
|
|
63
67
|
gap: "var(--vis-legend-spacing)"
|
|
64
68
|
})
|
|
65
69
|
}, [
|
|
66
|
-
n(
|
|
70
|
+
n(i(j), {
|
|
67
71
|
data: e.data,
|
|
68
72
|
height: e.height,
|
|
69
|
-
|
|
73
|
+
duration: l.duration,
|
|
74
|
+
onWheel: L
|
|
70
75
|
}, {
|
|
71
76
|
default: H(() => [
|
|
72
|
-
n(
|
|
77
|
+
n(i(O), {
|
|
73
78
|
x: e.x,
|
|
74
79
|
length: e.length,
|
|
75
80
|
lineWidth: e.lineWidth,
|
|
76
81
|
rowHeight: e.rowHeight,
|
|
77
82
|
type: e.type,
|
|
78
|
-
color:
|
|
83
|
+
color: w.value,
|
|
79
84
|
labelWidth: e.labelWidth,
|
|
80
85
|
showLabels: e.showLabels,
|
|
81
|
-
onClick:
|
|
86
|
+
onClick: C
|
|
82
87
|
}, null, 8, ["x", "length", "lineWidth", "rowHeight", "type", "color", "labelWidth", "showLabels"]),
|
|
83
|
-
|
|
88
|
+
l.hideTooltip ? g("", !0) : (c(), P(i($), {
|
|
89
|
+
key: 0,
|
|
90
|
+
followCursor: e.tooltip.followCursor,
|
|
91
|
+
"show-delay": e.tooltip.showDelay,
|
|
92
|
+
"hide-delay": e.tooltip.hideDelay,
|
|
84
93
|
triggers: {
|
|
85
|
-
[
|
|
86
|
-
var
|
|
87
|
-
return
|
|
94
|
+
[i(x).selectors.label]: (t) => {
|
|
95
|
+
var h;
|
|
96
|
+
return f(t), t ? (h = m.value) == null ? void 0 : h.innerHTML : "";
|
|
88
97
|
}
|
|
89
98
|
}
|
|
90
|
-
}, null, 8, ["triggers"]),
|
|
91
|
-
n(
|
|
99
|
+
}, null, 8, ["followCursor", "show-delay", "hide-delay", "triggers"])),
|
|
100
|
+
n(i(G), S({
|
|
92
101
|
type: "x",
|
|
93
|
-
tickFormat:
|
|
94
|
-
numTicks:
|
|
95
|
-
"tick-line":
|
|
96
|
-
"grid-line":
|
|
97
|
-
"domain-line":
|
|
98
|
-
|
|
102
|
+
tickFormat: l.xTickFormat || i(D),
|
|
103
|
+
numTicks: l.xNumTicks,
|
|
104
|
+
"tick-line": l.xTickLine,
|
|
105
|
+
"grid-line": l.xGridLine,
|
|
106
|
+
"domain-line": l.xDomainLine,
|
|
107
|
+
duration: l.duration
|
|
108
|
+
}, l.xAxisConfig), null, 16, ["tickFormat", "numTicks", "tick-line", "grid-line", "domain-line", "duration"])
|
|
99
109
|
]),
|
|
100
110
|
_: 1
|
|
101
|
-
}, 8, ["data", "height"]),
|
|
102
|
-
e.hideLegend ?
|
|
111
|
+
}, 8, ["data", "height", "duration"]),
|
|
112
|
+
e.hideLegend ? g("", !0) : (c(), p("div", {
|
|
103
113
|
key: 0,
|
|
104
|
-
style:
|
|
114
|
+
style: u({
|
|
105
115
|
display: "flex",
|
|
106
116
|
justifyContent: b.value
|
|
107
117
|
})
|
|
108
118
|
}, [
|
|
109
|
-
n(
|
|
110
|
-
style:
|
|
119
|
+
n(i(M), {
|
|
120
|
+
style: u([
|
|
111
121
|
e.legendStyle,
|
|
112
122
|
"display: flex; gap: var(--vis-legend-spacing);"
|
|
113
123
|
]),
|
|
@@ -119,23 +129,23 @@ const I = /* @__PURE__ */ B({
|
|
|
119
129
|
], 4)),
|
|
120
130
|
F("div", {
|
|
121
131
|
ref_key: "slotWrapper",
|
|
122
|
-
ref:
|
|
132
|
+
ref: m,
|
|
123
133
|
style: { display: "none" }
|
|
124
134
|
}, [
|
|
125
|
-
|
|
135
|
+
i(T).labelTooltip ? y(o.$slots, "labelTooltip", {
|
|
126
136
|
key: 0,
|
|
127
137
|
values: r.value
|
|
128
|
-
}) : r.value ? y(
|
|
138
|
+
}) : r.value ? y(o.$slots, "fallback", { key: 1 }, () => [
|
|
129
139
|
n(N, {
|
|
130
140
|
data: r.value,
|
|
131
141
|
"title-formatter": e.tooltipTitleFormatter,
|
|
132
|
-
categories:
|
|
142
|
+
categories: l.categories
|
|
133
143
|
}, null, 8, ["data", "title-formatter", "categories"])
|
|
134
|
-
]) :
|
|
144
|
+
]) : g("", !0)
|
|
135
145
|
], 512)
|
|
136
146
|
], 4));
|
|
137
147
|
}
|
|
138
148
|
});
|
|
139
149
|
export {
|
|
140
|
-
|
|
150
|
+
J as default
|
|
141
151
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BulletLegendItemInterface, CrosshairConfig, LegendPosition, AxisConfig } from '../../types';
|
|
1
|
+
import { BulletLegendItemInterface, CrosshairConfig, LegendPosition, AxisConfig, TooltipConfig } from '../../types';
|
|
2
2
|
export interface GanttChartProps<T> {
|
|
3
3
|
/**
|
|
4
4
|
* The data to be displayed in the timeline chart.
|
|
@@ -113,4 +113,12 @@ export interface GanttChartProps<T> {
|
|
|
113
113
|
* Axis configuration object for customizing the appearance of the axes.
|
|
114
114
|
*/
|
|
115
115
|
yAxisConfig?: AxisConfig;
|
|
116
|
+
/**
|
|
117
|
+
* Animation duration in milliseconds for the chart components.
|
|
118
|
+
*/
|
|
119
|
+
duration?: number;
|
|
120
|
+
/**
|
|
121
|
+
* Configuration object for the chart tooltip.
|
|
122
|
+
*/
|
|
123
|
+
tooltip?: TooltipConfig;
|
|
116
124
|
}
|