vccs 0.1.0 → 0.2.0

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 (215) hide show
  1. package/dist/cartesian/funnel/Funnel.d.ts +2 -0
  2. package/dist/cartesian/funnel/index.d.ts +2 -0
  3. package/dist/cartesian/funnel/type.d.ts +74 -5
  4. package/dist/cartesian/index.d.ts +1 -0
  5. package/dist/chart/FunnelChart.d.ts +1 -0
  6. package/dist/chart/index.d.ts +1 -0
  7. package/dist/es/animation/Animate.mjs +48 -22
  8. package/dist/es/cartesian/GraphicalItemClipPath.mjs +16 -15
  9. package/dist/es/cartesian/area/ActivePoints.mjs +44 -40
  10. package/dist/es/cartesian/area/Area.mjs +42 -31
  11. package/dist/es/cartesian/area/ClipRect.mjs +79 -58
  12. package/dist/es/cartesian/area/RenderArea.mjs +142 -108
  13. package/dist/es/cartesian/area/hooks/useArea.mjs +71 -47
  14. package/dist/es/cartesian/area/type.mjs +11 -11
  15. package/dist/es/cartesian/area/utils.mjs +69 -49
  16. package/dist/es/cartesian/axis/XAxis.mjs +87 -73
  17. package/dist/es/cartesian/axis/YAxis.mjs +67 -56
  18. package/dist/es/cartesian/bar/Bar.mjs +93 -71
  19. package/dist/es/cartesian/bar/components/BarBackground.mjs +22 -19
  20. package/dist/es/cartesian/bar/components/BarRectangles.mjs +117 -80
  21. package/dist/es/cartesian/bar/hooks/useBar.mjs +49 -37
  22. package/dist/es/cartesian/bar/type.mjs +9 -9
  23. package/dist/es/cartesian/bar/utils.mjs +97 -70
  24. package/dist/es/cartesian/cartesian-axis/CartesianAxis.mjs +165 -115
  25. package/dist/es/cartesian/cartesian-grid/Background.mjs +19 -16
  26. package/dist/es/cartesian/cartesian-grid/CartesianGrid.mjs +116 -97
  27. package/dist/es/cartesian/cartesian-grid/HorizontalGridLines.mjs +24 -23
  28. package/dist/es/cartesian/cartesian-grid/HorizontalStripes.mjs +24 -24
  29. package/dist/es/cartesian/cartesian-grid/VerticalGridLines.mjs +23 -22
  30. package/dist/es/cartesian/cartesian-grid/VerticalStripes.mjs +24 -24
  31. package/dist/es/cartesian/cartesian-grid/const.mjs +317 -10
  32. package/dist/es/cartesian/cartesian-grid/utils.mjs +18 -13
  33. package/dist/es/cartesian/error-bar/ErrorBar.mjs +111 -83
  34. package/dist/es/cartesian/error-bar/ErrorBarContext.mjs +13 -12
  35. package/dist/es/cartesian/funnel/Funnel.mjs +177 -0
  36. package/dist/es/cartesian/funnel/type.mjs +80 -0
  37. package/dist/es/cartesian/funnel/utils.mjs +102 -0
  38. package/dist/es/cartesian/line/ActivePoints.mjs +45 -41
  39. package/dist/es/cartesian/line/Line.mjs +41 -37
  40. package/dist/es/cartesian/line/StaticLine.mjs +191 -122
  41. package/dist/es/cartesian/line/hooks/useLine.mjs +60 -44
  42. package/dist/es/cartesian/line/type.mjs +11 -11
  43. package/dist/es/cartesian/line/utils.mjs +27 -26
  44. package/dist/es/cartesian/reference-area/ReferenceArea.mjs +86 -69
  45. package/dist/es/cartesian/reference-line/ReferenceLine.mjs +99 -77
  46. package/dist/es/cartesian/scatter/Scatter.mjs +168 -140
  47. package/dist/es/cartesian/scatter/hooks/useScatter.mjs +18 -14
  48. package/dist/es/cartesian/useNeedsClip.mjs +18 -9
  49. package/dist/es/cartesian/utils/get-ticks.mjs +103 -68
  50. package/dist/es/cartesian/z-axis/ZAxis.mjs +30 -28
  51. package/dist/es/chart/AreaChart.mjs +5 -5
  52. package/dist/es/chart/BarChart.mjs +5 -5
  53. package/dist/es/chart/ComposedChart.mjs +5 -5
  54. package/dist/es/chart/FunnelChart.mjs +11 -0
  55. package/dist/es/chart/LegendPortalContext.mjs +3 -3
  56. package/dist/es/chart/LineChart.mjs +5 -5
  57. package/dist/es/chart/PieChart.mjs +5 -5
  58. package/dist/es/chart/RadarChart.mjs +5 -5
  59. package/dist/es/chart/RadialBarChart.mjs +5 -5
  60. package/dist/es/chart/RechartsWrapper.mjs +111 -88
  61. package/dist/es/chart/ScatterChart.mjs +5 -5
  62. package/dist/es/chart/Surface.mjs +3 -3
  63. package/dist/es/chart/Surface.vue_vue_type_script_setup_true_lang.mjs +51 -45
  64. package/dist/es/chart/TooltipPortalContext.mjs +3 -3
  65. package/dist/es/chart/const.mjs +2 -2
  66. package/dist/es/chart/generateCategoricalChart.mjs +97 -88
  67. package/dist/es/chart/provideClipPathId.mjs +12 -7
  68. package/dist/es/components/Cell.mjs +16 -4
  69. package/dist/es/components/Text.mjs +3 -3
  70. package/dist/es/components/Text.vue_vue_type_script_setup_true_lang.mjs +106 -69
  71. package/dist/es/components/Tooltip.mjs +274 -199
  72. package/dist/es/components/label/Label.mjs +30 -26
  73. package/dist/es/components/label/LabelList.mjs +45 -39
  74. package/dist/es/components/label/types.mjs +8 -5
  75. package/dist/es/components/label/utils.mjs +194 -162
  76. package/dist/es/components/legend/Legend.mjs +82 -71
  77. package/dist/es/components/legend/LegendSymbol.mjs +40 -38
  78. package/dist/es/components/legend/hooks/useLegend.mjs +66 -46
  79. package/dist/es/components/legend/hooks/useLegendContent.mjs +52 -31
  80. package/dist/es/components/legend/type.mjs +2 -2
  81. package/dist/es/components/legend/utils.mjs +19 -11
  82. package/dist/es/components/utils.mjs +35 -22
  83. package/dist/es/container/ClipPath.mjs +14 -14
  84. package/dist/es/container/Layer.mjs +9 -7
  85. package/dist/es/container/ResponsiveContainer.mjs +3 -3
  86. package/dist/es/container/ResponsiveContainer.vue_vue_type_script_setup_true_lang.mjs +109 -77
  87. package/dist/es/container/Surface.mjs +23 -19
  88. package/dist/es/container/useSizeContext.mjs +3 -3
  89. package/dist/es/context/ChartDataContextProvider.mjs +19 -13
  90. package/dist/es/context/PanoramaContextProvider.mjs +15 -10
  91. package/dist/es/context/accessibilityContext.mjs +3 -3
  92. package/dist/es/context/cartesianLabelListContext.mjs +3 -3
  93. package/dist/es/context/chartLayoutContext.mjs +33 -30
  94. package/dist/es/context/cursorLayerContext.mjs +3 -3
  95. package/dist/es/context/graphicalLayerContext.mjs +3 -3
  96. package/dist/es/context/labelLayerContext.mjs +3 -3
  97. package/dist/es/context/polarLabelViewBoxContext.mjs +5 -5
  98. package/dist/es/context/useTooltipAxis.mjs +14 -12
  99. package/dist/es/events/useChartSynchronisation.mjs +91 -66
  100. package/dist/es/hooks/useIsAnimating.mjs +28 -0
  101. package/dist/es/hooks/useSetupGraphicalItem.mjs +52 -43
  102. package/dist/es/index.mjs +46 -42
  103. package/dist/es/polar/pie/Pie.mjs +131 -115
  104. package/dist/es/polar/pie/type.mjs +6 -6
  105. package/dist/es/polar/radar/PolarAngleAxis.mjs +103 -84
  106. package/dist/es/polar/radar/PolarGrid.mjs +72 -59
  107. package/dist/es/polar/radar/PolarRadiusAxis.mjs +90 -65
  108. package/dist/es/polar/radar/Radar.mjs +181 -145
  109. package/dist/es/polar/radial-bar/RadialBar.mjs +161 -140
  110. package/dist/es/polar/radial-bar/type.mjs +9 -9
  111. package/dist/es/shape/Cross.mjs +11 -10
  112. package/dist/es/shape/Curve.mjs +69 -43
  113. package/dist/es/shape/Dot.mjs +12 -11
  114. package/dist/es/shape/Rectangle.mjs +41 -26
  115. package/dist/es/shape/Sector.mjs +103 -75
  116. package/dist/es/shape/Symbols.mjs +45 -34
  117. package/dist/es/shape/Trapezoid.mjs +52 -0
  118. package/dist/es/state/ReportChartProps.mjs +21 -20
  119. package/dist/es/state/ReportMainChartProps.mjs +26 -21
  120. package/dist/es/state/ReportPolarOptions.mjs +23 -22
  121. package/dist/es/state/SetGraphicalItem.mjs +42 -27
  122. package/dist/es/state/SetLegendPayload.mjs +17 -13
  123. package/dist/es/state/SetTooltipEntrySettings.mjs +14 -12
  124. package/dist/es/state/brushSlice.mjs +12 -8
  125. package/dist/es/state/cartesianAxisSlice.mjs +23 -17
  126. package/dist/es/state/chartDataSlice.mjs +18 -13
  127. package/dist/es/state/externalEventsMiddleware.mjs +25 -15
  128. package/dist/es/state/graphicalItemsSlice.mjs +29 -25
  129. package/dist/es/state/hooks.mjs +4 -3
  130. package/dist/es/state/keyboardEventsMiddleware.mjs +50 -42
  131. package/dist/es/state/layoutSlice.mjs +18 -12
  132. package/dist/es/state/legendSlice.mjs +19 -14
  133. package/dist/es/state/mouseEventsMiddleware.mjs +31 -24
  134. package/dist/es/state/optionsSlice.mjs +14 -11
  135. package/dist/es/state/polarAxisSlice.mjs +15 -13
  136. package/dist/es/state/polarOptionsSlice.mjs +8 -6
  137. package/dist/es/state/reduxDevtoolsJsonStringifyReplacer.mjs +5 -3
  138. package/dist/es/state/referenceElementsSlice.mjs +21 -19
  139. package/dist/es/state/rootPropsSlice.mjs +20 -9
  140. package/dist/es/state/selectors/areaSelectors.mjs +65 -55
  141. package/dist/es/state/selectors/axisSelectors.mjs +755 -569
  142. package/dist/es/state/selectors/barSelectors.mjs +225 -162
  143. package/dist/es/state/selectors/brushSelectors.mjs +15 -14
  144. package/dist/es/state/selectors/combiners/combineActiveLabel.mjs +6 -5
  145. package/dist/es/state/selectors/combiners/combineActiveTooltipIndex.mjs +36 -27
  146. package/dist/es/state/selectors/combiners/combineAxisRangeWithReverse.mjs +5 -3
  147. package/dist/es/state/selectors/combiners/combineCoordinateForDefaultIndex.mjs +13 -11
  148. package/dist/es/state/selectors/combiners/combineTooltipInteractionState.mjs +26 -21
  149. package/dist/es/state/selectors/combiners/combineTooltipPayloadConfigurations.mjs +10 -6
  150. package/dist/es/state/selectors/common.mjs +2 -2
  151. package/dist/es/state/selectors/containerSelectors.mjs +5 -2
  152. package/dist/es/state/selectors/dataSelectors.mjs +28 -9
  153. package/dist/es/state/selectors/funnelSelectors.mjs +38 -0
  154. package/dist/es/state/selectors/legendSelectors.mjs +7 -6
  155. package/dist/es/state/selectors/lineSelectors.mjs +54 -47
  156. package/dist/es/state/selectors/pickAxisId.mjs +2 -2
  157. package/dist/es/state/selectors/pickAxisType.mjs +2 -2
  158. package/dist/es/state/selectors/pieSelectors.mjs +116 -81
  159. package/dist/es/state/selectors/polarAxisSelectors.mjs +113 -94
  160. package/dist/es/state/selectors/polarGridSelectors.mjs +13 -11
  161. package/dist/es/state/selectors/polarScaleSelectors.mjs +49 -46
  162. package/dist/es/state/selectors/polarSelectors.mjs +79 -62
  163. package/dist/es/state/selectors/radarSelectors.mjs +111 -91
  164. package/dist/es/state/selectors/radialBarSelectors.mjs +230 -183
  165. package/dist/es/state/selectors/rootPropsSelectors.mjs +11 -5
  166. package/dist/es/state/selectors/scatterSelectors.mjs +111 -95
  167. package/dist/es/state/selectors/selectActivePropsFromChartPointer.mjs +19 -17
  168. package/dist/es/state/selectors/selectAllAxes.mjs +8 -3
  169. package/dist/es/state/selectors/selectChartOffset.mjs +59 -50
  170. package/dist/es/state/selectors/selectChartOffsetInternal.mjs +55 -44
  171. package/dist/es/state/selectors/selectTooltipEventType.mjs +15 -14
  172. package/dist/es/state/selectors/selectTooltipPayloadSearcher.mjs +3 -3
  173. package/dist/es/state/selectors/selectTooltipSettings.mjs +2 -2
  174. package/dist/es/state/selectors/selectTooltipState.mjs +2 -2
  175. package/dist/es/state/selectors/selectors.mjs +94 -75
  176. package/dist/es/state/selectors/tooltipSelectors.mjs +253 -204
  177. package/dist/es/state/selectors/touchSelectors.mjs +17 -14
  178. package/dist/es/state/store.mjs +46 -46
  179. package/dist/es/state/tooltipSlice.mjs +64 -37
  180. package/dist/es/state/touchEventsMiddleware.mjs +35 -29
  181. package/dist/es/state/utils/useReportScale.mjs +16 -13
  182. package/dist/es/synchronisation/syncSelectors.mjs +3 -3
  183. package/dist/es/synchronisation/useChartSynchronisation.mjs +33 -19
  184. package/dist/es/types/event.mjs +164 -2
  185. package/dist/es/utils/ReduceCSSCalc.mjs +81 -49
  186. package/dist/es/utils/VueUtils.mjs +35 -14
  187. package/dist/es/utils/attrs.mjs +43 -26
  188. package/dist/es/utils/cartesian.mjs +47 -15
  189. package/dist/es/utils/chart.mjs +298 -197
  190. package/dist/es/utils/const.mjs +30 -2
  191. package/dist/es/utils/createContext.mjs +28 -9
  192. package/dist/es/utils/data-utils.mjs +9 -8
  193. package/dist/es/utils/data.mjs +35 -21
  194. package/dist/es/utils/events.mjs +5 -3
  195. package/dist/es/utils/getLinearRegression.mjs +28 -11
  196. package/dist/es/utils/grid.mjs +20 -5
  197. package/dist/es/utils/isDomainSpecifiedByUser.mjs +105 -54
  198. package/dist/es/utils/legend.mjs +13 -12
  199. package/dist/es/utils/log.mjs +10 -7
  200. package/dist/es/utils/payload/getUniqPayload.mjs +6 -4
  201. package/dist/es/utils/polar.mjs +37 -30
  202. package/dist/es/utils/props.mjs +16 -10
  203. package/dist/es/utils/resolveDefaultProps.mjs +23 -4
  204. package/dist/es/utils/scale/getNiceTickValues.mjs +127 -49
  205. package/dist/es/utils/scale/utils/arithmetic.mjs +49 -19
  206. package/dist/es/utils/scale/utils/utils.mjs +43 -24
  207. package/dist/es/utils/style.mjs +24 -13
  208. package/dist/es/utils/tick.mjs +34 -23
  209. package/dist/es/utils/tooltip/translate.mjs +63 -49
  210. package/dist/es/utils/validate.mjs +40 -29
  211. package/dist/hooks/useIsAnimating.d.ts +14 -0
  212. package/dist/shape/Trapezoid.d.ts +31 -0
  213. package/dist/shape/index.d.ts +1 -0
  214. package/dist/state/graphicalItemsSlice.d.ts +1 -1
  215. package/package.json +1 -1
@@ -1,12 +1,14 @@
1
- import { filterProps as e } from "../utils/VueUtils.mjs";
2
- import { createVNode as t, defineComponent as n, mergeProps as r } from "vue";
1
+ import { filterProps } from "../utils/VueUtils.mjs";
2
+ import { createVNode, defineComponent, mergeProps } from "vue";
3
3
  //#region src/container/Layer.tsx
4
- var i = /* @__PURE__ */ n({
4
+ var Layer = /* @__PURE__ */ defineComponent({
5
5
  name: "VChartsLayer",
6
- inheritAttrs: !1,
7
- setup(n, { attrs: i, slots: a }) {
8
- return () => t("g", r(i, e(i, !0), { class: "v-charts-layer" }), [a.default?.()]);
6
+ inheritAttrs: false,
7
+ setup(_, { attrs, slots }) {
8
+ return () => {
9
+ return createVNode("g", mergeProps(attrs, filterProps(attrs, true), { "class": "v-charts-layer" }), [slots.default?.()]);
10
+ };
9
11
  }
10
12
  });
11
13
  //#endregion
12
- export { i as Layer };
14
+ export { Layer };
@@ -1,5 +1,5 @@
1
- import e from "./ResponsiveContainer.vue_vue_type_script_setup_true_lang.mjs";
1
+ import ResponsiveContainer_vue_vue_type_script_setup_true_lang_default from "./ResponsiveContainer.vue_vue_type_script_setup_true_lang.mjs";
2
2
  //#region src/container/ResponsiveContainer.vue
3
- var t = e;
3
+ var ResponsiveContainer_default = ResponsiveContainer_vue_vue_type_script_setup_true_lang_default;
4
4
  //#endregion
5
- export { t as default };
5
+ export { ResponsiveContainer_default as default };
@@ -1,12 +1,13 @@
1
- import { isPercent as e } from "../utils/validate.mjs";
2
- import { normalizeStyle as t } from "../utils/style.mjs";
3
- import { provideSizeContext as n } from "./useSizeContext.mjs";
4
- import { Fragment as r, cloneVNode as i, computed as a, createBlock as o, createElementBlock as s, defineComponent as c, normalizeClass as l, normalizeStyle as u, onMounted as d, onUnmounted as f, openBlock as p, ref as m, resolveDynamicComponent as h, toRef as g, useSlots as _ } from "vue";
5
- import { useThrottleFn as v } from "@vueuse/core";
1
+ import { isPercent } from "../utils/validate.mjs";
2
+ import { normalizeStyle as normalizeStyle$1 } from "../utils/style.mjs";
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";
5
+ import { useThrottleFn } from "@vueuse/core";
6
6
  //#region src/container/ResponsiveContainer.vue?vue&type=script&setup=true&lang.ts
7
- var y = ["id"], b = /* @__PURE__ */ c({
7
+ var _hoisted_1 = ["id"];
8
+ var ResponsiveContainer_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
8
9
  name: "ResponsiveContainer",
9
- inheritAttrs: !1,
10
+ inheritAttrs: false,
10
11
  __name: "ResponsiveContainer",
11
12
  props: {
12
13
  aspect: {},
@@ -25,88 +26,119 @@ var y = ["id"], b = /* @__PURE__ */ c({
25
26
  style: {},
26
27
  onResize: {}
27
28
  },
28
- setup(c) {
29
- let b = c, x = _(), S = g(b, "debounce"), C = m({
30
- width: b.initialDimension.width,
31
- height: b.initialDimension.height
32
- }), w = a(() => e(b.width) ? C.value.width : b.width), T = a(() => {
33
- let t = e(b.height) ? C.value.height : b.height;
34
- return b.aspect && b.aspect > 0 && (b.width && (b.height == null || b.height === "auto") ? t = w.value / b.aspect : b.height && (b.width == null || b.width)), t;
35
- }), E = a(() => {
36
- let e = w.value;
37
- return b.aspect && b.aspect > 0 && b.height && (b.width == null || b.width === "auto") && (e = T.value * b.aspect), e;
29
+ setup(__props) {
30
+ const props = __props;
31
+ const slots = useSlots();
32
+ const debounce = toRef(props, "debounce");
33
+ const sizes = ref({
34
+ width: props.initialDimension.width,
35
+ height: props.initialDimension.height
38
36
  });
39
- n({
40
- sizes: C,
41
- calculatedWidth: E,
42
- calculatedHeight: T
37
+ const calculatedWidth = computed(() => {
38
+ return isPercent(props.width) ? sizes.value.width : props.width;
43
39
  });
44
- function D(e, t) {
45
- let n = Math.round(e), r = Math.round(t), { width: i, height: a } = C.value;
46
- i === n && a === r || (C.value = {
47
- width: n,
48
- height: r
49
- });
40
+ const calculatedHeight = computed(() => {
41
+ let height = isPercent(props.height) ? sizes.value.height : props.height;
42
+ if (props.aspect && props.aspect > 0) {
43
+ if (props.width && (props.height == null || props.height === "auto")) height = calculatedWidth.value / props.aspect;
44
+ else if (props.height && (props.width == null || props.width === "auto")) {}
45
+ }
46
+ return height;
47
+ });
48
+ const finalCalculatedWidth = computed(() => {
49
+ let width = calculatedWidth.value;
50
+ if (props.aspect && props.aspect > 0) {
51
+ if (props.height && (props.width == null || props.width === "auto")) width = calculatedHeight.value * props.aspect;
52
+ }
53
+ return width;
54
+ });
55
+ provideSizeContext({
56
+ sizes,
57
+ calculatedWidth: finalCalculatedWidth,
58
+ calculatedHeight
59
+ });
60
+ function setContainerSize(width, height) {
61
+ const roundedWidth = Math.round(width);
62
+ const roundedHeight = Math.round(height);
63
+ const { width: containerWidth, height: containerHeight } = sizes.value;
64
+ if (containerWidth === roundedWidth && containerHeight === roundedHeight) return;
65
+ sizes.value = {
66
+ width: roundedWidth,
67
+ height: roundedHeight
68
+ };
50
69
  }
51
- let O = v((e) => {
52
- let { width: t, height: n } = e[0].contentRect;
53
- D(t, n), b.onResize?.(t, n);
54
- }, S, !0, !1), k = m(), A = null;
55
- d(() => {
56
- A = new ResizeObserver(O);
57
- let { width: e, height: t } = k.value.getBoundingClientRect() ?? {
70
+ const handleResize = useThrottleFn((entries) => {
71
+ const { width: containerWidth, height: containerHeight } = entries[0].contentRect;
72
+ setContainerSize(containerWidth, containerHeight);
73
+ props.onResize?.(containerWidth, containerHeight);
74
+ }, debounce, true, false);
75
+ const containerRef = ref();
76
+ let observer = null;
77
+ onMounted(() => {
78
+ observer = new ResizeObserver(handleResize);
79
+ const { width: containerWidth, height: containerHeight } = containerRef.value.getBoundingClientRect() ?? {
58
80
  width: 0,
59
81
  height: 0
60
82
  };
61
- D(e, t), A.observe(k.value);
62
- }), f(() => {
63
- A?.disconnect();
83
+ setContainerSize(containerWidth, containerHeight);
84
+ observer.observe(containerRef.value);
85
+ });
86
+ onUnmounted(() => {
87
+ observer?.disconnect();
64
88
  });
65
- let j = a(() => {
66
- let { width: e, height: t } = C.value;
67
- return e >= 0 && t >= 0;
89
+ const isReady = computed(() => {
90
+ const { width: containerWidth, height: containerHeight } = sizes.value;
91
+ return containerWidth >= 0 && containerHeight >= 0;
68
92
  });
69
- function M(e) {
70
- let t = [];
71
- for (let n of e) n.type === r && Array.isArray(n.children) ? t.push(...M(n.children)) : t.push(n);
72
- return t;
93
+ function flattenSlotChildren(vnodes) {
94
+ const result = [];
95
+ for (const vnode of vnodes) if (vnode.type === Fragment && Array.isArray(vnode.children)) result.push(...flattenSlotChildren(vnode.children));
96
+ else result.push(vnode);
97
+ return result;
73
98
  }
74
- function N() {
75
- if (!j.value) return;
76
- let e = E.value, n = T.value, r = x.default?.();
77
- if (r) return M(r).map((r, a) => i(r, {
78
- width: e,
79
- height: n,
80
- key: r.key || `responsive-child-${a}`,
81
- style: {
82
- ...t({
83
- maxHeight: C.value.height,
84
- maxWidth: C.value.width
85
- }),
86
- height: "100%",
87
- width: "100%",
88
- ...r.props?.style
89
- }
90
- }));
99
+ function renderChildren() {
100
+ if (!isReady.value) return;
101
+ const calculatedWidthValue = finalCalculatedWidth.value;
102
+ const calculatedHeightValue = calculatedHeight.value;
103
+ const rawChildren = slots.default?.();
104
+ if (!rawChildren) return void 0;
105
+ return flattenSlotChildren(rawChildren).map((child, index) => {
106
+ return cloneVNode(child, {
107
+ width: calculatedWidthValue,
108
+ height: calculatedHeightValue,
109
+ key: child.key || `responsive-child-${index}`,
110
+ style: {
111
+ ...normalizeStyle$1({
112
+ maxHeight: sizes.value.height,
113
+ maxWidth: sizes.value.width
114
+ }),
115
+ height: "100%",
116
+ width: "100%",
117
+ ...child.props?.style
118
+ }
119
+ });
120
+ });
91
121
  }
92
- let P = a(() => ({
93
- ...b.style,
94
- ...t({
95
- width: b.width,
96
- height: b.height,
97
- minWidth: b.minWidth,
98
- minHeight: b.minHeight,
99
- maxHeight: b.maxHeight
122
+ const containerStyle = computed(() => ({
123
+ ...props.style,
124
+ ...normalizeStyle$1({
125
+ width: props.width,
126
+ height: props.height,
127
+ minWidth: props.minWidth,
128
+ minHeight: props.minHeight,
129
+ maxHeight: props.maxHeight
100
130
  })
101
131
  }));
102
- return (e, t) => (p(), s("div", {
103
- id: e.id ? `${e.id}` : void 0,
104
- ref_key: "containerRef",
105
- ref: k,
106
- class: l(["vcharts-responsive-container", [b.class]]),
107
- style: u(P.value)
108
- }, [(p(), o(h(() => N())))], 14, y));
132
+ return (_ctx, _cache) => {
133
+ return openBlock(), createElementBlock("div", {
134
+ id: _ctx.id ? `${_ctx.id}` : void 0,
135
+ ref_key: "containerRef",
136
+ ref: containerRef,
137
+ class: normalizeClass(["vcharts-responsive-container", [props.class]]),
138
+ style: normalizeStyle(containerStyle.value)
139
+ }, [(openBlock(), createBlock(resolveDynamicComponent(() => renderChildren())))], 14, _hoisted_1);
140
+ };
109
141
  }
110
142
  });
111
143
  //#endregion
112
- export { b as default };
144
+ export { ResponsiveContainer_vue_vue_type_script_setup_true_lang_default as default };
@@ -1,15 +1,18 @@
1
- import { createVNode as e, defineComponent as t, mergeProps as n } from "vue";
1
+ import { createVNode, defineComponent, mergeProps } from "vue";
2
2
  //#region src/container/Surface.tsx
3
- var r = /* @__PURE__ */ t({
3
+ /**
4
+ * @fileOverview Surface component for SVG rendering
5
+ */
6
+ var Surface = /* @__PURE__ */ defineComponent({
4
7
  name: "Surface",
5
8
  props: {
6
9
  width: {
7
10
  type: Number,
8
- required: !0
11
+ required: true
9
12
  },
10
13
  height: {
11
14
  type: Number,
12
- required: !0
15
+ required: true
13
16
  },
14
17
  viewBox: {
15
18
  type: Object,
@@ -32,27 +35,28 @@ var r = /* @__PURE__ */ t({
32
35
  default: void 0
33
36
  }
34
37
  },
35
- setup(t, { slots: r, attrs: i }) {
38
+ setup(props, { slots, attrs }) {
36
39
  return () => {
37
- let { width: a, height: o, viewBox: s, class: c, style: l, title: u, desc: d, ...f } = t, p = s || {
38
- width: a,
39
- height: o,
40
+ const { width, height, viewBox, class: className, style, title, desc, ...rest } = props;
41
+ const svgView = viewBox || {
42
+ width,
43
+ height,
40
44
  x: 0,
41
45
  y: 0
42
46
  };
43
- return e("svg", n({
44
- class: ["vcharts-surface", c],
45
- width: a,
46
- height: o,
47
- style: l,
48
- viewBox: `${p.x} ${p.y} ${p.width} ${p.height}`
49
- }, f, i), [
50
- u && e("title", null, [u]),
51
- d && e("desc", null, [d]),
52
- r.default?.()
47
+ return createVNode("svg", mergeProps({
48
+ "class": ["vcharts-surface", className],
49
+ "width": width,
50
+ "height": height,
51
+ "style": style,
52
+ "viewBox": `${svgView.x} ${svgView.y} ${svgView.width} ${svgView.height}`
53
+ }, rest, attrs), [
54
+ title && createVNode("title", null, [title]),
55
+ desc && createVNode("desc", null, [desc]),
56
+ slots.default?.()
53
57
  ]);
54
58
  };
55
59
  }
56
60
  });
57
61
  //#endregion
58
- export { r as default };
62
+ export { Surface as default };
@@ -1,5 +1,5 @@
1
- import { createContext as e } from "../utils/createContext.mjs";
1
+ import { createContext } from "../utils/createContext.mjs";
2
2
  //#region src/container/useSizeContext.ts
3
- var [t, n] = e("SizeContext");
3
+ var [useSizeContext, provideSizeContext] = createContext("SizeContext");
4
4
  //#endregion
5
- export { n as provideSizeContext };
5
+ export { provideSizeContext };
@@ -1,21 +1,27 @@
1
- import { useAppDispatch as e } from "../state/hooks.mjs";
2
- import { setChartData as t } from "../state/chartDataSlice.mjs";
3
- import { defineComponent as n, onUnmounted as r, watch as i } from "vue";
1
+ import { useAppDispatch } from "../state/hooks.mjs";
2
+ import { setChartData } from "../state/chartDataSlice.mjs";
3
+ import { defineComponent, onUnmounted, watch } from "vue";
4
4
  //#region src/context/ChartDataContextProvider.ts
5
- var a = n({
5
+ /**
6
+ * ChartDataContextProvider for Vue
7
+ * Sets chartData in store on mount/update, clears on unmount. Renders nothing.
8
+ */
9
+ var ChartDataContextProvider = defineComponent({
6
10
  name: "ChartDataContextProvider",
7
11
  props: { chartData: {
8
12
  type: Array,
9
- required: !0
13
+ required: true
10
14
  } },
11
- setup(n) {
12
- let a = e();
13
- return i(() => n.chartData, (e) => {
14
- a(t(Array.from(e)));
15
- }, { immediate: !0 }), r(() => {
16
- a(t(void 0));
17
- }), () => null;
15
+ setup(props) {
16
+ const dispatch = useAppDispatch();
17
+ watch(() => props.chartData, (val) => {
18
+ dispatch(setChartData(Array.from(val)));
19
+ }, { immediate: true });
20
+ onUnmounted(() => {
21
+ dispatch(setChartData(void 0));
22
+ });
23
+ return () => null;
18
24
  }
19
25
  });
20
26
  //#endregion
21
- export { a as ChartDataContextProvider };
27
+ export { ChartDataContextProvider };
@@ -1,19 +1,24 @@
1
- import { createContext as e } from "../utils/createContext.mjs";
2
- import { defineComponent as t } from "vue";
1
+ import { createContext } from "../utils/createContext.mjs";
2
+ import { defineComponent } from "vue";
3
3
  //#region src/context/PanoramaContextProvider.ts
4
- var [n, r] = e("PanoramaContext");
5
- function i() {
6
- return n(!1);
4
+ var [injectPanorama, providePanoramaContext] = createContext("PanoramaContext");
5
+ /**
6
+ * useIsPanorama composable
7
+ * Returns the injected isPanorama value (default: false)
8
+ */
9
+ function useIsPanorama() {
10
+ return injectPanorama(false);
7
11
  }
8
- t({
12
+ defineComponent({
9
13
  name: "PanoramaContextProvider",
10
14
  props: { isPanorama: {
11
15
  type: Boolean,
12
- required: !0
16
+ required: true
13
17
  } },
14
- setup(e, { slots: t }) {
15
- return r(!0), () => t.default?.();
18
+ setup(props, { slots }) {
19
+ providePanoramaContext(true);
20
+ return () => slots.default?.();
16
21
  }
17
22
  });
18
23
  //#endregion
19
- export { i as useIsPanorama };
24
+ export { useIsPanorama };
@@ -1,5 +1,5 @@
1
- import { useAppSelector as e } from "../state/hooks.mjs";
1
+ import { useAppSelector } from "../state/hooks.mjs";
2
2
  //#region src/context/accessibilityContext.tsx
3
- var t = () => e((e) => e.rootProps.accessibilityLayer);
3
+ var useAccessibilityLayer = () => useAppSelector((state) => state.rootProps.accessibilityLayer);
4
4
  //#endregion
5
- export { t as useAccessibilityLayer };
5
+ export { useAccessibilityLayer };
@@ -1,5 +1,5 @@
1
- import { createContext as e } from "../utils/createContext.mjs";
1
+ import { createContext } from "../utils/createContext.mjs";
2
2
  //#region src/context/cartesianLabelListContext.ts
3
- var [t, n] = e("CartesianLabelListContext");
3
+ var [useCartesianLabelListData, provideCartesianLabelListData] = createContext("CartesianLabelListContext");
4
4
  //#endregion
5
- export { n as provideCartesianLabelListData, t as useCartesianLabelListData };
5
+ export { provideCartesianLabelListData, useCartesianLabelListData };
@@ -1,46 +1,49 @@
1
- import { useIsPanorama as e } from "./PanoramaContextProvider.mjs";
2
- import { selectChartHeight as t, selectChartWidth as n } from "../state/selectors/containerSelectors.mjs";
3
- import { selectChartOffset as r, selectChartViewBox as i } from "../state/selectors/selectChartOffset.mjs";
4
- import { selectBrushDimensions as a, selectBrushSettings as o } from "../state/selectors/brushSelectors.mjs";
5
- import { selectChartLayout as s } from "../state/selectors/common.mjs";
6
- import { useAppSelector as c } from "../state/hooks.mjs";
7
- import { selectChartOffsetInternal as l } from "../state/selectors/selectChartOffsetInternal.mjs";
8
- import { computed as u } from "vue";
1
+ import { useIsPanorama } from "./PanoramaContextProvider.mjs";
2
+ import { selectChartHeight, selectChartWidth } from "../state/selectors/containerSelectors.mjs";
3
+ import { selectChartOffset, selectChartViewBox } from "../state/selectors/selectChartOffset.mjs";
4
+ import { selectBrushDimensions, selectBrushSettings } from "../state/selectors/brushSelectors.mjs";
5
+ import { selectChartLayout } from "../state/selectors/common.mjs";
6
+ import { useAppSelector } from "../state/hooks.mjs";
7
+ import { selectChartOffsetInternal } from "../state/selectors/selectChartOffsetInternal.mjs";
8
+ import { computed } from "vue";
9
9
  //#region src/context/chartLayoutContext.tsx
10
- function d() {
11
- return c(r);
10
+ function useOffset() {
11
+ return useAppSelector(selectChartOffset);
12
12
  }
13
- var f = () => c(s);
14
- function p() {
15
- let t = e(), n = c(i), r = c(a), s = c(o);
16
- return u(() => {
17
- if (!t || !r.value || !s.value) return n.value;
18
- let e = s.value.padding;
13
+ var useChartLayout = () => useAppSelector(selectChartLayout);
14
+ function useViewBox() {
15
+ const panorama = useIsPanorama();
16
+ const rootViewBox = useAppSelector(selectChartViewBox);
17
+ const brushDimensions = useAppSelector(selectBrushDimensions);
18
+ const brushPadding = useAppSelector(selectBrushSettings);
19
+ return computed(() => {
20
+ if (!panorama || !brushDimensions.value || !brushPadding.value) return rootViewBox.value;
21
+ const padding = brushPadding.value.padding;
19
22
  return {
20
- width: r.value.width - e.left - e.right,
21
- height: r.value.height - e.top - e.bottom,
22
- x: e.left,
23
- y: e.top
23
+ width: brushDimensions.value.width - padding.left - padding.right,
24
+ height: brushDimensions.value.height - padding.top - padding.bottom,
25
+ x: padding.left,
26
+ y: padding.top
24
27
  };
25
28
  });
26
29
  }
27
- function m() {
28
- return c(n);
30
+ function useChartWidth() {
31
+ return useAppSelector(selectChartWidth);
29
32
  }
30
- function h() {
31
- return c(t);
33
+ function useChartHeight() {
34
+ return useAppSelector(selectChartHeight);
32
35
  }
33
- function g() {
34
- return c(l);
36
+ function useOffsetInternal() {
37
+ return useAppSelector(selectChartOffsetInternal);
35
38
  }
36
- var _ = {
39
+ var manyComponentsThrowErrorsIfMarginIsUndefined = {
37
40
  top: 0,
38
41
  right: 0,
39
42
  bottom: 0,
40
43
  left: 0
41
44
  };
42
- function v() {
43
- return c((e) => e.layout.margin ?? _);
45
+ function useMargin() {
46
+ return useAppSelector((state) => state.layout.margin ?? manyComponentsThrowErrorsIfMarginIsUndefined);
44
47
  }
45
48
  //#endregion
46
- export { h as useChartHeight, f as useChartLayout, m as useChartWidth, v as useMargin, d as useOffset, g as useOffsetInternal, p as useViewBox };
49
+ export { useChartHeight, useChartLayout, useChartWidth, useMargin, useOffset, useOffsetInternal, useViewBox };
@@ -1,5 +1,5 @@
1
- import { createContext as e } from "../utils/createContext.mjs";
1
+ import { createContext } from "../utils/createContext.mjs";
2
2
  //#region src/context/cursorLayerContext.ts
3
- var [t, n] = e("CursorLayerContext");
3
+ var [useCursorLayerRef, provideCursorLayerRef] = createContext("CursorLayerContext");
4
4
  //#endregion
5
- export { n as provideCursorLayerRef, t as useCursorLayerRef };
5
+ export { provideCursorLayerRef, useCursorLayerRef };
@@ -1,5 +1,5 @@
1
- import { createContext as e } from "../utils/createContext.mjs";
1
+ import { createContext } from "../utils/createContext.mjs";
2
2
  //#region src/context/graphicalLayerContext.ts
3
- var [t, n] = e("GraphicalLayerContext");
3
+ var [useGraphicalLayerRef, provideGraphicalLayerRef] = createContext("GraphicalLayerContext");
4
4
  //#endregion
5
- export { n as provideGraphicalLayerRef, t as useGraphicalLayerRef };
5
+ export { provideGraphicalLayerRef, useGraphicalLayerRef };
@@ -1,5 +1,5 @@
1
- import { createContext as e } from "../utils/createContext.mjs";
1
+ import { createContext } from "../utils/createContext.mjs";
2
2
  //#region src/context/labelLayerContext.ts
3
- var [t, n] = e("LabelLayerContext");
3
+ var [useLabelLayerRef, provideLabelLayerRef] = createContext("LabelLayerContext");
4
4
  //#endregion
5
- export { n as provideLabelLayerRef, t as useLabelLayerRef };
5
+ export { provideLabelLayerRef, useLabelLayerRef };
@@ -1,8 +1,8 @@
1
- import { computed as e, inject as t } from "vue";
1
+ import { computed, inject } from "vue";
2
2
  //#region src/context/polarLabelViewBoxContext.ts
3
- var n = Symbol("polar-label-view-box");
4
- function r() {
5
- return t(n, e(() => void 0));
3
+ var POLAR_LABEL_VIEW_BOX_KEY = Symbol("polar-label-view-box");
4
+ function usePolarLabelViewBox() {
5
+ return inject(POLAR_LABEL_VIEW_BOX_KEY, computed(() => void 0));
6
6
  }
7
7
  //#endregion
8
- export { n as POLAR_LABEL_VIEW_BOX_KEY, r as usePolarLabelViewBox };
8
+ export { POLAR_LABEL_VIEW_BOX_KEY, usePolarLabelViewBox };
@@ -1,15 +1,17 @@
1
- import { getBandSizeOfAxis as e } from "../utils/chart.mjs";
2
- import { selectTooltipAxis as t, selectTooltipAxisScale as n, selectTooltipAxisTicks as r } from "../state/selectors/tooltipSelectors.mjs";
3
- import { useAppSelector as i } from "../state/hooks.mjs";
4
- import { computed as a } from "vue";
1
+ import { getBandSizeOfAxis } from "../utils/chart.mjs";
2
+ import { selectTooltipAxis, selectTooltipAxisScale, selectTooltipAxisTicks } from "../state/selectors/tooltipSelectors.mjs";
3
+ import { useAppSelector } from "../state/hooks.mjs";
4
+ import { computed } from "vue";
5
5
  //#region src/context/useTooltipAxis.ts
6
- var o = () => i(t);
7
- function s() {
8
- let t = o(), s = i(r), c = i(n);
9
- return a(() => e({
10
- ...t.value,
11
- scale: c.value
12
- }, s.value));
6
+ var useTooltipAxis = () => useAppSelector(selectTooltipAxis);
7
+ function useTooltipAxisBandSize() {
8
+ const tooltipAxis = useTooltipAxis();
9
+ const tooltipTicks = useAppSelector(selectTooltipAxisTicks);
10
+ const tooltipAxisScale = useAppSelector(selectTooltipAxisScale);
11
+ return computed(() => getBandSizeOfAxis({
12
+ ...tooltipAxis.value,
13
+ scale: tooltipAxisScale.value
14
+ }, tooltipTicks.value));
13
15
  }
14
16
  //#endregion
15
- export { s as useTooltipAxisBandSize };
17
+ export { useTooltipAxisBandSize };