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,33 @@
1
+ import { DagreGraphProps, GraphNodeDatum, GraphLinkDatum } from './types';
2
+ declare const _default: <N extends GraphNodeDatum = GraphNodeDatum, L extends GraphLinkDatum = GraphLinkDatum>(__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 onNodeClick?: ((node: N, event?: MouseEvent | undefined) => any) | undefined;
5
+ readonly onNodeMouseover?: ((node: N, event?: MouseEvent | undefined) => any) | undefined;
6
+ readonly onNodeMouseout?: ((node: N, event?: MouseEvent | undefined) => any) | undefined;
7
+ readonly onLinkClick?: ((link: L, event?: MouseEvent | undefined) => any) | undefined;
8
+ readonly onLinkMouseover?: ((link: L, event?: MouseEvent | undefined) => any) | undefined;
9
+ readonly onLinkMouseout?: ((link: L, event?: MouseEvent | undefined) => any) | undefined;
10
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onNodeClick" | "onNodeMouseover" | "onNodeMouseout" | "onLinkClick" | "onLinkMouseover" | "onLinkMouseout"> & DagreGraphProps<N, L> & Partial<{}>> & import('vue').PublicProps;
11
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
12
+ attrs: any;
13
+ slots: {
14
+ tooltip?(_: {
15
+ node: N | undefined;
16
+ }): any;
17
+ fallback?(_: {}): any;
18
+ };
19
+ emit: {
20
+ (e: "nodeClick", node: N, event?: MouseEvent): void;
21
+ (e: "nodeMouseover", node: N, event?: MouseEvent): void;
22
+ (e: "nodeMouseout", node: N, event?: MouseEvent): void;
23
+ (e: "linkClick", link: L, event?: MouseEvent): void;
24
+ (e: "linkMouseover", link: L, event?: MouseEvent): void;
25
+ (e: "linkMouseout", link: L, event?: MouseEvent): void;
26
+ };
27
+ }>) => import('vue').VNode & {
28
+ __ctx?: Awaited<typeof __VLS_setup>;
29
+ };
30
+ export default _default;
31
+ type __VLS_PrettifyLocal<T> = {
32
+ [K in keyof T]: T[K];
33
+ } & {};
@@ -0,0 +1,4 @@
1
+ import f from "./DagreGraph.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,253 @@
1
+ import { BulletLegendItemInterface, TooltipConfig, LegendPosition } from '../../types';
2
+ /**
3
+ * Dagre layout direction options
4
+ */
5
+ export type DagreRankDir = "TB" | "BT" | "LR" | "RL";
6
+ /**
7
+ * Dagre layout alignment options
8
+ */
9
+ export type DagreAlign = "UL" | "UR" | "DL" | "DR";
10
+ /**
11
+ * Dagre ranking algorithm options
12
+ */
13
+ export type DagreRanker = "network-simplex" | "tight-tree" | "longest-path";
14
+ /**
15
+ * Node shape options
16
+ */
17
+ export type NodeShape = "circle" | "square" | "triangle" | "diamond";
18
+ /**
19
+ * Link arrow position options
20
+ */
21
+ export type LinkArrowPosition = "start" | "end" | "both" | "none";
22
+ /**
23
+ * Configuration for Dagre layout algorithm
24
+ */
25
+ export interface DagreLayoutSettings {
26
+ /**
27
+ * Direction of the layout: 'TB' (top-to-bottom), 'BT' (bottom-to-top),
28
+ * 'LR' (left-to-right), 'RL' (right-to-left)
29
+ * @default 'TB'
30
+ */
31
+ rankdir?: DagreRankDir;
32
+ /**
33
+ * Alignment of nodes: 'UL' (up-left), 'UR' (up-right), 'DL' (down-left), 'DR' (down-right)
34
+ */
35
+ align?: DagreAlign;
36
+ /**
37
+ * Horizontal spacing between nodes in pixels
38
+ * @default 50
39
+ */
40
+ nodesep?: number;
41
+ /**
42
+ * Spacing between edges in pixels
43
+ * @default 10
44
+ */
45
+ edgesep?: number;
46
+ /**
47
+ * Vertical spacing between ranks in pixels
48
+ * @default 50
49
+ */
50
+ ranksep?: number;
51
+ /**
52
+ * Algorithm to use for ranking nodes
53
+ * @default 'network-simplex'
54
+ */
55
+ ranker?: DagreRanker;
56
+ /**
57
+ * Horizontal margin in pixels
58
+ * @default 0
59
+ */
60
+ marginx?: number;
61
+ /**
62
+ * Vertical margin in pixels
63
+ * @default 0
64
+ */
65
+ marginy?: number;
66
+ }
67
+ /**
68
+ * Node data structure for the graph
69
+ */
70
+ export interface GraphNodeDatum {
71
+ /**
72
+ * Unique identifier for the node
73
+ */
74
+ id: string;
75
+ /**
76
+ * Display label for the node
77
+ */
78
+ label?: string;
79
+ /**
80
+ * Node level (for hierarchical data)
81
+ */
82
+ level?: number;
83
+ /**
84
+ * Additional data associated with the node
85
+ */
86
+ [key: string]: any;
87
+ }
88
+ /**
89
+ * Link/Edge data structure for the graph
90
+ */
91
+ export interface GraphLinkDatum {
92
+ /**
93
+ * Source node ID
94
+ */
95
+ source: string;
96
+ /**
97
+ * Target node ID
98
+ */
99
+ target: string;
100
+ /**
101
+ * Label for the link
102
+ */
103
+ label?: string;
104
+ /**
105
+ * Additional data associated with the link
106
+ */
107
+ [key: string]: any;
108
+ }
109
+ /**
110
+ * Graph data structure containing nodes and links
111
+ */
112
+ export interface GraphData<N = GraphNodeDatum, L = GraphLinkDatum> {
113
+ /**
114
+ * Array of node data
115
+ */
116
+ nodes: N[];
117
+ /**
118
+ * Array of link data
119
+ */
120
+ links: L[];
121
+ }
122
+ /**
123
+ * Props for the DagreGraph component
124
+ */
125
+ export interface DagreGraphProps<N = GraphNodeDatum, L = GraphLinkDatum> {
126
+ /**
127
+ * The graph data containing nodes and links
128
+ */
129
+ data: GraphData<N, L>;
130
+ /**
131
+ * The height of the graph container in pixels
132
+ * @default 600
133
+ */
134
+ height?: number;
135
+ /**
136
+ * The width of the graph container in pixels
137
+ * @default undefined (auto)
138
+ */
139
+ width?: number;
140
+ /**
141
+ * Dagre layout configuration
142
+ */
143
+ dagreLayoutSettings?: DagreLayoutSettings;
144
+ /**
145
+ * Function or value to determine node size
146
+ * @default 40
147
+ */
148
+ nodeSize?: number | ((node: N, index: number) => number);
149
+ /**
150
+ * Function to extract node label
151
+ */
152
+ nodeLabel?: (node: N, index: number) => string;
153
+ /**
154
+ * Function or value to determine node shape
155
+ */
156
+ nodeShape?: NodeShape | ((node: N, index: number) => NodeShape);
157
+ /**
158
+ * Function or value to determine node fill color
159
+ */
160
+ nodeFill?: string | ((node: N, index: number) => string);
161
+ /**
162
+ * Function or value to determine node stroke color
163
+ */
164
+ nodeStroke?: string | ((node: N, index: number) => string);
165
+ /**
166
+ * Function or value to determine node stroke width
167
+ */
168
+ nodeStrokeWidth?: number | ((node: N, index: number) => number);
169
+ /**
170
+ * Link arrow configuration
171
+ * @default 'end'
172
+ */
173
+ linkArrow?: LinkArrowPosition;
174
+ /**
175
+ * Function to extract link label
176
+ */
177
+ linkLabel?: (link: L, index: number) => string;
178
+ /**
179
+ * Function or value to determine link color
180
+ */
181
+ linkStroke?: string | ((link: L, index: number) => string);
182
+ /**
183
+ * Function or value to determine link width
184
+ */
185
+ linkWidth?: number | ((link: L, index: number) => number);
186
+ /**
187
+ * Link curvature amount (0-1)
188
+ * @default 0
189
+ */
190
+ linkCurvature?: number;
191
+ /**
192
+ * Optional padding applied to the graph
193
+ */
194
+ padding?: {
195
+ top: number;
196
+ right: number;
197
+ bottom: number;
198
+ left: number;
199
+ };
200
+ /**
201
+ * If true, hides the tooltip
202
+ */
203
+ hideTooltip?: boolean;
204
+ /**
205
+ * Enable zoom and pan controls
206
+ * @default true
207
+ */
208
+ zoomEnabled?: boolean;
209
+ /**
210
+ * Zoom scale extent [min, max]
211
+ * @default [0.1, 10]
212
+ */
213
+ zoomScaleExtent?: [number, number];
214
+ /**
215
+ * Enable node dragging
216
+ * @default false
217
+ */
218
+ nodeDraggingEnabled?: boolean;
219
+ /**
220
+ * If true, hides the legend
221
+ */
222
+ hideLegend?: boolean;
223
+ /**
224
+ * Legend position
225
+ * @default LegendPosition.BottomCenter
226
+ */
227
+ legendPosition?: LegendPosition;
228
+ /**
229
+ * Legend style
230
+ */
231
+ legendStyle?: string | Record<string, string>;
232
+ /**
233
+ * Legend items configuration
234
+ */
235
+ legendItems?: BulletLegendItemInterface[];
236
+ /**
237
+ * Custom formatter for tooltip titles
238
+ */
239
+ tooltipTitleFormatter?: (node: N) => string | number;
240
+ /**
241
+ * Custom formatter for tooltip content
242
+ */
243
+ tooltipContentFormatter?: (node: N) => string;
244
+ /**
245
+ * Configuration object for the chart tooltip.
246
+ */
247
+ tooltip?: TooltipConfig;
248
+ /**
249
+ * Animation duration in milliseconds
250
+ * @default 600
251
+ */
252
+ duration?: number;
253
+ }
@@ -1,18 +1,18 @@
1
- import { defineComponent as B, useSlots as D, useTemplateRef as P, ref as W, computed as s, createElementBlock as p, openBlock as m, normalizeStyle as d, createVNode as a, createCommentVNode as v, createElementVNode as y, unref as r, withCtx as b, renderSlot as u } from "vue";
2
- import { Donut as N } from "@unovis/ts";
3
- import { DonutType as $ } from "./types.js";
4
- import j from "../Tooltip.js";
5
- import { VisSingleContainer as z, VisTooltip as H, VisDonut as E, VisBulletLegend as F } from "@unovis/vue";
6
- import { LegendPosition as O } from "../../types.js";
7
- const R = { style: {
1
+ import { defineComponent as L, useSlots as S, useTemplateRef as P, ref as W, computed as s, createElementBlock as y, openBlock as d, normalizeStyle as u, createVNode as a, createCommentVNode as c, createElementVNode as h, unref as i, withCtx as b, createBlock as N, renderSlot as f } from "vue";
2
+ import { Donut as $ } from "@unovis/ts";
3
+ import { DonutType as j } from "./types.js";
4
+ import z from "../Tooltip.js";
5
+ import { VisSingleContainer as H, VisTooltip as E, VisDonut as F, VisBulletLegend as O } from "@unovis/vue";
6
+ import { LegendPosition as R } from "../../types.js";
7
+ const M = { style: {
8
8
  position: "absolute",
9
9
  top: "50%",
10
10
  left: "50%",
11
11
  transform: "translate(-50%, -50%)"
12
- } }, M = {
12
+ } }, U = {
13
13
  ref: "slotWrapper",
14
14
  style: { display: "none" }
15
- }, K = /* @__PURE__ */ B({
15
+ }, X = /* @__PURE__ */ L({
16
16
  __name: "DonutChart",
17
17
  props: {
18
18
  type: {},
@@ -21,98 +21,108 @@ const R = { style: {
21
21
  height: {},
22
22
  radius: {},
23
23
  hideLegend: { type: Boolean },
24
- legendPosition: { default: O.BottomCenter },
24
+ legendPosition: { default: R.BottomCenter },
25
25
  legendStyle: {},
26
26
  categories: {},
27
27
  padAngle: {},
28
- tooltipTitleFormatter: {}
28
+ tooltipTitleFormatter: {},
29
+ hideTooltip: { type: Boolean },
30
+ tooltip: { default: () => ({
31
+ followCursor: !0
32
+ }) },
33
+ duration: { default: 600 }
29
34
  },
30
35
  emits: ["click"],
31
- setup(l, { emit: h }) {
32
- const C = h, t = l, k = D(), c = P("slotWrapper"), i = W(), T = (e) => e, V = t.type === $.Half;
33
- function x(e) {
34
- const o = Object.values(t.categories)[e.index].name;
35
- return i.value = {
36
+ setup(l, { emit: v }) {
37
+ const C = v, e = l, w = S(), g = P("slotWrapper"), n = W(), k = (t) => t, T = e.type === j.Half;
38
+ function V(t) {
39
+ const o = Object.values(e.categories)[t.index].name;
40
+ return n.value = {
36
41
  label: o,
37
- [o]: e.data
38
- }, A();
42
+ [o]: t.data
43
+ }, x();
39
44
  }
40
- function A() {
41
- return typeof window > "u" ? "" : c.value ? c.value.innerHTML : "";
45
+ function x() {
46
+ return typeof window > "u" ? "" : g.value ? g.value.innerHTML : "";
42
47
  }
43
- const L = s(() => t.legendPosition.includes("top")), S = s(() => t.legendPosition.includes("left") ? "flex-start" : t.legendPosition.includes("right") ? "flex-end" : "center"), g = (e, o = "#ccc") => e ? Array.isArray(e) ? e[0] || o : e : o, f = s(() => Object.values(t.categories)), w = (e, o) => {
44
- const n = f.value[o];
45
- if (n)
46
- return g(n.color);
48
+ const B = s(() => e.legendPosition.includes("top")), D = s(() => e.legendPosition.includes("left") ? "flex-start" : e.legendPosition.includes("right") ? "flex-end" : "center"), p = (t, o = "#ccc") => t ? Array.isArray(t) ? t[0] || o : t : o, m = s(() => Object.values(e.categories)), A = (t, o) => {
49
+ const r = m.value[o];
50
+ if (r)
51
+ return p(r.color);
47
52
  };
48
- return (e, o) => (m(), p("div", {
49
- style: d({
53
+ return (t, o) => (d(), y("div", {
54
+ style: u({
50
55
  display: "flex",
51
- flexDirection: L.value ? "column-reverse" : "column",
56
+ flexDirection: B.value ? "column-reverse" : "column",
52
57
  gap: "var(--vis-legend-spacing)"
53
58
  }),
54
- onClick: o[0] || (o[0] = (n) => C("click", n, i.value))
59
+ onClick: o[0] || (o[0] = (r) => C("click", r, n.value))
55
60
  }, [
56
- a(r(z), {
61
+ a(i(H), {
57
62
  data: l.data,
58
63
  height: l.height,
64
+ duration: l.duration,
59
65
  margin: {}
60
66
  }, {
61
67
  default: b(() => [
62
- a(r(H), {
68
+ l.hideTooltip ? c("", !0) : (d(), N(i(E), {
69
+ key: 0,
63
70
  "horizontal-shift": 20,
64
71
  "vertical-shift": 20,
72
+ followCursor: e.tooltip.followCursor,
73
+ "show-delay": e.tooltip.showDelay,
74
+ "hide-delay": e.tooltip.hideDelay,
65
75
  triggers: {
66
- [r(N).selectors.segment]: x
76
+ [i($).selectors.segment]: V
67
77
  }
68
- }, null, 8, ["triggers"]),
69
- a(r(E), {
70
- value: T,
78
+ }, null, 8, ["followCursor", "show-delay", "hide-delay", "triggers"])),
79
+ a(i(F), {
80
+ value: k,
71
81
  "corner-radius": l.radius,
72
82
  "arc-width": l.arcWidth ?? 20,
73
- color: w,
74
- "angle-range": V ? [-1.5707963267948966, 1.5707963267948966] : [],
75
- "pad-angle": t.padAngle || 0
83
+ color: A,
84
+ "angle-range": T ? [-1.5707963267948966, 1.5707963267948966] : [],
85
+ "pad-angle": e.padAngle || 0
76
86
  }, null, 8, ["corner-radius", "arc-width", "angle-range", "pad-angle"]),
77
- y("div", R, [
78
- u(e.$slots, "default")
87
+ h("div", M, [
88
+ f(t.$slots, "default")
79
89
  ])
80
90
  ]),
81
91
  _: 3
82
- }, 8, ["data", "height"]),
83
- t.hideLegend ? v("", !0) : (m(), p("div", {
92
+ }, 8, ["data", "height", "duration"]),
93
+ e.hideLegend ? c("", !0) : (d(), y("div", {
84
94
  key: 0,
85
- style: d({
95
+ style: u({
86
96
  display: "flex",
87
- justifyContent: S.value
97
+ justifyContent: D.value
88
98
  })
89
99
  }, [
90
- a(r(F), {
91
- style: d([
92
- t.legendStyle,
100
+ a(i(O), {
101
+ style: u([
102
+ e.legendStyle,
93
103
  "display: flex; gap: var(--vis-legend-spacing);"
94
104
  ]),
95
- items: f.value.map((n) => ({
96
- ...n,
97
- color: g(n.color)
105
+ items: m.value.map((r) => ({
106
+ ...r,
107
+ color: p(r.color)
98
108
  }))
99
109
  }, null, 8, ["style", "items"])
100
110
  ], 4)),
101
- y("div", M, [
102
- r(k).tooltip ? u(e.$slots, "tooltip", {
111
+ h("div", U, [
112
+ i(w).tooltip ? f(t.$slots, "tooltip", {
103
113
  key: 0,
104
- values: i.value
105
- }) : i.value ? u(e.$slots, "fallback", { key: 1 }, () => [
106
- a(j, {
107
- data: i.value,
108
- categories: t.categories,
109
- "title-formatter": t.tooltipTitleFormatter
114
+ values: n.value
115
+ }) : n.value ? f(t.$slots, "fallback", { key: 1 }, () => [
116
+ a(z, {
117
+ data: n.value,
118
+ categories: e.categories,
119
+ "title-formatter": e.tooltipTitleFormatter
110
120
  }, null, 8, ["data", "categories", "title-formatter"])
111
- ]) : v("", !0)
121
+ ]) : c("", !0)
112
122
  ], 512)
113
123
  ], 4));
114
124
  }
115
125
  });
116
126
  export {
117
- K as default
127
+ X as default
118
128
  };
@@ -1,4 +1,4 @@
1
- import { BulletLegendItemInterface, LegendPosition } from '../../types';
1
+ import { BulletLegendItemInterface, LegendPosition, TooltipConfig } from '../../types';
2
2
  export type DonutChartProps<T> = {
3
3
  /**
4
4
  * The type of donut chart to render.
@@ -17,7 +17,7 @@ export type DonutChartProps<T> = {
17
17
  /**
18
18
  * The height of the chart in pixels.
19
19
  */
20
- height: number;
20
+ height?: number;
21
21
  /**
22
22
  * The radius of the donut in pixels.
23
23
  */
@@ -48,6 +48,18 @@ export type DonutChartProps<T> = {
48
48
  * Use custom formatter for tooltip titles
49
49
  */
50
50
  tooltipTitleFormatter?: (data: T) => string | number;
51
+ /**
52
+ * If `true`, hides the chart tooltip.
53
+ */
54
+ hideTooltip?: boolean;
55
+ /**
56
+ * Configuration object for the chart tooltip.
57
+ */
58
+ tooltip?: TooltipConfig;
59
+ /**
60
+ * Animation duration in milliseconds.
61
+ */
62
+ duration?: number;
51
63
  };
52
64
  declare enum DonutType {
53
65
  Half = "half",