vccs 0.1.0 → 0.3.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.
- package/README.md +151 -0
- package/dist/animation/Animate.d.ts +1 -1
- package/dist/cartesian/area/type.d.ts +3 -3
- package/dist/cartesian/bar/type.d.ts +1 -13
- package/dist/cartesian/brush/components/Slide.d.ts +1 -1
- package/dist/cartesian/brush/components/TravellerLayer.d.ts +1 -1
- package/dist/cartesian/brush/type.d.ts +2 -1
- package/dist/cartesian/cartesian-axis/CartesianAxis.d.ts +2 -1
- package/dist/cartesian/funnel/Funnel.d.ts +2 -0
- package/dist/cartesian/funnel/index.d.ts +2 -0
- package/dist/cartesian/funnel/type.d.ts +74 -6
- package/dist/cartesian/index.d.ts +2 -0
- package/dist/cartesian/line/Line.d.ts +7 -13
- package/dist/cartesian/line/type.d.ts +4 -17
- package/dist/cartesian/reference-area/ReferenceArea.d.ts +16 -16
- package/dist/cartesian/reference-dot/ReferenceDot.d.ts +143 -0
- package/dist/cartesian/reference-dot/index.d.ts +2 -0
- package/dist/cartesian/reference-line/ReferenceLine.d.ts +8 -8
- package/dist/cartesian/scatter/Scatter.d.ts +1 -1
- package/dist/chart/FunnelChart.d.ts +1 -0
- package/dist/chart/RechartsWrapper.d.ts +7 -3
- package/dist/chart/Surface.d.ts +2 -1
- package/dist/chart/Treemap.d.ts +237 -0
- package/dist/chart/generateCategoricalChart.d.ts +2 -1
- package/dist/chart/index.d.ts +2 -0
- package/dist/chart/treemapUtils.d.ts +22 -0
- package/dist/components/Customized.d.ts +23 -0
- package/dist/components/Text.d.ts +4 -4
- package/dist/components/Tooltip.d.ts +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/label/Label.d.ts +3 -3
- package/dist/components/label/types.d.ts +1 -1
- package/dist/container/Surface.d.ts +3 -2
- package/dist/es/animation/Animate.mjs +48 -22
- package/dist/es/cartesian/GraphicalItemClipPath.mjs +16 -15
- package/dist/es/cartesian/area/ActivePoints.mjs +44 -40
- package/dist/es/cartesian/area/Area.mjs +42 -31
- package/dist/es/cartesian/area/ClipRect.mjs +79 -58
- package/dist/es/cartesian/area/RenderArea.mjs +142 -108
- package/dist/es/cartesian/area/hooks/useArea.mjs +71 -47
- package/dist/es/cartesian/area/type.mjs +13 -15
- package/dist/es/cartesian/area/utils.mjs +69 -49
- package/dist/es/cartesian/axis/XAxis.mjs +87 -73
- package/dist/es/cartesian/axis/YAxis.mjs +67 -56
- package/dist/es/cartesian/bar/Bar.mjs +78 -71
- package/dist/es/cartesian/bar/components/BarBackground.mjs +22 -19
- package/dist/es/cartesian/bar/components/BarRectangles.mjs +117 -80
- package/dist/es/cartesian/bar/hooks/useBar.mjs +49 -37
- package/dist/es/cartesian/bar/type.mjs +11 -25
- package/dist/es/cartesian/bar/utils.mjs +97 -70
- package/dist/es/cartesian/cartesian-axis/CartesianAxis.mjs +165 -115
- package/dist/es/cartesian/cartesian-grid/Background.mjs +19 -16
- package/dist/es/cartesian/cartesian-grid/CartesianGrid.mjs +116 -97
- package/dist/es/cartesian/cartesian-grid/HorizontalGridLines.mjs +24 -23
- package/dist/es/cartesian/cartesian-grid/HorizontalStripes.mjs +24 -24
- package/dist/es/cartesian/cartesian-grid/VerticalGridLines.mjs +23 -22
- package/dist/es/cartesian/cartesian-grid/VerticalStripes.mjs +24 -24
- package/dist/es/cartesian/cartesian-grid/const.mjs +317 -10
- package/dist/es/cartesian/cartesian-grid/utils.mjs +18 -13
- package/dist/es/cartesian/error-bar/ErrorBar.mjs +111 -83
- package/dist/es/cartesian/error-bar/ErrorBarContext.mjs +13 -12
- package/dist/es/cartesian/funnel/Funnel.mjs +162 -0
- package/dist/es/cartesian/funnel/type.mjs +78 -0
- package/dist/es/cartesian/funnel/utils.mjs +102 -0
- package/dist/es/cartesian/line/ActivePoints.mjs +45 -41
- package/dist/es/cartesian/line/Line.mjs +41 -37
- package/dist/es/cartesian/line/StaticLine.mjs +191 -122
- package/dist/es/cartesian/line/hooks/useLine.mjs +60 -44
- package/dist/es/cartesian/line/type.mjs +13 -18
- package/dist/es/cartesian/line/utils.mjs +27 -26
- package/dist/es/cartesian/reference-area/ReferenceArea.mjs +79 -78
- package/dist/es/cartesian/reference-dot/ReferenceDot.mjs +134 -0
- package/dist/es/cartesian/reference-line/ReferenceLine.mjs +93 -84
- package/dist/es/cartesian/scatter/Scatter.mjs +168 -140
- package/dist/es/cartesian/scatter/hooks/useScatter.mjs +18 -14
- package/dist/es/cartesian/useNeedsClip.mjs +18 -9
- package/dist/es/cartesian/utils/get-ticks.mjs +103 -68
- package/dist/es/cartesian/z-axis/ZAxis.mjs +30 -28
- package/dist/es/chart/AreaChart.mjs +5 -5
- package/dist/es/chart/BarChart.mjs +5 -5
- package/dist/es/chart/ComposedChart.mjs +5 -5
- package/dist/es/chart/FunnelChart.mjs +11 -0
- package/dist/es/chart/LegendPortalContext.mjs +3 -3
- package/dist/es/chart/LineChart.mjs +5 -5
- package/dist/es/chart/PieChart.mjs +5 -5
- package/dist/es/chart/RadarChart.mjs +5 -5
- package/dist/es/chart/RadialBarChart.mjs +5 -5
- package/dist/es/chart/RechartsWrapper.mjs +113 -89
- package/dist/es/chart/ScatterChart.mjs +5 -5
- package/dist/es/chart/Surface.mjs +3 -3
- package/dist/es/chart/Surface.vue_vue_type_script_setup_true_lang.mjs +51 -45
- package/dist/es/chart/TooltipPortalContext.mjs +3 -3
- package/dist/es/chart/Treemap.mjs +379 -0
- package/dist/es/chart/const.mjs +2 -2
- package/dist/es/chart/generateCategoricalChart.mjs +99 -89
- package/dist/es/chart/provideClipPathId.mjs +12 -7
- package/dist/es/chart/treemapUtils.mjs +32 -0
- package/dist/es/components/Cell.mjs +16 -4
- package/dist/es/components/Customized.mjs +43 -0
- package/dist/es/components/Text.mjs +3 -3
- package/dist/es/components/Text.vue_vue_type_script_setup_true_lang.mjs +106 -69
- package/dist/es/components/Tooltip.mjs +274 -199
- package/dist/es/components/label/Label.mjs +30 -26
- package/dist/es/components/label/LabelList.mjs +45 -39
- package/dist/es/components/label/types.mjs +10 -6
- package/dist/es/components/label/utils.mjs +194 -162
- package/dist/es/components/legend/Legend.mjs +82 -71
- package/dist/es/components/legend/LegendSymbol.mjs +40 -38
- package/dist/es/components/legend/hooks/useLegend.mjs +71 -46
- package/dist/es/components/legend/hooks/useLegendContent.mjs +52 -31
- package/dist/es/components/legend/type.mjs +2 -2
- package/dist/es/components/legend/utils.mjs +19 -11
- package/dist/es/components/utils.mjs +35 -22
- package/dist/es/container/ClipPath.mjs +14 -14
- package/dist/es/container/Layer.mjs +9 -7
- package/dist/es/container/ResponsiveContainer.mjs +3 -3
- package/dist/es/container/ResponsiveContainer.vue_vue_type_script_setup_true_lang.mjs +109 -77
- package/dist/es/container/Surface.mjs +25 -23
- package/dist/es/container/useSizeContext.mjs +3 -3
- package/dist/es/context/ChartDataContextProvider.mjs +19 -13
- package/dist/es/context/PanoramaContextProvider.mjs +15 -10
- package/dist/es/context/accessibilityContext.mjs +3 -3
- package/dist/es/context/cartesianLabelListContext.mjs +3 -3
- package/dist/es/context/chartLayoutContext.mjs +33 -30
- package/dist/es/context/cursorLayerContext.mjs +3 -3
- package/dist/es/context/graphicalLayerContext.mjs +3 -3
- package/dist/es/context/labelLayerContext.mjs +3 -3
- package/dist/es/context/polarLabelViewBoxContext.mjs +5 -5
- package/dist/es/context/useTooltipAxis.mjs +14 -12
- package/dist/es/events/useChartSynchronisation.mjs +91 -66
- package/dist/es/hooks/publicHooks.mjs +207 -0
- package/dist/es/hooks/useIsAnimating.mjs +28 -0
- package/dist/es/hooks/useSetupGraphicalItem.mjs +52 -43
- package/dist/es/index.mjs +54 -42
- package/dist/es/polar/pie/Pie.mjs +131 -115
- package/dist/es/polar/pie/type.mjs +8 -10
- package/dist/es/polar/radar/PolarAngleAxis.mjs +103 -84
- package/dist/es/polar/radar/PolarGrid.mjs +72 -59
- package/dist/es/polar/radar/PolarRadiusAxis.mjs +90 -65
- package/dist/es/polar/radar/Radar.mjs +181 -145
- package/dist/es/polar/radial-bar/RadialBar.mjs +161 -140
- package/dist/es/polar/radial-bar/type.mjs +9 -9
- package/dist/es/shape/Cross.mjs +11 -10
- package/dist/es/shape/Curve.mjs +71 -44
- package/dist/es/shape/Dot.mjs +12 -11
- package/dist/es/shape/Polygon.mjs +19 -0
- package/dist/es/shape/Rectangle.mjs +41 -30
- package/dist/es/shape/Sector.mjs +105 -79
- package/dist/es/shape/Symbols.mjs +45 -34
- package/dist/es/shape/Trapezoid.mjs +50 -0
- package/dist/es/state/ReportChartProps.mjs +23 -24
- package/dist/es/state/ReportMainChartProps.mjs +26 -21
- package/dist/es/state/ReportPolarOptions.mjs +23 -22
- package/dist/es/state/SetGraphicalItem.mjs +42 -27
- package/dist/es/state/SetLegendPayload.mjs +17 -13
- package/dist/es/state/SetTooltipEntrySettings.mjs +14 -12
- package/dist/es/state/brushSlice.mjs +12 -8
- package/dist/es/state/cartesianAxisSlice.mjs +23 -17
- package/dist/es/state/chartDataSlice.mjs +18 -13
- package/dist/es/state/externalEventsMiddleware.mjs +25 -15
- package/dist/es/state/graphicalItemsSlice.mjs +29 -25
- package/dist/es/state/hooks.mjs +24 -3
- package/dist/es/state/keyboardEventsMiddleware.mjs +50 -42
- package/dist/es/state/layoutSlice.mjs +18 -12
- package/dist/es/state/legendSlice.mjs +19 -14
- package/dist/es/state/mouseEventsMiddleware.mjs +31 -24
- package/dist/es/state/optionsSlice.mjs +14 -11
- package/dist/es/state/polarAxisSlice.mjs +15 -13
- package/dist/es/state/polarOptionsSlice.mjs +8 -6
- package/dist/es/state/reduxDevtoolsJsonStringifyReplacer.mjs +5 -3
- package/dist/es/state/referenceElementsSlice.mjs +21 -19
- package/dist/es/state/rootPropsSlice.mjs +20 -9
- package/dist/es/state/selectors/areaSelectors.mjs +65 -55
- package/dist/es/state/selectors/axisSelectors.mjs +784 -569
- package/dist/es/state/selectors/barSelectors.mjs +225 -162
- package/dist/es/state/selectors/brushSelectors.mjs +15 -14
- package/dist/es/state/selectors/combiners/combineActiveLabel.mjs +6 -5
- package/dist/es/state/selectors/combiners/combineActiveTooltipIndex.mjs +36 -27
- package/dist/es/state/selectors/combiners/combineAxisRangeWithReverse.mjs +5 -3
- package/dist/es/state/selectors/combiners/combineCoordinateForDefaultIndex.mjs +13 -11
- package/dist/es/state/selectors/combiners/combineTooltipInteractionState.mjs +26 -21
- package/dist/es/state/selectors/combiners/combineTooltipPayloadConfigurations.mjs +10 -6
- package/dist/es/state/selectors/common.mjs +2 -2
- package/dist/es/state/selectors/containerSelectors.mjs +5 -2
- package/dist/es/state/selectors/dataSelectors.mjs +28 -9
- package/dist/es/state/selectors/funnelSelectors.mjs +38 -0
- package/dist/es/state/selectors/legendSelectors.mjs +7 -6
- package/dist/es/state/selectors/lineSelectors.mjs +54 -47
- package/dist/es/state/selectors/pickAxisId.mjs +2 -2
- package/dist/es/state/selectors/pickAxisType.mjs +2 -2
- package/dist/es/state/selectors/pieSelectors.mjs +116 -81
- package/dist/es/state/selectors/polarAxisSelectors.mjs +113 -94
- package/dist/es/state/selectors/polarGridSelectors.mjs +13 -11
- package/dist/es/state/selectors/polarScaleSelectors.mjs +49 -46
- package/dist/es/state/selectors/polarSelectors.mjs +79 -62
- package/dist/es/state/selectors/radarSelectors.mjs +111 -91
- package/dist/es/state/selectors/radialBarSelectors.mjs +230 -183
- package/dist/es/state/selectors/rootPropsSelectors.mjs +11 -5
- package/dist/es/state/selectors/scatterSelectors.mjs +111 -95
- package/dist/es/state/selectors/selectActivePropsFromChartPointer.mjs +19 -17
- package/dist/es/state/selectors/selectAllAxes.mjs +8 -3
- package/dist/es/state/selectors/selectChartOffset.mjs +59 -50
- package/dist/es/state/selectors/selectChartOffsetInternal.mjs +55 -44
- package/dist/es/state/selectors/selectTooltipEventType.mjs +15 -14
- package/dist/es/state/selectors/selectTooltipPayloadSearcher.mjs +3 -3
- package/dist/es/state/selectors/selectTooltipSettings.mjs +2 -2
- package/dist/es/state/selectors/selectTooltipState.mjs +2 -2
- package/dist/es/state/selectors/selectors.mjs +94 -75
- package/dist/es/state/selectors/tooltipSelectors.mjs +253 -204
- package/dist/es/state/selectors/touchSelectors.mjs +17 -14
- package/dist/es/state/store.mjs +46 -46
- package/dist/es/state/tooltipSlice.mjs +64 -37
- package/dist/es/state/touchEventsMiddleware.mjs +35 -29
- package/dist/es/state/utils/useReportScale.mjs +16 -13
- package/dist/es/synchronisation/syncSelectors.mjs +3 -3
- package/dist/es/synchronisation/useChartSynchronisation.mjs +33 -19
- package/dist/es/types/common.mjs +12 -0
- package/dist/es/types/event.mjs +164 -2
- package/dist/es/utils/ReduceCSSCalc.mjs +81 -49
- package/dist/es/utils/VueUtils.mjs +35 -14
- package/dist/es/utils/attrs.mjs +43 -26
- package/dist/es/utils/cartesian.mjs +47 -15
- package/dist/es/utils/cell.mjs +28 -0
- package/dist/es/utils/chart.mjs +298 -197
- package/dist/es/utils/const.mjs +30 -2
- package/dist/es/utils/createCategoricalInverse.mjs +46 -0
- package/dist/es/utils/createContext.mjs +28 -9
- package/dist/es/utils/data-utils.mjs +9 -8
- package/dist/es/utils/data.mjs +35 -21
- package/dist/es/utils/events.mjs +5 -3
- package/dist/es/utils/getLinearRegression.mjs +28 -11
- package/dist/es/utils/grid.mjs +20 -5
- package/dist/es/utils/isDomainSpecifiedByUser.mjs +105 -54
- package/dist/es/utils/legend.mjs +13 -12
- package/dist/es/utils/log.mjs +10 -7
- package/dist/es/utils/payload/getUniqPayload.mjs +6 -4
- package/dist/es/utils/polar.mjs +37 -30
- package/dist/es/utils/props.mjs +16 -10
- package/dist/es/utils/resolveDefaultProps.mjs +23 -4
- package/dist/es/utils/scale/getNiceTickValues.mjs +127 -49
- package/dist/es/utils/scale/utils/arithmetic.mjs +49 -19
- package/dist/es/utils/scale/utils/utils.mjs +43 -24
- package/dist/es/utils/scale.mjs +46 -0
- package/dist/es/utils/style.mjs +24 -13
- package/dist/es/utils/tick.mjs +34 -23
- package/dist/es/utils/tooltip/translate.mjs +63 -49
- package/dist/es/utils/validate.mjs +40 -29
- package/dist/hooks/publicHooks.d.ts +143 -0
- package/dist/hooks/useIsAnimating.d.ts +14 -0
- package/dist/index.d.ts +1 -0
- package/dist/polar/pie/type.d.ts +2 -2
- package/dist/polar/radar/Radar.d.ts +4 -4
- package/dist/shape/Curve.d.ts +2 -1
- package/dist/shape/Polygon.d.ts +9 -0
- package/dist/shape/Rectangle.d.ts +0 -4
- package/dist/shape/Sector.d.ts +2 -2
- package/dist/shape/Symbols.d.ts +2 -1
- package/dist/shape/Trapezoid.d.ts +30 -0
- package/dist/shape/index.d.ts +2 -0
- package/dist/shape/types.d.ts +4 -5
- package/dist/state/ReportChartProps.d.ts +3 -3
- package/dist/state/graphicalItemsSlice.d.ts +1 -1
- package/dist/state/rootPropsSlice.d.ts +2 -2
- package/dist/state/selectors/axisSelectors.d.ts +5 -0
- package/dist/types/axis.d.ts +2 -2
- package/dist/types/bar.d.ts +2 -6
- package/dist/types/categorical.d.ts +2 -2
- package/dist/types/common.d.ts +7 -1
- package/dist/types/tooltip.d.ts +2 -2
- package/dist/utils/cell.d.ts +11 -0
- package/dist/utils/createCategoricalInverse.d.ts +16 -0
- package/dist/utils/scale.d.ts +23 -0
- package/package.json +2 -1
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
import { Curve
|
|
2
|
-
import { getTooltipNameProp
|
|
3
|
-
import { mouseLeaveChart
|
|
4
|
-
import { selectActiveTooltipDataKey
|
|
5
|
-
import { useAppDispatch
|
|
6
|
-
import { Layer
|
|
7
|
-
import { LabelList
|
|
8
|
-
import { Animate
|
|
9
|
-
import { SetTooltipEntrySettings
|
|
10
|
-
import { useSetupGraphicalItem
|
|
11
|
-
import { useGraphicalLayerRef
|
|
12
|
-
import { createErrorBarRegistry
|
|
13
|
-
import { useScatter
|
|
14
|
-
import { Symbols
|
|
15
|
-
import { getLinearRegression
|
|
16
|
-
import { Fragment
|
|
1
|
+
import { Curve } from "../../shape/Curve.mjs";
|
|
2
|
+
import { getTooltipNameProp, getValueByDataKey } from "../../utils/chart.mjs";
|
|
3
|
+
import { mouseLeaveChart, setActiveMouseOverItemIndex, setMouseOverAxisIndex } from "../../state/tooltipSlice.mjs";
|
|
4
|
+
import { selectActiveTooltipDataKey, selectActiveTooltipIndex } from "../../state/selectors/tooltipSelectors.mjs";
|
|
5
|
+
import { useAppDispatch, useAppSelector } from "../../state/hooks.mjs";
|
|
6
|
+
import { Layer } from "../../container/Layer.mjs";
|
|
7
|
+
import { LabelList } from "../../components/label/LabelList.mjs";
|
|
8
|
+
import { Animate } from "../../animation/Animate.mjs";
|
|
9
|
+
import { SetTooltipEntrySettings } from "../../state/SetTooltipEntrySettings.mjs";
|
|
10
|
+
import { useSetupGraphicalItem } from "../../hooks/useSetupGraphicalItem.mjs";
|
|
11
|
+
import { useGraphicalLayerRef } from "../../context/graphicalLayerContext.mjs";
|
|
12
|
+
import { createErrorBarRegistry, provideErrorBarContext, provideErrorBarRegistry } from "../error-bar/ErrorBarContext.mjs";
|
|
13
|
+
import { useScatter } from "./hooks/useScatter.mjs";
|
|
14
|
+
import { Symbols } from "../../shape/Symbols.mjs";
|
|
15
|
+
import { getLinearRegression } from "../../utils/getLinearRegression.mjs";
|
|
16
|
+
import { Fragment, Teleport, computed, createVNode, defineComponent, isVNode, mergeProps, useAttrs } from "vue";
|
|
17
17
|
//#region src/cartesian/scatter/Scatter.tsx
|
|
18
|
-
function
|
|
19
|
-
return typeof
|
|
18
|
+
function _isSlot(s) {
|
|
19
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
20
20
|
}
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
var interpolateNumber = (from, to) => (t) => from + (to - from) * t;
|
|
22
|
+
var errorBarDataPointFormatter = (dataPoint, dataKey, direction) => ({
|
|
23
|
+
x: dataPoint.cx,
|
|
24
|
+
y: dataPoint.cy,
|
|
25
|
+
value: direction === "x" ? Number(dataPoint.node.x) : Number(dataPoint.node.y),
|
|
26
|
+
errorVal: getValueByDataKey(dataPoint.payload, dataKey)
|
|
27
|
+
});
|
|
28
|
+
var Scatter = /* @__PURE__ */ defineComponent({
|
|
27
29
|
name: "Scatter",
|
|
28
30
|
props: {
|
|
29
31
|
xAxisId: {
|
|
@@ -56,7 +58,7 @@ var j = (e, t) => (n) => e + (t - e) * n, M = (e, t, r) => ({
|
|
|
56
58
|
},
|
|
57
59
|
hide: {
|
|
58
60
|
type: Boolean,
|
|
59
|
-
default:
|
|
61
|
+
default: false
|
|
60
62
|
},
|
|
61
63
|
fill: {
|
|
62
64
|
type: String,
|
|
@@ -68,11 +70,11 @@ var j = (e, t) => (n) => e + (t - e) * n, M = (e, t, r) => ({
|
|
|
68
70
|
},
|
|
69
71
|
isAnimationActive: {
|
|
70
72
|
type: Boolean,
|
|
71
|
-
default:
|
|
73
|
+
default: true
|
|
72
74
|
},
|
|
73
75
|
line: {
|
|
74
76
|
type: [Boolean, Object],
|
|
75
|
-
default:
|
|
77
|
+
default: false
|
|
76
78
|
},
|
|
77
79
|
lineType: {
|
|
78
80
|
type: String,
|
|
@@ -84,7 +86,7 @@ var j = (e, t) => (n) => e + (t - e) * n, M = (e, t, r) => ({
|
|
|
84
86
|
},
|
|
85
87
|
label: {
|
|
86
88
|
type: [Boolean, Object],
|
|
87
|
-
default:
|
|
89
|
+
default: false
|
|
88
90
|
},
|
|
89
91
|
legendType: {
|
|
90
92
|
type: String,
|
|
@@ -99,154 +101,180 @@ var j = (e, t) => (n) => e + (t - e) * n, M = (e, t, r) => ({
|
|
|
99
101
|
default: void 0
|
|
100
102
|
}
|
|
101
103
|
},
|
|
102
|
-
inheritAttrs:
|
|
104
|
+
inheritAttrs: false,
|
|
103
105
|
slots: Object,
|
|
104
|
-
setup(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
setup(props, { attrs, slots }) {
|
|
107
|
+
const errorBarRegistry = createErrorBarRegistry();
|
|
108
|
+
provideErrorBarRegistry(errorBarRegistry);
|
|
109
|
+
useSetupGraphicalItem(props, "scatter", {
|
|
110
|
+
skipTooltip: true,
|
|
111
|
+
errorBars: errorBarRegistry.errorBars
|
|
109
112
|
});
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
113
|
+
const { shouldRender, points } = useScatter(props);
|
|
114
|
+
const graphicalLayerRef = useGraphicalLayerRef();
|
|
115
|
+
const svgAttrs = useAttrs();
|
|
116
|
+
const dispatch = useAppDispatch();
|
|
117
|
+
const activeIndex = useAppSelector(selectActiveTooltipIndex);
|
|
118
|
+
const activeDataKey = useAppSelector(selectActiveTooltipDataKey);
|
|
119
|
+
SetTooltipEntrySettings({
|
|
120
|
+
fn: (input) => ({
|
|
121
|
+
dataDefinedOnItem: input.points?.map((p) => p.tooltipPayload),
|
|
114
122
|
positions: void 0,
|
|
115
123
|
settings: {
|
|
116
|
-
stroke:
|
|
117
|
-
strokeWidth:
|
|
118
|
-
fill:
|
|
119
|
-
dataKey:
|
|
124
|
+
stroke: input.stroke,
|
|
125
|
+
strokeWidth: input.strokeWidth,
|
|
126
|
+
fill: input.fill,
|
|
127
|
+
dataKey: input.dataKey,
|
|
120
128
|
nameKey: void 0,
|
|
121
|
-
name:
|
|
122
|
-
hide:
|
|
123
|
-
type:
|
|
124
|
-
color:
|
|
129
|
+
name: getTooltipNameProp(input.name, input.dataKey),
|
|
130
|
+
hide: input.hide,
|
|
131
|
+
type: input.tooltipType,
|
|
132
|
+
color: input.fill,
|
|
125
133
|
unit: ""
|
|
126
134
|
}
|
|
127
135
|
}),
|
|
128
|
-
args:
|
|
129
|
-
points:
|
|
130
|
-
fill:
|
|
131
|
-
stroke:
|
|
132
|
-
strokeWidth:
|
|
133
|
-
name:
|
|
134
|
-
dataKey:
|
|
135
|
-
hide:
|
|
136
|
-
tooltipType:
|
|
136
|
+
args: computed(() => ({
|
|
137
|
+
points: points.value,
|
|
138
|
+
fill: svgAttrs.fill ?? props.fill,
|
|
139
|
+
stroke: svgAttrs.stroke,
|
|
140
|
+
strokeWidth: svgAttrs["stroke-width"],
|
|
141
|
+
name: props.name,
|
|
142
|
+
dataKey: props.dataKey,
|
|
143
|
+
hide: props.hide,
|
|
144
|
+
tooltipType: props.tooltipType
|
|
137
145
|
}))
|
|
138
|
-
}), _({
|
|
139
|
-
data: F,
|
|
140
|
-
xAxisId: n.xAxisId,
|
|
141
|
-
yAxisId: n.yAxisId,
|
|
142
|
-
dataPointFormatter: M,
|
|
143
|
-
errorBarOffset: w(() => 0)
|
|
144
146
|
});
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
provideErrorBarContext({
|
|
148
|
+
data: points,
|
|
149
|
+
xAxisId: props.xAxisId,
|
|
150
|
+
yAxisId: props.yAxisId,
|
|
151
|
+
dataPointFormatter: errorBarDataPointFormatter,
|
|
152
|
+
errorBarOffset: computed(() => 0)
|
|
153
|
+
});
|
|
154
|
+
let previousPoints = null;
|
|
155
|
+
let animationId = 0;
|
|
156
|
+
const dispatchScatterHover = (point, index) => {
|
|
157
|
+
const payload = {
|
|
158
|
+
activeDataKey: props.dataKey,
|
|
159
|
+
activeIndex: String(index),
|
|
160
|
+
activeCoordinate: point.tooltipPosition
|
|
150
161
|
};
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
...
|
|
162
|
+
dispatch(setMouseOverAxisIndex(payload));
|
|
163
|
+
dispatch(setActiveMouseOverItemIndex(payload));
|
|
164
|
+
};
|
|
165
|
+
const onMouseLeaveSymbol = () => {
|
|
166
|
+
dispatch(mouseLeaveChart());
|
|
167
|
+
};
|
|
168
|
+
const renderSymbols = (data, svgAttrs) => {
|
|
169
|
+
const currentActiveIndex = activeIndex.value;
|
|
170
|
+
const currentActiveDataKey = activeDataKey.value;
|
|
171
|
+
return data.map((point, i) => {
|
|
172
|
+
if (point.cx == null || point.cy == null) return null;
|
|
173
|
+
const isActive = currentActiveIndex === String(i) && currentActiveDataKey === props.dataKey;
|
|
174
|
+
const symbolProps = {
|
|
175
|
+
...svgAttrs,
|
|
176
|
+
...props.fill != null ? { fill: props.fill } : {},
|
|
177
|
+
cx: point.cx,
|
|
178
|
+
cy: point.cy,
|
|
179
|
+
size: isActive ? (point.size ?? 64) * 1.6 : point.size,
|
|
180
|
+
type: props.shape,
|
|
181
|
+
...isActive ? {
|
|
166
182
|
stroke: "#fff",
|
|
167
183
|
"stroke-width": 2
|
|
168
184
|
} : {}
|
|
169
185
|
};
|
|
170
|
-
return
|
|
171
|
-
class: "v-charts-scatter-symbol",
|
|
172
|
-
onMouseenter: () =>
|
|
173
|
-
onMousemove: (
|
|
174
|
-
|
|
186
|
+
return createVNode("g", {
|
|
187
|
+
"class": "v-charts-scatter-symbol",
|
|
188
|
+
"onMouseenter": () => dispatchScatterHover(point, i),
|
|
189
|
+
"onMousemove": (e) => {
|
|
190
|
+
e.stopPropagation();
|
|
191
|
+
dispatchScatterHover(point, i);
|
|
175
192
|
},
|
|
176
|
-
onMouseleave:
|
|
177
|
-
}, [
|
|
193
|
+
"onMouseleave": onMouseLeaveSymbol
|
|
194
|
+
}, [Symbols(symbolProps)]);
|
|
178
195
|
});
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
196
|
+
};
|
|
197
|
+
const renderLine = (data, svgAttrs) => {
|
|
198
|
+
if (!props.line) return null;
|
|
199
|
+
let linePoints;
|
|
200
|
+
if (props.lineType === "joint") linePoints = data.map((p) => ({
|
|
201
|
+
x: p.cx ?? 0,
|
|
202
|
+
y: p.cy ?? 0
|
|
185
203
|
}));
|
|
186
204
|
else {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
x:
|
|
190
|
-
y:
|
|
205
|
+
const { xmin, xmax, a, b } = getLinearRegression(data);
|
|
206
|
+
linePoints = [{
|
|
207
|
+
x: xmin,
|
|
208
|
+
y: a * xmin + b
|
|
191
209
|
}, {
|
|
192
|
-
x:
|
|
193
|
-
y:
|
|
210
|
+
x: xmax,
|
|
211
|
+
y: a * xmax + b
|
|
194
212
|
}];
|
|
195
213
|
}
|
|
196
|
-
|
|
214
|
+
const lineProps = {
|
|
197
215
|
fill: "none",
|
|
198
|
-
stroke:
|
|
199
|
-
...typeof
|
|
200
|
-
points:
|
|
216
|
+
stroke: svgAttrs.stroke ?? props.fill,
|
|
217
|
+
...typeof props.line === "object" ? props.line : {},
|
|
218
|
+
points: linePoints
|
|
201
219
|
};
|
|
202
|
-
return
|
|
203
|
-
class: "v-charts-scatter-line",
|
|
204
|
-
style: { pointerEvents: "none" }
|
|
205
|
-
}, { default: () => [
|
|
220
|
+
return createVNode(Layer, {
|
|
221
|
+
"class": "v-charts-scatter-line",
|
|
222
|
+
"style": { pointerEvents: "none" }
|
|
223
|
+
}, { default: () => [createVNode(Curve, mergeProps(lineProps, { "type": props.lineJointType }), null)] });
|
|
206
224
|
};
|
|
207
225
|
return () => {
|
|
208
|
-
if (!
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
226
|
+
if (!shouldRender.value) return null;
|
|
227
|
+
const svgAttrs = attrs;
|
|
228
|
+
const data = points.value;
|
|
229
|
+
const isAnimationActive = props.isAnimationActive;
|
|
230
|
+
let symbolsContent;
|
|
231
|
+
if (isAnimationActive && previousPoints !== data) {
|
|
232
|
+
const prevData = previousPoints;
|
|
233
|
+
animationId++;
|
|
234
|
+
symbolsContent = createVNode(Animate, {
|
|
235
|
+
"key": animationId,
|
|
236
|
+
"transition": props.transition,
|
|
237
|
+
"isActive": isAnimationActive
|
|
238
|
+
}, { default: (t) => {
|
|
239
|
+
const stepData = t === 1 ? data : data.map((entry, index) => {
|
|
240
|
+
const prev = prevData && prevData[index];
|
|
241
|
+
if (prev) return {
|
|
242
|
+
...entry,
|
|
243
|
+
cx: entry.cx == null ? void 0 : interpolateNumber(prev.cx ?? 0, entry.cx)(t),
|
|
244
|
+
cy: entry.cy == null ? void 0 : interpolateNumber(prev.cy ?? 0, entry.cy)(t),
|
|
245
|
+
size: interpolateNumber(prev.size ?? 0, entry.size ?? 0)(t)
|
|
246
|
+
};
|
|
247
|
+
return {
|
|
248
|
+
...entry,
|
|
249
|
+
size: interpolateNumber(0, entry.size ?? 0)(t)
|
|
227
250
|
};
|
|
228
251
|
});
|
|
229
|
-
|
|
252
|
+
if (t > 0) previousPoints = stepData;
|
|
253
|
+
return createVNode(Fragment, null, [renderLine(stepData, svgAttrs), renderSymbols(stepData, svgAttrs)]);
|
|
230
254
|
} });
|
|
231
|
-
} else
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
255
|
+
} else {
|
|
256
|
+
previousPoints = data;
|
|
257
|
+
symbolsContent = createVNode(Fragment, null, [renderLine(data, svgAttrs), renderSymbols(data, svgAttrs)]);
|
|
258
|
+
}
|
|
259
|
+
const content = createVNode(Layer, { "class": "v-charts-scatter" }, { default: () => [
|
|
260
|
+
slots.default?.(),
|
|
261
|
+
symbolsContent,
|
|
262
|
+
props.label && (() => {
|
|
263
|
+
const labelData = data.map((point) => ({
|
|
264
|
+
x: point.cx ?? 0,
|
|
265
|
+
y: point.cy ?? 0,
|
|
239
266
|
width: 0,
|
|
240
267
|
height: 0,
|
|
241
268
|
value: void 0,
|
|
242
|
-
payload:
|
|
269
|
+
payload: point.payload
|
|
243
270
|
}));
|
|
244
|
-
return
|
|
271
|
+
return createVNode(LabelList, mergeProps(typeof props.label === "object" ? props.label : {}, { "data": labelData }), null);
|
|
245
272
|
})()
|
|
246
273
|
] });
|
|
247
|
-
|
|
274
|
+
if (graphicalLayerRef?.value) return createVNode(Teleport, { "to": graphicalLayerRef.value }, _isSlot(content) ? content : { default: () => [content] });
|
|
275
|
+
return content;
|
|
248
276
|
};
|
|
249
277
|
}
|
|
250
278
|
});
|
|
251
279
|
//#endregion
|
|
252
|
-
export {
|
|
280
|
+
export { Scatter };
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import { useIsPanorama
|
|
2
|
-
import { useAppSelector
|
|
3
|
-
import { selectScatterPoints
|
|
4
|
-
import { computed
|
|
1
|
+
import { useIsPanorama } from "../../../context/PanoramaContextProvider.mjs";
|
|
2
|
+
import { useAppSelector } from "../../../state/hooks.mjs";
|
|
3
|
+
import { selectScatterPoints } from "../../../state/selectors/scatterSelectors.mjs";
|
|
4
|
+
import { computed } from "vue";
|
|
5
5
|
//#region src/cartesian/scatter/hooks/useScatter.ts
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
function useScatter(props) {
|
|
7
|
+
const isPanorama = useIsPanorama();
|
|
8
|
+
const scatterSettings = computed(() => ({
|
|
9
|
+
data: props.data,
|
|
10
|
+
dataKey: props.dataKey,
|
|
11
|
+
tooltipType: props.tooltipType,
|
|
12
|
+
name: props.name ?? String(props.dataKey ?? "")
|
|
13
|
+
}));
|
|
14
|
+
const points = useAppSelector((state) => selectScatterPoints(state, props.xAxisId ?? 0, props.yAxisId ?? 0, props.zAxisId ?? 0, scatterSettings.value, isPanorama));
|
|
13
15
|
return {
|
|
14
|
-
shouldRender:
|
|
15
|
-
|
|
16
|
+
shouldRender: computed(() => {
|
|
17
|
+
return !props.hide && points.value != null && points.value.length > 0;
|
|
18
|
+
}),
|
|
19
|
+
points
|
|
16
20
|
};
|
|
17
21
|
}
|
|
18
22
|
//#endregion
|
|
19
|
-
export {
|
|
23
|
+
export { useScatter };
|
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
import { selectXAxisSettings
|
|
2
|
-
import { useAppSelector
|
|
3
|
-
import { computed
|
|
1
|
+
import { selectXAxisSettings, selectYAxisSettings } from "../state/selectors/axisSelectors.mjs";
|
|
2
|
+
import { useAppSelector } from "../state/hooks.mjs";
|
|
3
|
+
import { computed } from "vue";
|
|
4
4
|
//#region src/cartesian/useNeedsClip.ts
|
|
5
|
-
function
|
|
6
|
-
|
|
5
|
+
function useNeedsClip(xAxisId, yAxisId) {
|
|
6
|
+
const xAxis = useAppSelector((state) => selectXAxisSettings(state, xAxisId));
|
|
7
|
+
const yAxis = useAppSelector((state) => selectYAxisSettings(state, yAxisId));
|
|
8
|
+
const needClipX = computed(() => {
|
|
9
|
+
return xAxis.value && xAxis.value.allowDataOverflow;
|
|
10
|
+
});
|
|
11
|
+
const needClipY = computed(() => {
|
|
12
|
+
return yAxis.value && yAxis.value.allowDataOverflow;
|
|
13
|
+
});
|
|
7
14
|
return {
|
|
8
|
-
needClip:
|
|
9
|
-
|
|
10
|
-
|
|
15
|
+
needClip: computed(() => {
|
|
16
|
+
return needClipX.value || needClipY.value;
|
|
17
|
+
}),
|
|
18
|
+
needClipX,
|
|
19
|
+
needClipY
|
|
11
20
|
};
|
|
12
21
|
}
|
|
13
22
|
//#endregion
|
|
14
|
-
export {
|
|
23
|
+
export { useNeedsClip };
|
|
@@ -1,83 +1,118 @@
|
|
|
1
|
-
import { isNumber
|
|
2
|
-
import { mathSign
|
|
3
|
-
import { getStringSize
|
|
4
|
-
import { getAngledTickWidth
|
|
5
|
-
import { getEquidistantTicks
|
|
1
|
+
import { isNumber, isSsr, isVisible } from "../../utils/validate.mjs";
|
|
2
|
+
import { mathSign } from "../../utils/data.mjs";
|
|
3
|
+
import { getStringSize } from "../../utils/attrs.mjs";
|
|
4
|
+
import { getAngledTickWidth, getNumberIntervalTicks, getTickBoundaries } from "../../utils/tick.mjs";
|
|
5
|
+
import { getEquidistantTicks } from "../../utils/cartesian.mjs";
|
|
6
6
|
//#region src/cartesian/utils/get-ticks.ts
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
function getTicksEnd(sign, boundaries, getTickSize, ticks, minTickGap) {
|
|
8
|
+
const result = (ticks || []).slice();
|
|
9
|
+
const len = result.length;
|
|
10
|
+
const { start } = boundaries;
|
|
11
|
+
let { end } = boundaries;
|
|
12
|
+
for (let i = len - 1; i >= 0; i--) {
|
|
13
|
+
let entry = result[i];
|
|
14
|
+
let size;
|
|
15
|
+
const getSize = () => {
|
|
16
|
+
if (size === void 0) size = getTickSize(entry, i);
|
|
17
|
+
return size;
|
|
18
|
+
};
|
|
19
|
+
if (i === len - 1) {
|
|
20
|
+
const gap = sign * (entry.coordinate + sign * getSize() / 2 - end);
|
|
21
|
+
result[i] = entry = {
|
|
22
|
+
...entry,
|
|
23
|
+
tickCoord: gap > 0 ? entry.coordinate - gap * sign : entry.coordinate
|
|
16
24
|
};
|
|
17
|
-
} else
|
|
18
|
-
...
|
|
19
|
-
tickCoord:
|
|
25
|
+
} else result[i] = entry = {
|
|
26
|
+
...entry,
|
|
27
|
+
tickCoord: entry.coordinate
|
|
20
28
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
if (isVisible(sign, entry.tickCoord, getSize, start, end)) {
|
|
30
|
+
end = entry.tickCoord - sign * (getSize() / 2 + minTickGap);
|
|
31
|
+
result[i] = {
|
|
32
|
+
...entry,
|
|
33
|
+
isShow: true
|
|
34
|
+
};
|
|
35
|
+
}
|
|
25
36
|
}
|
|
26
|
-
return
|
|
37
|
+
return result;
|
|
27
38
|
}
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
function getTicksStart(sign, boundaries, getTickSize, ticks, minTickGap, preserveEnd) {
|
|
40
|
+
const result = (ticks || []).slice();
|
|
41
|
+
const len = result.length;
|
|
42
|
+
let { start, end } = boundaries;
|
|
43
|
+
if (preserveEnd) {
|
|
44
|
+
let tail = ticks[len - 1];
|
|
45
|
+
const tailSize = getTickSize(tail, len - 1);
|
|
46
|
+
const tailGap = sign * (tail.coordinate + sign * tailSize / 2 - end);
|
|
47
|
+
result[len - 1] = tail = {
|
|
48
|
+
...tail,
|
|
49
|
+
tickCoord: tailGap > 0 ? tail.coordinate - tailGap * sign : tail.coordinate
|
|
50
|
+
};
|
|
51
|
+
if (isVisible(sign, tail.tickCoord, () => tailSize, start, end)) {
|
|
52
|
+
end = tail.tickCoord - sign * (tailSize / 2 + minTickGap);
|
|
53
|
+
result[len - 1] = {
|
|
54
|
+
...tail,
|
|
55
|
+
isShow: true
|
|
56
|
+
};
|
|
57
|
+
}
|
|
39
58
|
}
|
|
40
|
-
|
|
41
|
-
for (let
|
|
42
|
-
let
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
59
|
+
const count = preserveEnd ? len - 1 : len;
|
|
60
|
+
for (let i = 0; i < count; i++) {
|
|
61
|
+
let entry = result[i];
|
|
62
|
+
let size;
|
|
63
|
+
const getSize = () => {
|
|
64
|
+
if (size === void 0) size = getTickSize(entry, i);
|
|
65
|
+
return size;
|
|
66
|
+
};
|
|
67
|
+
if (i === 0) {
|
|
68
|
+
const gap = sign * (entry.coordinate - sign * getSize() / 2 - start);
|
|
69
|
+
result[i] = entry = {
|
|
70
|
+
...entry,
|
|
71
|
+
tickCoord: gap < 0 ? entry.coordinate - gap * sign : entry.coordinate
|
|
48
72
|
};
|
|
49
|
-
} else
|
|
50
|
-
...
|
|
51
|
-
tickCoord:
|
|
73
|
+
} else result[i] = entry = {
|
|
74
|
+
...entry,
|
|
75
|
+
tickCoord: entry.coordinate
|
|
52
76
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
77
|
+
if (isVisible(sign, entry.tickCoord, getSize, start, end)) {
|
|
78
|
+
start = entry.tickCoord + sign * (getSize() / 2 + minTickGap);
|
|
79
|
+
result[i] = {
|
|
80
|
+
...entry,
|
|
81
|
+
isShow: true
|
|
82
|
+
};
|
|
83
|
+
}
|
|
57
84
|
}
|
|
58
|
-
return
|
|
85
|
+
return result;
|
|
59
86
|
}
|
|
60
|
-
function
|
|
61
|
-
|
|
62
|
-
if (!
|
|
63
|
-
if (
|
|
64
|
-
let
|
|
65
|
-
|
|
66
|
-
|
|
87
|
+
function getTicks(props, fontSize, letterSpacing) {
|
|
88
|
+
const { tick, ticks, viewBox, minTickGap, orientation, interval, tickFormatter, unit, angle } = props;
|
|
89
|
+
if (!ticks || !ticks.length || !tick) return [];
|
|
90
|
+
if (isNumber(interval) || isSsr) return getNumberIntervalTicks(ticks, isNumber(interval) ? interval : 0) ?? [];
|
|
91
|
+
let candidates = [];
|
|
92
|
+
const sizeKey = orientation === "top" || orientation === "bottom" ? "width" : "height";
|
|
93
|
+
const unitSize = unit && sizeKey === "width" ? getStringSize(unit, {
|
|
94
|
+
fontSize,
|
|
95
|
+
letterSpacing
|
|
67
96
|
}) : {
|
|
68
97
|
width: 0,
|
|
69
98
|
height: 0
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
99
|
+
};
|
|
100
|
+
const getTickSize = (content, index) => {
|
|
101
|
+
const value = typeof tickFormatter === "function" ? tickFormatter(content.value, index) : content.value;
|
|
102
|
+
return sizeKey === "width" ? getAngledTickWidth(getStringSize(value, {
|
|
103
|
+
fontSize,
|
|
104
|
+
letterSpacing
|
|
105
|
+
}), unitSize, angle) : getStringSize(value, {
|
|
106
|
+
fontSize,
|
|
107
|
+
letterSpacing
|
|
108
|
+
})[sizeKey];
|
|
109
|
+
};
|
|
110
|
+
const sign = ticks.length >= 2 ? mathSign(ticks[1].coordinate - ticks[0].coordinate) : 1;
|
|
111
|
+
const boundaries = getTickBoundaries(viewBox, sign, sizeKey);
|
|
112
|
+
if (interval === "equidistantPreserveStart") return getEquidistantTicks(sign, boundaries, getTickSize, ticks, minTickGap);
|
|
113
|
+
if (interval === "preserveStart" || interval === "preserveStartEnd") candidates = getTicksStart(sign, boundaries, getTickSize, ticks, minTickGap, interval === "preserveStartEnd");
|
|
114
|
+
else candidates = getTicksEnd(sign, boundaries, getTickSize, ticks, minTickGap);
|
|
115
|
+
return candidates.filter((entry) => entry.isShow);
|
|
81
116
|
}
|
|
82
117
|
//#endregion
|
|
83
|
-
export {
|
|
118
|
+
export { getTicks };
|