vccs 0.0.1 → 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.
- package/LICENSE +21 -0
- package/dist/animation/Animate.d.ts +72 -0
- package/dist/cartesian/GraphicalItemClipPath.d.ts +31 -0
- package/dist/cartesian/area/ActivePoints.d.ts +77 -0
- package/dist/cartesian/area/Area.d.ts +17 -0
- package/dist/cartesian/area/ClipRect.d.ts +1 -0
- package/dist/cartesian/area/RenderArea.d.ts +16 -0
- package/dist/cartesian/area/__stories__/config.d.ts +31 -0
- package/dist/cartesian/area/hooks/useArea.d.ts +27 -0
- package/dist/cartesian/area/index.d.ts +2 -0
- package/dist/cartesian/area/type.d.ts +173 -0
- package/dist/cartesian/area/utils.d.ts +19 -0
- package/dist/cartesian/axis/XAxis.d.ts +189 -0
- package/dist/cartesian/axis/YAxis.d.ts +192 -0
- package/dist/cartesian/axis/index.d.ts +2 -0
- package/dist/cartesian/axis/type.d.ts +57 -0
- package/dist/cartesian/bar/Bar.d.ts +2 -0
- package/dist/cartesian/bar/components/BarBackground.d.ts +1 -0
- package/dist/cartesian/bar/components/BarRectangles.d.ts +1 -0
- package/dist/cartesian/bar/hooks/useBar.d.ts +23 -0
- package/dist/cartesian/bar/index.d.ts +1 -0
- package/dist/cartesian/bar/type.d.ts +166 -0
- package/dist/cartesian/bar/utils.d.ts +31 -0
- package/dist/cartesian/brush/Brush.d.ts +2 -0
- package/dist/cartesian/brush/components/Background.d.ts +15 -0
- package/dist/cartesian/brush/components/BrushText.d.ts +27 -0
- package/dist/cartesian/brush/components/Panorama.d.ts +65 -0
- package/dist/cartesian/brush/components/Slide.d.ts +20 -0
- package/dist/cartesian/brush/components/Traveller.d.ts +13 -0
- package/dist/cartesian/brush/components/TravellerLayer.d.ts +22 -0
- package/dist/cartesian/brush/hooks/useBrushHandlers.d.ts +25 -0
- package/dist/cartesian/brush/hooks/useBrushSetting.d.ts +6 -0
- package/dist/cartesian/brush/hooks/useBrushState.d.ts +29 -0
- package/dist/cartesian/brush/index.d.ts +2 -0
- package/dist/cartesian/brush/type.d.ts +103 -0
- package/dist/cartesian/brush/utils.d.ts +15 -0
- package/dist/cartesian/cartesian-axis/CartesianAxis.d.ts +209 -0
- package/dist/cartesian/cartesian-axis/const.d.ts +24 -0
- package/dist/cartesian/cartesian-axis/index.d.ts +1 -0
- package/dist/cartesian/cartesian-axis/use-axis-line.d.ts +7 -0
- package/dist/cartesian/cartesian-grid/Background.d.ts +18 -0
- package/dist/cartesian/cartesian-grid/CartesianGrid.d.ts +75 -0
- package/dist/cartesian/cartesian-grid/HorizontalGridLines.d.ts +37 -0
- package/dist/cartesian/cartesian-grid/HorizontalStripes.d.ts +20 -0
- package/dist/cartesian/cartesian-grid/VerticalGridLines.d.ts +26 -0
- package/dist/cartesian/cartesian-grid/VerticalStripes.d.ts +20 -0
- package/dist/cartesian/cartesian-grid/const.d.ts +6 -0
- package/dist/cartesian/cartesian-grid/index.d.ts +1 -0
- package/dist/cartesian/cartesian-grid/type.d.ts +145 -0
- package/dist/cartesian/cartesian-grid/utils.d.ts +5 -0
- package/dist/cartesian/error-bar/ErrorBar.d.ts +68 -0
- package/dist/cartesian/error-bar/ErrorBarContext.d.ts +27 -0
- package/dist/cartesian/error-bar/index.d.ts +2 -0
- 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 +106 -0
- package/dist/cartesian/funnel/utils.d.ts +12 -0
- package/dist/cartesian/index.d.ts +12 -0
- package/dist/cartesian/line/ActivePoints.d.ts +77 -0
- package/dist/cartesian/line/Line.d.ts +87 -0
- package/dist/cartesian/line/StaticLine.d.ts +16 -0
- package/dist/cartesian/line/hooks/useLine.d.ts +28 -0
- package/dist/cartesian/line/index.d.ts +3 -0
- package/dist/cartesian/line/type.d.ts +180 -0
- package/dist/cartesian/line/utils.d.ts +13 -0
- package/dist/cartesian/reference-area/ReferenceArea.d.ts +191 -0
- package/dist/cartesian/reference-area/index.d.ts +1 -0
- package/dist/cartesian/reference-line/ReferenceLine.d.ts +139 -0
- package/dist/cartesian/reference-line/index.d.ts +1 -0
- package/dist/cartesian/scatter/Scatter.d.ts +165 -0
- package/dist/cartesian/scatter/hooks/useScatter.d.ts +18 -0
- package/dist/cartesian/scatter/index.d.ts +1 -0
- package/dist/cartesian/type.d.ts +21 -0
- package/dist/cartesian/useNeedsClip.d.ts +6 -0
- package/dist/cartesian/utils/get-ticks.d.ts +16 -0
- package/dist/cartesian/z-axis/ZAxis.d.ts +81 -0
- package/dist/cartesian/z-axis/index.d.ts +1 -0
- package/dist/chart/AreaChart.d.ts +1 -0
- package/dist/chart/BarChart.d.ts +1 -0
- package/dist/chart/ComposedChart.d.ts +1 -0
- package/dist/chart/FunnelChart.d.ts +1 -0
- package/dist/chart/LegendPortalContext.d.ts +3 -0
- package/dist/chart/LineChart.d.ts +1 -0
- package/dist/chart/PieChart.d.ts +1 -0
- package/dist/chart/RadarChart.d.ts +1 -0
- package/dist/chart/RadialBarChart.d.ts +1 -0
- package/dist/chart/RechartsWrapper.d.ts +99 -0
- package/dist/chart/ScatterChart.d.ts +1 -0
- package/dist/chart/Surface.d.ts +40 -0
- package/dist/chart/TooltipPortalContext.d.ts +2 -0
- package/dist/chart/const.d.ts +6 -0
- package/dist/chart/generateCategoricalChart.d.ts +118 -0
- package/dist/chart/index.d.ts +9 -0
- package/dist/chart/provideClipPathId.d.ts +12 -0
- package/dist/components/Cell.d.ts +18 -0
- package/dist/components/DefaultLegendContent.d.ts +18 -0
- package/dist/components/Text.d.ts +149 -0
- package/dist/components/Tooltip.d.ts +250 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/label/Label.d.ts +81 -0
- package/dist/components/label/LabelList.d.ts +63 -0
- package/dist/components/label/index.d.ts +2 -0
- package/dist/components/label/types.d.ts +88 -0
- package/dist/components/label/utils.d.ts +24 -0
- package/dist/components/legend/Legend.d.ts +4 -0
- package/dist/components/legend/LegendSymbol.d.ts +27 -0
- package/dist/components/legend/hooks/useLegend.d.ts +19 -0
- package/dist/components/legend/hooks/useLegendContent.d.ts +36 -0
- package/dist/components/legend/index.d.ts +2 -0
- package/dist/components/legend/type.d.ts +54 -0
- package/dist/components/legend/utils.d.ts +18 -0
- package/dist/components/types.d.ts +9 -0
- package/dist/components/utils.d.ts +4 -0
- package/dist/container/ClipPath.d.ts +12 -0
- package/dist/container/Layer.d.ts +2 -0
- package/dist/container/ResponsiveContainer.d.ts +50 -0
- package/dist/container/RootSurface.d.ts +17 -0
- package/dist/container/Surface.d.ts +25 -0
- package/dist/container/index.d.ts +1 -0
- package/dist/container/useSizeContext.d.ts +11 -0
- package/dist/context/ChartDataContextProvider.d.ts +17 -0
- package/dist/context/PanoramaContextProvider.d.ts +22 -0
- package/dist/context/accessibilityContext.d.ts +1 -0
- package/dist/context/cartesianLabelListContext.d.ts +3 -0
- package/dist/context/chartLayoutContext.d.ts +8 -0
- package/dist/context/cursorLayerContext.d.ts +2 -0
- package/dist/context/graphicalLayerContext.d.ts +2 -0
- package/dist/context/labelLayerContext.d.ts +2 -0
- package/dist/context/polarLabelViewBoxContext.d.ts +4 -0
- package/dist/context/useTooltipAxis.d.ts +2 -0
- package/dist/es/animation/Animate.mjs +89 -0
- package/dist/es/cartesian/GraphicalItemClipPath.mjs +37 -0
- package/dist/es/cartesian/area/ActivePoints.mjs +78 -0
- package/dist/es/cartesian/area/Area.mjs +52 -0
- package/dist/es/cartesian/area/ClipRect.mjs +125 -0
- package/dist/es/cartesian/area/RenderArea.mjs +185 -0
- package/dist/es/cartesian/area/hooks/useArea.mjs +81 -0
- package/dist/es/cartesian/area/type.mjs +136 -0
- package/dist/es/cartesian/area/utils.mjs +79 -0
- package/dist/es/cartesian/axis/XAxis.mjs +203 -0
- package/dist/es/cartesian/axis/YAxis.mjs +192 -0
- package/dist/es/cartesian/bar/Bar.mjs +111 -0
- package/dist/es/cartesian/bar/components/BarBackground.mjs +32 -0
- package/dist/es/cartesian/bar/components/BarRectangles.mjs +143 -0
- package/dist/es/cartesian/bar/hooks/useBar.mjs +53 -0
- package/dist/es/cartesian/bar/type.mjs +131 -0
- package/dist/es/cartesian/bar/utils.mjs +111 -0
- package/dist/es/cartesian/cartesian-axis/CartesianAxis.mjs +296 -0
- package/dist/es/cartesian/cartesian-grid/Background.mjs +33 -0
- package/dist/es/cartesian/cartesian-grid/CartesianGrid.mjs +174 -0
- package/dist/es/cartesian/cartesian-grid/HorizontalGridLines.mjs +50 -0
- package/dist/es/cartesian/cartesian-grid/HorizontalStripes.mjs +43 -0
- package/dist/es/cartesian/cartesian-grid/VerticalGridLines.mjs +45 -0
- package/dist/es/cartesian/cartesian-grid/VerticalStripes.mjs +43 -0
- package/dist/es/cartesian/cartesian-grid/const.mjs +336 -0
- package/dist/es/cartesian/cartesian-grid/utils.mjs +22 -0
- package/dist/es/cartesian/error-bar/ErrorBar.mjs +143 -0
- package/dist/es/cartesian/error-bar/ErrorBarContext.mjs +20 -0
- package/dist/es/cartesian/funnel/Funnel.mjs +177 -0
- package/dist/es/cartesian/funnel/type.mjs +80 -0
- package/dist/es/cartesian/funnel/utils.mjs +102 -0
- package/dist/es/cartesian/line/ActivePoints.mjs +79 -0
- package/dist/es/cartesian/line/Line.mjs +50 -0
- package/dist/es/cartesian/line/StaticLine.mjs +217 -0
- package/dist/es/cartesian/line/hooks/useLine.mjs +69 -0
- package/dist/es/cartesian/line/type.mjs +112 -0
- package/dist/es/cartesian/line/utils.mjs +34 -0
- package/dist/es/cartesian/reference-area/ReferenceArea.mjs +163 -0
- package/dist/es/cartesian/reference-line/ReferenceLine.mjs +165 -0
- package/dist/es/cartesian/scatter/Scatter.mjs +280 -0
- package/dist/es/cartesian/scatter/hooks/useScatter.mjs +23 -0
- package/dist/es/cartesian/useNeedsClip.mjs +23 -0
- package/dist/es/cartesian/utils/get-ticks.mjs +118 -0
- package/dist/es/cartesian/z-axis/ZAxis.mjs +72 -0
- package/dist/es/chart/AreaChart.mjs +9 -0
- package/dist/es/chart/BarChart.mjs +10 -0
- package/dist/es/chart/ComposedChart.mjs +10 -0
- package/dist/es/chart/FunnelChart.mjs +11 -0
- package/dist/es/chart/LegendPortalContext.mjs +5 -0
- package/dist/es/chart/LineChart.mjs +10 -0
- package/dist/es/chart/PieChart.mjs +16 -0
- package/dist/es/chart/RadarChart.mjs +16 -0
- package/dist/es/chart/RadialBarChart.mjs +16 -0
- package/dist/es/chart/RechartsWrapper.mjs +160 -0
- package/dist/es/chart/ScatterChart.mjs +10 -0
- package/dist/es/chart/Surface.mjs +5 -0
- package/dist/es/chart/Surface.vue_vue_type_script_setup_true_lang.mjs +72 -0
- package/dist/es/chart/TooltipPortalContext.mjs +5 -0
- package/dist/es/chart/const.mjs +7 -0
- package/dist/es/chart/generateCategoricalChart.mjs +175 -0
- package/dist/es/chart/provideClipPathId.mjs +15 -0
- package/dist/es/components/Cell.mjs +23 -0
- package/dist/es/components/Text.mjs +5 -0
- package/dist/es/components/Text.vue_vue_type_script_setup_true_lang.mjs +191 -0
- package/dist/es/components/Tooltip.mjs +463 -0
- package/dist/es/components/label/Label.mjs +40 -0
- package/dist/es/components/label/LabelList.mjs +55 -0
- package/dist/es/components/label/types.mjs +38 -0
- package/dist/es/components/label/utils.mjs +265 -0
- package/dist/es/components/legend/Legend.mjs +93 -0
- package/dist/es/components/legend/LegendSymbol.mjs +62 -0
- package/dist/es/components/legend/hooks/useLegend.mjs +72 -0
- package/dist/es/components/legend/hooks/useLegendContent.mjs +68 -0
- package/dist/es/components/legend/type.mjs +41 -0
- package/dist/es/components/legend/utils.mjs +25 -0
- package/dist/es/components/utils.mjs +44 -0
- package/dist/es/container/ClipPath.mjs +25 -0
- package/dist/es/container/Layer.mjs +14 -0
- package/dist/es/container/ResponsiveContainer.mjs +5 -0
- package/dist/es/container/ResponsiveContainer.vue_vue_type_script_setup_true_lang.mjs +144 -0
- package/dist/es/container/Surface.mjs +62 -0
- package/dist/es/container/useSizeContext.mjs +5 -0
- package/dist/es/context/ChartDataContextProvider.mjs +27 -0
- package/dist/es/context/PanoramaContextProvider.mjs +24 -0
- package/dist/es/context/accessibilityContext.mjs +5 -0
- package/dist/es/context/cartesianLabelListContext.mjs +5 -0
- package/dist/es/context/chartLayoutContext.mjs +49 -0
- package/dist/es/context/cursorLayerContext.mjs +5 -0
- package/dist/es/context/graphicalLayerContext.mjs +5 -0
- package/dist/es/context/labelLayerContext.mjs +5 -0
- package/dist/es/context/polarLabelViewBoxContext.mjs +8 -0
- package/dist/es/context/useTooltipAxis.mjs +17 -0
- package/dist/es/events/useChartSynchronisation.mjs +113 -0
- package/dist/es/hooks/useIsAnimating.mjs +28 -0
- package/dist/es/hooks/useSetupGraphicalItem.mjs +66 -0
- package/dist/es/index.mjs +46 -0
- package/dist/es/polar/pie/Pie.mjs +161 -0
- package/dist/es/polar/pie/type.mjs +97 -0
- package/dist/es/polar/radar/PolarAngleAxis.mjs +180 -0
- package/dist/es/polar/radar/PolarGrid.mjs +115 -0
- package/dist/es/polar/radar/PolarRadiusAxis.mjs +162 -0
- package/dist/es/polar/radar/Radar.mjs +284 -0
- package/dist/es/polar/radial-bar/RadialBar.mjs +197 -0
- package/dist/es/polar/radial-bar/type.mjs +97 -0
- package/dist/es/shape/Cross.mjs +16 -0
- package/dist/es/shape/Curve.mjs +86 -0
- package/dist/es/shape/Dot.mjs +24 -0
- package/dist/es/shape/Rectangle.mjs +83 -0
- package/dist/es/shape/Sector.mjs +156 -0
- package/dist/es/shape/Symbols.mjs +52 -0
- package/dist/es/shape/Trapezoid.mjs +52 -0
- package/dist/es/state/ReportChartProps.mjs +64 -0
- package/dist/es/state/ReportMainChartProps.mjs +46 -0
- package/dist/es/state/ReportPolarOptions.mjs +56 -0
- package/dist/es/state/SetGraphicalItem.mjs +49 -0
- package/dist/es/state/SetLegendPayload.mjs +20 -0
- package/dist/es/state/SetTooltipEntrySettings.mjs +19 -0
- package/dist/es/state/brushSlice.mjs +26 -0
- package/dist/es/state/cartesianAxisSlice.mjs +39 -0
- package/dist/es/state/chartDataSlice.mjs +33 -0
- package/dist/es/state/externalEventsMiddleware.mjs +30 -0
- package/dist/es/state/graphicalItemsSlice.mjs +47 -0
- package/dist/es/state/hooks.mjs +6 -0
- package/dist/es/state/keyboardEventsMiddleware.mjs +63 -0
- package/dist/es/state/layoutSlice.mjs +39 -0
- package/dist/es/state/legendSlice.mjs +40 -0
- package/dist/es/state/mouseEventsMiddleware.mjs +41 -0
- package/dist/es/state/optionsSlice.mjs +25 -0
- package/dist/es/state/polarAxisSlice.mjs +28 -0
- package/dist/es/state/polarOptionsSlice.mjs +13 -0
- package/dist/es/state/reduxDevtoolsJsonStringifyReplacer.mjs +8 -0
- package/dist/es/state/referenceElementsSlice.mjs +36 -0
- package/dist/es/state/rootPropsSlice.mjs +32 -0
- package/dist/es/state/selectors/areaSelectors.mjs +77 -0
- package/dist/es/state/selectors/axisSelectors.mjs +879 -0
- package/dist/es/state/selectors/barSelectors.mjs +241 -0
- package/dist/es/state/selectors/brushSelectors.mjs +18 -0
- package/dist/es/state/selectors/combiners/combineActiveLabel.mjs +9 -0
- package/dist/es/state/selectors/combiners/combineActiveTooltipIndex.mjs +43 -0
- package/dist/es/state/selectors/combiners/combineAxisRangeWithReverse.mjs +8 -0
- package/dist/es/state/selectors/combiners/combineCoordinateForDefaultIndex.mjs +21 -0
- package/dist/es/state/selectors/combiners/combineTooltipInteractionState.mjs +37 -0
- package/dist/es/state/selectors/combiners/combineTooltipPayloadConfigurations.mjs +13 -0
- package/dist/es/state/selectors/common.mjs +4 -0
- package/dist/es/state/selectors/containerSelectors.mjs +7 -0
- package/dist/es/state/selectors/dataSelectors.mjs +35 -0
- package/dist/es/state/selectors/funnelSelectors.mjs +38 -0
- package/dist/es/state/selectors/legendSelectors.mjs +10 -0
- package/dist/es/state/selectors/lineSelectors.mjs +64 -0
- package/dist/es/state/selectors/pickAxisId.mjs +4 -0
- package/dist/es/state/selectors/pickAxisType.mjs +4 -0
- package/dist/es/state/selectors/pieSelectors.mjs +132 -0
- package/dist/es/state/selectors/polarAxisSelectors.mjs +167 -0
- package/dist/es/state/selectors/polarGridSelectors.mjs +19 -0
- package/dist/es/state/selectors/polarScaleSelectors.mjs +55 -0
- package/dist/es/state/selectors/polarSelectors.mjs +81 -0
- package/dist/es/state/selectors/radarSelectors.mjs +133 -0
- package/dist/es/state/selectors/radialBarSelectors.mjs +259 -0
- package/dist/es/state/selectors/rootPropsSelectors.mjs +14 -0
- package/dist/es/state/selectors/scatterSelectors.mjs +134 -0
- package/dist/es/state/selectors/selectActivePropsFromChartPointer.mjs +20 -0
- package/dist/es/state/selectors/selectAllAxes.mjs +10 -0
- package/dist/es/state/selectors/selectChartOffset.mjs +69 -0
- package/dist/es/state/selectors/selectChartOffsetInternal.mjs +66 -0
- package/dist/es/state/selectors/selectTooltipEventType.mjs +22 -0
- package/dist/es/state/selectors/selectTooltipPayloadSearcher.mjs +6 -0
- package/dist/es/state/selectors/selectTooltipSettings.mjs +4 -0
- package/dist/es/state/selectors/selectTooltipState.mjs +4 -0
- package/dist/es/state/selectors/selectors.mjs +104 -0
- package/dist/es/state/selectors/tooltipSelectors.mjs +269 -0
- package/dist/es/state/selectors/touchSelectors.mjs +19 -0
- package/dist/es/state/store.mjs +55 -0
- package/dist/es/state/tooltipSlice.mjs +102 -0
- package/dist/es/state/touchEventsMiddleware.mjs +44 -0
- package/dist/es/state/utils/useReportScale.mjs +19 -0
- package/dist/es/synchronisation/syncSelectors.mjs +6 -0
- package/dist/es/synchronisation/useChartSynchronisation.mjs +38 -0
- package/dist/es/types/event.mjs +166 -0
- package/dist/es/utils/ReduceCSSCalc.mjs +114 -0
- package/dist/es/utils/VueUtils.mjs +39 -0
- package/dist/es/utils/attrs.mjs +69 -0
- package/dist/es/utils/cartesian.mjs +54 -0
- package/dist/es/utils/chart.mjs +366 -0
- package/dist/es/utils/const.mjs +32 -0
- package/dist/es/utils/createContext.mjs +31 -0
- package/dist/es/utils/data-utils.mjs +13 -0
- package/dist/es/utils/data.mjs +41 -0
- package/dist/es/utils/events.mjs +7 -0
- package/dist/es/utils/getLinearRegression.mjs +34 -0
- package/dist/es/utils/grid.mjs +23 -0
- package/dist/es/utils/isDomainSpecifiedByUser.mjs +116 -0
- package/dist/es/utils/legend.mjs +19 -0
- package/dist/es/utils/log.mjs +14 -0
- package/dist/es/utils/payload/getUniqPayload.mjs +9 -0
- package/dist/es/utils/polar.mjs +59 -0
- package/dist/es/utils/props.mjs +20 -0
- package/dist/es/utils/resolveDefaultProps.mjs +26 -0
- package/dist/es/utils/scale/getNiceTickValues.mjs +137 -0
- package/dist/es/utils/scale/utils/arithmetic.mjs +54 -0
- package/dist/es/utils/scale/utils/utils.mjs +53 -0
- package/dist/es/utils/style.mjs +30 -0
- package/dist/es/utils/tick.mjs +42 -0
- package/dist/es/utils/tooltip/translate.mjs +73 -0
- package/dist/es/utils/validate.mjs +42 -0
- package/dist/events/useChartSynchronisation.d.ts +8 -0
- package/dist/hooks/useIsAnimating.d.ts +14 -0
- package/dist/hooks/useSetupGraphicalItem.d.ts +7 -0
- package/dist/index.d.ts +6 -0
- package/dist/polar/index.d.ts +3 -0
- package/dist/polar/pie/Pie.d.ts +2 -0
- package/dist/polar/pie/index.d.ts +2 -0
- package/dist/polar/pie/type.d.ts +88 -0
- package/dist/polar/radar/PolarAngleAxis.d.ts +145 -0
- package/dist/polar/radar/PolarGrid.d.ts +77 -0
- package/dist/polar/radar/PolarRadiusAxis.d.ts +125 -0
- package/dist/polar/radar/Radar.d.ts +160 -0
- package/dist/polar/radar/index.d.ts +4 -0
- package/dist/polar/radial-bar/RadialBar.d.ts +2 -0
- package/dist/polar/radial-bar/index.d.ts +2 -0
- package/dist/polar/radial-bar/type.d.ts +96 -0
- package/dist/shape/Cross.d.ts +10 -0
- package/dist/shape/Curve.d.ts +42 -0
- package/dist/shape/Dot.d.ts +18 -0
- package/dist/shape/Rectangle.d.ts +33 -0
- package/dist/shape/Sector.d.ts +48 -0
- package/dist/shape/Symbols.d.ts +15 -0
- package/dist/shape/Trapezoid.d.ts +31 -0
- package/dist/shape/index.d.ts +9 -0
- package/dist/shape/types.d.ts +20 -0
- package/dist/state/ReportBar.d.ts +1 -0
- package/dist/state/ReportChartProps.d.ts +88 -0
- package/dist/state/ReportMainChartProps.d.ts +37 -0
- package/dist/state/ReportPolarOptions.d.ts +59 -0
- package/dist/state/SetGraphicalItem.d.ts +9 -0
- package/dist/state/SetLegendPayload.d.ts +3 -0
- package/dist/state/SetTooltipEntrySettings.d.ts +8 -0
- package/dist/state/brushSlice.d.ts +18 -0
- package/dist/state/cartesianAxisSlice.d.ts +88 -0
- package/dist/state/chartDataSlice.d.ts +44 -0
- package/dist/state/externalEventsMiddleware.d.ts +17 -0
- package/dist/state/graphicalItemsSlice.d.ts +108 -0
- package/dist/state/hooks.d.ts +54 -0
- package/dist/state/keyboardEventsMiddleware.d.ts +3 -0
- package/dist/state/layoutSlice.d.ts +15 -0
- package/dist/state/legendSlice.d.ts +26 -0
- package/dist/state/mouseEventsMiddleware.d.ts +5 -0
- package/dist/state/optionsSlice.d.ts +27 -0
- package/dist/state/polarAxisSlice.d.ts +10 -0
- package/dist/state/polarOptionsSlice.d.ts +10 -0
- package/dist/state/reduxDevtoolsJsonStringifyReplacer.d.ts +1 -0
- package/dist/state/referenceElementsSlice.d.ts +40 -0
- package/dist/state/rootPropsSlice.d.ts +26 -0
- package/dist/state/selectors/areaSelectors.d.ts +24 -0
- package/dist/state/selectors/axisSelectors.d.ts +1828 -0
- package/dist/state/selectors/barSelectors.d.ts +944 -0
- package/dist/state/selectors/brushSelectors.d.ts +10 -0
- package/dist/state/selectors/combiners/combineActiveLabel.d.ts +3 -0
- package/dist/state/selectors/combiners/combineActiveTooltipIndex.d.ts +5 -0
- package/dist/state/selectors/combiners/combineAxisRangeWithReverse.d.ts +3 -0
- package/dist/state/selectors/combiners/combineCoordinateForDefaultIndex.d.ts +3 -0
- package/dist/state/selectors/combiners/combineTooltipInteractionState.d.ts +3 -0
- package/dist/state/selectors/combiners/combineTooltipPayloadConfigurations.d.ts +3 -0
- package/dist/state/selectors/common.d.ts +2 -0
- package/dist/state/selectors/containerSelectors.d.ts +6 -0
- package/dist/state/selectors/dataSelectors.d.ts +23 -0
- package/dist/state/selectors/funnelSelectors.d.ts +69 -0
- package/dist/state/selectors/legendSelectors.d.ts +7 -0
- package/dist/state/selectors/lineSelectors.d.ts +123 -0
- package/dist/state/selectors/pickAxisId.d.ts +3 -0
- package/dist/state/selectors/pickAxisType.d.ts +2 -0
- package/dist/state/selectors/pieSelectors.d.ts +55 -0
- package/dist/state/selectors/polarAxisSelectors.d.ts +49 -0
- package/dist/state/selectors/polarGridSelectors.d.ts +118 -0
- package/dist/state/selectors/polarScaleSelectors.d.ts +9 -0
- package/dist/state/selectors/polarSelectors.d.ts +70 -0
- package/dist/state/selectors/radarSelectors.d.ts +76 -0
- package/dist/state/selectors/radialBarSelectors.d.ts +61 -0
- package/dist/state/selectors/rootPropsSelectors.d.ts +11 -0
- package/dist/state/selectors/scatterSelectors.d.ts +21 -0
- package/dist/state/selectors/selectActivePropsFromChartPointer.d.ts +382 -0
- package/dist/state/selectors/selectAllAxes.d.ts +4 -0
- package/dist/state/selectors/selectChartOffset.d.ts +116 -0
- package/dist/state/selectors/selectChartOffsetInternal.d.ts +9 -0
- package/dist/state/selectors/selectTooltipEventType.d.ts +8 -0
- package/dist/state/selectors/selectTooltipPayloadSearcher.d.ts +3 -0
- package/dist/state/selectors/selectTooltipSettings.d.ts +3 -0
- package/dist/state/selectors/selectTooltipState.d.ts +3 -0
- package/dist/state/selectors/selectors.d.ts +184 -0
- package/dist/state/selectors/tooltipSelectors.d.ts +581 -0
- package/dist/state/selectors/touchSelectors.d.ts +4 -0
- package/dist/state/store.d.ts +74 -0
- package/dist/state/tooltipSlice.d.ts +204 -0
- package/dist/state/touchEventsMiddleware.d.ts +2 -0
- package/dist/state/utils/useReportScale.d.ts +1 -0
- package/dist/synchronisation/syncSelectors.d.ts +3 -0
- package/dist/synchronisation/useChartSynchronisation.d.ts +11 -0
- package/dist/types/area.d.ts +8 -0
- package/dist/types/axis.d.ts +127 -0
- package/dist/types/bar.d.ts +51 -0
- package/dist/types/categorical.d.ts +36 -0
- package/dist/types/common.d.ts +129 -0
- package/dist/types/event.d.ts +16 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/legend.d.ts +1 -0
- package/dist/types/offset.d.ts +8 -0
- package/dist/types/radar.d.ts +28 -0
- package/dist/types/scale.d.ts +11 -0
- package/dist/types/tick.d.ts +55 -0
- package/dist/types/tooltip.d.ts +33 -0
- package/dist/utils/ReduceCSSCalc.d.ts +2 -0
- package/dist/utils/VueUtils.d.ts +11 -0
- package/dist/utils/attrs.d.ts +46 -0
- package/dist/utils/cartesian.d.ts +20 -0
- package/dist/utils/chart.d.ts +99 -0
- package/dist/utils/const.d.ts +30 -0
- package/dist/utils/context.d.ts +8 -0
- package/dist/utils/createContext.d.ts +8 -0
- package/dist/utils/data-utils.d.ts +4 -0
- package/dist/utils/data.d.ts +13 -0
- package/dist/utils/events.d.ts +12 -0
- package/dist/utils/getLinearRegression.d.ts +15 -0
- package/dist/utils/getRelativeCoordinate.d.ts +11 -0
- package/dist/utils/grid.d.ts +37 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/isDomainSpecifiedByUser.d.ts +47 -0
- package/dist/utils/legend.d.ts +3 -0
- package/dist/utils/log.d.ts +1 -0
- package/dist/utils/payload/getUniqPayload.d.ts +4 -0
- package/dist/utils/polar.d.ts +21 -0
- package/dist/utils/props.d.ts +15 -0
- package/dist/utils/resolveDefaultProps.d.ts +52 -0
- package/dist/utils/scale/getNiceTickValues.d.ts +61 -0
- package/dist/utils/scale/utils/arithmetic.d.ts +50 -0
- package/dist/utils/scale/utils/utils.d.ts +9 -0
- package/dist/utils/style.d.ts +12 -0
- package/dist/utils/tick.d.ts +19 -0
- package/dist/utils/tooltip/translate.d.ts +47 -0
- package/dist/utils/types.d.ts +14 -0
- package/dist/utils/validate.d.ts +25 -0
- package/package.json +27 -10
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { useIsPanorama } from "../../context/PanoramaContextProvider.mjs";
|
|
2
|
+
import { selectAxisViewBox } from "../../state/selectors/selectChartOffset.mjs";
|
|
3
|
+
import { implicitYAxis, selectAxisScale, selectTicksOfAxis, selectYAxisPosition, selectYAxisSize } from "../../state/selectors/axisSelectors.mjs";
|
|
4
|
+
import { useAppDispatch, useAppSelector } from "../../state/hooks.mjs";
|
|
5
|
+
import { addYAxis, removeYAxis } from "../../state/cartesianAxisSlice.mjs";
|
|
6
|
+
import { CartesianAxis } from "../cartesian-axis/CartesianAxis.mjs";
|
|
7
|
+
import { createVNode, defineComponent, mergeProps, watchEffect } from "vue";
|
|
8
|
+
//#region src/cartesian/axis/YAxis.tsx
|
|
9
|
+
var YAxisImpl = /* @__PURE__ */ defineComponent({
|
|
10
|
+
props: { yAxisId: {
|
|
11
|
+
type: [String, Number],
|
|
12
|
+
default: 0
|
|
13
|
+
} },
|
|
14
|
+
inheritAttrs: false,
|
|
15
|
+
setup(props, { attrs }) {
|
|
16
|
+
const isPanorama = useIsPanorama();
|
|
17
|
+
const axisType = "yAxis";
|
|
18
|
+
const scale = useAppSelector((state) => selectAxisScale(state, axisType, props.yAxisId, isPanorama));
|
|
19
|
+
const axisSize = useAppSelector((state) => selectYAxisSize(state, props.yAxisId));
|
|
20
|
+
const position = useAppSelector((state) => selectYAxisPosition(state, props.yAxisId));
|
|
21
|
+
const cartesianTickItems = useAppSelector((state) => selectTicksOfAxis(state, axisType, props.yAxisId, isPanorama));
|
|
22
|
+
const viewBox = useAppSelector(selectAxisViewBox);
|
|
23
|
+
return () => {
|
|
24
|
+
const { ...allOtherProps } = props;
|
|
25
|
+
if (axisSize.value == null || position.value == null) return null;
|
|
26
|
+
return createVNode(CartesianAxis, mergeProps(allOtherProps, attrs, {
|
|
27
|
+
"viewBox": viewBox.value,
|
|
28
|
+
"scale": scale.value,
|
|
29
|
+
"x": position.value?.x,
|
|
30
|
+
"y": position.value?.y,
|
|
31
|
+
"width": axisSize.value?.width,
|
|
32
|
+
"height": axisSize.value?.height,
|
|
33
|
+
"ticks": cartesianTickItems.value,
|
|
34
|
+
"class": ["v-charts-yAxis yAxis", attrs.class]
|
|
35
|
+
}), null);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
var YAxisSettingsDispatcher = /* @__PURE__ */ defineComponent({
|
|
40
|
+
props: {
|
|
41
|
+
interval: [String, Number],
|
|
42
|
+
yAxisId: {
|
|
43
|
+
type: [String, Number],
|
|
44
|
+
default: 0
|
|
45
|
+
},
|
|
46
|
+
scale: [String, Function],
|
|
47
|
+
type: String,
|
|
48
|
+
padding: Object,
|
|
49
|
+
allowDataOverflow: Boolean,
|
|
50
|
+
allowDuplicatedCategory: Boolean,
|
|
51
|
+
allowDecimals: Boolean,
|
|
52
|
+
tickCount: Number,
|
|
53
|
+
includeHidden: Boolean,
|
|
54
|
+
reversed: Boolean,
|
|
55
|
+
ticks: Array,
|
|
56
|
+
width: Number,
|
|
57
|
+
orientation: String,
|
|
58
|
+
mirror: Boolean,
|
|
59
|
+
hide: Boolean,
|
|
60
|
+
unit: String,
|
|
61
|
+
name: String,
|
|
62
|
+
angle: Number,
|
|
63
|
+
minTickGap: Number,
|
|
64
|
+
tick: {
|
|
65
|
+
type: [Boolean, Object],
|
|
66
|
+
default: true
|
|
67
|
+
},
|
|
68
|
+
tickFormatter: Function,
|
|
69
|
+
domain: Array,
|
|
70
|
+
dataKey: {
|
|
71
|
+
type: [
|
|
72
|
+
String,
|
|
73
|
+
Number,
|
|
74
|
+
Function
|
|
75
|
+
],
|
|
76
|
+
default: void 0
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
setup(props) {
|
|
80
|
+
const dispatch = useAppDispatch();
|
|
81
|
+
watchEffect((onCleanup) => {
|
|
82
|
+
const settings = {
|
|
83
|
+
...props,
|
|
84
|
+
interval: props.interval ?? "preserveEnd",
|
|
85
|
+
id: props.yAxisId,
|
|
86
|
+
dataKey: props.dataKey,
|
|
87
|
+
includeHidden: props.includeHidden ?? false,
|
|
88
|
+
angle: props.angle ?? 0,
|
|
89
|
+
minTickGap: props.minTickGap ?? 5,
|
|
90
|
+
tick: props.tick ?? true
|
|
91
|
+
};
|
|
92
|
+
dispatch(addYAxis(settings));
|
|
93
|
+
onCleanup(() => {
|
|
94
|
+
dispatch(removeYAxis(settings));
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
return () => createVNode(YAxisImpl, props, null);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
var YAxis = /* @__PURE__ */ defineComponent({
|
|
101
|
+
name: "YAxis",
|
|
102
|
+
props: {
|
|
103
|
+
allowDataOverflow: {
|
|
104
|
+
type: Boolean,
|
|
105
|
+
default: implicitYAxis.allowDataOverflow
|
|
106
|
+
},
|
|
107
|
+
allowDecimals: {
|
|
108
|
+
type: Boolean,
|
|
109
|
+
default: implicitYAxis.allowDecimals
|
|
110
|
+
},
|
|
111
|
+
allowDuplicatedCategory: {
|
|
112
|
+
type: Boolean,
|
|
113
|
+
default: implicitYAxis.allowDuplicatedCategory
|
|
114
|
+
},
|
|
115
|
+
width: {
|
|
116
|
+
type: Number,
|
|
117
|
+
default: implicitYAxis.width
|
|
118
|
+
},
|
|
119
|
+
hide: {
|
|
120
|
+
type: Boolean,
|
|
121
|
+
default: false
|
|
122
|
+
},
|
|
123
|
+
mirror: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
default: implicitYAxis.mirror
|
|
126
|
+
},
|
|
127
|
+
orientation: {
|
|
128
|
+
type: String,
|
|
129
|
+
default: implicitYAxis.orientation
|
|
130
|
+
},
|
|
131
|
+
padding: {
|
|
132
|
+
type: Object,
|
|
133
|
+
default: implicitYAxis.padding
|
|
134
|
+
},
|
|
135
|
+
reversed: {
|
|
136
|
+
type: Boolean,
|
|
137
|
+
default: implicitYAxis.reversed
|
|
138
|
+
},
|
|
139
|
+
scale: {
|
|
140
|
+
type: [String, Function],
|
|
141
|
+
default: implicitYAxis.scale
|
|
142
|
+
},
|
|
143
|
+
tickCount: {
|
|
144
|
+
type: Number,
|
|
145
|
+
default: implicitYAxis.tickCount
|
|
146
|
+
},
|
|
147
|
+
type: {
|
|
148
|
+
type: String,
|
|
149
|
+
default: implicitYAxis.type
|
|
150
|
+
},
|
|
151
|
+
yAxisId: { type: [String, Number] },
|
|
152
|
+
dataKey: {
|
|
153
|
+
type: [
|
|
154
|
+
String,
|
|
155
|
+
Number,
|
|
156
|
+
Function
|
|
157
|
+
],
|
|
158
|
+
default: void 0
|
|
159
|
+
},
|
|
160
|
+
tickFormatter: {
|
|
161
|
+
type: Function,
|
|
162
|
+
default: void 0
|
|
163
|
+
},
|
|
164
|
+
unit: {
|
|
165
|
+
type: String,
|
|
166
|
+
default: void 0
|
|
167
|
+
},
|
|
168
|
+
interval: { type: [String, Number] },
|
|
169
|
+
domain: {
|
|
170
|
+
type: Array,
|
|
171
|
+
default: void 0
|
|
172
|
+
},
|
|
173
|
+
axisLine: {
|
|
174
|
+
type: [Boolean, Object],
|
|
175
|
+
default: true
|
|
176
|
+
},
|
|
177
|
+
tickLine: {
|
|
178
|
+
type: [Boolean, Object],
|
|
179
|
+
default: true
|
|
180
|
+
},
|
|
181
|
+
tickMargin: Number,
|
|
182
|
+
minTickGap: {
|
|
183
|
+
type: Number,
|
|
184
|
+
default: 5
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
setup(props, { attrs }) {
|
|
188
|
+
return () => createVNode(YAxisSettingsDispatcher, mergeProps(props, attrs), null);
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
//#endregion
|
|
192
|
+
export { YAxis };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { getValueByDataKey } from "../../utils/chart.mjs";
|
|
2
|
+
import { useChartLayout } from "../../context/chartLayoutContext.mjs";
|
|
3
|
+
import { Layer } from "../../container/Layer.mjs";
|
|
4
|
+
import { provideCartesianLabelListData } from "../../context/cartesianLabelListContext.mjs";
|
|
5
|
+
import { LabelList } from "../../components/label/LabelList.mjs";
|
|
6
|
+
import { useSetupGraphicalItem } from "../../hooks/useSetupGraphicalItem.mjs";
|
|
7
|
+
import { useGraphicalLayerRef } from "../../context/graphicalLayerContext.mjs";
|
|
8
|
+
import { BarVueProps } from "./type.mjs";
|
|
9
|
+
import { useNeedsClip } from "../useNeedsClip.mjs";
|
|
10
|
+
import { useBar } from "./hooks/useBar.mjs";
|
|
11
|
+
import { GraphicalItemClipPath } from "../GraphicalItemClipPath.mjs";
|
|
12
|
+
import { BarBackground } from "./components/BarBackground.mjs";
|
|
13
|
+
import { BarRectangles } from "./components/BarRectangles.mjs";
|
|
14
|
+
import { createErrorBarRegistry, provideErrorBarContext, provideErrorBarRegistry } from "../error-bar/ErrorBarContext.mjs";
|
|
15
|
+
import { Cell } from "../../components/Cell.mjs";
|
|
16
|
+
import { Fragment, Teleport, computed, createVNode, defineComponent, isVNode, mergeProps } from "vue";
|
|
17
|
+
//#region src/cartesian/bar/Bar.tsx
|
|
18
|
+
function _isSlot(s) {
|
|
19
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
20
|
+
}
|
|
21
|
+
var errorBarDataPointFormatter = (dataPoint, dataKey) => {
|
|
22
|
+
const value = Array.isArray(dataPoint.value) ? dataPoint.value[1] : dataPoint.value;
|
|
23
|
+
return {
|
|
24
|
+
x: dataPoint.x,
|
|
25
|
+
y: dataPoint.y,
|
|
26
|
+
value,
|
|
27
|
+
errorVal: getValueByDataKey(dataPoint.payload ?? dataPoint, dataKey)
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
var Bar = /* @__PURE__ */ defineComponent({
|
|
31
|
+
name: "Bar",
|
|
32
|
+
props: BarVueProps,
|
|
33
|
+
inheritAttrs: false,
|
|
34
|
+
slots: Object,
|
|
35
|
+
setup(props, { attrs, slots }) {
|
|
36
|
+
const errorBarRegistry = createErrorBarRegistry();
|
|
37
|
+
provideErrorBarRegistry(errorBarRegistry);
|
|
38
|
+
useSetupGraphicalItem(props, "bar", { errorBars: errorBarRegistry.errorBars });
|
|
39
|
+
const { shouldRender, clipPathId, barData, isAnimating, cellProps: cellPropsRef } = useBar(props, slots.shape, slots.activeBar);
|
|
40
|
+
const { needClip } = useNeedsClip(props.xAxisId, props.yAxisId);
|
|
41
|
+
const layout = useChartLayout();
|
|
42
|
+
const errorBarOffset = computed(() => {
|
|
43
|
+
const first = barData.value?.[0];
|
|
44
|
+
if (first == null || first.height == null || first.width == null) return 0;
|
|
45
|
+
return layout.value === "vertical" ? first.height / 2 : first.width / 2;
|
|
46
|
+
});
|
|
47
|
+
provideErrorBarContext({
|
|
48
|
+
data: barData,
|
|
49
|
+
xAxisId: props.xAxisId ?? "xAxis-0",
|
|
50
|
+
yAxisId: props.yAxisId ?? "yAxis-0",
|
|
51
|
+
dataPointFormatter: errorBarDataPointFormatter,
|
|
52
|
+
errorBarOffset
|
|
53
|
+
});
|
|
54
|
+
provideCartesianLabelListData(computed(() => {
|
|
55
|
+
if (isAnimating.value || !barData.value) return void 0;
|
|
56
|
+
return barData.value.map((entry, i) => {
|
|
57
|
+
const fill = cellPropsRef.value?.[i]?.fill ?? entry.payload?.fill ?? props.fill;
|
|
58
|
+
return {
|
|
59
|
+
x: entry.x,
|
|
60
|
+
y: entry.y,
|
|
61
|
+
width: entry.width,
|
|
62
|
+
height: entry.height,
|
|
63
|
+
value: entry.value,
|
|
64
|
+
payload: entry.payload,
|
|
65
|
+
parentViewBox: entry.parentViewBox,
|
|
66
|
+
...fill != null ? { fill } : {}
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
}));
|
|
70
|
+
const graphicalLayerRef = useGraphicalLayerRef(null);
|
|
71
|
+
const extractCellProps = (vnodes) => {
|
|
72
|
+
const result = [];
|
|
73
|
+
for (const vnode of vnodes) if (vnode.type === Cell) result.push(vnode.props ?? {});
|
|
74
|
+
else if (vnode.type === Fragment && Array.isArray(vnode.children)) result.push(...extractCellProps(vnode.children));
|
|
75
|
+
return result;
|
|
76
|
+
};
|
|
77
|
+
const filterOutCells = (vnodes) => {
|
|
78
|
+
const result = [];
|
|
79
|
+
for (const vnode of vnodes) {
|
|
80
|
+
if (vnode.type === Cell) continue;
|
|
81
|
+
if (vnode.type === Fragment && Array.isArray(vnode.children)) result.push(...filterOutCells(vnode.children));
|
|
82
|
+
else result.push(vnode);
|
|
83
|
+
}
|
|
84
|
+
return result;
|
|
85
|
+
};
|
|
86
|
+
return () => {
|
|
87
|
+
if (!shouldRender.value) return null;
|
|
88
|
+
const defaultContent = slots.default?.() ?? [];
|
|
89
|
+
const cells = extractCellProps(defaultContent);
|
|
90
|
+
cellPropsRef.value = cells;
|
|
91
|
+
const nonCellContent = cells.length > 0 ? filterOutCells(defaultContent) : defaultContent;
|
|
92
|
+
const barContent = createVNode(Layer, { "class": ["v-charts-bar", attrs.class] }, { default: () => [
|
|
93
|
+
needClip.value && createVNode("defs", null, [createVNode(GraphicalItemClipPath, {
|
|
94
|
+
"clipPathId": clipPathId,
|
|
95
|
+
"xAxisId": props.xAxisId,
|
|
96
|
+
"yAxisId": props.yAxisId
|
|
97
|
+
}, null)]),
|
|
98
|
+
createVNode(Layer, {
|
|
99
|
+
"class": "v-charts-bar-rectangles",
|
|
100
|
+
"clip-path": needClip.value ? `url(#clipPath-${clipPathId})` : null
|
|
101
|
+
}, { default: () => [props.background && createVNode(BarBackground, null, null), createVNode(BarRectangles, null, null)] }),
|
|
102
|
+
!isAnimating.value && props.label && createVNode(LabelList, mergeProps(typeof props.label === "object" ? props.label : {}, { "data": barData.value }), null),
|
|
103
|
+
nonCellContent
|
|
104
|
+
] });
|
|
105
|
+
if (graphicalLayerRef?.value) return createVNode(Teleport, { "to": graphicalLayerRef.value }, _isSlot(barContent) ? barContent : { default: () => [barContent] });
|
|
106
|
+
return barContent;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
//#endregion
|
|
111
|
+
export { Bar };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Layer } from "../../../container/Layer.mjs";
|
|
2
|
+
import { useBarContext } from "../hooks/useBar.mjs";
|
|
3
|
+
import { Rectangle } from "../../../shape/Rectangle.mjs";
|
|
4
|
+
import { Fragment, createVNode, defineComponent } from "vue";
|
|
5
|
+
//#region src/cartesian/bar/components/BarBackground.tsx
|
|
6
|
+
var BarBackground = /* @__PURE__ */ defineComponent({
|
|
7
|
+
name: "BarBackground",
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
setup(_, { attrs }) {
|
|
10
|
+
const { props, data: barData } = useBarContext();
|
|
11
|
+
return () => {
|
|
12
|
+
const data = barData.value;
|
|
13
|
+
const backgroundFromProps = props.background;
|
|
14
|
+
if (!backgroundFromProps || !data) return null;
|
|
15
|
+
return createVNode(Fragment, null, [data.map((entry, i) => {
|
|
16
|
+
const { value, background: backgroundFromDataEntry, tooltipPosition, ...rest } = entry;
|
|
17
|
+
if (!backgroundFromDataEntry) return null;
|
|
18
|
+
const backgroundObjectProps = typeof backgroundFromProps === "object" ? backgroundFromProps : {};
|
|
19
|
+
const barRectangleProps = {
|
|
20
|
+
option: backgroundFromProps,
|
|
21
|
+
...rest,
|
|
22
|
+
fill: "#eee",
|
|
23
|
+
...backgroundFromDataEntry,
|
|
24
|
+
...backgroundObjectProps
|
|
25
|
+
};
|
|
26
|
+
return createVNode(Layer, { "key": `background-bar-${i}` }, { default: () => [createVNode(Rectangle, barRectangleProps, null)] });
|
|
27
|
+
})]);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
//#endregion
|
|
32
|
+
export { BarBackground };
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { mouseLeaveItem, setActiveClickItemIndex, setActiveMouseOverItemIndex } from "../../../state/tooltipSlice.mjs";
|
|
2
|
+
import { selectActiveTooltipDataKey, selectActiveTooltipIndex } from "../../../state/selectors/tooltipSelectors.mjs";
|
|
3
|
+
import { useAppDispatch, useAppSelector } from "../../../state/hooks.mjs";
|
|
4
|
+
import { filterProps } from "../../../utils/VueUtils.mjs";
|
|
5
|
+
import { Layer } from "../../../container/Layer.mjs";
|
|
6
|
+
import { Animate } from "../../../animation/Animate.mjs";
|
|
7
|
+
import { useBarContext } from "../hooks/useBar.mjs";
|
|
8
|
+
import { Rectangle } from "../../../shape/Rectangle.mjs";
|
|
9
|
+
import { Fragment, createVNode, defineComponent, isVNode } from "vue";
|
|
10
|
+
//#region src/cartesian/bar/components/BarRectangles.tsx
|
|
11
|
+
function _isSlot(s) {
|
|
12
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
13
|
+
}
|
|
14
|
+
var BarRectangles = /* @__PURE__ */ defineComponent({
|
|
15
|
+
name: "BarRectangles",
|
|
16
|
+
inheritAttrs: false,
|
|
17
|
+
setup(_) {
|
|
18
|
+
const dispatch = useAppDispatch();
|
|
19
|
+
const activeIndex = useAppSelector(selectActiveTooltipIndex);
|
|
20
|
+
const activeDataKey = useAppSelector(selectActiveTooltipDataKey);
|
|
21
|
+
let previousRectangles = null;
|
|
22
|
+
let animationId = 0;
|
|
23
|
+
const { props, data: barData, layout, isAnimating, shapeSlot, activeBarSlot, cellProps } = useBarContext();
|
|
24
|
+
const { dataKey, isAnimationActive, onAnimationStart, onAnimationEnd, activeBar, activeIndex: activeIndexProp } = props;
|
|
25
|
+
const onMouseEnterFromContext = (entry, index) => (e) => {
|
|
26
|
+
dispatch(setActiveMouseOverItemIndex({
|
|
27
|
+
activeDataKey: dataKey,
|
|
28
|
+
activeIndex: String(index),
|
|
29
|
+
activeCoordinate: {
|
|
30
|
+
x: entry.tooltipPosition.x,
|
|
31
|
+
y: entry.tooltipPosition.y
|
|
32
|
+
}
|
|
33
|
+
}));
|
|
34
|
+
};
|
|
35
|
+
const onMouseLeaveFromContext = (entry, index) => (e) => {
|
|
36
|
+
dispatch(mouseLeaveItem());
|
|
37
|
+
};
|
|
38
|
+
const onClickFromContext = (entry, index) => (e) => {
|
|
39
|
+
dispatch(setActiveClickItemIndex({
|
|
40
|
+
activeDataKey: dataKey,
|
|
41
|
+
activeIndex: String(index),
|
|
42
|
+
activeCoordinate: {
|
|
43
|
+
x: entry.tooltipPosition.x,
|
|
44
|
+
y: entry.tooltipPosition.y
|
|
45
|
+
}
|
|
46
|
+
}));
|
|
47
|
+
};
|
|
48
|
+
const baseProps = filterProps(props, false);
|
|
49
|
+
const interpolateNumber = (from, to) => (t) => from + (to - from) * t;
|
|
50
|
+
const renderRectangles = (data) => {
|
|
51
|
+
if (!data) return null;
|
|
52
|
+
return createVNode(Fragment, null, [data.map((entry, i) => {
|
|
53
|
+
let _slot;
|
|
54
|
+
const activeEnabled = activeBar !== false || activeIndexProp != null || !!activeBarSlot;
|
|
55
|
+
const isActive = activeIndexProp != null ? activeEnabled && i === activeIndexProp : activeEnabled && String(i) === activeIndex.value && (activeDataKey.value == null || dataKey === activeDataKey.value);
|
|
56
|
+
const activeBarProps = isActive && typeof activeBar === "object" ? activeBar : {};
|
|
57
|
+
const entryFill = entry.payload?.fill;
|
|
58
|
+
const cellPropsForIndex = cellProps.value?.[i];
|
|
59
|
+
const barRectangleProps = {
|
|
60
|
+
...baseProps,
|
|
61
|
+
...entryFill ? { fill: entryFill } : {},
|
|
62
|
+
...entry,
|
|
63
|
+
...cellPropsForIndex ?? {},
|
|
64
|
+
...isActive ? activeBarProps : {},
|
|
65
|
+
isActive,
|
|
66
|
+
index: i,
|
|
67
|
+
dataKey
|
|
68
|
+
};
|
|
69
|
+
const renderShape = () => {
|
|
70
|
+
if (isActive && activeBarSlot) return activeBarSlot(barRectangleProps);
|
|
71
|
+
if (shapeSlot) return shapeSlot(barRectangleProps);
|
|
72
|
+
return createVNode(Rectangle, barRectangleProps, null);
|
|
73
|
+
};
|
|
74
|
+
return createVNode(Layer, {
|
|
75
|
+
"key": `rectangle-${entry?.x}-${entry?.y}-${entry?.value}-${i}`,
|
|
76
|
+
"class": "v-charts-bar-rectangle",
|
|
77
|
+
"onMouseenter": onMouseEnterFromContext(entry, i),
|
|
78
|
+
"onMouseleave": onMouseLeaveFromContext(entry, i),
|
|
79
|
+
"onClick": onClickFromContext(entry, i)
|
|
80
|
+
}, _isSlot(_slot = renderShape()) ? _slot : { default: () => [_slot] });
|
|
81
|
+
})]);
|
|
82
|
+
};
|
|
83
|
+
return () => {
|
|
84
|
+
const data = barData.value;
|
|
85
|
+
if (!data) return null;
|
|
86
|
+
if (isAnimationActive && previousRectangles !== data) {
|
|
87
|
+
const prevData = previousRectangles;
|
|
88
|
+
animationId++;
|
|
89
|
+
isAnimating.value = true;
|
|
90
|
+
return createVNode(Animate, {
|
|
91
|
+
"key": animationId,
|
|
92
|
+
"transition": props.transition,
|
|
93
|
+
"isActive": isAnimationActive,
|
|
94
|
+
"onAnimationStart": onAnimationStart,
|
|
95
|
+
"onAnimationEnd": () => {
|
|
96
|
+
isAnimating.value = false;
|
|
97
|
+
onAnimationEnd?.();
|
|
98
|
+
}
|
|
99
|
+
}, { default: (t) => {
|
|
100
|
+
const stepData = t === 1 ? data : data.map((entry, index) => {
|
|
101
|
+
const prev = prevData?.[index];
|
|
102
|
+
if (prev && prev.stackedBarStart === entry.stackedBarStart) {
|
|
103
|
+
const interpolatorX = interpolateNumber(prev.x || 0, entry.x || 0);
|
|
104
|
+
const interpolatorY = interpolateNumber(prev.y || 0, entry.y || 0);
|
|
105
|
+
const interpolatorWidth = interpolateNumber(prev.width, entry.width);
|
|
106
|
+
const interpolatorHeight = interpolateNumber(prev.height, entry.height);
|
|
107
|
+
return {
|
|
108
|
+
...entry,
|
|
109
|
+
x: interpolatorX(t),
|
|
110
|
+
y: interpolatorY(t),
|
|
111
|
+
width: interpolatorWidth(t),
|
|
112
|
+
height: interpolatorHeight(t)
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
if (layout.value === "horizontal") {
|
|
116
|
+
const h = interpolateNumber(0, entry.height)(t);
|
|
117
|
+
const y = interpolateNumber(entry.stackedBarStart, entry.y)(t);
|
|
118
|
+
return {
|
|
119
|
+
...entry,
|
|
120
|
+
y,
|
|
121
|
+
height: h
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
const w = interpolateNumber(0, entry.width)(t);
|
|
125
|
+
const x = interpolateNumber(entry.stackedBarStart, entry.x)(t);
|
|
126
|
+
return {
|
|
127
|
+
...entry,
|
|
128
|
+
width: w,
|
|
129
|
+
x
|
|
130
|
+
};
|
|
131
|
+
});
|
|
132
|
+
if (t > 0) previousRectangles = stepData;
|
|
133
|
+
return createVNode("g", null, [renderRectangles(stepData)]);
|
|
134
|
+
} });
|
|
135
|
+
}
|
|
136
|
+
isAnimating.value = false;
|
|
137
|
+
previousRectangles = data;
|
|
138
|
+
return createVNode("g", null, [renderRectangles(data)]);
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
//#endregion
|
|
143
|
+
export { BarRectangles };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { uniqueId } from "../../../utils/data-utils.mjs";
|
|
2
|
+
import { useIsPanorama } from "../../../context/PanoramaContextProvider.mjs";
|
|
3
|
+
import { getNormalizedStackId } from "../../../utils/chart.mjs";
|
|
4
|
+
import { useAppSelector } from "../../../state/hooks.mjs";
|
|
5
|
+
import { useChartLayout } from "../../../context/chartLayoutContext.mjs";
|
|
6
|
+
import { useNeedsClip } from "../../useNeedsClip.mjs";
|
|
7
|
+
import { selectBarRectangles } from "../../../state/selectors/barSelectors.mjs";
|
|
8
|
+
import { computed, ref, shallowRef, useAttrs } from "vue";
|
|
9
|
+
import { createContext } from "motion-v";
|
|
10
|
+
//#region src/cartesian/bar/hooks/useBar.ts
|
|
11
|
+
var [useBarContext, provideBarContext] = createContext("BarContext");
|
|
12
|
+
function useBar(props, shapeSlot, activeBarSlot) {
|
|
13
|
+
const isPanorama = useIsPanorama();
|
|
14
|
+
const attrs = useAttrs();
|
|
15
|
+
const layout = useChartLayout();
|
|
16
|
+
const { needClip } = useNeedsClip(props.xAxisId, props.yAxisId);
|
|
17
|
+
const barSettings = computed(() => ({
|
|
18
|
+
barSize: props.barSize,
|
|
19
|
+
data: props.data,
|
|
20
|
+
dataKey: props.dataKey,
|
|
21
|
+
maxBarSize: props.maxBarSize,
|
|
22
|
+
minPointSize: props.minPointSize,
|
|
23
|
+
stackId: getNormalizedStackId(props.stackId)
|
|
24
|
+
}));
|
|
25
|
+
const rects = useAppSelector((state) => selectBarRectangles(state, props.xAxisId, props.yAxisId, isPanorama, barSettings.value));
|
|
26
|
+
const shouldRender = computed(() => {
|
|
27
|
+
return (layout.value === "vertical" || layout.value === "horizontal") && !props.hide;
|
|
28
|
+
});
|
|
29
|
+
const clipPathId = uniqueId("v-charts-bar-");
|
|
30
|
+
const isAnimating = ref(false);
|
|
31
|
+
const cellPropsRef = shallowRef([]);
|
|
32
|
+
provideBarContext({
|
|
33
|
+
clipPathId,
|
|
34
|
+
layout,
|
|
35
|
+
props,
|
|
36
|
+
attrs,
|
|
37
|
+
data: rects,
|
|
38
|
+
isAnimating,
|
|
39
|
+
shapeSlot,
|
|
40
|
+
activeBarSlot,
|
|
41
|
+
cellProps: cellPropsRef
|
|
42
|
+
});
|
|
43
|
+
return {
|
|
44
|
+
shouldRender,
|
|
45
|
+
needClip,
|
|
46
|
+
clipPathId,
|
|
47
|
+
barData: rects,
|
|
48
|
+
isAnimating,
|
|
49
|
+
cellProps: cellPropsRef
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
export { useBar, useBarContext };
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
//#region src/cartesian/bar/type.ts
|
|
2
|
+
var BarVueProps = {
|
|
3
|
+
class: {
|
|
4
|
+
type: String,
|
|
5
|
+
default: void 0
|
|
6
|
+
},
|
|
7
|
+
barSize: { type: [String, Number] },
|
|
8
|
+
data: {
|
|
9
|
+
type: Array,
|
|
10
|
+
default: void 0
|
|
11
|
+
},
|
|
12
|
+
dataKey: {
|
|
13
|
+
type: [
|
|
14
|
+
String,
|
|
15
|
+
Number,
|
|
16
|
+
Function
|
|
17
|
+
],
|
|
18
|
+
required: true
|
|
19
|
+
},
|
|
20
|
+
fill: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: void 0
|
|
23
|
+
},
|
|
24
|
+
stroke: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: void 0
|
|
27
|
+
},
|
|
28
|
+
strokeWidth: {
|
|
29
|
+
type: Number,
|
|
30
|
+
default: 0
|
|
31
|
+
},
|
|
32
|
+
unit: {
|
|
33
|
+
type: [String, Number],
|
|
34
|
+
default: void 0
|
|
35
|
+
},
|
|
36
|
+
name: { type: [String, Number] },
|
|
37
|
+
tooltipType: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: void 0
|
|
40
|
+
},
|
|
41
|
+
legendType: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: "rect"
|
|
44
|
+
},
|
|
45
|
+
minPointSize: {
|
|
46
|
+
type: [Number, Function],
|
|
47
|
+
default: 0
|
|
48
|
+
},
|
|
49
|
+
maxBarSize: { type: Number },
|
|
50
|
+
hide: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false
|
|
53
|
+
},
|
|
54
|
+
background: {
|
|
55
|
+
type: [Boolean, Object],
|
|
56
|
+
default: false
|
|
57
|
+
},
|
|
58
|
+
radius: {
|
|
59
|
+
type: [Number, Array],
|
|
60
|
+
default: void 0
|
|
61
|
+
},
|
|
62
|
+
onAnimationStart: {
|
|
63
|
+
type: Function,
|
|
64
|
+
default: void 0
|
|
65
|
+
},
|
|
66
|
+
onAnimationEnd: {
|
|
67
|
+
type: Function,
|
|
68
|
+
default: void 0
|
|
69
|
+
},
|
|
70
|
+
isAnimationActive: {
|
|
71
|
+
type: Boolean,
|
|
72
|
+
default: true
|
|
73
|
+
},
|
|
74
|
+
activeBar: {
|
|
75
|
+
type: [
|
|
76
|
+
Object,
|
|
77
|
+
Boolean,
|
|
78
|
+
Function
|
|
79
|
+
],
|
|
80
|
+
default: false
|
|
81
|
+
},
|
|
82
|
+
activeIndex: {
|
|
83
|
+
type: Number,
|
|
84
|
+
default: void 0
|
|
85
|
+
},
|
|
86
|
+
id: {
|
|
87
|
+
type: String,
|
|
88
|
+
default: void 0
|
|
89
|
+
},
|
|
90
|
+
stackId: {
|
|
91
|
+
type: [String, Number],
|
|
92
|
+
default: void 0
|
|
93
|
+
},
|
|
94
|
+
xAxisId: {
|
|
95
|
+
type: [String, Number],
|
|
96
|
+
default: 0
|
|
97
|
+
},
|
|
98
|
+
yAxisId: {
|
|
99
|
+
type: [String, Number],
|
|
100
|
+
default: 0
|
|
101
|
+
},
|
|
102
|
+
animationBegin: {
|
|
103
|
+
type: Number,
|
|
104
|
+
default: 0
|
|
105
|
+
},
|
|
106
|
+
animationDuration: {
|
|
107
|
+
type: Number,
|
|
108
|
+
default: 1500
|
|
109
|
+
},
|
|
110
|
+
animationEasing: {
|
|
111
|
+
type: String,
|
|
112
|
+
default: "ease"
|
|
113
|
+
},
|
|
114
|
+
transition: {
|
|
115
|
+
type: Object,
|
|
116
|
+
default: {
|
|
117
|
+
duration: .4,
|
|
118
|
+
ease: "easeOut"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
needClip: {
|
|
122
|
+
type: Boolean,
|
|
123
|
+
default: false
|
|
124
|
+
},
|
|
125
|
+
label: {
|
|
126
|
+
type: [Boolean, Object],
|
|
127
|
+
default: false
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
//#endregion
|
|
131
|
+
export { BarVueProps };
|