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.
Files changed (165) hide show
  1. package/dist/components/AreaChart/AreaChart.js +141 -112
  2. package/dist/components/AreaChart/types.d.ts +33 -1
  3. package/dist/components/BarChart/BarChart.js +76 -65
  4. package/dist/components/BarChart/types.d.ts +9 -1
  5. package/dist/components/BubbleChart/BubbleChart.js +55 -45
  6. package/dist/components/BubbleChart/types.d.ts +9 -1
  7. package/dist/components/DagreGraph/DagreGraph.js +171 -0
  8. package/dist/components/DagreGraph/DagreGraph.vue.d.ts +33 -0
  9. package/dist/components/DagreGraph/DagreGraph2.js +4 -0
  10. package/dist/components/DagreGraph/types.d.ts +253 -0
  11. package/dist/components/DonutChart/DonutChart.js +69 -59
  12. package/dist/components/DonutChart/types.d.ts +14 -2
  13. package/dist/components/DualChart/DualChart.js +216 -0
  14. package/dist/components/DualChart/DualChart.vue.d.ts +21 -0
  15. package/dist/components/DualChart/DualChart2.js +4 -0
  16. package/dist/components/DualChart/types.d.ts +195 -0
  17. package/dist/components/GanttChart/GanttChart.js +58 -48
  18. package/dist/components/GanttChart/types.d.ts +9 -1
  19. package/dist/components/LineChart/LineChart.js +17 -9
  20. package/dist/components/Maps/DottedMap/DottedMap.js +170 -0
  21. package/dist/components/Maps/DottedMap/DottedMap.vue.d.ts +52 -0
  22. package/dist/components/Maps/DottedMap/DottedMap2.js +4 -0
  23. package/dist/components/Maps/DottedMap/MapLegend.vue.d.ts +6 -0
  24. package/dist/components/Maps/DottedMap/MapZoomControls.js +44 -0
  25. package/dist/components/Maps/DottedMap/MapZoomControls.vue.d.ts +13 -0
  26. package/dist/components/Maps/DottedMap/MapZoomControls2.js +4 -0
  27. package/dist/components/Maps/DottedMap/core.js +122 -0
  28. package/dist/components/Maps/DottedMap/core.vue.d.ts +36 -0
  29. package/dist/components/Maps/DottedMap/core2.js +4 -0
  30. package/dist/components/Maps/DottedMap/mapUtils.d.ts +49 -0
  31. package/dist/components/Maps/DottedMap/mapUtils.js +130 -0
  32. package/dist/components/Maps/DottedMap/pins.d.ts +9 -0
  33. package/dist/components/Maps/DottedMap/pins.js +58 -0
  34. package/dist/components/Maps/DottedMap/regions.d.ts +4 -0
  35. package/dist/components/Maps/DottedMap/regions.js +66 -0
  36. package/dist/components/Maps/DottedMap/types.d.ts +127 -0
  37. package/dist/components/Maps/DottedMap/useMapPanZoom.d.ts +22 -0
  38. package/dist/components/Maps/DottedMap/useMapPanZoom.js +41 -0
  39. package/dist/components/Maps/TopoJSONMap/TopoJSONMap.js +170 -0
  40. package/dist/components/Maps/TopoJSONMap/TopoJSONMap.vue.d.ts +30 -0
  41. package/dist/components/Maps/TopoJSONMap/TopoJSONMap2.js +4 -0
  42. package/dist/components/Maps/TopoJSONMap/data.d.ts +13 -0
  43. package/dist/components/Maps/TopoJSONMap/types.d.ts +40 -0
  44. package/dist/components/Maps/types.d.ts +48 -0
  45. package/dist/components/SankeyChart/SankeyChart.js +133 -0
  46. package/dist/components/SankeyChart/SankeyChart.vue.d.ts +22 -0
  47. package/dist/components/SankeyChart/SankeyChart2.js +4 -0
  48. package/dist/components/SankeyChart/types.d.ts +116 -0
  49. package/dist/components/Tooltip.js +32 -27
  50. package/dist/data/countries.geo.json.js +9 -0
  51. package/dist/index.d.ts +8 -2
  52. package/dist/index.js +25 -12
  53. 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
  54. package/dist/node_modules/.pnpm/@turf_invariant@7.3.1/node_modules/@turf/invariant/dist/esm/index.js +20 -0
  55. package/dist/node_modules/.pnpm/mgrs@1.0.0/node_modules/mgrs/mgrs.js +222 -0
  56. package/dist/node_modules/.pnpm/point-in-polygon-hao@1.2.4/node_modules/point-in-polygon-hao/dist/esm/index.js +25 -0
  57. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/Point.js +24 -0
  58. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/Proj.js +46 -0
  59. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/adjust_axis.js +31 -0
  60. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/checkSanity.js +15 -0
  61. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/adjust_lat.js +8 -0
  62. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/adjust_lon.js +8 -0
  63. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/adjust_zone.js +13 -0
  64. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/asinhy.js +9 -0
  65. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/asinz.js +6 -0
  66. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/clens.js +8 -0
  67. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/clens_cmplx.js +10 -0
  68. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/cosh.js +7 -0
  69. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/e0fn.js +6 -0
  70. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/e1fn.js +6 -0
  71. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/e2fn.js +6 -0
  72. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/e3fn.js +6 -0
  73. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/gN.js +7 -0
  74. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/gatg.js +8 -0
  75. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/hypot.js +8 -0
  76. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/imlfn.js +11 -0
  77. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/iqsfnz.js +13 -0
  78. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/log1py.js +7 -0
  79. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/mlfn.js +6 -0
  80. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/msfnz.js +7 -0
  81. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/phi2z.js +10 -0
  82. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/pj_enfn.js +10 -0
  83. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/pj_inv_mlfn.js +14 -0
  84. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/pj_mlfn.js +6 -0
  85. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/qsfnz.js +7 -0
  86. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/sign.js +6 -0
  87. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/sinh.js +7 -0
  88. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/srat.js +6 -0
  89. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/toPoint.js +10 -0
  90. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/tsfnz.js +8 -0
  91. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/vincenty.js +33 -0
  92. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/Datum.js +1278 -0
  93. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/Ellipsoid.js +226 -0
  94. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/PrimeMeridian.js +17 -0
  95. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/units.js +25 -0
  96. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/values.js +22 -0
  97. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/core.js +65 -0
  98. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/datum.js +8 -0
  99. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/datumUtils.js +82 -0
  100. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/datum_transform.js +94 -0
  101. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/defs.js +39 -0
  102. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/deriveConstants.js +30 -0
  103. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/extend.js +12 -0
  104. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/global.js +9 -0
  105. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/index.js +25 -0
  106. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/match.js +11 -0
  107. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/nadgrid.js +128 -0
  108. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/parseCode.js +47 -0
  109. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projString.js +119 -0
  110. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/aea.js +43 -0
  111. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/aeqd.js +36 -0
  112. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/bonne.js +55 -0
  113. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/cass.js +52 -0
  114. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/cea.js +36 -0
  115. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/eqc.js +27 -0
  116. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/eqdc.js +48 -0
  117. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/eqearth.js +30 -0
  118. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/etmerc.js +54 -0
  119. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/gauss.js +27 -0
  120. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/geocent.js +26 -0
  121. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/geos.js +49 -0
  122. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/gnom.js +28 -0
  123. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/krovak.js +31 -0
  124. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/laea.js +134 -0
  125. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/lcc.js +61 -0
  126. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/longlat.js +19 -0
  127. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/merc.js +49 -0
  128. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/mill.js +26 -0
  129. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/moll.js +37 -0
  130. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/nzmg.js +48 -0
  131. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/ob_tran.js +173 -0
  132. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/omerc.js +58 -0
  133. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/ortho.js +28 -0
  134. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/poly.js +68 -0
  135. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/qsc.js +67 -0
  136. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/robin.js +104 -0
  137. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/sinu.js +47 -0
  138. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/somerc.js +34 -0
  139. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/stere.js +46 -0
  140. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/sterea.js +33 -0
  141. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/tmerc.js +60 -0
  142. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/tpers.js +110 -0
  143. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/utm.js +22 -0
  144. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/vandg.js +34 -0
  145. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections.js +34 -0
  146. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/transform.js +49 -0
  147. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/projs.js +38 -0
  148. package/dist/node_modules/.pnpm/robust-predicates@3.0.2/node_modules/robust-predicates/esm/orient2d.js +23 -0
  149. package/dist/node_modules/.pnpm/robust-predicates@3.0.2/node_modules/robust-predicates/esm/util.js +30 -0
  150. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/PROJJSONBuilder2015.js +9 -0
  151. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/PROJJSONBuilder2019.js +20 -0
  152. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/PROJJSONBuilderBase.js +171 -0
  153. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/buildPROJJSON.js +11 -0
  154. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/detectWKTVersion.js +7 -0
  155. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/index.js +104 -0
  156. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/parser.js +117 -0
  157. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/process.js +89 -0
  158. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/transformPROJJSON.js +73 -0
  159. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/util.js +12 -0
  160. package/dist/types.d.ts +21 -1
  161. package/dist/utils/geoJsonToGrid.d.ts +14 -0
  162. package/dist/utils/index.d.ts +1 -0
  163. package/dist/utils.d.ts +3 -0
  164. package/dist/utils.js +35 -31
  165. 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,4 @@
1
+ import f from "./DualChart.js";
2
+ export {
3
+ f as default
4
+ };
@@ -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 B, useSlots as V, useTemplateRef as w, ref as A, computed as c, createElementBlock as f, openBlock as p, normalizeStyle as d, createVNode as n, createCommentVNode as h, createElementVNode as F, unref as o, withCtx as H, mergeProps as P, renderSlot as y } from "vue";
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 S } from "../../utils.js";
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 D, VisBulletLegend as G } from "@unovis/vue";
6
- import { LegendPosition as M } from "../../types.js";
7
- const I = /* @__PURE__ */ B({
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: M.TopRight },
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(i, { emit: T }) {
40
- const e = i, s = T, k = V(), u = w("slotWrapper"), r = A(), v = c(() => e.legendPosition.startsWith("top")), b = c(() => e.legendPosition.includes("left") ? "flex-start" : e.legendPosition.includes("right") ? "flex-end" : "center");
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 g(l) {
43
- r.value = l, s("labelHover", l);
46
+ function f(o) {
47
+ r.value = o, s("labelHover", o);
44
48
  }
45
- function L(l, a, t) {
46
- s("click", t, { index: a, item: l });
49
+ function C(o, a, t) {
50
+ s("click", t, { index: a, item: o });
47
51
  }
48
- function C(l) {
49
- s("scroll", l.deltaY);
52
+ function L(o) {
53
+ s("scroll", o.deltaY);
50
54
  }
51
- const W = c(() => {
52
- const l = Object.values(e.categories).map(
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 ?? l[t]
60
+ (a, t) => a.color ?? o[t]
57
61
  );
58
62
  });
59
- return (l, a) => (p(), f("div", {
60
- style: d({
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(o(j), {
70
+ n(i(j), {
67
71
  data: e.data,
68
72
  height: e.height,
69
- onWheel: C
73
+ duration: l.duration,
74
+ onWheel: L
70
75
  }, {
71
76
  default: H(() => [
72
- n(o(O), {
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: W.value,
83
+ color: w.value,
79
84
  labelWidth: e.labelWidth,
80
85
  showLabels: e.showLabels,
81
- onClick: L
86
+ onClick: C
82
87
  }, null, 8, ["x", "length", "lineWidth", "rowHeight", "type", "color", "labelWidth", "showLabels"]),
83
- n(o($), {
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
- [o(x).selectors.label]: (t) => {
86
- var m;
87
- return g(t), t ? (m = u.value) == null ? void 0 : m.innerHTML : "";
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(o(D), P({
99
+ }, null, 8, ["followCursor", "show-delay", "hide-delay", "triggers"])),
100
+ n(i(G), S({
92
101
  type: "x",
93
- tickFormat: i.xTickFormat || o(S),
94
- numTicks: i.xNumTicks,
95
- "tick-line": i.xTickLine,
96
- "grid-line": i.xGridLine,
97
- "domain-line": i.xDomainLine
98
- }, i.xAxisConfig), null, 16, ["tickFormat", "numTicks", "tick-line", "grid-line", "domain-line"])
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 ? h("", !0) : (p(), f("div", {
111
+ }, 8, ["data", "height", "duration"]),
112
+ e.hideLegend ? g("", !0) : (c(), p("div", {
103
113
  key: 0,
104
- style: d({
114
+ style: u({
105
115
  display: "flex",
106
116
  justifyContent: b.value
107
117
  })
108
118
  }, [
109
- n(o(G), {
110
- style: d([
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: u,
132
+ ref: m,
123
133
  style: { display: "none" }
124
134
  }, [
125
- o(k).labelTooltip ? y(l.$slots, "labelTooltip", {
135
+ i(T).labelTooltip ? y(o.$slots, "labelTooltip", {
126
136
  key: 0,
127
137
  values: r.value
128
- }) : r.value ? y(l.$slots, "fallback", { key: 1 }, () => [
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: i.categories
142
+ categories: l.categories
133
143
  }, null, 8, ["data", "title-formatter", "categories"])
134
- ]) : h("", !0)
144
+ ]) : g("", !0)
135
145
  ], 512)
136
146
  ], 4));
137
147
  }
138
148
  });
139
149
  export {
140
- I as default
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
  }