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,5 +1,5 @@
1
1
  //#region src/cartesian/cartesian-grid/const.ts
2
- var e = {
2
+ var CartesianAxisDefaultProps = {
3
3
  x: 0,
4
4
  y: 0,
5
5
  width: 0,
@@ -13,17 +13,324 @@ var e = {
13
13
  orientation: "bottom",
14
14
  ticks: [],
15
15
  stroke: "#666",
16
- tickLine: !0,
17
- axisLine: !0,
18
- mirror: !1,
16
+ tickLine: true,
17
+ axisLine: true,
18
+ mirror: false,
19
19
  minTickGap: 5,
20
20
  tickSize: 6,
21
21
  tickMargin: 2,
22
22
  interval: "preserveEnd"
23
- }, t = ["viewBox"], n = ["points", "pathLength"], r = {
24
- svg: t,
25
- polygon: n,
26
- polyline: n
27
- }, i = /* @__PURE__ */ "aria-activedescendant.aria-atomic.aria-autocomplete.aria-busy.aria-checked.aria-colcount.aria-colindex.aria-colspan.aria-controls.aria-current.aria-describedby.aria-details.aria-disabled.aria-errormessage.aria-expanded.aria-flowto.aria-haspopup.aria-hidden.aria-invalid.aria-keyshortcuts.aria-label.aria-labelledby.aria-level.aria-live.aria-modal.aria-multiline.aria-multiselectable.aria-orientation.aria-owns.aria-placeholder.aria-posinset.aria-pressed.aria-readonly.aria-relevant.aria-required.aria-roledescription.aria-rowcount.aria-rowindex.aria-rowspan.aria-selected.aria-setsize.aria-sort.aria-valuemax.aria-valuemin.aria-valuenow.aria-valuetext.class.color.height.id.lang.max.media.method.min.name.style.target.width.role.tabIndex.accentHeight.accumulate.additive.alignmentBaseline.allowReorder.alphabetic.amplitude.arabicForm.ascent.attributeName.attributeType.autoReverse.azimuth.baseFrequency.baselineShift.baseProfile.bbox.begin.bias.by.calcMode.capHeight.clip.clipPath.clipPathUnits.clipRule.colorInterpolation.colorInterpolationFilters.colorProfile.colorRendering.contentScriptType.contentStyleType.cursor.cx.cy.d.decelerate.descent.diffuseConstant.direction.display.divisor.dominantBaseline.dur.dx.dy.edgeMode.elevation.enableBackground.end.exponent.externalResourcesRequired.fill.fillOpacity.fillRule.filter.filterRes.filterUnits.floodColor.floodOpacity.focusable.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.format.from.fx.fy.g1.g2.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.glyphRef.gradientTransform.gradientUnits.hanging.horizAdvX.horizOriginX.href.ideographic.imageRendering.in2.in.intercept.k1.k2.k3.k4.k.kernelMatrix.kernelUnitLength.kerning.keyPoints.keySplines.keyTimes.lengthAdjust.letterSpacing.lightingColor.limitingConeAngle.local.markerEnd.markerHeight.markerMid.markerStart.markerUnits.markerWidth.mask.maskContentUnits.maskUnits.mathematical.mode.numOctaves.offset.opacity.operator.order.orient.orientation.origin.overflow.overlinePosition.overlineThickness.paintOrder.panose1.pathLength.patternContentUnits.patternTransform.patternUnits.pointerEvents.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.r.radius.refX.refY.renderingIntent.repeatCount.repeatDur.requiredExtensions.requiredFeatures.restart.result.rotate.rx.ry.seed.shapeRendering.slope.spacing.specularConstant.specularExponent.speed.spreadMethod.startOffset.stdDeviation.stemh.stemv.stitchTiles.stopColor.stopOpacity.strikethroughPosition.strikethroughThickness.string.stroke.stroke-dasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.strokeMiterlimit.strokeOpacity.strokeWidth.surfaceScale.systemLanguage.tableValues.targetX.targetY.textAnchor.textDecoration.textLength.textRendering.to.transform.u1.u2.underlinePosition.underlineThickness.unicode.unicodeBidi.unicodeRange.unitsPerEm.vAlphabetic.values.vectorEffect.version.vertAdvY.vertOriginX.vertOriginY.vHanging.vIdeographic.viewTarget.visibility.vMathematical.widths.wordSpacing.writingMode.x1.x2.x.xChannelSelector.xHeight.xlinkActuate.xlinkArcrole.xlinkHref.xlinkRole.xlinkShow.xlinkTitle.xlinkType.xmlBase.xmlLang.xmlns.xmlnsXlink.xmlSpace.y1.y2.y.yChannelSelector.z.zoomAndPan.ref.key.angle".split(".");
23
+ };
24
+ var SVGContainerPropKeys = ["viewBox"];
25
+ var PolyElementKeys = ["points", "pathLength"];
26
+ /** map of svg element types to unique svg attributes that belong to that element */
27
+ var FilteredElementKeyMap = {
28
+ svg: SVGContainerPropKeys,
29
+ polygon: PolyElementKeys,
30
+ polyline: PolyElementKeys
31
+ };
32
+ var SVGElementPropKeys = [
33
+ "aria-activedescendant",
34
+ "aria-atomic",
35
+ "aria-autocomplete",
36
+ "aria-busy",
37
+ "aria-checked",
38
+ "aria-colcount",
39
+ "aria-colindex",
40
+ "aria-colspan",
41
+ "aria-controls",
42
+ "aria-current",
43
+ "aria-describedby",
44
+ "aria-details",
45
+ "aria-disabled",
46
+ "aria-errormessage",
47
+ "aria-expanded",
48
+ "aria-flowto",
49
+ "aria-haspopup",
50
+ "aria-hidden",
51
+ "aria-invalid",
52
+ "aria-keyshortcuts",
53
+ "aria-label",
54
+ "aria-labelledby",
55
+ "aria-level",
56
+ "aria-live",
57
+ "aria-modal",
58
+ "aria-multiline",
59
+ "aria-multiselectable",
60
+ "aria-orientation",
61
+ "aria-owns",
62
+ "aria-placeholder",
63
+ "aria-posinset",
64
+ "aria-pressed",
65
+ "aria-readonly",
66
+ "aria-relevant",
67
+ "aria-required",
68
+ "aria-roledescription",
69
+ "aria-rowcount",
70
+ "aria-rowindex",
71
+ "aria-rowspan",
72
+ "aria-selected",
73
+ "aria-setsize",
74
+ "aria-sort",
75
+ "aria-valuemax",
76
+ "aria-valuemin",
77
+ "aria-valuenow",
78
+ "aria-valuetext",
79
+ "class",
80
+ "color",
81
+ "height",
82
+ "id",
83
+ "lang",
84
+ "max",
85
+ "media",
86
+ "method",
87
+ "min",
88
+ "name",
89
+ "style",
90
+ "target",
91
+ "width",
92
+ "role",
93
+ "tabIndex",
94
+ "accentHeight",
95
+ "accumulate",
96
+ "additive",
97
+ "alignmentBaseline",
98
+ "allowReorder",
99
+ "alphabetic",
100
+ "amplitude",
101
+ "arabicForm",
102
+ "ascent",
103
+ "attributeName",
104
+ "attributeType",
105
+ "autoReverse",
106
+ "azimuth",
107
+ "baseFrequency",
108
+ "baselineShift",
109
+ "baseProfile",
110
+ "bbox",
111
+ "begin",
112
+ "bias",
113
+ "by",
114
+ "calcMode",
115
+ "capHeight",
116
+ "clip",
117
+ "clipPath",
118
+ "clipPathUnits",
119
+ "clipRule",
120
+ "colorInterpolation",
121
+ "colorInterpolationFilters",
122
+ "colorProfile",
123
+ "colorRendering",
124
+ "contentScriptType",
125
+ "contentStyleType",
126
+ "cursor",
127
+ "cx",
128
+ "cy",
129
+ "d",
130
+ "decelerate",
131
+ "descent",
132
+ "diffuseConstant",
133
+ "direction",
134
+ "display",
135
+ "divisor",
136
+ "dominantBaseline",
137
+ "dur",
138
+ "dx",
139
+ "dy",
140
+ "edgeMode",
141
+ "elevation",
142
+ "enableBackground",
143
+ "end",
144
+ "exponent",
145
+ "externalResourcesRequired",
146
+ "fill",
147
+ "fillOpacity",
148
+ "fillRule",
149
+ "filter",
150
+ "filterRes",
151
+ "filterUnits",
152
+ "floodColor",
153
+ "floodOpacity",
154
+ "focusable",
155
+ "fontFamily",
156
+ "fontSize",
157
+ "fontSizeAdjust",
158
+ "fontStretch",
159
+ "fontStyle",
160
+ "fontVariant",
161
+ "fontWeight",
162
+ "format",
163
+ "from",
164
+ "fx",
165
+ "fy",
166
+ "g1",
167
+ "g2",
168
+ "glyphName",
169
+ "glyphOrientationHorizontal",
170
+ "glyphOrientationVertical",
171
+ "glyphRef",
172
+ "gradientTransform",
173
+ "gradientUnits",
174
+ "hanging",
175
+ "horizAdvX",
176
+ "horizOriginX",
177
+ "href",
178
+ "ideographic",
179
+ "imageRendering",
180
+ "in2",
181
+ "in",
182
+ "intercept",
183
+ "k1",
184
+ "k2",
185
+ "k3",
186
+ "k4",
187
+ "k",
188
+ "kernelMatrix",
189
+ "kernelUnitLength",
190
+ "kerning",
191
+ "keyPoints",
192
+ "keySplines",
193
+ "keyTimes",
194
+ "lengthAdjust",
195
+ "letterSpacing",
196
+ "lightingColor",
197
+ "limitingConeAngle",
198
+ "local",
199
+ "markerEnd",
200
+ "markerHeight",
201
+ "markerMid",
202
+ "markerStart",
203
+ "markerUnits",
204
+ "markerWidth",
205
+ "mask",
206
+ "maskContentUnits",
207
+ "maskUnits",
208
+ "mathematical",
209
+ "mode",
210
+ "numOctaves",
211
+ "offset",
212
+ "opacity",
213
+ "operator",
214
+ "order",
215
+ "orient",
216
+ "orientation",
217
+ "origin",
218
+ "overflow",
219
+ "overlinePosition",
220
+ "overlineThickness",
221
+ "paintOrder",
222
+ "panose1",
223
+ "pathLength",
224
+ "patternContentUnits",
225
+ "patternTransform",
226
+ "patternUnits",
227
+ "pointerEvents",
228
+ "pointsAtX",
229
+ "pointsAtY",
230
+ "pointsAtZ",
231
+ "preserveAlpha",
232
+ "preserveAspectRatio",
233
+ "primitiveUnits",
234
+ "r",
235
+ "radius",
236
+ "refX",
237
+ "refY",
238
+ "renderingIntent",
239
+ "repeatCount",
240
+ "repeatDur",
241
+ "requiredExtensions",
242
+ "requiredFeatures",
243
+ "restart",
244
+ "result",
245
+ "rotate",
246
+ "rx",
247
+ "ry",
248
+ "seed",
249
+ "shapeRendering",
250
+ "slope",
251
+ "spacing",
252
+ "specularConstant",
253
+ "specularExponent",
254
+ "speed",
255
+ "spreadMethod",
256
+ "startOffset",
257
+ "stdDeviation",
258
+ "stemh",
259
+ "stemv",
260
+ "stitchTiles",
261
+ "stopColor",
262
+ "stopOpacity",
263
+ "strikethroughPosition",
264
+ "strikethroughThickness",
265
+ "string",
266
+ "stroke",
267
+ "stroke-dasharray",
268
+ "strokeDashoffset",
269
+ "strokeLinecap",
270
+ "strokeLinejoin",
271
+ "strokeMiterlimit",
272
+ "strokeOpacity",
273
+ "strokeWidth",
274
+ "surfaceScale",
275
+ "systemLanguage",
276
+ "tableValues",
277
+ "targetX",
278
+ "targetY",
279
+ "textAnchor",
280
+ "textDecoration",
281
+ "textLength",
282
+ "textRendering",
283
+ "to",
284
+ "transform",
285
+ "u1",
286
+ "u2",
287
+ "underlinePosition",
288
+ "underlineThickness",
289
+ "unicode",
290
+ "unicodeBidi",
291
+ "unicodeRange",
292
+ "unitsPerEm",
293
+ "vAlphabetic",
294
+ "values",
295
+ "vectorEffect",
296
+ "version",
297
+ "vertAdvY",
298
+ "vertOriginX",
299
+ "vertOriginY",
300
+ "vHanging",
301
+ "vIdeographic",
302
+ "viewTarget",
303
+ "visibility",
304
+ "vMathematical",
305
+ "widths",
306
+ "wordSpacing",
307
+ "writingMode",
308
+ "x1",
309
+ "x2",
310
+ "x",
311
+ "xChannelSelector",
312
+ "xHeight",
313
+ "xlinkActuate",
314
+ "xlinkArcrole",
315
+ "xlinkHref",
316
+ "xlinkRole",
317
+ "xlinkShow",
318
+ "xlinkTitle",
319
+ "xlinkType",
320
+ "xmlBase",
321
+ "xmlLang",
322
+ "xmlns",
323
+ "xmlnsXlink",
324
+ "xmlSpace",
325
+ "y1",
326
+ "y2",
327
+ "y",
328
+ "yChannelSelector",
329
+ "z",
330
+ "zoomAndPan",
331
+ "ref",
332
+ "key",
333
+ "angle"
334
+ ];
28
335
  //#endregion
29
- export { e as CartesianAxisDefaultProps, r as FilteredElementKeyMap, i as SVGElementPropKeys };
336
+ export { CartesianAxisDefaultProps, FilteredElementKeyMap, SVGElementPropKeys };
@@ -1,17 +1,22 @@
1
- import { filterProps as e } from "../../utils/VueUtils.mjs";
2
- import { createVNode as t, mergeProps as n } from "vue";
1
+ import { filterProps } from "../../utils/VueUtils.mjs";
2
+ import { createVNode, mergeProps } from "vue";
3
3
  //#region src/cartesian/cartesian-grid/utils.tsx
4
- function r(r, i, a) {
5
- if (r) return r(a);
6
- let { x1: o, y1: s, x2: c, y2: l, key: u, ...d } = { ...a }, { offset: f, ...p } = e(d, !1);
7
- return t("line", n(p, {
8
- x1: o,
9
- y1: s,
10
- x2: c,
11
- y2: l,
12
- fill: "none",
13
- key: u
4
+ /**
5
+ * Render a grid line item.
6
+ * Priority: slot > default <line> with optional SVG attr overrides from `option`.
7
+ */
8
+ function renderLineItem(slot, option, props) {
9
+ if (slot) return slot(props);
10
+ const { x1, y1, x2, y2, key, ...others } = { ...props };
11
+ const { offset: __, ...restOfFilteredProps } = filterProps(others, false);
12
+ return createVNode("line", mergeProps(restOfFilteredProps, {
13
+ "x1": x1,
14
+ "y1": y1,
15
+ "x2": x2,
16
+ "y2": y2,
17
+ "fill": "none",
18
+ "key": key
14
19
  }), null);
15
20
  }
16
21
  //#endregion
17
- export { r as renderLineItem };
22
+ export { renderLineItem };
@@ -1,21 +1,21 @@
1
- import { selectAxisWithScale as e } from "../../state/selectors/axisSelectors.mjs";
2
- import { useAppSelector as t } from "../../state/hooks.mjs";
3
- import { useChartLayout as n } from "../../context/chartLayoutContext.mjs";
4
- import { Layer as r } from "../../container/Layer.mjs";
5
- import { useErrorBarContext as i, useErrorBarRegistry as a } from "./ErrorBarContext.mjs";
6
- import { createVNode as o, defineComponent as s, isVNode as c, onUnmounted as l } from "vue";
1
+ import { selectAxisWithScale } from "../../state/selectors/axisSelectors.mjs";
2
+ import { useAppSelector } from "../../state/hooks.mjs";
3
+ import { useChartLayout } from "../../context/chartLayoutContext.mjs";
4
+ import { Layer } from "../../container/Layer.mjs";
5
+ import { useErrorBarContext, useErrorBarRegistry } from "./ErrorBarContext.mjs";
6
+ import { createVNode, defineComponent, isVNode, onUnmounted } from "vue";
7
7
  //#region src/cartesian/error-bar/ErrorBar.tsx
8
- function u(e) {
9
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !c(e);
8
+ function _isSlot(s) {
9
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
10
10
  }
11
- var d = {
11
+ var ErrorBarVueProps = {
12
12
  dataKey: {
13
13
  type: [
14
14
  String,
15
15
  Number,
16
16
  Function
17
17
  ],
18
- required: !0
18
+ required: true
19
19
  },
20
20
  width: {
21
21
  type: Number,
@@ -30,86 +30,114 @@ var d = {
30
30
  type: [Number, String],
31
31
  default: 1.5
32
32
  }
33
- }, f = /* @__PURE__ */ s({
33
+ };
34
+ var ErrorBar = /* @__PURE__ */ defineComponent({
34
35
  name: "ErrorBar",
35
- props: d,
36
- setup(s) {
37
- let c = n(), { data: d, dataPointFormatter: f, xAxisId: p, yAxisId: m, errorBarOffset: h } = i(), g = a(null);
38
- if (g) {
39
- let e = {
40
- direction: s.direction ?? (c.value === "horizontal" ? "y" : "x"),
41
- dataKey: s.dataKey
36
+ props: ErrorBarVueProps,
37
+ setup(props) {
38
+ const layout = useChartLayout();
39
+ const { data, dataPointFormatter, xAxisId, yAxisId, errorBarOffset } = useErrorBarContext();
40
+ const registry = useErrorBarRegistry(null);
41
+ if (registry) {
42
+ const settings = {
43
+ direction: props.direction ?? (layout.value === "horizontal" ? "y" : "x"),
44
+ dataKey: props.dataKey
42
45
  };
43
- g.register(e), l(() => g.unregister(e));
46
+ registry.register(settings);
47
+ onUnmounted(() => registry.unregister(settings));
44
48
  }
45
- let _ = t((t) => e(t, "xAxis", p, !1)), v = t((t) => e(t, "yAxis", m, !1));
49
+ const xAxis = useAppSelector((state) => selectAxisWithScale(state, "xAxis", xAxisId, false));
50
+ const yAxis = useAppSelector((state) => selectAxisWithScale(state, "yAxis", yAxisId, false));
46
51
  return () => {
47
- let e = _.value, t = v.value;
48
- if (e?.scale == null || t?.scale == null || d.value == null) return null;
49
- let n = s.direction ?? (c.value === "horizontal" ? "y" : "x");
50
- if (n === "x" && e.type !== "number") return null;
51
- let i = h.value, a = d.value.map((a, c) => {
52
- let l, { x: d, y: p, value: m, errorVal: h } = f(a, s.dataKey, n);
53
- if (!h || d == null || p == null) return null;
54
- let g = [], _, v;
55
- if (Array.isArray(h)) {
56
- let [e, t] = h;
57
- if (e == null || t == null) return null;
58
- _ = e, v = t;
59
- } else _ = v = h;
60
- if (n === "x") {
61
- let { scale: t } = e, n = p + i, r = n + s.width, a = n - s.width, o = t(m - _), c = t(m + v);
62
- o != null && c != null && (g.push({
63
- x1: c,
64
- y1: r,
65
- x2: c,
66
- y2: a
67
- }), g.push({
68
- x1: o,
69
- y1: n,
70
- x2: c,
71
- y2: n
72
- }), g.push({
73
- x1: o,
74
- y1: r,
75
- x2: o,
76
- y2: a
77
- }));
78
- } else if (n === "y") {
79
- let { scale: e } = t, n = d + i, r = n - s.width, a = n + s.width, o = e(m - _), c = e(m + v);
80
- o != null && c != null && (g.push({
81
- x1: r,
82
- y1: c,
83
- x2: a,
84
- y2: c
85
- }), g.push({
86
- x1: n,
87
- y1: o,
88
- x2: n,
89
- y2: c
90
- }), g.push({
91
- x1: r,
92
- y1: o,
93
- x2: a,
94
- y2: o
95
- }));
52
+ const xAxisVal = xAxis.value;
53
+ const yAxisVal = yAxis.value;
54
+ if (xAxisVal?.scale == null || yAxisVal?.scale == null || data.value == null) return null;
55
+ const direction = props.direction ?? (layout.value === "horizontal" ? "y" : "x");
56
+ if (direction === "x" && xAxisVal.type !== "number") return null;
57
+ const offset = errorBarOffset.value;
58
+ const errorBars = data.value.map((entry, dataIndex) => {
59
+ let _slot;
60
+ const { x, y, value, errorVal } = dataPointFormatter(entry, props.dataKey, direction);
61
+ if (!errorVal || x == null || y == null) return null;
62
+ const lineCoordinates = [];
63
+ let lowBound, highBound;
64
+ if (Array.isArray(errorVal)) {
65
+ const [low, high] = errorVal;
66
+ if (low == null || high == null) return null;
67
+ lowBound = low;
68
+ highBound = high;
69
+ } else lowBound = highBound = errorVal;
70
+ if (direction === "x") {
71
+ const { scale } = xAxisVal;
72
+ const yMid = y + offset;
73
+ const yMin = yMid + props.width;
74
+ const yMax = yMid - props.width;
75
+ const xMin = scale(value - lowBound);
76
+ const xMax = scale(value + highBound);
77
+ if (xMin != null && xMax != null) {
78
+ lineCoordinates.push({
79
+ x1: xMax,
80
+ y1: yMin,
81
+ x2: xMax,
82
+ y2: yMax
83
+ });
84
+ lineCoordinates.push({
85
+ x1: xMin,
86
+ y1: yMid,
87
+ x2: xMax,
88
+ y2: yMid
89
+ });
90
+ lineCoordinates.push({
91
+ x1: xMin,
92
+ y1: yMin,
93
+ x2: xMin,
94
+ y2: yMax
95
+ });
96
+ }
97
+ } else if (direction === "y") {
98
+ const { scale } = yAxisVal;
99
+ const xMid = x + offset;
100
+ const xMin = xMid - props.width;
101
+ const xMax = xMid + props.width;
102
+ const yMin = scale(value - lowBound);
103
+ const yMax = scale(value + highBound);
104
+ if (yMin != null && yMax != null) {
105
+ lineCoordinates.push({
106
+ x1: xMin,
107
+ y1: yMax,
108
+ x2: xMax,
109
+ y2: yMax
110
+ });
111
+ lineCoordinates.push({
112
+ x1: xMid,
113
+ y1: yMin,
114
+ x2: xMid,
115
+ y2: yMax
116
+ });
117
+ lineCoordinates.push({
118
+ x1: xMin,
119
+ y1: yMin,
120
+ x2: xMax,
121
+ y2: yMin
122
+ });
123
+ }
96
124
  }
97
- return o(r, {
98
- class: "v-charts-errorBar",
99
- key: `bar-${d}-${p}-${m}-${c}`
100
- }, u(l = g.map((e, t) => o("line", {
101
- key: `errorbar-${c}-${e.x1}-${e.y1}-${e.x2}-${e.y2}-${t}`,
102
- x1: e.x1,
103
- y1: e.y1,
104
- x2: e.x2,
105
- y2: e.y2,
106
- stroke: s.stroke,
107
- "stroke-width": s.strokeWidth
108
- }, null))) ? l : { default: () => [l] });
125
+ return createVNode(Layer, {
126
+ "class": "v-charts-errorBar",
127
+ "key": `bar-${x}-${y}-${value}-${dataIndex}`
128
+ }, _isSlot(_slot = lineCoordinates.map((c, lineIndex) => createVNode("line", {
129
+ "key": `errorbar-${dataIndex}-${c.x1}-${c.y1}-${c.x2}-${c.y2}-${lineIndex}`,
130
+ "x1": c.x1,
131
+ "y1": c.y1,
132
+ "x2": c.x2,
133
+ "y2": c.y2,
134
+ "stroke": props.stroke,
135
+ "stroke-width": props.strokeWidth
136
+ }, null))) ? _slot : { default: () => [_slot] });
109
137
  });
110
- return o(r, { class: "v-charts-errorBars" }, u(a) ? a : { default: () => [a] });
138
+ return createVNode(Layer, { "class": "v-charts-errorBars" }, _isSlot(errorBars) ? errorBars : { default: () => [errorBars] });
111
139
  };
112
140
  }
113
141
  });
114
142
  //#endregion
115
- export { f as ErrorBar, d as ErrorBarVueProps };
143
+ export { ErrorBar, ErrorBarVueProps };
@@ -1,19 +1,20 @@
1
- import { createContext as e } from "../../utils/createContext.mjs";
2
- import { shallowRef as t } from "vue";
3
- import { createContext as n } from "motion-v";
1
+ import { createContext as createContext$1 } from "../../utils/createContext.mjs";
2
+ import { shallowRef } from "vue";
3
+ import { createContext } from "motion-v";
4
4
  //#region src/cartesian/error-bar/ErrorBarContext.ts
5
- var [r, i] = n("ErrorBarContext"), [a, o] = e("ErrorBarRegistry");
6
- function s() {
7
- let e = t([]);
5
+ var [useErrorBarContext, provideErrorBarContext] = createContext("ErrorBarContext");
6
+ var [useErrorBarRegistry, provideErrorBarRegistry] = createContext$1("ErrorBarRegistry");
7
+ function createErrorBarRegistry() {
8
+ const errorBars = shallowRef([]);
8
9
  return {
9
- errorBars: e,
10
- register(t) {
11
- e.value = [...e.value, t];
10
+ errorBars,
11
+ register(settings) {
12
+ errorBars.value = [...errorBars.value, settings];
12
13
  },
13
- unregister(t) {
14
- e.value = e.value.filter((e) => e !== t);
14
+ unregister(settings) {
15
+ errorBars.value = errorBars.value.filter((s) => s !== settings);
15
16
  }
16
17
  };
17
18
  }
18
19
  //#endregion
19
- export { s as createErrorBarRegistry, i as provideErrorBarContext, o as provideErrorBarRegistry, r as useErrorBarContext, a as useErrorBarRegistry };
20
+ export { createErrorBarRegistry, provideErrorBarContext, provideErrorBarRegistry, useErrorBarContext, useErrorBarRegistry };