vccs 0.4.0 → 0.4.1

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 (39) hide show
  1. package/README.md +4 -0
  2. package/dist/chart/RechartsWrapper.d.ts +3 -3
  3. package/dist/chart/Sankey.d.ts +327 -0
  4. package/dist/chart/SunburstChart.d.ts +249 -0
  5. package/dist/chart/generateCategoricalChart.d.ts +2 -2
  6. package/dist/chart/index.d.ts +2 -0
  7. package/dist/chart/sankeyUtils.d.ts +36 -0
  8. package/dist/chart/sunburstUtils.d.ts +34 -0
  9. package/dist/es/cartesian/utils/get-ticks.mjs +3 -2
  10. package/dist/es/chart/RechartsWrapper.mjs +8 -5
  11. package/dist/es/chart/Sankey.mjs +332 -0
  12. package/dist/es/chart/SunburstChart.mjs +229 -0
  13. package/dist/es/chart/generateCategoricalChart.mjs +5 -1
  14. package/dist/es/chart/sankeyUtils.mjs +28 -0
  15. package/dist/es/chart/sunburstUtils.mjs +67 -0
  16. package/dist/es/components/Tooltip.mjs +15 -6
  17. package/dist/es/container/ResponsiveContainer.vue_vue_type_script_setup_true_lang.mjs +15 -2
  18. package/dist/es/index.mjs +5 -2
  19. package/dist/es/polar/pie/Pie.mjs +1 -1
  20. package/dist/es/polar/pie/type.mjs +7 -0
  21. package/dist/es/polar/radar/Radar.mjs +9 -1
  22. package/dist/es/polar/radial-bar/RadialBar.mjs +1 -0
  23. package/dist/es/polar/radial-bar/type.mjs +7 -0
  24. package/dist/es/utils/Global.mjs +18 -0
  25. package/dist/es/utils/attrs.mjs +2 -2
  26. package/dist/es/utils/validate.mjs +1 -2
  27. package/dist/hooks/publicHooks.d.ts +1 -1
  28. package/dist/index.d.ts +2 -0
  29. package/dist/polar/pie/type.d.ts +8 -0
  30. package/dist/polar/radar/Radar.d.ts +16 -0
  31. package/dist/polar/radial-bar/type.d.ts +8 -0
  32. package/dist/state/selectors/combiners/combineActiveLabel.d.ts +1 -1
  33. package/dist/state/selectors/selectors.d.ts +1 -1
  34. package/dist/state/selectors/tooltipSelectors.d.ts +1 -1
  35. package/dist/types/common.d.ts +1 -1
  36. package/dist/utils/Global.d.ts +9 -0
  37. package/dist/utils/index.d.ts +1 -0
  38. package/dist/utils/validate.d.ts +0 -1
  39. package/package.json +3 -1
@@ -0,0 +1,67 @@
1
+ import { hierarchy, partition } from "d3-hierarchy";
2
+ //#region src/chart/sunburstUtils.ts
3
+ /**
4
+ * Record each node's original child index before sorting mutates the order.
5
+ * This ensures tooltipIndex paths point into the original data.children order.
6
+ */
7
+ function recordOriginalIndices(node) {
8
+ if (node.children) node.children.forEach((child, i) => {
9
+ child._originalIndex = i;
10
+ recordOriginalIndices(child);
11
+ });
12
+ }
13
+ /**
14
+ * Build a hierarchical tooltip index path string for a d3 hierarchy node.
15
+ * Uses _originalIndex (pre-sort) so the path matches the original data structure.
16
+ * E.g. 'children[0].children[1]'
17
+ */
18
+ function buildTooltipIndex(node) {
19
+ const parts = [];
20
+ let current = node;
21
+ while (current.parent) {
22
+ const idx = current._originalIndex ?? current.parent.children.indexOf(current);
23
+ parts.unshift(`children[${idx}]`);
24
+ current = current.parent;
25
+ }
26
+ return parts.join(".");
27
+ }
28
+ function computeSunburstLayout(options) {
29
+ const { data, cx, cy, innerRadius, outerRadius, startAngle, endAngle, dataKey, ringPadding = 0, padding = 0 } = options;
30
+ if (!data.children || data.children.length === 0) return [];
31
+ const root = hierarchy(data).sum((d) => {
32
+ if (d.children && d.children.length > 0) return 0;
33
+ const val = d[dataKey];
34
+ return typeof val === "number" && val > 0 ? val : 0;
35
+ });
36
+ recordOriginalIndices(root);
37
+ root.sort((a, b) => (b.value ?? 0) - (a.value ?? 0));
38
+ partition().size([1, 1])(root);
39
+ const angleRange = endAngle - startAngle;
40
+ const radiusRange = outerRadius - innerRadius;
41
+ const nodes = [];
42
+ root.descendants().forEach((d) => {
43
+ if (d.depth === 0) return;
44
+ const nodeStartAngle = startAngle + d.x0 * angleRange + padding / 2;
45
+ const nodeEndAngle = startAngle + d.x1 * angleRange - padding / 2;
46
+ const nodeInnerRadius = innerRadius + d.y0 * radiusRange + ringPadding / 2;
47
+ const nodeOuterRadius = innerRadius + d.y1 * radiusRange - ringPadding / 2;
48
+ if (nodeEndAngle <= nodeStartAngle || nodeOuterRadius <= nodeInnerRadius) return;
49
+ nodes.push({
50
+ cx,
51
+ cy,
52
+ innerRadius: nodeInnerRadius,
53
+ outerRadius: nodeOuterRadius,
54
+ startAngle: nodeStartAngle,
55
+ endAngle: nodeEndAngle,
56
+ depth: d.depth,
57
+ name: d.data.name,
58
+ value: d.value ?? 0,
59
+ fill: d.data.fill,
60
+ payload: d.data,
61
+ tooltipIndex: buildTooltipIndex(d)
62
+ });
63
+ });
64
+ return nodes;
65
+ }
66
+ //#endregion
67
+ export { computeSunburstLayout };
@@ -8,17 +8,17 @@ import { selectActiveCoordinate, selectActiveLabel, selectIsTooltipActive, selec
8
8
  import { Rectangle } from "../shape/Rectangle.mjs";
9
9
  import { useCursorLayerRef } from "../context/cursorLayerContext.mjs";
10
10
  import { usePortal } from "../chart/TooltipPortalContext.mjs";
11
+ import { Sector } from "../shape/Sector.mjs";
11
12
  import { useAccessibilityLayer } from "../context/accessibilityContext.mjs";
12
13
  import { getTooltipTranslate } from "../utils/tooltip/translate.mjs";
13
14
  import { Cross } from "../shape/Cross.mjs";
14
- import { Sector } from "../shape/Sector.mjs";
15
15
  import { getCursorPoints } from "./utils.mjs";
16
16
  import { useTooltipAxisBandSize } from "../context/useTooltipAxis.mjs";
17
17
  import { useTooltipChartSynchronisation } from "../synchronisation/useChartSynchronisation.mjs";
18
18
  import { Fragment, Teleport, computed, createVNode, defineComponent, isVNode, reactive, ref, watch, watchEffect, watchPostEffect } from "vue";
19
19
  import { sortBy, uniqBy } from "es-toolkit/compat";
20
20
  import { animate } from "motion-v";
21
- import { useElementBounding, useMagicKeys, usePreferredReducedMotion } from "@vueuse/core";
21
+ import { useMagicKeys, usePreferredReducedMotion } from "@vueuse/core";
22
22
  //#region src/components/Tooltip.tsx
23
23
  function _isSlot(s) {
24
24
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
@@ -148,7 +148,10 @@ var TooltipBoundingBox = /* @__PURE__ */ defineComponent({
148
148
  }
149
149
  });
150
150
  const el = ref();
151
- const lastBoundingBox = useElementBounding(el, {});
151
+ const tooltipSize = ref({
152
+ width: 0,
153
+ height: 0
154
+ });
152
155
  let preTransform;
153
156
  let animationControls;
154
157
  const reducedMotion = usePreferredReducedMotion();
@@ -161,13 +164,13 @@ var TooltipBoundingBox = /* @__PURE__ */ defineComponent({
161
164
  position,
162
165
  reverseDirection,
163
166
  tooltipBox: {
164
- height: lastBoundingBox.height.value,
165
- width: lastBoundingBox.width.value
167
+ height: tooltipSize.value.height,
168
+ width: tooltipSize.value.width
166
169
  },
167
170
  useTranslate3d: false,
168
171
  viewBox
169
172
  });
170
- transform = !lastBoundingBox.height.value && preTransform ? preTransform : transform;
173
+ transform = !tooltipSize.value.height && preTransform ? preTransform : transform;
171
174
  preTransform = transform || preTransform;
172
175
  return {
173
176
  cssClasses,
@@ -181,6 +184,12 @@ var TooltipBoundingBox = /* @__PURE__ */ defineComponent({
181
184
  if (!element || !transform?.transform) return;
182
185
  if (props.isAnimationActive && reducedMotion.value !== "reduce") animationControls = animate(element, { transform: transform.transform }, props.transition);
183
186
  else element.style.transform = transform.transform;
187
+ const width = element.offsetWidth;
188
+ const height = element.offsetHeight;
189
+ if (height > 0 && (width !== tooltipSize.value.width || height !== tooltipSize.value.height)) tooltipSize.value = {
190
+ width,
191
+ height
192
+ };
184
193
  onCleanup(() => {
185
194
  animationControls?.stop();
186
195
  animationControls = void 0;
@@ -1,7 +1,7 @@
1
1
  import { isPercent } from "../utils/validate.mjs";
2
2
  import { normalizeStyle as normalizeStyle$1 } from "../utils/style.mjs";
3
3
  import { provideSizeContext } from "./useSizeContext.mjs";
4
- import { Fragment, cloneVNode, computed, createBlock, createElementBlock, defineComponent, normalizeClass, normalizeStyle, onMounted, onUnmounted, openBlock, ref, resolveDynamicComponent, toRef, useSlots } from "vue";
4
+ import { Fragment, cloneVNode, computed, createElementBlock, createVNode, defineComponent, normalizeClass, normalizeStyle, onMounted, onUnmounted, openBlock, ref, toRef, useSlots } from "vue";
5
5
  import { useThrottleFn } from "@vueuse/core";
6
6
  //#region src/container/ResponsiveContainer.vue?vue&type=script&setup=true&lang.ts
7
7
  var _hoisted_1 = ["id"];
@@ -119,6 +119,19 @@ var ResponsiveContainer_vue_vue_type_script_setup_true_lang_default = /* @__PURE
119
119
  });
120
120
  });
121
121
  }
122
+ /**
123
+ * Rendering the children through `<component :is="() => renderChildren()" />` would
124
+ * create a new component type on every render, so Vue unmounts and remounts the whole
125
+ * chart subtree each time. Charts that dispatch on `mouseenter` (radial bar, radar) then
126
+ * loop forever: the remount recreates the element under the cursor, which fires
127
+ * `mouseenter` again. This renderer keeps a stable type, so the subtree is patched.
128
+ */
129
+ const ChildrenRenderer = (rendererProps) => rendererProps.nodes;
130
+ ChildrenRenderer.props = { nodes: {
131
+ type: Array,
132
+ required: true
133
+ } };
134
+ ChildrenRenderer.inheritAttrs = false;
122
135
  const containerStyle = computed(() => ({
123
136
  ...props.style,
124
137
  ...normalizeStyle$1({
@@ -136,7 +149,7 @@ var ResponsiveContainer_vue_vue_type_script_setup_true_lang_default = /* @__PURE
136
149
  ref: containerRef,
137
150
  class: normalizeClass(["vcharts-responsive-container", [props.class]]),
138
151
  style: normalizeStyle(containerStyle.value)
139
- }, [(openBlock(), createBlock(resolveDynamicComponent(() => renderChildren())))], 14, _hoisted_1);
152
+ }, [createVNode(ChildrenRenderer, { nodes: renderChildren() ?? [] }, null, 8, ["nodes"])], 14, _hoisted_1);
140
153
  };
141
154
  }
142
155
  });
package/dist/es/index.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ import { Global } from "./utils/Global.mjs";
1
2
  import { Curve, CurveVueProps, getPath } from "./shape/Curve.mjs";
2
3
  import { useActiveTooltipDataPoints } from "./state/hooks.mjs";
3
4
  import { useChartHeight, useChartWidth, useMargin, useOffset } from "./context/chartLayoutContext.mjs";
@@ -36,11 +37,13 @@ import { ScatterChart } from "./chart/ScatterChart.mjs";
36
37
  import { RadialBarChart } from "./chart/RadialBarChart.mjs";
37
38
  import { FunnelChart } from "./chart/FunnelChart.mjs";
38
39
  import { Treemap, TreemapVueProps, treemapPayloadSearcher } from "./chart/Treemap.mjs";
40
+ import { Sankey, SankeyVueProps, sankeyPayloadSearcher } from "./chart/Sankey.mjs";
41
+ import { Sector } from "./shape/Sector.mjs";
42
+ import { SunburstChart, SunburstChartVueProps, sunburstPayloadSearcher } from "./chart/SunburstChart.mjs";
39
43
  import ResponsiveContainer_default from "./container/ResponsiveContainer.mjs";
40
44
  import { Customized } from "./components/Customized.mjs";
41
45
  import Legend_default from "./components/legend/Legend.mjs";
42
46
  import { Cross } from "./shape/Cross.mjs";
43
- import { Sector } from "./shape/Sector.mjs";
44
47
  import Tooltip, { getUniqPayload } from "./components/Tooltip.mjs";
45
48
  import { PieVueProps } from "./polar/pie/type.mjs";
46
49
  import { Pie } from "./polar/pie/Pie.mjs";
@@ -51,4 +54,4 @@ import { PolarRadiusAxis } from "./polar/radar/PolarRadiusAxis.mjs";
51
54
  import { RadialBar } from "./polar/radial-bar/RadialBar.mjs";
52
55
  import { Polygon } from "./shape/Polygon.mjs";
53
56
  import { useActiveTooltipCoordinate, useActiveTooltipLabel, useCartesianScale, useIsTooltipActive, usePlotArea, useXAxisDomain, useXAxisInverseDataSnapScale, useXAxisInverseScale, useXAxisInverseTickSnapScale, useXAxisScale, useXAxisTicks, useYAxisDomain, useYAxisInverseDataSnapScale, useYAxisInverseScale, useYAxisInverseTickSnapScale, useYAxisScale, useYAxisTicks } from "./hooks/publicHooks.mjs";
54
- export { Area, AreaChart, Bar, BarChart, CartesianAxis, CartesianGrid, Cell, ComposedChart, Cross, Curve, CurveVueProps, Customized, Dot, ErrorBar, ErrorBarVueProps, Funnel, FunnelChart, FunnelVueProps, Label, LabelList, Legend_default as Legend, Line, LineChart, LineContextKey, Pie, PieChart, PieVueProps, PolarAngleAxis, PolarGrid, PolarRadiusAxis, Polygon, Radar, RadarChart, RadialBar, RadialBarChart, Rectangle, ReferenceArea, ReferenceDot, ReferenceLine, ResponsiveContainer_default as ResponsiveContainer, Scatter, ScatterChart, Sector, Symbols, Text_default as Text, Tooltip, Trapezoid, Treemap, TreemapVueProps, XAxis, YAxis, ZAxis, createErrorBarRegistry, getPath, getUniqPayload, provideErrorBarContext, provideErrorBarRegistry, provideLineContext, treemapPayloadSearcher, useActiveTooltipCoordinate, useActiveTooltipDataPoints, useActiveTooltipLabel, useCartesianScale, useChartHeight, useChartWidth, useErrorBarContext, useErrorBarRegistry, useIsTooltipActive, useLine, useLineContext, useMargin, useOffset, usePlotArea, useXAxisDomain, useXAxisInverseDataSnapScale, useXAxisInverseScale, useXAxisInverseTickSnapScale, useXAxisScale, useXAxisTicks, useYAxisDomain, useYAxisInverseDataSnapScale, useYAxisInverseScale, useYAxisInverseTickSnapScale, useYAxisScale, useYAxisTicks };
57
+ export { Area, AreaChart, Bar, BarChart, CartesianAxis, CartesianGrid, Cell, ComposedChart, Cross, Curve, CurveVueProps, Customized, Dot, ErrorBar, ErrorBarVueProps, Funnel, FunnelChart, FunnelVueProps, Global, Label, LabelList, Legend_default as Legend, Line, LineChart, LineContextKey, Pie, PieChart, PieVueProps, PolarAngleAxis, PolarGrid, PolarRadiusAxis, Polygon, Radar, RadarChart, RadialBar, RadialBarChart, Rectangle, ReferenceArea, ReferenceDot, ReferenceLine, ResponsiveContainer_default as ResponsiveContainer, Sankey, SankeyVueProps, Scatter, ScatterChart, Sector, SunburstChart, SunburstChartVueProps, Symbols, Text_default as Text, Tooltip, Trapezoid, Treemap, TreemapVueProps, XAxis, YAxis, ZAxis, createErrorBarRegistry, getPath, getUniqPayload, provideErrorBarContext, provideErrorBarRegistry, provideLineContext, sankeyPayloadSearcher, sunburstPayloadSearcher, treemapPayloadSearcher, useActiveTooltipCoordinate, useActiveTooltipDataPoints, useActiveTooltipLabel, useCartesianScale, useChartHeight, useChartWidth, useErrorBarContext, useErrorBarRegistry, useIsTooltipActive, useLine, useLineContext, useMargin, useOffset, usePlotArea, useXAxisDomain, useXAxisInverseDataSnapScale, useXAxisInverseScale, useXAxisInverseTickSnapScale, useXAxisScale, useXAxisTicks, useYAxisDomain, useYAxisInverseDataSnapScale, useYAxisInverseScale, useYAxisInverseTickSnapScale, useYAxisScale, useYAxisTicks };
@@ -120,7 +120,7 @@ var Pie = /* @__PURE__ */ defineComponent({
120
120
  "isActive": props.isAnimationActive,
121
121
  "from": 0,
122
122
  "to": 1,
123
- "transition": { duration: 1.5 }
123
+ "transition": props.transition
124
124
  }, { default: (progress) => {
125
125
  let curAngle = sectorList[0]?.startAngle ?? 0;
126
126
  const sectorNodes = sectorList.map((sector, i) => {
@@ -85,6 +85,13 @@ var PieVueProps = {
85
85
  type: Boolean,
86
86
  default: true
87
87
  },
88
+ transition: {
89
+ type: Object,
90
+ default: () => ({
91
+ duration: 1.2,
92
+ ease: "easeOut"
93
+ })
94
+ },
88
95
  label: {
89
96
  type: Boolean,
90
97
  default: false
@@ -115,6 +115,13 @@ var Radar = /* @__PURE__ */ defineComponent({
115
115
  type: Boolean,
116
116
  default: true
117
117
  },
118
+ transition: {
119
+ type: Object,
120
+ default: () => ({
121
+ duration: .8,
122
+ ease: "easeOut"
123
+ })
124
+ },
118
125
  activeDot: {
119
126
  type: [Object, Boolean],
120
127
  default: true
@@ -175,7 +182,7 @@ var Radar = /* @__PURE__ */ defineComponent({
175
182
  let prevPoints = null;
176
183
  let prevBaseLinePoints = null;
177
184
  let animationId = 0;
178
- let lastData = void 0;
185
+ let lastData;
179
186
  const renderPolygon = (points, baseLinePoints, isRange) => {
180
187
  const stroke = props.stroke ?? props.fill;
181
188
  const hasStroke = stroke && stroke !== "none";
@@ -259,6 +266,7 @@ var Radar = /* @__PURE__ */ defineComponent({
259
266
  createVNode(Animate, {
260
267
  "key": animationId,
261
268
  "isActive": true,
269
+ "transition": props.transition,
262
270
  "onAnimationStart": () => {
263
271
  isAnimating.value = true;
264
272
  },
@@ -165,6 +165,7 @@ var RadialBar = /* @__PURE__ */ defineComponent({
165
165
  createVNode(Animate, {
166
166
  "key": animationId,
167
167
  "isActive": true,
168
+ "transition": props.transition,
168
169
  "onAnimationStart": () => {
169
170
  isAnimating.value = true;
170
171
  },
@@ -64,6 +64,13 @@ var RadialBarVueProps = {
64
64
  type: Boolean,
65
65
  default: true
66
66
  },
67
+ transition: {
68
+ type: Object,
69
+ default: () => ({
70
+ duration: .4,
71
+ ease: "easeOut"
72
+ })
73
+ },
67
74
  minPointSize: {
68
75
  type: Number,
69
76
  default: 0
@@ -0,0 +1,18 @@
1
+ //#region src/utils/Global.ts
2
+ function parseIsSsrByDefault() {
3
+ return typeof window === "undefined";
4
+ }
5
+ var Global = {
6
+ isSsr: parseIsSsrByDefault(),
7
+ get(key) {
8
+ return Global[key];
9
+ },
10
+ set(key, value) {
11
+ if (typeof key === "string") Global[key] = value;
12
+ else Object.keys(key).forEach((k) => {
13
+ Global[k] = key[k];
14
+ });
15
+ }
16
+ };
17
+ //#endregion
18
+ export { Global };
@@ -1,4 +1,4 @@
1
- import { isSsr } from "./validate.mjs";
1
+ import { Global } from "./Global.mjs";
2
2
  //#region src/utils/attrs.ts
3
3
  var stringCache = {
4
4
  widthCache: {},
@@ -23,7 +23,7 @@ function removeInvalidKeys(obj) {
23
23
  return copyObj;
24
24
  }
25
25
  function getStringSize(text, style = {}) {
26
- if (text === void 0 || text === null || isSsr) return {
26
+ if (text === void 0 || text === null || Global.isSsr) return {
27
27
  width: 0,
28
28
  height: 0
29
29
  };
@@ -28,7 +28,6 @@ function isVisible(sign, tickPosition, getSize, start, end) {
28
28
  const size = getSize();
29
29
  return sign * (tickPosition - sign * size / 2 - start) >= 0 && sign * (tickPosition + sign * size / 2 - end) <= 0;
30
30
  }
31
- var isSsr = typeof window === "undefined";
32
31
  /**
33
32
  * Checks if the value is null or undefined
34
33
  * @param {any} value The value to check
@@ -39,4 +38,4 @@ function isNullish(value) {
39
38
  }
40
39
  var isNumOrStr = (value) => isNumber(value) || typeof value === "string";
41
40
  //#endregion
42
- export { isCategoricalAxis, isNan, isNullish, isNumOrStr, isNumber, isPercent, isSsr, isVisible, isWellBehavedNumber, validateWidthHeight };
41
+ export { isCategoricalAxis, isNan, isNullish, isNumOrStr, isNumber, isPercent, isVisible, isWellBehavedNumber, validateWidthHeight };
@@ -33,7 +33,7 @@ export declare function useActiveTooltipCoordinate(): Readonly<import('vue').Sha
33
33
  *
34
34
  * @returns A reactive string label or undefined when no tooltip is active
35
35
  */
36
- export declare function useActiveTooltipLabel(): Readonly<import('vue').ShallowRef<string>>;
36
+ export declare function useActiveTooltipLabel(): Readonly<import('vue').ShallowRef<string | number>>;
37
37
  /**
38
38
  * Returns the plot area rectangle { x, y, width, height }.
39
39
  * This is the area inside all axes, legend, and brush — where graphical items render.
package/dist/index.d.ts CHANGED
@@ -5,3 +5,5 @@ export * from './components';
5
5
  export * from './polar';
6
6
  export * from './shape';
7
7
  export * from './hooks/publicHooks';
8
+ export { Global } from './utils/Global';
9
+ export type { GlobalConfig, GlobalConfigKeys } from './utils/Global';
@@ -1,4 +1,5 @@
1
1
  import { PropType } from 'vue';
2
+ import { AnimationOptions } from 'motion-v';
2
3
  import { DataKey, VuePropsToType, WithSVGProps } from '../../types';
3
4
  import { LegendType } from '../../types/legend';
4
5
  import { TooltipType } from '../../types/tooltip';
@@ -75,6 +76,13 @@ export declare const PieVueProps: {
75
76
  type: BooleanConstructor;
76
77
  default: boolean;
77
78
  };
79
+ transition: {
80
+ type: PropType<AnimationOptions>;
81
+ default: () => {
82
+ duration: number;
83
+ ease: string;
84
+ };
85
+ };
78
86
  label: {
79
87
  type: BooleanConstructor;
80
88
  default: boolean;
@@ -1,4 +1,5 @@
1
1
  import { PropType } from 'vue';
2
+ import { AnimationOptions } from 'motion-v';
2
3
  import { DataKey } from '../../types';
3
4
  import { LegendType } from '../../types/legend';
4
5
  import { TooltipType } from '../../types/tooltip';
@@ -67,6 +68,13 @@ export declare const Radar: import('vue').DefineComponent<import('vue').ExtractP
67
68
  type: BooleanConstructor;
68
69
  default: boolean;
69
70
  };
71
+ transition: {
72
+ type: PropType<AnimationOptions>;
73
+ default: () => {
74
+ duration: number;
75
+ ease: string;
76
+ };
77
+ };
70
78
  activeDot: {
71
79
  type: PropType<object | boolean>;
72
80
  default: boolean;
@@ -136,6 +144,13 @@ export declare const Radar: import('vue').DefineComponent<import('vue').ExtractP
136
144
  type: BooleanConstructor;
137
145
  default: boolean;
138
146
  };
147
+ transition: {
148
+ type: PropType<AnimationOptions>;
149
+ default: () => {
150
+ duration: number;
151
+ ease: string;
152
+ };
153
+ };
139
154
  activeDot: {
140
155
  type: PropType<object | boolean>;
141
156
  default: boolean;
@@ -146,6 +161,7 @@ export declare const Radar: import('vue').DefineComponent<import('vue').ExtractP
146
161
  stroke: string;
147
162
  strokeDasharray: string;
148
163
  strokeWidth: number;
164
+ transition: AnimationOptions;
149
165
  name: string;
150
166
  label: boolean | Record<string, any>;
151
167
  connectNulls: boolean;
@@ -1,4 +1,5 @@
1
1
  import { PropType } from 'vue';
2
+ import { AnimationOptions } from 'motion-v';
2
3
  import { DataKey, VuePropsToType, WithSVGProps } from '../../types';
3
4
  import { LegendType } from '../../types/legend';
4
5
  import { TooltipType } from '../../types/tooltip';
@@ -64,6 +65,13 @@ export declare const RadialBarVueProps: {
64
65
  type: BooleanConstructor;
65
66
  default: boolean;
66
67
  };
68
+ transition: {
69
+ type: PropType<AnimationOptions>;
70
+ default: () => {
71
+ duration: number;
72
+ ease: string;
73
+ };
74
+ };
67
75
  minPointSize: {
68
76
  type: NumberConstructor;
69
77
  default: number;
@@ -1,3 +1,3 @@
1
1
  import { TooltipIndex } from '../../tooltipSlice';
2
2
  import { TickItem } from '../../../types';
3
- export declare function combineActiveLabel(tooltipTicks: ReadonlyArray<TickItem>, activeIndex: TooltipIndex): string | undefined;
3
+ export declare function combineActiveLabel(tooltipTicks: ReadonlyArray<TickItem>, activeIndex: TooltipIndex): string | number | undefined;
@@ -175,7 +175,7 @@ export declare function selectTooltipDataKey(state: RechartsRootState, tooltipEv
175
175
  export declare const selectTooltipPayloadConfigurations: (state: RechartsRootState, tooltipEventType: TooltipEventType, trigger: TooltipTrigger, defaultIndex: TooltipIndex | undefined) => ReadonlyArray<TooltipPayloadConfiguration>;
176
176
  export declare const selectCoordinateForDefaultIndex: (state: RechartsRootState, tooltipEventType: TooltipEventType, trigger: TooltipTrigger, defaultIndex: TooltipIndex | undefined) => Coordinate | undefined;
177
177
  export declare const selectActiveCoordinate: (state: RechartsRootState, tooltipEventType: TooltipEventType, trigger: TooltipTrigger, defaultIndex: TooltipIndex | undefined) => Coordinate | undefined;
178
- export declare const selectActiveLabel: (state: RechartsRootState, tooltipEventType: TooltipEventType, trigger: TooltipTrigger, defaultIndex: TooltipIndex | undefined) => string | undefined;
178
+ export declare const selectActiveLabel: (state: RechartsRootState, tooltipEventType: TooltipEventType, trigger: TooltipTrigger, defaultIndex: TooltipIndex | undefined) => string | number | undefined;
179
179
  export declare const selectTooltipPayload: (state: RechartsRootState, tooltipEventType: TooltipEventType, trigger: TooltipTrigger, defaultIndex: TooltipIndex | undefined) => TooltipPayload | undefined;
180
180
  export declare const selectIsTooltipActive: (state: RechartsRootState, tooltipEventType: TooltipEventType, trigger: TooltipTrigger, defaultIndex: TooltipIndex | undefined) => {
181
181
  isActive: boolean;
@@ -518,7 +518,7 @@ export declare const selectTooltipAxisTicks: ((state: {
518
518
  memoize: typeof import('@reduxjs/toolkit').weakMapMemoize;
519
519
  };
520
520
  export declare const selectActiveTooltipIndex: (state: RechartsRootState) => TooltipIndex | null;
521
- export declare const selectActiveLabel: (state: RechartsRootState) => string | undefined;
521
+ export declare const selectActiveLabel: (state: RechartsRootState) => string | number | undefined;
522
522
  export declare const selectActiveTooltipDataKey: (state: RechartsRootState) => DataKey<any> | undefined;
523
523
  export declare const selectActiveTooltipCoordinate: (state: RechartsRootState) => Coordinate | undefined;
524
524
  export declare const selectIsTooltipActive: (state: RechartsRootState) => boolean;
@@ -49,7 +49,7 @@ export type MouseHandlerDataParam = {
49
49
  * Exactly the same as activeTooltipIndex - this was also duplicated in recharts@2 so let's keep both properties for better backwards compatibility.
50
50
  */
51
51
  activeIndex: number | TooltipIndex | undefined;
52
- activeLabel: string | undefined;
52
+ activeLabel: string | number | undefined;
53
53
  activeDataKey: DataKey<any> | undefined;
54
54
  activeCoordinate: Coordinate | undefined;
55
55
  };
@@ -0,0 +1,9 @@
1
+ export type GlobalConfigKeys = 'isSsr';
2
+ export interface GlobalConfig {
3
+ isSsr?: boolean;
4
+ }
5
+ export declare const Global: {
6
+ isSsr: boolean;
7
+ get(key: GlobalConfigKeys): boolean;
8
+ set(key: GlobalConfigKeys | GlobalConfig, value?: any): void;
9
+ };
@@ -1,4 +1,5 @@
1
1
  export * from './style';
2
2
  export * from './validate';
3
3
  export * from './data-utils';
4
+ export * from './Global';
4
5
  export * from './log';
@@ -15,7 +15,6 @@ export declare function isWellBehavedNumber(n: unknown): n is number;
15
15
  export declare function isPercent(value: string | number): value is `${number}%`;
16
16
  export declare function isCategoricalAxis(layout: LayoutType, axisType: AxisType): boolean;
17
17
  export declare function isVisible(sign: number, tickPosition: number, getSize: () => number, start: number, end: number): boolean;
18
- export declare const isSsr: boolean;
19
18
  /**
20
19
  * Checks if the value is null or undefined
21
20
  * @param {any} value The value to check
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vccs",
3
3
  "type": "module",
4
- "version": "0.4.0",
4
+ "version": "0.4.1",
5
5
  "description": "Composable charting components for Vue 3 — an unofficial port of Recharts",
6
6
  "author": "rick-hup",
7
7
  "license": "MIT",
@@ -48,6 +48,7 @@
48
48
  "@reduxjs/vue-redux": "^1.0.1",
49
49
  "@vueuse/core": "^13.1.0",
50
50
  "d3-hierarchy": "^3.1.2",
51
+ "d3-sankey": "^0.12.3",
51
52
  "decimal.js-light": "^2.5.1",
52
53
  "es-toolkit": "^1.39.3",
53
54
  "eventemitter3": "^5.0.1",
@@ -56,6 +57,7 @@
56
57
  "victory-vendor": "^37.3.6"
57
58
  },
58
59
  "devDependencies": {
60
+ "@types/d3-sankey": "^0.12.5",
59
61
  "@types/lodash-es": "^4.17.12",
60
62
  "@vitejs/plugin-vue-jsx": "^5.0.0",
61
63
  "@vue/babel-plugin-jsx": "^1.1.1",