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,59 +1,73 @@
|
|
|
1
|
-
import { isNumber
|
|
1
|
+
import { isNumber } from "../validate.mjs";
|
|
2
2
|
//#region src/utils/tooltip/translate.ts
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
[`${
|
|
8
|
-
[`${
|
|
9
|
-
[`${
|
|
3
|
+
var CSS_CLASS_PREFIX = "v-charts-tooltip-wrapper";
|
|
4
|
+
var TOOLTIP_HIDDEN = { visibility: "hidden" };
|
|
5
|
+
function getTooltipCSSClassName({ coordinate, translateX, translateY }) {
|
|
6
|
+
return [CSS_CLASS_PREFIX, {
|
|
7
|
+
[`${CSS_CLASS_PREFIX}-right`]: isNumber(translateX) && coordinate && isNumber(coordinate.x) && translateX >= coordinate.x,
|
|
8
|
+
[`${CSS_CLASS_PREFIX}-left`]: isNumber(translateX) && coordinate && isNumber(coordinate.x) && translateX < coordinate.x,
|
|
9
|
+
[`${CSS_CLASS_PREFIX}-bottom`]: isNumber(translateY) && coordinate && isNumber(coordinate.y) && translateY >= coordinate.y,
|
|
10
|
+
[`${CSS_CLASS_PREFIX}-top`]: isNumber(translateY) && coordinate && isNumber(coordinate.y) && translateY < coordinate.y
|
|
10
11
|
}];
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
-
if (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
function getTooltipTranslateXY({ allowEscapeViewBox, coordinate, key, offsetTopLeft, position, reverseDirection, tooltipDimension, viewBox, viewBoxDimension }) {
|
|
14
|
+
if (position && isNumber(position[key])) return position[key];
|
|
15
|
+
const negative = coordinate[key] - tooltipDimension - (offsetTopLeft > 0 ? offsetTopLeft : 0);
|
|
16
|
+
const positive = coordinate[key] + offsetTopLeft;
|
|
17
|
+
if (allowEscapeViewBox[key]) return reverseDirection[key] ? negative : positive;
|
|
18
|
+
const viewBoxKey = viewBox[key];
|
|
19
|
+
if (viewBoxKey == null) return 0;
|
|
20
|
+
if (reverseDirection[key]) {
|
|
21
|
+
if (negative < viewBoxKey) return Math.max(positive, viewBoxKey);
|
|
22
|
+
return Math.max(negative, viewBoxKey);
|
|
23
|
+
}
|
|
24
|
+
if (viewBoxDimension == null) return 0;
|
|
25
|
+
if (positive + tooltipDimension > viewBoxKey + viewBoxDimension) return Math.max(negative, viewBoxKey);
|
|
26
|
+
return Math.max(positive, viewBoxKey);
|
|
18
27
|
}
|
|
19
|
-
function
|
|
20
|
-
return { transform:
|
|
28
|
+
function getTransformStyle({ translateX, translateY, useTranslate3d }) {
|
|
29
|
+
return { transform: useTranslate3d ? `translate3d(${translateX}px, ${translateY}px, 0)` : `translate(${translateX}px, ${translateY}px)` };
|
|
21
30
|
}
|
|
22
|
-
function
|
|
23
|
-
let
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
31
|
+
function getTooltipTranslate({ allowEscapeViewBox, coordinate, offsetTopLeft, position, reverseDirection, tooltipBox, useTranslate3d, viewBox }) {
|
|
32
|
+
let cssProperties, translateX, translateY;
|
|
33
|
+
if (tooltipBox.height > 0 && tooltipBox.width > 0 && coordinate) {
|
|
34
|
+
translateX = getTooltipTranslateXY({
|
|
35
|
+
allowEscapeViewBox,
|
|
36
|
+
coordinate,
|
|
37
|
+
key: "x",
|
|
38
|
+
offsetTopLeft,
|
|
39
|
+
position,
|
|
40
|
+
reverseDirection,
|
|
41
|
+
tooltipDimension: tooltipBox.width,
|
|
42
|
+
viewBox,
|
|
43
|
+
viewBoxDimension: viewBox.width
|
|
44
|
+
});
|
|
45
|
+
translateY = getTooltipTranslateXY({
|
|
46
|
+
allowEscapeViewBox,
|
|
47
|
+
coordinate,
|
|
48
|
+
key: "y",
|
|
49
|
+
offsetTopLeft,
|
|
50
|
+
position,
|
|
51
|
+
reverseDirection,
|
|
52
|
+
tooltipDimension: tooltipBox.height,
|
|
53
|
+
viewBox,
|
|
54
|
+
viewBoxDimension: viewBox.height
|
|
55
|
+
});
|
|
56
|
+
cssProperties = {};
|
|
57
|
+
} else cssProperties = TOOLTIP_HIDDEN;
|
|
58
|
+
return {
|
|
59
|
+
cssProperties,
|
|
60
|
+
cssClasses: getTooltipCSSClassName({
|
|
61
|
+
translateX,
|
|
62
|
+
translateY,
|
|
63
|
+
coordinate
|
|
50
64
|
}),
|
|
51
|
-
transform:
|
|
52
|
-
translateX:
|
|
53
|
-
translateY:
|
|
54
|
-
useTranslate3d
|
|
65
|
+
transform: getTransformStyle({
|
|
66
|
+
translateX: translateX ?? 0,
|
|
67
|
+
translateY: translateY ?? 0,
|
|
68
|
+
useTranslate3d
|
|
55
69
|
})
|
|
56
70
|
};
|
|
57
71
|
}
|
|
58
72
|
//#endregion
|
|
59
|
-
export {
|
|
73
|
+
export { getTooltipTranslate };
|
|
@@ -1,31 +1,42 @@
|
|
|
1
1
|
//#region src/utils/validate.ts
|
|
2
|
-
function
|
|
3
|
-
return typeof
|
|
4
|
-
}
|
|
5
|
-
function
|
|
6
|
-
return (typeof
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return
|
|
16
|
-
}
|
|
17
|
-
function
|
|
18
|
-
return
|
|
19
|
-
}
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
2
|
+
function isNan(value) {
|
|
3
|
+
return typeof value == "number" && value != +value;
|
|
4
|
+
}
|
|
5
|
+
function isNumber(value) {
|
|
6
|
+
return (typeof value === "number" || value instanceof Number) && !isNan(value);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* validate the width and height props of a chart element
|
|
10
|
+
* @param {object} el A chart element
|
|
11
|
+
* @return {boolean} true If the props width and height are number, and greater than 0
|
|
12
|
+
*/
|
|
13
|
+
function validateWidthHeight({ width, height }) {
|
|
14
|
+
if (!isNumber(width) || width <= 0 || !isNumber(height) || height <= 0) return false;
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
function isWellBehavedNumber(n) {
|
|
18
|
+
return Number.isFinite(n);
|
|
19
|
+
}
|
|
20
|
+
function isPercent(value) {
|
|
21
|
+
return typeof value === "string" && value.indexOf("%") === value.length - 1;
|
|
22
|
+
}
|
|
23
|
+
function isCategoricalAxis(layout, axisType) {
|
|
24
|
+
return layout === "horizontal" && axisType === "xAxis" || layout === "vertical" && axisType === "yAxis" || layout === "centric" && axisType === "angleAxis" || layout === "radial" && axisType === "radiusAxis";
|
|
25
|
+
}
|
|
26
|
+
function isVisible(sign, tickPosition, getSize, start, end) {
|
|
27
|
+
if (sign * tickPosition < sign * start || sign * tickPosition > sign * end) return false;
|
|
28
|
+
const size = getSize();
|
|
29
|
+
return sign * (tickPosition - sign * size / 2 - start) >= 0 && sign * (tickPosition + sign * size / 2 - end) <= 0;
|
|
30
|
+
}
|
|
31
|
+
var isSsr = typeof window === "undefined";
|
|
32
|
+
/**
|
|
33
|
+
* Checks if the value is null or undefined
|
|
34
|
+
* @param {any} value The value to check
|
|
35
|
+
* @returns {boolean} true if the value is null or undefined
|
|
36
|
+
*/
|
|
37
|
+
function isNullish(value) {
|
|
38
|
+
return value === null || typeof value === "undefined";
|
|
39
|
+
}
|
|
40
|
+
var isNumOrStr = (value) => isNumber(value) || typeof value === "string";
|
|
30
41
|
//#endregion
|
|
31
|
-
export {
|
|
42
|
+
export { isCategoricalAxis, isNan, isNullish, isNumOrStr, isNumber, isPercent, isSsr, isVisible, isWellBehavedNumber, validateWidthHeight };
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { useChartHeight, useChartWidth, useMargin, useOffset } from '../context/chartLayoutContext';
|
|
3
|
+
import { AxisId } from '../state/cartesianAxisSlice';
|
|
4
|
+
import { Coordinate } from '../types/common';
|
|
5
|
+
export type { InverseScaleFunction } from '../utils/createCategoricalInverse';
|
|
6
|
+
export type ScaleFunction = (value: unknown) => number | undefined;
|
|
7
|
+
export interface CartesianDataPoint {
|
|
8
|
+
x: number | string;
|
|
9
|
+
y: number | string;
|
|
10
|
+
}
|
|
11
|
+
export { useChartWidth, useChartHeight, useMargin, useOffset };
|
|
12
|
+
export { useActiveTooltipDataPoints } from '../state/hooks';
|
|
13
|
+
/**
|
|
14
|
+
* Returns whether the tooltip is currently active (visible).
|
|
15
|
+
*
|
|
16
|
+
* Must be used inside a chart component tree (where the Redux store is provided).
|
|
17
|
+
*
|
|
18
|
+
* @returns A reactive boolean indicating tooltip active state
|
|
19
|
+
*/
|
|
20
|
+
export declare function useIsTooltipActive(): Readonly<import('vue').ShallowRef<boolean>>;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the current coordinate of the active tooltip.
|
|
23
|
+
*
|
|
24
|
+
* Must be used inside a chart component tree (where the Redux store is provided).
|
|
25
|
+
*
|
|
26
|
+
* @returns A reactive Coordinate ({ x, y }) or undefined when no tooltip is active
|
|
27
|
+
*/
|
|
28
|
+
export declare function useActiveTooltipCoordinate(): Readonly<import('vue').ShallowRef<Coordinate>>;
|
|
29
|
+
/**
|
|
30
|
+
* Returns the label of the currently active tooltip (the value from the axis dataKey at the hovered index).
|
|
31
|
+
*
|
|
32
|
+
* Must be used inside a chart component tree (where the Redux store is provided).
|
|
33
|
+
*
|
|
34
|
+
* @returns A reactive string label or undefined when no tooltip is active
|
|
35
|
+
*/
|
|
36
|
+
export declare function useActiveTooltipLabel(): Readonly<import('vue').ShallowRef<string>>;
|
|
37
|
+
/**
|
|
38
|
+
* Returns the plot area rectangle { x, y, width, height }.
|
|
39
|
+
* This is the area inside all axes, legend, and brush — where graphical items render.
|
|
40
|
+
*
|
|
41
|
+
* Must be used inside a chart component tree (where the Redux store is provided).
|
|
42
|
+
*
|
|
43
|
+
* @returns A reactive object with x, y, width, height or undefined if offset is not yet available
|
|
44
|
+
*/
|
|
45
|
+
export declare function usePlotArea(): ComputedRef<{
|
|
46
|
+
x: number;
|
|
47
|
+
y: number;
|
|
48
|
+
width: number;
|
|
49
|
+
height: number;
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* Returns the computed domain of an X axis.
|
|
53
|
+
*
|
|
54
|
+
* @param axisId - The axis ID (defaults to 0)
|
|
55
|
+
* @returns A reactive domain (categorical or numerical) or undefined
|
|
56
|
+
*/
|
|
57
|
+
export declare function useXAxisDomain(axisId?: AxisId): Readonly<import('vue').ShallowRef<import('../types/axis').NumberDomain | import('../types').CategoricalDomain>>;
|
|
58
|
+
/**
|
|
59
|
+
* Returns the computed domain of a Y axis.
|
|
60
|
+
*
|
|
61
|
+
* @param axisId - The axis ID (defaults to 0)
|
|
62
|
+
* @returns A reactive domain (categorical or numerical) or undefined
|
|
63
|
+
*/
|
|
64
|
+
export declare function useYAxisDomain(axisId?: AxisId): Readonly<import('vue').ShallowRef<import('../types/axis').NumberDomain | import('../types').CategoricalDomain>>;
|
|
65
|
+
/**
|
|
66
|
+
* Returns the computed tick items of an X axis.
|
|
67
|
+
*
|
|
68
|
+
* @param axisId - The axis ID (defaults to 0)
|
|
69
|
+
* @returns A reactive array of TickItem or undefined
|
|
70
|
+
*/
|
|
71
|
+
export declare function useXAxisTicks(axisId?: AxisId): Readonly<import('vue').ShallowRef<readonly import('../types/common').TickItem[]>>;
|
|
72
|
+
/**
|
|
73
|
+
* Returns the computed tick items of a Y axis.
|
|
74
|
+
*
|
|
75
|
+
* @param axisId - The axis ID (defaults to 0)
|
|
76
|
+
* @returns A reactive array of TickItem or undefined
|
|
77
|
+
*/
|
|
78
|
+
export declare function useYAxisTicks(axisId?: AxisId): Readonly<import('vue').ShallowRef<readonly import('../types/common').TickItem[]>>;
|
|
79
|
+
/**
|
|
80
|
+
* Returns the scale function for an X axis, mapping data values to pixel coordinates.
|
|
81
|
+
*
|
|
82
|
+
* @param axisId - The axis ID (defaults to 0)
|
|
83
|
+
* @returns A reactive ScaleFunction or undefined if the axis is not yet initialized
|
|
84
|
+
*/
|
|
85
|
+
export declare function useXAxisScale(axisId?: AxisId): ComputedRef<ScaleFunction | undefined>;
|
|
86
|
+
/**
|
|
87
|
+
* Returns the scale function for a Y axis, mapping data values to pixel coordinates.
|
|
88
|
+
*
|
|
89
|
+
* @param axisId - The axis ID (defaults to 0)
|
|
90
|
+
* @returns A reactive ScaleFunction or undefined if the axis is not yet initialized
|
|
91
|
+
*/
|
|
92
|
+
export declare function useYAxisScale(axisId?: AxisId): ComputedRef<ScaleFunction | undefined>;
|
|
93
|
+
/**
|
|
94
|
+
* Returns the inverse scale function for an X axis, mapping pixel coordinates back to data values.
|
|
95
|
+
*
|
|
96
|
+
* @param axisId - The axis ID (defaults to 0)
|
|
97
|
+
* @returns A reactive InverseScaleFunction or undefined
|
|
98
|
+
*/
|
|
99
|
+
export declare function useXAxisInverseScale(axisId?: AxisId): Readonly<import('vue').ShallowRef<import('../utils/createCategoricalInverse').InverseScaleFunction>>;
|
|
100
|
+
/**
|
|
101
|
+
* Returns the inverse scale function for a Y axis, mapping pixel coordinates back to data values.
|
|
102
|
+
*
|
|
103
|
+
* @param axisId - The axis ID (defaults to 0)
|
|
104
|
+
* @returns A reactive InverseScaleFunction or undefined
|
|
105
|
+
*/
|
|
106
|
+
export declare function useYAxisInverseScale(axisId?: AxisId): Readonly<import('vue').ShallowRef<import('../utils/createCategoricalInverse').InverseScaleFunction>>;
|
|
107
|
+
/**
|
|
108
|
+
* Returns the inverse scale function for an X axis that snaps to the nearest data point.
|
|
109
|
+
*
|
|
110
|
+
* @param axisId - The axis ID (defaults to 0)
|
|
111
|
+
* @returns A reactive InverseScaleFunction or undefined
|
|
112
|
+
*/
|
|
113
|
+
export declare function useXAxisInverseDataSnapScale(axisId?: AxisId): Readonly<import('vue').ShallowRef<import('../utils/createCategoricalInverse').InverseScaleFunction>>;
|
|
114
|
+
/**
|
|
115
|
+
* Returns the inverse scale function for a Y axis that snaps to the nearest data point.
|
|
116
|
+
*
|
|
117
|
+
* @param axisId - The axis ID (defaults to 0)
|
|
118
|
+
* @returns A reactive InverseScaleFunction or undefined
|
|
119
|
+
*/
|
|
120
|
+
export declare function useYAxisInverseDataSnapScale(axisId?: AxisId): Readonly<import('vue').ShallowRef<import('../utils/createCategoricalInverse').InverseScaleFunction>>;
|
|
121
|
+
/**
|
|
122
|
+
* Returns the inverse scale function for an X axis that snaps to the nearest tick.
|
|
123
|
+
*
|
|
124
|
+
* @param axisId - The axis ID (defaults to 0)
|
|
125
|
+
* @returns A reactive InverseScaleFunction or undefined
|
|
126
|
+
*/
|
|
127
|
+
export declare function useXAxisInverseTickSnapScale(axisId?: AxisId): Readonly<import('vue').ShallowRef<import('../utils/createCategoricalInverse').InverseScaleFunction>>;
|
|
128
|
+
/**
|
|
129
|
+
* Returns the inverse scale function for a Y axis that snaps to the nearest tick.
|
|
130
|
+
*
|
|
131
|
+
* @param axisId - The axis ID (defaults to 0)
|
|
132
|
+
* @returns A reactive InverseScaleFunction or undefined
|
|
133
|
+
*/
|
|
134
|
+
export declare function useYAxisInverseTickSnapScale(axisId?: AxisId): Readonly<import('vue').ShallowRef<import('../utils/createCategoricalInverse').InverseScaleFunction>>;
|
|
135
|
+
/**
|
|
136
|
+
* Convenience hook that maps a data point to pixel coordinates using both X and Y axis scales.
|
|
137
|
+
*
|
|
138
|
+
* @param dataPoint - An object with x and y data values
|
|
139
|
+
* @param xAxisId - The X axis ID (defaults to 0)
|
|
140
|
+
* @param yAxisId - The Y axis ID (defaults to 0)
|
|
141
|
+
* @returns A reactive Coordinate ({ x, y }) or undefined if either scale is unavailable
|
|
142
|
+
*/
|
|
143
|
+
export declare function useCartesianScale(dataPoint: CartesianDataPoint, xAxisId?: AxisId, yAxisId?: AxisId): ComputedRef<Coordinate | undefined>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Tracks whether a component is currently animating.
|
|
4
|
+
*
|
|
5
|
+
* When `isAnimationActive` is `false`, always returns `false` regardless of
|
|
6
|
+
* internal state — this ensures `isAnimationActive={false}` immediately
|
|
7
|
+
* disables all animation-gated rendering (e.g. deferred LabelList).
|
|
8
|
+
*
|
|
9
|
+
* When `isAnimationActive` is `true`, starts as `true` and can be set to
|
|
10
|
+
* `false` via the returned ref (typically on animation end).
|
|
11
|
+
*
|
|
12
|
+
* Re-entering `isAnimationActive=true` resets internal state to `true`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useIsAnimating(isAnimationActive: () => boolean): Ref<boolean>;
|
package/dist/index.d.ts
CHANGED
package/dist/polar/pie/type.d.ts
CHANGED
|
@@ -142,14 +142,14 @@ export declare const Radar: import('vue').DefineComponent<import('vue').ExtractP
|
|
|
142
142
|
};
|
|
143
143
|
}>> & Readonly<{}>, {
|
|
144
144
|
fill: string;
|
|
145
|
-
|
|
145
|
+
fillOpacity: number;
|
|
146
146
|
stroke: string;
|
|
147
|
-
label: boolean | Record<string, any>;
|
|
148
|
-
connectNulls: boolean;
|
|
149
147
|
strokeDasharray: string;
|
|
150
148
|
strokeWidth: number;
|
|
149
|
+
name: string;
|
|
150
|
+
label: boolean | Record<string, any>;
|
|
151
|
+
connectNulls: boolean;
|
|
151
152
|
hide: boolean;
|
|
152
|
-
fillOpacity: number;
|
|
153
153
|
tooltipType: "none";
|
|
154
154
|
legendType: LegendType;
|
|
155
155
|
isAnimationActive: boolean;
|
package/dist/shape/Curve.d.ts
CHANGED
|
@@ -33,7 +33,8 @@ export declare const CurveVueProps: {
|
|
|
33
33
|
type: StringConstructor;
|
|
34
34
|
};
|
|
35
35
|
class: {
|
|
36
|
-
type: (
|
|
36
|
+
type: PropType<import('../types').VueClassValue>;
|
|
37
|
+
default: any;
|
|
37
38
|
};
|
|
38
39
|
};
|
|
39
40
|
export type CurvePropsWithOutSVG = VuePropsToType<typeof CurveVueProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SVGAttributes } from 'vue';
|
|
2
|
+
export interface PolygonPoint {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}
|
|
6
|
+
export interface PolygonProps {
|
|
7
|
+
points?: PolygonPoint[];
|
|
8
|
+
}
|
|
9
|
+
export declare function Polygon(props: PolygonProps & SVGAttributes): import("vue/jsx-runtime").JSX.Element;
|
|
@@ -2,10 +2,6 @@ import { PropType } from 'vue';
|
|
|
2
2
|
import { VuePropsToType, WithSVGProps } from '../types';
|
|
3
3
|
import { RectRadius } from '../types/bar';
|
|
4
4
|
declare const RectangleVueProps: {
|
|
5
|
-
className: {
|
|
6
|
-
type: PropType<string>;
|
|
7
|
-
default: any;
|
|
8
|
-
};
|
|
9
5
|
x: {
|
|
10
6
|
type: PropType<number>;
|
|
11
7
|
default: number;
|
package/dist/shape/Sector.d.ts
CHANGED
package/dist/shape/Symbols.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { VueClassValue } from '../types/common';
|
|
1
2
|
export type SymbolType = 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye';
|
|
2
3
|
type SizeType = 'area' | 'diameter';
|
|
3
4
|
export interface SymbolsProps {
|
|
4
|
-
|
|
5
|
+
class?: VueClassValue;
|
|
5
6
|
type?: SymbolType;
|
|
6
7
|
cx?: number;
|
|
7
8
|
cy?: number;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { WithSVGProps } from '../types';
|
|
2
|
+
declare const TrapezoidVueProps: {
|
|
3
|
+
x: {
|
|
4
|
+
type: NumberConstructor;
|
|
5
|
+
default: number;
|
|
6
|
+
};
|
|
7
|
+
y: {
|
|
8
|
+
type: NumberConstructor;
|
|
9
|
+
default: number;
|
|
10
|
+
};
|
|
11
|
+
upperWidth: {
|
|
12
|
+
type: NumberConstructor;
|
|
13
|
+
default: number;
|
|
14
|
+
};
|
|
15
|
+
lowerWidth: {
|
|
16
|
+
type: NumberConstructor;
|
|
17
|
+
default: number;
|
|
18
|
+
};
|
|
19
|
+
height: {
|
|
20
|
+
type: NumberConstructor;
|
|
21
|
+
default: number;
|
|
22
|
+
};
|
|
23
|
+
class: {
|
|
24
|
+
type: import('vue').PropType<import('../types').VueClassValue>;
|
|
25
|
+
default: any;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export type TrapezoidComponentProps = WithSVGProps<typeof TrapezoidVueProps>;
|
|
29
|
+
export declare const Trapezoid: import('vue').DefineComponent<TrapezoidComponentProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<TrapezoidComponentProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
30
|
+
export {};
|
package/dist/shape/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export * from './Cross';
|
|
|
3
3
|
export { Curve, CurveVueProps, getPath } from './Curve';
|
|
4
4
|
export type { CurveType, CurvePropsWithOutSVG, CurveProps } from './Curve';
|
|
5
5
|
export * from './Dot';
|
|
6
|
+
export * from './Polygon';
|
|
6
7
|
export * from './Rectangle';
|
|
7
8
|
export * from './Symbols';
|
|
8
9
|
export * from './Sector';
|
|
10
|
+
export * from './Trapezoid';
|
package/dist/shape/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AnimationOptions } from 'motion-v';
|
|
2
|
+
import { VueClassValue } from '../types/common';
|
|
2
3
|
export interface Point {
|
|
3
4
|
readonly x: number;
|
|
4
5
|
readonly y: number;
|
|
@@ -6,7 +7,7 @@ export interface Point {
|
|
|
6
7
|
export type MinPointSize = number | ((value: number, index: number) => number);
|
|
7
8
|
export type NormalizedStackId = string;
|
|
8
9
|
export interface TrapezoidProps {
|
|
9
|
-
|
|
10
|
+
class?: VueClassValue;
|
|
10
11
|
x?: number;
|
|
11
12
|
y?: number;
|
|
12
13
|
width?: number;
|
|
@@ -14,7 +15,5 @@ export interface TrapezoidProps {
|
|
|
14
15
|
lowerWidth?: number;
|
|
15
16
|
height?: number;
|
|
16
17
|
isUpdateAnimationActive?: boolean;
|
|
17
|
-
|
|
18
|
-
animationDuration?: number;
|
|
19
|
-
animationEasing?: AnimationEasing;
|
|
18
|
+
transition?: AnimationOptions;
|
|
20
19
|
}
|
|
@@ -18,7 +18,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
18
18
|
default: any;
|
|
19
19
|
};
|
|
20
20
|
class: {
|
|
21
|
-
type:
|
|
21
|
+
type: PropType<import('../types').VueClassValue>;
|
|
22
22
|
default: any;
|
|
23
23
|
};
|
|
24
24
|
maxBarSize: {
|
|
@@ -55,7 +55,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
55
55
|
default: any;
|
|
56
56
|
};
|
|
57
57
|
class: {
|
|
58
|
-
type:
|
|
58
|
+
type: PropType<import('../types').VueClassValue>;
|
|
59
59
|
default: any;
|
|
60
60
|
};
|
|
61
61
|
maxBarSize: {
|
|
@@ -79,7 +79,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
79
79
|
barCategoryGap: string | number;
|
|
80
80
|
barGap: number;
|
|
81
81
|
barSize: string | number;
|
|
82
|
-
class:
|
|
82
|
+
class: import('../types').VueClassValue;
|
|
83
83
|
maxBarSize: number;
|
|
84
84
|
stackOffset: StackOffsetType;
|
|
85
85
|
syncId: string | number;
|
|
@@ -23,7 +23,7 @@ export type ErrorBarsSettings = {
|
|
|
23
23
|
dataKey: DataKey<any>;
|
|
24
24
|
};
|
|
25
25
|
export type CartesianGraphicalItemType = 'area' | 'bar' | 'line' | 'scatter';
|
|
26
|
-
export type PolarGraphicalItemType = 'pie' | 'radar' | 'radialBar';
|
|
26
|
+
export type PolarGraphicalItemType = 'pie' | 'radar' | 'radialBar' | 'funnel';
|
|
27
27
|
export interface GraphicalItemSettings extends MaybeStackedGraphicalItem {
|
|
28
28
|
data: ChartData;
|
|
29
29
|
dataKey: DataKey<any> | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StackOffsetType, SyncMethod } from '../types';
|
|
1
|
+
import { StackOffsetType, SyncMethod, VueClassValue } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* These are chart options that users can choose - which means they can also
|
|
4
4
|
* choose to change them which should trigger a re-render.
|
|
@@ -12,7 +12,7 @@ export type UpdatableChartOptions = {
|
|
|
12
12
|
* Useful for debugging which chart is which when synchronising.
|
|
13
13
|
* The className is also passed to the root element of the chart but that's done in the JSX, not through Redux.
|
|
14
14
|
*/
|
|
15
|
-
class:
|
|
15
|
+
class: VueClassValue | undefined;
|
|
16
16
|
maxBarSize: number | undefined;
|
|
17
17
|
stackOffset: StackOffsetType;
|
|
18
18
|
/**
|
|
@@ -10,6 +10,7 @@ import { AxisDomain, AxisType, NumberDomain } from '../../types/axis';
|
|
|
10
10
|
import { CategoricalDomain, Coordinate, DataKey, LayoutType, Size, StackOffsetType, TickItem } from '../../types';
|
|
11
11
|
import { StackId } from '../../types/tick';
|
|
12
12
|
import { RechartsScale } from '../../types/scale';
|
|
13
|
+
import { InverseScaleFunction } from '../../utils/createCategoricalInverse';
|
|
13
14
|
import { AxisPropsForCartesianGridTicksGeneration } from '../../cartesian/cartesian-grid/type';
|
|
14
15
|
/**
|
|
15
16
|
* angle, radius, X, Y, and Z axes all have domain and range and scale and associated settings
|
|
@@ -876,6 +877,9 @@ export declare const selectAxisScale: ((state: {
|
|
|
876
877
|
argsMemoize: typeof import('@reduxjs/toolkit').weakMapMemoize;
|
|
877
878
|
memoize: typeof import('@reduxjs/toolkit').weakMapMemoize;
|
|
878
879
|
};
|
|
880
|
+
export declare const selectSortedDataPoints: (state: RechartsRootState, axisType: XorYorZType, axisId: AxisId, isPanorama: boolean) => ReadonlyArray<unknown> | undefined;
|
|
881
|
+
export declare const selectAxisInverseScale: (state: RechartsRootState, axisType: XorYorZType, axisId: AxisId, isPanorama: boolean) => InverseScaleFunction | undefined;
|
|
882
|
+
export declare const selectAxisInverseDataSnapScale: (state: RechartsRootState, axisType: XorYorZType, axisId: AxisId, isPanorama: boolean) => InverseScaleFunction | undefined;
|
|
879
883
|
export declare const selectErrorBarsSettings: ((state: {
|
|
880
884
|
brush: import('../brushSlice').BrushSettings;
|
|
881
885
|
cartesianAxis: {
|
|
@@ -1702,6 +1706,7 @@ export declare const selectTicksOfAxis: ((state: {
|
|
|
1702
1706
|
argsMemoize: typeof import('@reduxjs/toolkit').weakMapMemoize;
|
|
1703
1707
|
memoize: typeof import('@reduxjs/toolkit').weakMapMemoize;
|
|
1704
1708
|
};
|
|
1709
|
+
export declare const selectAxisInverseTickSnapScale: (state: RechartsRootState, axisType: XorYorZType, axisId: AxisId, isPanorama: boolean) => InverseScaleFunction | undefined;
|
|
1705
1710
|
export declare function combineGraphicalItemTicks(layout: LayoutType, axis: AxisWithTicksSettings, scale: RechartsScale | undefined, axisRange: AxisRange | undefined, duplicateDomain: ReadonlyArray<unknown> | undefined, categoricalDomain: ReadonlyArray<unknown> | undefined, axisType: XorYType): TickItem[] | null;
|
|
1706
1711
|
export declare const selectTicksOfGraphicalItem: (state: RechartsRootState, axisType: XorYType, axisId: AxisId, isPanorama: boolean) => TickItem[] | null;
|
|
1707
1712
|
export type BaseAxisWithScale = BaseCartesianAxis & {
|
package/dist/types/axis.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataKey } from './common';
|
|
1
|
+
import { DataKey, VueClassValue } from './common';
|
|
2
2
|
import { RechartsScale, ScaleType } from './scale';
|
|
3
3
|
import { TickFormatter, TicksSettings } from './tick';
|
|
4
4
|
export type AxisId = string | number;
|
|
@@ -113,7 +113,7 @@ export interface XAxisProps {
|
|
|
113
113
|
angle?: number;
|
|
114
114
|
minTickGap?: number;
|
|
115
115
|
label?: string | number | any;
|
|
116
|
-
|
|
116
|
+
class?: VueClassValue;
|
|
117
117
|
}
|
|
118
118
|
/**
|
|
119
119
|
* NumberDomain is an evaluated {@link AxisDomain}.
|
package/dist/types/bar.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Coordinate } from './common';
|
|
1
|
+
import { Coordinate, VueClassValue } from './common';
|
|
2
2
|
import { CartesianViewBox } from '../cartesian/type';
|
|
3
3
|
export type BarPositionPosition = {
|
|
4
4
|
/**
|
|
@@ -16,9 +16,8 @@ export type BarPositionPosition = {
|
|
|
16
16
|
size: number | undefined | typeof NaN;
|
|
17
17
|
};
|
|
18
18
|
export type RectRadius = [number, number, number, number];
|
|
19
|
-
export type AnimationEasing = 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear';
|
|
20
19
|
interface RectangleProps {
|
|
21
|
-
|
|
20
|
+
class?: VueClassValue;
|
|
22
21
|
x?: number;
|
|
23
22
|
y?: number;
|
|
24
23
|
width?: number;
|
|
@@ -26,9 +25,6 @@ interface RectangleProps {
|
|
|
26
25
|
radius?: number | RectRadius;
|
|
27
26
|
isAnimationActive?: boolean;
|
|
28
27
|
isUpdateAnimationActive?: boolean;
|
|
29
|
-
animationBegin?: number;
|
|
30
|
-
animationDuration?: number;
|
|
31
|
-
animationEasing?: AnimationEasing;
|
|
32
28
|
}
|
|
33
29
|
export interface BarRectangleItem extends RectangleProps {
|
|
34
30
|
value?: number | [number, number];
|