vue-chrts 2.1.0-beta-2 → 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 (159) hide show
  1. package/dist/components/AreaChart/AreaChart.js +127 -107
  2. package/dist/components/AreaChart/types.d.ts +34 -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 +33 -24
  8. package/dist/components/DagreGraph/types.d.ts +5 -1
  9. package/dist/components/DonutChart/DonutChart.js +69 -59
  10. package/dist/components/DonutChart/types.d.ts +14 -2
  11. package/dist/components/DualChart/DualChart.js +56 -46
  12. package/dist/components/DualChart/types.d.ts +10 -1
  13. package/dist/components/GanttChart/GanttChart.js +58 -48
  14. package/dist/components/GanttChart/types.d.ts +9 -1
  15. package/dist/components/LineChart/LineChart.js +17 -9
  16. package/dist/components/Maps/DottedMap/DottedMap.js +170 -0
  17. package/dist/components/Maps/DottedMap/DottedMap.vue.d.ts +52 -0
  18. package/dist/components/Maps/DottedMap/DottedMap2.js +4 -0
  19. package/dist/components/Maps/DottedMap/MapLegend.vue.d.ts +6 -0
  20. package/dist/components/Maps/DottedMap/MapZoomControls.js +44 -0
  21. package/dist/components/Maps/DottedMap/MapZoomControls.vue.d.ts +13 -0
  22. package/dist/components/Maps/DottedMap/MapZoomControls2.js +4 -0
  23. package/dist/components/Maps/DottedMap/core.js +122 -0
  24. package/dist/components/Maps/DottedMap/core.vue.d.ts +36 -0
  25. package/dist/components/Maps/DottedMap/core2.js +4 -0
  26. package/dist/components/Maps/DottedMap/mapUtils.d.ts +49 -0
  27. package/dist/components/Maps/DottedMap/mapUtils.js +130 -0
  28. package/dist/components/Maps/DottedMap/pins.d.ts +9 -0
  29. package/dist/components/Maps/DottedMap/pins.js +58 -0
  30. package/dist/components/Maps/DottedMap/regions.d.ts +4 -0
  31. package/dist/components/Maps/DottedMap/regions.js +66 -0
  32. package/dist/components/Maps/DottedMap/types.d.ts +127 -0
  33. package/dist/components/Maps/DottedMap/useMapPanZoom.d.ts +22 -0
  34. package/dist/components/Maps/DottedMap/useMapPanZoom.js +41 -0
  35. package/dist/components/Maps/TopoJSONMap/TopoJSONMap.js +170 -0
  36. package/dist/components/Maps/TopoJSONMap/TopoJSONMap.vue.d.ts +30 -0
  37. package/dist/components/Maps/TopoJSONMap/TopoJSONMap2.js +4 -0
  38. package/dist/components/Maps/TopoJSONMap/data.d.ts +13 -0
  39. package/dist/components/Maps/TopoJSONMap/types.d.ts +40 -0
  40. package/dist/components/Maps/types.d.ts +48 -0
  41. package/dist/components/SankeyChart/SankeyChart.js +50 -40
  42. package/dist/components/SankeyChart/SankeyChart.vue.d.ts +1 -1
  43. package/dist/components/SankeyChart/types.d.ts +14 -1
  44. package/dist/components/Tooltip.js +32 -27
  45. package/dist/data/countries.geo.json.js +9 -0
  46. package/dist/index.d.ts +6 -3
  47. package/dist/index.js +27 -23
  48. 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
  49. package/dist/node_modules/.pnpm/@turf_invariant@7.3.1/node_modules/@turf/invariant/dist/esm/index.js +20 -0
  50. package/dist/node_modules/.pnpm/mgrs@1.0.0/node_modules/mgrs/mgrs.js +222 -0
  51. package/dist/node_modules/.pnpm/point-in-polygon-hao@1.2.4/node_modules/point-in-polygon-hao/dist/esm/index.js +25 -0
  52. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/Point.js +24 -0
  53. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/Proj.js +46 -0
  54. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/adjust_axis.js +31 -0
  55. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/checkSanity.js +15 -0
  56. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/adjust_lat.js +8 -0
  57. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/adjust_lon.js +8 -0
  58. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/adjust_zone.js +13 -0
  59. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/asinhy.js +9 -0
  60. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/asinz.js +6 -0
  61. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/clens.js +8 -0
  62. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/clens_cmplx.js +10 -0
  63. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/cosh.js +7 -0
  64. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/e0fn.js +6 -0
  65. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/e1fn.js +6 -0
  66. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/e2fn.js +6 -0
  67. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/e3fn.js +6 -0
  68. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/gN.js +7 -0
  69. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/gatg.js +8 -0
  70. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/hypot.js +8 -0
  71. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/imlfn.js +11 -0
  72. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/iqsfnz.js +13 -0
  73. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/log1py.js +7 -0
  74. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/mlfn.js +6 -0
  75. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/msfnz.js +7 -0
  76. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/phi2z.js +10 -0
  77. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/pj_enfn.js +10 -0
  78. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/pj_inv_mlfn.js +14 -0
  79. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/pj_mlfn.js +6 -0
  80. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/qsfnz.js +7 -0
  81. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/sign.js +6 -0
  82. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/sinh.js +7 -0
  83. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/srat.js +6 -0
  84. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/toPoint.js +10 -0
  85. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/tsfnz.js +8 -0
  86. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/vincenty.js +33 -0
  87. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/Datum.js +1278 -0
  88. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/Ellipsoid.js +226 -0
  89. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/PrimeMeridian.js +17 -0
  90. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/units.js +25 -0
  91. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/values.js +22 -0
  92. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/core.js +65 -0
  93. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/datum.js +8 -0
  94. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/datumUtils.js +82 -0
  95. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/datum_transform.js +94 -0
  96. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/defs.js +39 -0
  97. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/deriveConstants.js +30 -0
  98. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/extend.js +12 -0
  99. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/global.js +9 -0
  100. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/index.js +25 -0
  101. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/match.js +11 -0
  102. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/nadgrid.js +128 -0
  103. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/parseCode.js +47 -0
  104. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projString.js +119 -0
  105. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/aea.js +43 -0
  106. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/aeqd.js +36 -0
  107. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/bonne.js +55 -0
  108. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/cass.js +52 -0
  109. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/cea.js +36 -0
  110. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/eqc.js +27 -0
  111. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/eqdc.js +48 -0
  112. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/eqearth.js +30 -0
  113. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/etmerc.js +54 -0
  114. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/gauss.js +27 -0
  115. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/geocent.js +26 -0
  116. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/geos.js +49 -0
  117. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/gnom.js +28 -0
  118. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/krovak.js +31 -0
  119. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/laea.js +134 -0
  120. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/lcc.js +61 -0
  121. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/longlat.js +19 -0
  122. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/merc.js +49 -0
  123. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/mill.js +26 -0
  124. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/moll.js +37 -0
  125. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/nzmg.js +48 -0
  126. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/ob_tran.js +173 -0
  127. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/omerc.js +58 -0
  128. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/ortho.js +28 -0
  129. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/poly.js +68 -0
  130. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/qsc.js +67 -0
  131. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/robin.js +104 -0
  132. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/sinu.js +47 -0
  133. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/somerc.js +34 -0
  134. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/stere.js +46 -0
  135. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/sterea.js +33 -0
  136. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/tmerc.js +60 -0
  137. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/tpers.js +110 -0
  138. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/utm.js +22 -0
  139. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/vandg.js +34 -0
  140. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections.js +34 -0
  141. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/transform.js +49 -0
  142. package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/projs.js +38 -0
  143. package/dist/node_modules/.pnpm/robust-predicates@3.0.2/node_modules/robust-predicates/esm/orient2d.js +23 -0
  144. package/dist/node_modules/.pnpm/robust-predicates@3.0.2/node_modules/robust-predicates/esm/util.js +30 -0
  145. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/PROJJSONBuilder2015.js +9 -0
  146. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/PROJJSONBuilder2019.js +20 -0
  147. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/PROJJSONBuilderBase.js +171 -0
  148. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/buildPROJJSON.js +11 -0
  149. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/detectWKTVersion.js +7 -0
  150. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/index.js +104 -0
  151. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/parser.js +117 -0
  152. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/process.js +89 -0
  153. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/transformPROJJSON.js +73 -0
  154. package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/util.js +12 -0
  155. package/dist/types.d.ts +60 -13
  156. package/dist/types.js +4 -6
  157. package/dist/utils/geoJsonToGrid.d.ts +14 -0
  158. package/dist/utils/index.d.ts +1 -0
  159. package/package.json +8 -2
@@ -0,0 +1,40 @@
1
+ import { GeoProjection } from 'd3-geo';
2
+ import { axisFormatter, BulletLegendItemInterface, LegendPosition } from '../../../types';
3
+ import { MapData, MapPoint } from '../types';
4
+ export type MapsData<T extends Record<string, any>> = {
5
+ mapFeatureKey: keyof T;
6
+ data: MapData;
7
+ topojson: any;
8
+ zoomFactor?: number;
9
+ zoomExtent?: [number, number];
10
+ projection?: GeoProjection;
11
+ areaColor?: string | ((d: any) => string);
12
+ areaCursor?: string | ((d: any) => string);
13
+ pointColor?: string | ((d: MapPoint) => string);
14
+ pointSize?: number | ((d: MapPoint) => number);
15
+ pointLabel?: (d: MapPoint) => string;
16
+ pointCursor?: string | ((d: MapPoint) => string);
17
+ linkColor?: string | ((d: any) => string);
18
+ linkWidth?: number | ((d: any) => number);
19
+ linkCursor?: string | ((d: any) => string);
20
+ height?: string | number;
21
+ width?: string | number;
22
+ fitView?: boolean;
23
+ fitViewPadding?: number;
24
+ hideTooltip?: boolean;
25
+ tooltipTitleFormatter?: (data: T) => string | number;
26
+ yFormatter?: axisFormatter;
27
+ categories?: Record<string, BulletLegendItemInterface>;
28
+ legendPosition?: LegendPosition;
29
+ legendStyle?: any;
30
+ hideLegend?: boolean;
31
+ duration?: number;
32
+ pointStrokeWidth?: number | ((d: MapPoint) => number);
33
+ mapFitToPoints?: boolean;
34
+ padding?: {
35
+ top: number;
36
+ right: number;
37
+ bottom: number;
38
+ left: number;
39
+ };
40
+ };
@@ -0,0 +1,48 @@
1
+ export type MapPoint = {
2
+ id: string;
3
+ latitude: number;
4
+ longitude: number;
5
+ color?: string;
6
+ [key: string]: any;
7
+ };
8
+ export type MapLink = {
9
+ source: string | number | MapPoint;
10
+ target: string | number | MapPoint;
11
+ color?: string;
12
+ width?: number;
13
+ };
14
+ export type MapArea = {
15
+ id: string;
16
+ color?: string;
17
+ [key: string]: any;
18
+ };
19
+ export type MapData = {
20
+ points?: MapPoint[];
21
+ links?: MapLink[];
22
+ areas?: MapArea[];
23
+ };
24
+ export interface TopoJSONMapProps {
25
+ mapType: 'uk' | 'france' | 'usa';
26
+ data: MapData;
27
+ width?: number;
28
+ height?: number;
29
+ disableZoom?: boolean;
30
+ zoomFactor?: number;
31
+ zoomExtent?: [number, number];
32
+ zoomDuration?: number;
33
+ mapFitToPoints?: boolean;
34
+ pointColor?: string | ((d: MapPoint) => string);
35
+ pointRadius?: number | ((d: MapPoint) => number);
36
+ pointStrokeWidth?: number | ((d: MapPoint) => number);
37
+ pointCursor?: string | ((d: MapPoint) => string);
38
+ pointLabel?: (d: MapPoint) => string;
39
+ linkColor?: string | ((d: MapLink) => string);
40
+ linkWidth?: number | ((d: MapLink) => number);
41
+ linkCursor?: string | ((d: MapLink) => string);
42
+ areaColor?: string | ((d: MapArea) => string);
43
+ areaCursor?: string | ((d: MapArea) => string);
44
+ heatmapMode?: boolean;
45
+ heatmapModeBlurStdDeviation?: number;
46
+ heatmapModeZoomLevelThreshold?: number;
47
+ projection?: any;
48
+ }
@@ -1,12 +1,12 @@
1
- import { defineComponent as W, useSlots as x, useTemplateRef as V, ref as L, computed as g, createElementBlock as u, openBlock as f, normalizeStyle as d, createVNode as n, createCommentVNode as c, createElementVNode as P, unref as o, withCtx as A, renderSlot as h } from "vue";
2
- import { VisSingleContainer as N, VisTooltip as p, VisSankey as B, VisBulletLegend as H } from "@unovis/vue";
3
- import z from "../Tooltip.js";
4
- import { LegendPosition as M } from "../../types.js";
5
- import { SankeyNodeAlign as O, Sankey as F } from "@unovis/ts";
6
- const T = {
1
+ import { defineComponent as W, useSlots as x, useTemplateRef as V, ref as L, computed as f, createElementBlock as c, openBlock as d, normalizeStyle as r, createVNode as a, createCommentVNode as s, createElementVNode as p, unref as o, withCtx as P, createBlock as w, renderSlot as h } from "vue";
2
+ import { SankeyNodeAlign as A, Sankey as B } from "@unovis/ts";
3
+ import { VisSingleContainer as N, VisTooltip as H, VisSankey as T, VisBulletLegend as z } from "@unovis/vue";
4
+ import M from "../Tooltip.js";
5
+ import { LegendPosition as O } from "../../types.js";
6
+ const F = {
7
7
  ref: "slotWrapper",
8
8
  style: { display: "none" }
9
- }, D = /* @__PURE__ */ W({
9
+ }, J = /* @__PURE__ */ W({
10
10
  __name: "SankeyChart",
11
11
  props: {
12
12
  data: {},
@@ -19,7 +19,7 @@ const T = {
19
19
  }) },
20
20
  categories: {},
21
21
  hideLegend: { type: Boolean, default: !1 },
22
- legendPosition: { default: M.BottomCenter },
22
+ legendPosition: { default: O.BottomCenter },
23
23
  legendStyle: { default: void 0 },
24
24
  label: {},
25
25
  subLabel: {},
@@ -27,44 +27,54 @@ const T = {
27
27
  linkColor: {},
28
28
  linkValue: {},
29
29
  nodeWidth: { default: 10 },
30
- nodeAlign: { default: O.Justify },
30
+ nodeAlign: { default: A.Justify },
31
31
  nodePadding: { default: 10 },
32
32
  nodeSort: {},
33
33
  linkSort: {},
34
34
  iterations: { default: 32 },
35
+ hideTooltip: { type: Boolean },
36
+ tooltip: { default: () => ({
37
+ followCursor: !0
38
+ }) },
35
39
  highlightSubtreeOnHover: { type: Boolean, default: !1 },
36
40
  labelFontSize: {},
37
41
  labelColor: {},
38
- labelMaxWidth: { default: 70 }
42
+ labelMaxWidth: { default: 70 },
43
+ duration: { default: 600 }
39
44
  },
40
45
  emits: ["click"],
41
- setup(e, { emit: b }) {
42
- const m = b, t = e, S = x(), k = V("slotWrapper"), i = L(), y = g(() => t.legendPosition.startsWith("top")), v = g(() => t.legendPosition.includes("left") ? "flex-start" : t.legendPosition.includes("right") ? "flex-end" : "center");
43
- function C(a) {
44
- i.value = a;
46
+ setup(e, { emit: y }) {
47
+ const b = y, t = e, m = x(), k = V("slotWrapper"), i = L(), S = f(() => t.legendPosition.startsWith("top")), C = f(() => t.legendPosition.includes("left") ? "flex-start" : t.legendPosition.includes("right") ? "flex-end" : "center");
48
+ function v(n) {
49
+ i.value = n;
45
50
  }
46
- return (a, r) => (f(), u("div", {
47
- style: d({
51
+ return (n, u) => (d(), c("div", {
52
+ style: r({
48
53
  display: "flex",
49
- flexDirection: y.value ? "column-reverse" : "column",
54
+ flexDirection: S.value ? "column-reverse" : "column",
50
55
  gap: "var(--vis-legend-spacing)"
51
56
  }),
52
- onClick: r[0] || (r[0] = (l) => m("click", l))
57
+ onClick: u[0] || (u[0] = (l) => b("click", l))
53
58
  }, [
54
- n(o(N), {
59
+ a(o(N), {
55
60
  padding: e.padding,
56
- height: e.height
61
+ height: e.height,
62
+ duration: e.duration
57
63
  }, {
58
- default: A(() => [
59
- n(o(p), {
64
+ default: P(() => [
65
+ e.hideTooltip ? s("", !0) : (d(), w(o(H), {
66
+ key: 0,
67
+ followCursor: t.tooltip.followCursor,
68
+ "show-delay": t.tooltip.showDelay,
69
+ "hide-delay": t.tooltip.hideDelay,
60
70
  triggers: {
61
- [o(F).selectors.node]: (l) => {
62
- var s;
63
- return C(l), l ? (s = k.value) == null ? void 0 : s.innerHTML : "";
71
+ [o(B).selectors.node]: (l) => {
72
+ var g;
73
+ return v(l), l ? (g = k.value) == null ? void 0 : g.innerHTML : "";
64
74
  }
65
75
  }
66
- }, null, 8, ["triggers"]),
67
- n(o(B), {
76
+ }, null, 8, ["followCursor", "show-delay", "hide-delay", "triggers"])),
77
+ a(o(T), {
68
78
  data: e.data,
69
79
  label: e.label,
70
80
  subLabel: e.subLabel,
@@ -84,16 +94,16 @@ const T = {
84
94
  }, null, 8, ["data", "label", "subLabel", "nodeColor", "linkColor", "linkValue", "nodeWidth", "nodeAlign", "nodePadding", "nodeSort", "linkSort", "iterations", "highlightSubtreeOnHover", "labelFontSize", "labelColor", "labelMaxWidth"])
85
95
  ]),
86
96
  _: 1
87
- }, 8, ["padding", "height"]),
88
- !t.hideLegend && t.categories ? (f(), u("div", {
97
+ }, 8, ["padding", "height", "duration"]),
98
+ !t.hideLegend && t.categories ? (d(), c("div", {
89
99
  key: 0,
90
- style: d({
100
+ style: r({
91
101
  display: "flex",
92
- justifyContent: v.value
102
+ justifyContent: C.value
93
103
  })
94
104
  }, [
95
- n(o(H), {
96
- style: d([
105
+ a(o(z), {
106
+ style: r([
97
107
  t.legendStyle,
98
108
  "display: flex; gap: var(--vis-legend-spacing);"
99
109
  ]),
@@ -102,22 +112,22 @@ const T = {
102
112
  color: Array.isArray(l.color) ? l.color[0] : l.color
103
113
  }))
104
114
  }, null, 8, ["style", "items"])
105
- ], 4)) : c("", !0),
106
- P("div", T, [
107
- o(S).tooltip ? h(a.$slots, "tooltip", {
115
+ ], 4)) : s("", !0),
116
+ p("div", F, [
117
+ o(m).tooltip ? h(n.$slots, "tooltip", {
108
118
  key: 0,
109
119
  node: i.value
110
- }) : i.value ? h(a.$slots, "fallback", { key: 1 }, () => [
111
- n(z, {
120
+ }) : i.value ? h(n.$slots, "fallback", { key: 1 }, () => [
121
+ a(M, {
112
122
  data: i.value,
113
123
  categories: t.categories ?? {},
114
124
  "title-formatter": (l) => l.label || l.id || "Node"
115
125
  }, null, 8, ["data", "categories", "title-formatter"])
116
- ]) : c("", !0)
126
+ ]) : s("", !0)
117
127
  ], 512)
118
128
  ], 4));
119
129
  }
120
130
  });
121
131
  export {
122
- D as default
132
+ J as default
123
133
  };
@@ -1,4 +1,4 @@
1
- import { SankeyInputLink, SankeyInputNode } from '../../types';
1
+ import { SankeyInputNode, SankeyInputLink } from '@unovis/ts';
2
2
  import { SankeyChartProps } from './types';
3
3
  declare const _default: <N extends SankeyInputNode, L extends SankeyInputLink>(__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<{
4
4
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
@@ -1,4 +1,5 @@
1
- import { BulletLegendItemInterface, LegendPosition, SankeyInputLink, SankeyInputNode, SankeyNodeAlign } from '../../types';
1
+ import { BulletLegendItemInterface, LegendPosition, TooltipConfig } from '../../types';
2
+ import { SankeyInputNode, SankeyInputLink, SankeyNodeAlign } from '@unovis/ts';
2
3
  export type SankeyChartProps<N extends SankeyInputNode, L extends SankeyInputLink> = {
3
4
  /**
4
5
  * The data to be displayed in the Sankey diagram.
@@ -84,6 +85,14 @@ export type SankeyChartProps<N extends SankeyInputNode, L extends SankeyInputLin
84
85
  * Sankey algorithm iterations. Default: 32
85
86
  */
86
87
  iterations?: number;
88
+ /**
89
+ * If `true`, hides the chart tooltip.
90
+ */
91
+ hideTooltip?: boolean;
92
+ /**
93
+ * Configuration object for the chart tooltip.
94
+ */
95
+ tooltip?: TooltipConfig;
87
96
  /**
88
97
  * Highlight the corresponding subtree on node / link hover. Default: false
89
98
  */
@@ -100,4 +109,8 @@ export type SankeyChartProps<N extends SankeyInputNode, L extends SankeyInputLin
100
109
  * Maximum label width in pixels. Default: 70
101
110
  */
102
111
  labelMaxWidth?: number;
112
+ /**
113
+ * Animation duration in milliseconds.
114
+ */
115
+ duration?: number;
103
116
  };
@@ -1,6 +1,6 @@
1
- import { defineComponent as F, computed as m, createElementBlock as n, openBlock as s, createElementVNode as r, toDisplayString as c, Fragment as p, renderList as z, normalizeStyle as w } from "vue";
2
- import { getFirstPropertyValue as B } from "../utils.js";
3
- const C = /* @__PURE__ */ F({
1
+ import { defineComponent as w, computed as l, createElementBlock as a, openBlock as n, createElementVNode as s, createCommentVNode as k, normalizeStyle as d, toDisplayString as m, Fragment as g, renderList as B } from "vue";
2
+ import { getFirstPropertyValue as C } from "../utils.js";
3
+ const _ = /* @__PURE__ */ w({
4
4
  __name: "Tooltip",
5
5
  props: {
6
6
  data: {},
@@ -8,42 +8,42 @@ const C = /* @__PURE__ */ F({
8
8
  titleFormatter: { type: Function },
9
9
  yFormatter: { type: Function }
10
10
  },
11
- setup(l) {
12
- const t = l, v = m(
13
- () => t.titleFormatter ? t.titleFormatter(t.data) : B(t.data)
14
- ), d = ["_index", "_stacked", "_ending"], g = m(() => Object.entries(t.data ?? []).filter(
15
- ([e, a]) => !d.includes(e) && Object.keys(t.categories).includes(e)
16
- )), u = {
11
+ setup(r) {
12
+ const t = r, u = l(
13
+ () => t.titleFormatter ? t.titleFormatter(t.data) : C(t.data)
14
+ ), f = ["_index", "_stacked", "_ending"], p = l(() => Object.entries(t.data ?? []).filter(
15
+ ([e, v]) => !f.includes(e) && Object.keys(t.categories).includes(e)
16
+ )), c = l(() => p.value.length > 0), y = {
17
17
  display: "flex",
18
18
  flexDirection: "column"
19
- }, f = {
19
+ }, h = l(() => ({
20
20
  color: "var(--vis-tooltip-title-color, #000)",
21
21
  textTransform: "var(--vis-tooltip-title-text-transform, capitalize)",
22
- borderBottom: "var(--vis-tooltip-title-border-bottom, 1px solid #e5e7eb)",
22
+ borderBottom: c.value ? "var(--vis-tooltip-title-border-bottom, 1px solid #e5e7eb)" : "none",
23
23
  padding: "var(--vis-tooltip-title-padding, 0.75rem 0.75rem 0.5rem 0.75rem)",
24
- margin: "var(--vis-tooltip-title-margin, 0 0 0.25rem 0)",
24
+ margin: c.value ? "var(--vis-tooltip-title-margin, 0 0 0.25rem 0)" : "0",
25
25
  fontSize: "var(--vis-tooltip-title-font-size, 0.875rem)",
26
26
  lineHeight: "var(--vis-tooltip-title-line-height, 100%)",
27
27
  fontWeight: "var(--vis-tooltip-title-font-weight, 600)"
28
- }, y = {
28
+ })), b = {
29
29
  display: "grid",
30
30
  gridTemplateColumns: "auto 1fr auto",
31
31
  alignItems: "center",
32
32
  gap: "var(--vis-tooltip-content-gap, 0.25rem 0.5rem)",
33
33
  padding: "var(--vis-tooltip-content-padding, 0 0.75rem 0.5rem 0.75rem)"
34
- }, h = {
34
+ }, x = {
35
35
  fontWeight: "var(--vis-tooltip-label-font-weight, 400)",
36
36
  fontSize: "var(--vis-tooltip-label-font-size, 0.875rem)",
37
37
  color: "var(--vis-tooltip-label-color, inherit)",
38
38
  margin: "var(--vis-tooltip-label-margin, 0 1rem 0 0)",
39
39
  whiteSpace: "nowrap"
40
- }, b = {
40
+ }, S = {
41
41
  fontSize: "var(--vis-tooltip-value-font-size, 0.875rem)",
42
42
  fontWeight: "var(--vis-tooltip-value-font-weight, 600)",
43
43
  color: "var(--vis-tooltip-value-color, inherit)",
44
44
  textAlign: "right",
45
45
  fontVariantNumeric: "tabular-nums"
46
- }, x = (e, a) => {
46
+ }, F = (e, v) => {
47
47
  var o, i;
48
48
  return {
49
49
  width: "8px",
@@ -52,23 +52,28 @@ const C = /* @__PURE__ */ F({
52
52
  borderRadius: "var(--vis-tooltip-dot-border-radius, 4px)",
53
53
  margin: "var(--vis-tooltip-dot-margin, 0)",
54
54
  flexShrink: "0",
55
- backgroundColor: typeof ((o = t.categories[e]) == null ? void 0 : o.color) == "string" && ((i = t.categories[e]) != null && i.color) ? t.categories[e].color : `var(--vis-color${a})`
55
+ backgroundColor: typeof ((o = t.categories[e]) == null ? void 0 : o.color) == "string" && ((i = t.categories[e]) != null && i.color) ? t.categories[e].color : `var(--vis-color${v})`
56
56
  };
57
57
  };
58
- return (e, a) => (s(), n("div", { style: u }, [
59
- r("div", { style: f }, c(v.value), 1),
60
- r("div", { style: y }, [
61
- (s(!0), n(p, null, z(g.value, ([o, i], S) => (s(), n(p, { key: o }, [
62
- r("span", {
63
- style: w(x(o, S))
58
+ return (e, v) => (n(), a("div", { style: y }, [
59
+ s("div", {
60
+ style: d(h.value)
61
+ }, m(u.value), 5),
62
+ c.value ? (n(), a("div", {
63
+ key: 0,
64
+ style: b
65
+ }, [
66
+ (n(!0), a(g, null, B(p.value, ([o, i], z) => (n(), a(g, { key: o }, [
67
+ s("span", {
68
+ style: d(F(o, z))
64
69
  }, null, 4),
65
- r("span", { style: h }, c(l.categories[o].name), 1),
66
- r("span", { style: b }, c(l.yFormatter ? l.yFormatter(i) : i), 1)
70
+ s("span", { style: x }, m(r.categories[o].name), 1),
71
+ s("span", { style: S }, m(r.yFormatter ? r.yFormatter(i) : i), 1)
67
72
  ], 64))), 128))
68
- ])
73
+ ])) : k("", !0)
69
74
  ]));
70
75
  }
71
76
  });
72
77
  export {
73
- C as default
78
+ _ as default
74
79
  };