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,165 @@
|
|
|
1
|
+
import { isNumOrStr, isWellBehavedNumber } from "../../utils/validate.mjs";
|
|
2
|
+
import { useIsPanorama } from "../../context/PanoramaContextProvider.mjs";
|
|
3
|
+
import { selectAxisScale, selectXAxisSettings, selectYAxisSettings } from "../../state/selectors/axisSelectors.mjs";
|
|
4
|
+
import { useAppDispatch, useAppSelector } from "../../state/hooks.mjs";
|
|
5
|
+
import { useViewBox } from "../../context/chartLayoutContext.mjs";
|
|
6
|
+
import { Layer } from "../../container/Layer.mjs";
|
|
7
|
+
import { Label } from "../../components/label/Label.mjs";
|
|
8
|
+
import { addLine, removeLine } from "../../state/referenceElementsSlice.mjs";
|
|
9
|
+
import { useClipPathId } from "../../chart/provideClipPathId.mjs";
|
|
10
|
+
import { computed, createVNode, defineComponent, mergeProps, onMounted, onUnmounted, reactive } from "vue";
|
|
11
|
+
//#region src/cartesian/reference-line/ReferenceLine.tsx
|
|
12
|
+
function scaleCoord(scale, value) {
|
|
13
|
+
const coord = scale(value);
|
|
14
|
+
if (!isWellBehavedNumber(coord)) return;
|
|
15
|
+
return coord + (scale.bandwidth?.() ?? 0) / 2;
|
|
16
|
+
}
|
|
17
|
+
function isInRange(scale, coord) {
|
|
18
|
+
const r = scale.range();
|
|
19
|
+
const min = Math.min(r[0], r[1]);
|
|
20
|
+
const max = Math.max(r[0], r[1]);
|
|
21
|
+
return coord >= min && coord <= max;
|
|
22
|
+
}
|
|
23
|
+
var ReferenceLine = /* @__PURE__ */ defineComponent({
|
|
24
|
+
name: "ReferenceLine",
|
|
25
|
+
props: {
|
|
26
|
+
x: {
|
|
27
|
+
type: [Number, String],
|
|
28
|
+
default: void 0
|
|
29
|
+
},
|
|
30
|
+
y: {
|
|
31
|
+
type: [Number, String],
|
|
32
|
+
default: void 0
|
|
33
|
+
},
|
|
34
|
+
xAxisId: {
|
|
35
|
+
type: [Number, String],
|
|
36
|
+
default: 0
|
|
37
|
+
},
|
|
38
|
+
yAxisId: {
|
|
39
|
+
type: [Number, String],
|
|
40
|
+
default: 0
|
|
41
|
+
},
|
|
42
|
+
stroke: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: "#ccc"
|
|
45
|
+
},
|
|
46
|
+
strokeWidth: {
|
|
47
|
+
type: [Number, String],
|
|
48
|
+
default: 1
|
|
49
|
+
},
|
|
50
|
+
fill: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: "none"
|
|
53
|
+
},
|
|
54
|
+
label: {
|
|
55
|
+
type: [
|
|
56
|
+
String,
|
|
57
|
+
Number,
|
|
58
|
+
Boolean,
|
|
59
|
+
Object
|
|
60
|
+
],
|
|
61
|
+
default: void 0
|
|
62
|
+
},
|
|
63
|
+
ifOverflow: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: "discard"
|
|
66
|
+
},
|
|
67
|
+
className: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: void 0
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
inheritAttrs: false,
|
|
73
|
+
setup(props, { attrs }) {
|
|
74
|
+
const dispatch = useAppDispatch();
|
|
75
|
+
const isPanorama = useIsPanorama();
|
|
76
|
+
const clipPathId = useClipPathId();
|
|
77
|
+
const viewBox = useViewBox();
|
|
78
|
+
const settings = reactive({
|
|
79
|
+
xAxisId: props.xAxisId,
|
|
80
|
+
yAxisId: props.yAxisId,
|
|
81
|
+
ifOverflow: props.ifOverflow,
|
|
82
|
+
x: props.x,
|
|
83
|
+
y: props.y
|
|
84
|
+
});
|
|
85
|
+
onMounted(() => {
|
|
86
|
+
dispatch(addLine(settings));
|
|
87
|
+
});
|
|
88
|
+
onUnmounted(() => {
|
|
89
|
+
dispatch(removeLine(settings));
|
|
90
|
+
});
|
|
91
|
+
const xAxisSettings = useAppSelector((state) => selectXAxisSettings(state, props.xAxisId));
|
|
92
|
+
const yAxisSettings = useAppSelector((state) => selectYAxisSettings(state, props.yAxisId));
|
|
93
|
+
const xAxisScale = useAppSelector((state) => selectAxisScale(state, "xAxis", props.xAxisId, isPanorama));
|
|
94
|
+
const yAxisScale = useAppSelector((state) => selectAxisScale(state, "yAxis", props.yAxisId, isPanorama));
|
|
95
|
+
const endPoints = computed(() => {
|
|
96
|
+
const vb = viewBox.value;
|
|
97
|
+
const xScale = xAxisScale.value;
|
|
98
|
+
const yScale = yAxisScale.value;
|
|
99
|
+
if (!vb || !xScale || !yScale) return null;
|
|
100
|
+
if (isNumOrStr(props.y)) {
|
|
101
|
+
const coord = scaleCoord(yScale, props.y);
|
|
102
|
+
if (coord == null) return null;
|
|
103
|
+
if (props.ifOverflow === "discard" && !isInRange(yScale, coord)) return null;
|
|
104
|
+
const yOrientation = yAxisSettings.value?.orientation;
|
|
105
|
+
const points = [{
|
|
106
|
+
x: vb.x + vb.width,
|
|
107
|
+
y: coord
|
|
108
|
+
}, {
|
|
109
|
+
x: vb.x,
|
|
110
|
+
y: coord
|
|
111
|
+
}];
|
|
112
|
+
return yOrientation === "left" ? points.reverse() : points;
|
|
113
|
+
}
|
|
114
|
+
if (isNumOrStr(props.x)) {
|
|
115
|
+
const coord = scaleCoord(xScale, props.x);
|
|
116
|
+
if (coord == null) return null;
|
|
117
|
+
if (props.ifOverflow === "discard" && !isInRange(xScale, coord)) return null;
|
|
118
|
+
const xOrientation = xAxisSettings.value?.orientation;
|
|
119
|
+
const points = [{
|
|
120
|
+
x: coord,
|
|
121
|
+
y: vb.y + vb.height
|
|
122
|
+
}, {
|
|
123
|
+
x: coord,
|
|
124
|
+
y: vb.y
|
|
125
|
+
}];
|
|
126
|
+
return xOrientation === "top" ? points.reverse() : points;
|
|
127
|
+
}
|
|
128
|
+
return null;
|
|
129
|
+
});
|
|
130
|
+
return () => {
|
|
131
|
+
const pts = endPoints.value;
|
|
132
|
+
if (!pts || pts.length < 2) return null;
|
|
133
|
+
const [p1, p2] = pts;
|
|
134
|
+
if (!isWellBehavedNumber(p1.x) || !isWellBehavedNumber(p1.y) || !isWellBehavedNumber(p2.x) || !isWellBehavedNumber(p2.y)) return null;
|
|
135
|
+
const clipPath = props.ifOverflow === "hidden" ? `url(#${clipPathId})` : void 0;
|
|
136
|
+
const svgAttrs = {
|
|
137
|
+
...attrs,
|
|
138
|
+
stroke: props.stroke,
|
|
139
|
+
"stroke-width": props.strokeWidth,
|
|
140
|
+
fill: props.fill
|
|
141
|
+
};
|
|
142
|
+
const labelViewBox = {
|
|
143
|
+
x: Math.min(p1.x, p2.x),
|
|
144
|
+
y: Math.min(p1.y, p2.y),
|
|
145
|
+
width: Math.abs(p2.x - p1.x),
|
|
146
|
+
height: Math.abs(p2.y - p1.y)
|
|
147
|
+
};
|
|
148
|
+
const labelValue = props.label;
|
|
149
|
+
const labelProps = typeof labelValue === "object" && labelValue !== null ? labelValue : {};
|
|
150
|
+
return createVNode(Layer, { "class": ["v-charts-reference-line", props.className] }, { default: () => [createVNode("line", mergeProps(svgAttrs, {
|
|
151
|
+
"clip-path": clipPath,
|
|
152
|
+
"x1": p1.x,
|
|
153
|
+
"y1": p1.y,
|
|
154
|
+
"x2": p2.x,
|
|
155
|
+
"y2": p2.y,
|
|
156
|
+
"class": "v-charts-reference-line-line"
|
|
157
|
+
}), null), labelValue != null && labelValue !== false && createVNode(Label, mergeProps({
|
|
158
|
+
"viewBox": labelViewBox,
|
|
159
|
+
"value": typeof labelValue === "string" || typeof labelValue === "number" ? labelValue : void 0
|
|
160
|
+
}, labelProps), null)] });
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
//#endregion
|
|
165
|
+
export { ReferenceLine };
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { Curve } from "../../shape/Curve.mjs";
|
|
2
|
+
import { getTooltipNameProp, getValueByDataKey } from "../../utils/chart.mjs";
|
|
3
|
+
import { mouseLeaveChart, setActiveMouseOverItemIndex, setMouseOverAxisIndex } from "../../state/tooltipSlice.mjs";
|
|
4
|
+
import { selectActiveTooltipDataKey, selectActiveTooltipIndex } from "../../state/selectors/tooltipSelectors.mjs";
|
|
5
|
+
import { useAppDispatch, useAppSelector } from "../../state/hooks.mjs";
|
|
6
|
+
import { Layer } from "../../container/Layer.mjs";
|
|
7
|
+
import { LabelList } from "../../components/label/LabelList.mjs";
|
|
8
|
+
import { Animate } from "../../animation/Animate.mjs";
|
|
9
|
+
import { SetTooltipEntrySettings } from "../../state/SetTooltipEntrySettings.mjs";
|
|
10
|
+
import { useSetupGraphicalItem } from "../../hooks/useSetupGraphicalItem.mjs";
|
|
11
|
+
import { useGraphicalLayerRef } from "../../context/graphicalLayerContext.mjs";
|
|
12
|
+
import { createErrorBarRegistry, provideErrorBarContext, provideErrorBarRegistry } from "../error-bar/ErrorBarContext.mjs";
|
|
13
|
+
import { useScatter } from "./hooks/useScatter.mjs";
|
|
14
|
+
import { Symbols } from "../../shape/Symbols.mjs";
|
|
15
|
+
import { getLinearRegression } from "../../utils/getLinearRegression.mjs";
|
|
16
|
+
import { Fragment, Teleport, computed, createVNode, defineComponent, isVNode, mergeProps, useAttrs } from "vue";
|
|
17
|
+
//#region src/cartesian/scatter/Scatter.tsx
|
|
18
|
+
function _isSlot(s) {
|
|
19
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
20
|
+
}
|
|
21
|
+
var interpolateNumber = (from, to) => (t) => from + (to - from) * t;
|
|
22
|
+
var errorBarDataPointFormatter = (dataPoint, dataKey, direction) => ({
|
|
23
|
+
x: dataPoint.cx,
|
|
24
|
+
y: dataPoint.cy,
|
|
25
|
+
value: direction === "x" ? Number(dataPoint.node.x) : Number(dataPoint.node.y),
|
|
26
|
+
errorVal: getValueByDataKey(dataPoint.payload, dataKey)
|
|
27
|
+
});
|
|
28
|
+
var Scatter = /* @__PURE__ */ defineComponent({
|
|
29
|
+
name: "Scatter",
|
|
30
|
+
props: {
|
|
31
|
+
xAxisId: {
|
|
32
|
+
type: [String, Number],
|
|
33
|
+
default: 0
|
|
34
|
+
},
|
|
35
|
+
yAxisId: {
|
|
36
|
+
type: [String, Number],
|
|
37
|
+
default: 0
|
|
38
|
+
},
|
|
39
|
+
zAxisId: {
|
|
40
|
+
type: [String, Number],
|
|
41
|
+
default: 0
|
|
42
|
+
},
|
|
43
|
+
dataKey: {
|
|
44
|
+
type: [
|
|
45
|
+
String,
|
|
46
|
+
Number,
|
|
47
|
+
Function
|
|
48
|
+
],
|
|
49
|
+
default: void 0
|
|
50
|
+
},
|
|
51
|
+
data: {
|
|
52
|
+
type: Array,
|
|
53
|
+
default: void 0
|
|
54
|
+
},
|
|
55
|
+
name: {
|
|
56
|
+
type: [String, Number],
|
|
57
|
+
default: void 0
|
|
58
|
+
},
|
|
59
|
+
hide: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: false
|
|
62
|
+
},
|
|
63
|
+
fill: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: void 0
|
|
66
|
+
},
|
|
67
|
+
shape: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: "circle"
|
|
70
|
+
},
|
|
71
|
+
isAnimationActive: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: true
|
|
74
|
+
},
|
|
75
|
+
line: {
|
|
76
|
+
type: [Boolean, Object],
|
|
77
|
+
default: false
|
|
78
|
+
},
|
|
79
|
+
lineType: {
|
|
80
|
+
type: String,
|
|
81
|
+
default: "joint"
|
|
82
|
+
},
|
|
83
|
+
lineJointType: {
|
|
84
|
+
type: [String, Function],
|
|
85
|
+
default: "linear"
|
|
86
|
+
},
|
|
87
|
+
label: {
|
|
88
|
+
type: [Boolean, Object],
|
|
89
|
+
default: false
|
|
90
|
+
},
|
|
91
|
+
legendType: {
|
|
92
|
+
type: String,
|
|
93
|
+
default: "circle"
|
|
94
|
+
},
|
|
95
|
+
tooltipType: {
|
|
96
|
+
type: String,
|
|
97
|
+
default: void 0
|
|
98
|
+
},
|
|
99
|
+
transition: {
|
|
100
|
+
type: Object,
|
|
101
|
+
default: void 0
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
inheritAttrs: false,
|
|
105
|
+
slots: Object,
|
|
106
|
+
setup(props, { attrs, slots }) {
|
|
107
|
+
const errorBarRegistry = createErrorBarRegistry();
|
|
108
|
+
provideErrorBarRegistry(errorBarRegistry);
|
|
109
|
+
useSetupGraphicalItem(props, "scatter", {
|
|
110
|
+
skipTooltip: true,
|
|
111
|
+
errorBars: errorBarRegistry.errorBars
|
|
112
|
+
});
|
|
113
|
+
const { shouldRender, points } = useScatter(props);
|
|
114
|
+
const graphicalLayerRef = useGraphicalLayerRef();
|
|
115
|
+
const svgAttrs = useAttrs();
|
|
116
|
+
const dispatch = useAppDispatch();
|
|
117
|
+
const activeIndex = useAppSelector(selectActiveTooltipIndex);
|
|
118
|
+
const activeDataKey = useAppSelector(selectActiveTooltipDataKey);
|
|
119
|
+
SetTooltipEntrySettings({
|
|
120
|
+
fn: (input) => ({
|
|
121
|
+
dataDefinedOnItem: input.points?.map((p) => p.tooltipPayload),
|
|
122
|
+
positions: void 0,
|
|
123
|
+
settings: {
|
|
124
|
+
stroke: input.stroke,
|
|
125
|
+
strokeWidth: input.strokeWidth,
|
|
126
|
+
fill: input.fill,
|
|
127
|
+
dataKey: input.dataKey,
|
|
128
|
+
nameKey: void 0,
|
|
129
|
+
name: getTooltipNameProp(input.name, input.dataKey),
|
|
130
|
+
hide: input.hide,
|
|
131
|
+
type: input.tooltipType,
|
|
132
|
+
color: input.fill,
|
|
133
|
+
unit: ""
|
|
134
|
+
}
|
|
135
|
+
}),
|
|
136
|
+
args: computed(() => ({
|
|
137
|
+
points: points.value,
|
|
138
|
+
fill: svgAttrs.fill ?? props.fill,
|
|
139
|
+
stroke: svgAttrs.stroke,
|
|
140
|
+
strokeWidth: svgAttrs["stroke-width"],
|
|
141
|
+
name: props.name,
|
|
142
|
+
dataKey: props.dataKey,
|
|
143
|
+
hide: props.hide,
|
|
144
|
+
tooltipType: props.tooltipType
|
|
145
|
+
}))
|
|
146
|
+
});
|
|
147
|
+
provideErrorBarContext({
|
|
148
|
+
data: points,
|
|
149
|
+
xAxisId: props.xAxisId,
|
|
150
|
+
yAxisId: props.yAxisId,
|
|
151
|
+
dataPointFormatter: errorBarDataPointFormatter,
|
|
152
|
+
errorBarOffset: computed(() => 0)
|
|
153
|
+
});
|
|
154
|
+
let previousPoints = null;
|
|
155
|
+
let animationId = 0;
|
|
156
|
+
const dispatchScatterHover = (point, index) => {
|
|
157
|
+
const payload = {
|
|
158
|
+
activeDataKey: props.dataKey,
|
|
159
|
+
activeIndex: String(index),
|
|
160
|
+
activeCoordinate: point.tooltipPosition
|
|
161
|
+
};
|
|
162
|
+
dispatch(setMouseOverAxisIndex(payload));
|
|
163
|
+
dispatch(setActiveMouseOverItemIndex(payload));
|
|
164
|
+
};
|
|
165
|
+
const onMouseLeaveSymbol = () => {
|
|
166
|
+
dispatch(mouseLeaveChart());
|
|
167
|
+
};
|
|
168
|
+
const renderSymbols = (data, svgAttrs) => {
|
|
169
|
+
const currentActiveIndex = activeIndex.value;
|
|
170
|
+
const currentActiveDataKey = activeDataKey.value;
|
|
171
|
+
return data.map((point, i) => {
|
|
172
|
+
if (point.cx == null || point.cy == null) return null;
|
|
173
|
+
const isActive = currentActiveIndex === String(i) && currentActiveDataKey === props.dataKey;
|
|
174
|
+
const symbolProps = {
|
|
175
|
+
...svgAttrs,
|
|
176
|
+
...props.fill != null ? { fill: props.fill } : {},
|
|
177
|
+
cx: point.cx,
|
|
178
|
+
cy: point.cy,
|
|
179
|
+
size: isActive ? (point.size ?? 64) * 1.6 : point.size,
|
|
180
|
+
type: props.shape,
|
|
181
|
+
...isActive ? {
|
|
182
|
+
stroke: "#fff",
|
|
183
|
+
"stroke-width": 2
|
|
184
|
+
} : {}
|
|
185
|
+
};
|
|
186
|
+
return createVNode("g", {
|
|
187
|
+
"class": "v-charts-scatter-symbol",
|
|
188
|
+
"onMouseenter": () => dispatchScatterHover(point, i),
|
|
189
|
+
"onMousemove": (e) => {
|
|
190
|
+
e.stopPropagation();
|
|
191
|
+
dispatchScatterHover(point, i);
|
|
192
|
+
},
|
|
193
|
+
"onMouseleave": onMouseLeaveSymbol
|
|
194
|
+
}, [Symbols(symbolProps)]);
|
|
195
|
+
});
|
|
196
|
+
};
|
|
197
|
+
const renderLine = (data, svgAttrs) => {
|
|
198
|
+
if (!props.line) return null;
|
|
199
|
+
let linePoints;
|
|
200
|
+
if (props.lineType === "joint") linePoints = data.map((p) => ({
|
|
201
|
+
x: p.cx ?? 0,
|
|
202
|
+
y: p.cy ?? 0
|
|
203
|
+
}));
|
|
204
|
+
else {
|
|
205
|
+
const { xmin, xmax, a, b } = getLinearRegression(data);
|
|
206
|
+
linePoints = [{
|
|
207
|
+
x: xmin,
|
|
208
|
+
y: a * xmin + b
|
|
209
|
+
}, {
|
|
210
|
+
x: xmax,
|
|
211
|
+
y: a * xmax + b
|
|
212
|
+
}];
|
|
213
|
+
}
|
|
214
|
+
const lineProps = {
|
|
215
|
+
fill: "none",
|
|
216
|
+
stroke: svgAttrs.stroke ?? props.fill,
|
|
217
|
+
...typeof props.line === "object" ? props.line : {},
|
|
218
|
+
points: linePoints
|
|
219
|
+
};
|
|
220
|
+
return createVNode(Layer, {
|
|
221
|
+
"class": "v-charts-scatter-line",
|
|
222
|
+
"style": { pointerEvents: "none" }
|
|
223
|
+
}, { default: () => [createVNode(Curve, mergeProps(lineProps, { "type": props.lineJointType }), null)] });
|
|
224
|
+
};
|
|
225
|
+
return () => {
|
|
226
|
+
if (!shouldRender.value) return null;
|
|
227
|
+
const svgAttrs = attrs;
|
|
228
|
+
const data = points.value;
|
|
229
|
+
const isAnimationActive = props.isAnimationActive;
|
|
230
|
+
let symbolsContent;
|
|
231
|
+
if (isAnimationActive && previousPoints !== data) {
|
|
232
|
+
const prevData = previousPoints;
|
|
233
|
+
animationId++;
|
|
234
|
+
symbolsContent = createVNode(Animate, {
|
|
235
|
+
"key": animationId,
|
|
236
|
+
"transition": props.transition,
|
|
237
|
+
"isActive": isAnimationActive
|
|
238
|
+
}, { default: (t) => {
|
|
239
|
+
const stepData = t === 1 ? data : data.map((entry, index) => {
|
|
240
|
+
const prev = prevData && prevData[index];
|
|
241
|
+
if (prev) return {
|
|
242
|
+
...entry,
|
|
243
|
+
cx: entry.cx == null ? void 0 : interpolateNumber(prev.cx ?? 0, entry.cx)(t),
|
|
244
|
+
cy: entry.cy == null ? void 0 : interpolateNumber(prev.cy ?? 0, entry.cy)(t),
|
|
245
|
+
size: interpolateNumber(prev.size ?? 0, entry.size ?? 0)(t)
|
|
246
|
+
};
|
|
247
|
+
return {
|
|
248
|
+
...entry,
|
|
249
|
+
size: interpolateNumber(0, entry.size ?? 0)(t)
|
|
250
|
+
};
|
|
251
|
+
});
|
|
252
|
+
if (t > 0) previousPoints = stepData;
|
|
253
|
+
return createVNode(Fragment, null, [renderLine(stepData, svgAttrs), renderSymbols(stepData, svgAttrs)]);
|
|
254
|
+
} });
|
|
255
|
+
} else {
|
|
256
|
+
previousPoints = data;
|
|
257
|
+
symbolsContent = createVNode(Fragment, null, [renderLine(data, svgAttrs), renderSymbols(data, svgAttrs)]);
|
|
258
|
+
}
|
|
259
|
+
const content = createVNode(Layer, { "class": "v-charts-scatter" }, { default: () => [
|
|
260
|
+
slots.default?.(),
|
|
261
|
+
symbolsContent,
|
|
262
|
+
props.label && (() => {
|
|
263
|
+
const labelData = data.map((point) => ({
|
|
264
|
+
x: point.cx ?? 0,
|
|
265
|
+
y: point.cy ?? 0,
|
|
266
|
+
width: 0,
|
|
267
|
+
height: 0,
|
|
268
|
+
value: void 0,
|
|
269
|
+
payload: point.payload
|
|
270
|
+
}));
|
|
271
|
+
return createVNode(LabelList, mergeProps(typeof props.label === "object" ? props.label : {}, { "data": labelData }), null);
|
|
272
|
+
})()
|
|
273
|
+
] });
|
|
274
|
+
if (graphicalLayerRef?.value) return createVNode(Teleport, { "to": graphicalLayerRef.value }, _isSlot(content) ? content : { default: () => [content] });
|
|
275
|
+
return content;
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
//#endregion
|
|
280
|
+
export { Scatter };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useIsPanorama } from "../../../context/PanoramaContextProvider.mjs";
|
|
2
|
+
import { useAppSelector } from "../../../state/hooks.mjs";
|
|
3
|
+
import { selectScatterPoints } from "../../../state/selectors/scatterSelectors.mjs";
|
|
4
|
+
import { computed } from "vue";
|
|
5
|
+
//#region src/cartesian/scatter/hooks/useScatter.ts
|
|
6
|
+
function useScatter(props) {
|
|
7
|
+
const isPanorama = useIsPanorama();
|
|
8
|
+
const scatterSettings = computed(() => ({
|
|
9
|
+
data: props.data,
|
|
10
|
+
dataKey: props.dataKey,
|
|
11
|
+
tooltipType: props.tooltipType,
|
|
12
|
+
name: props.name ?? String(props.dataKey ?? "")
|
|
13
|
+
}));
|
|
14
|
+
const points = useAppSelector((state) => selectScatterPoints(state, props.xAxisId ?? 0, props.yAxisId ?? 0, props.zAxisId ?? 0, scatterSettings.value, isPanorama));
|
|
15
|
+
return {
|
|
16
|
+
shouldRender: computed(() => {
|
|
17
|
+
return !props.hide && points.value != null && points.value.length > 0;
|
|
18
|
+
}),
|
|
19
|
+
points
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { useScatter };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { selectXAxisSettings, selectYAxisSettings } from "../state/selectors/axisSelectors.mjs";
|
|
2
|
+
import { useAppSelector } from "../state/hooks.mjs";
|
|
3
|
+
import { computed } from "vue";
|
|
4
|
+
//#region src/cartesian/useNeedsClip.ts
|
|
5
|
+
function useNeedsClip(xAxisId, yAxisId) {
|
|
6
|
+
const xAxis = useAppSelector((state) => selectXAxisSettings(state, xAxisId));
|
|
7
|
+
const yAxis = useAppSelector((state) => selectYAxisSettings(state, yAxisId));
|
|
8
|
+
const needClipX = computed(() => {
|
|
9
|
+
return xAxis.value && xAxis.value.allowDataOverflow;
|
|
10
|
+
});
|
|
11
|
+
const needClipY = computed(() => {
|
|
12
|
+
return yAxis.value && yAxis.value.allowDataOverflow;
|
|
13
|
+
});
|
|
14
|
+
return {
|
|
15
|
+
needClip: computed(() => {
|
|
16
|
+
return needClipX.value || needClipY.value;
|
|
17
|
+
}),
|
|
18
|
+
needClipX,
|
|
19
|
+
needClipY
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { useNeedsClip };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { isNumber, isSsr, isVisible } from "../../utils/validate.mjs";
|
|
2
|
+
import { mathSign } from "../../utils/data.mjs";
|
|
3
|
+
import { getStringSize } from "../../utils/attrs.mjs";
|
|
4
|
+
import { getAngledTickWidth, getNumberIntervalTicks, getTickBoundaries } from "../../utils/tick.mjs";
|
|
5
|
+
import { getEquidistantTicks } from "../../utils/cartesian.mjs";
|
|
6
|
+
//#region src/cartesian/utils/get-ticks.ts
|
|
7
|
+
function getTicksEnd(sign, boundaries, getTickSize, ticks, minTickGap) {
|
|
8
|
+
const result = (ticks || []).slice();
|
|
9
|
+
const len = result.length;
|
|
10
|
+
const { start } = boundaries;
|
|
11
|
+
let { end } = boundaries;
|
|
12
|
+
for (let i = len - 1; i >= 0; i--) {
|
|
13
|
+
let entry = result[i];
|
|
14
|
+
let size;
|
|
15
|
+
const getSize = () => {
|
|
16
|
+
if (size === void 0) size = getTickSize(entry, i);
|
|
17
|
+
return size;
|
|
18
|
+
};
|
|
19
|
+
if (i === len - 1) {
|
|
20
|
+
const gap = sign * (entry.coordinate + sign * getSize() / 2 - end);
|
|
21
|
+
result[i] = entry = {
|
|
22
|
+
...entry,
|
|
23
|
+
tickCoord: gap > 0 ? entry.coordinate - gap * sign : entry.coordinate
|
|
24
|
+
};
|
|
25
|
+
} else result[i] = entry = {
|
|
26
|
+
...entry,
|
|
27
|
+
tickCoord: entry.coordinate
|
|
28
|
+
};
|
|
29
|
+
if (isVisible(sign, entry.tickCoord, getSize, start, end)) {
|
|
30
|
+
end = entry.tickCoord - sign * (getSize() / 2 + minTickGap);
|
|
31
|
+
result[i] = {
|
|
32
|
+
...entry,
|
|
33
|
+
isShow: true
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
function getTicksStart(sign, boundaries, getTickSize, ticks, minTickGap, preserveEnd) {
|
|
40
|
+
const result = (ticks || []).slice();
|
|
41
|
+
const len = result.length;
|
|
42
|
+
let { start, end } = boundaries;
|
|
43
|
+
if (preserveEnd) {
|
|
44
|
+
let tail = ticks[len - 1];
|
|
45
|
+
const tailSize = getTickSize(tail, len - 1);
|
|
46
|
+
const tailGap = sign * (tail.coordinate + sign * tailSize / 2 - end);
|
|
47
|
+
result[len - 1] = tail = {
|
|
48
|
+
...tail,
|
|
49
|
+
tickCoord: tailGap > 0 ? tail.coordinate - tailGap * sign : tail.coordinate
|
|
50
|
+
};
|
|
51
|
+
if (isVisible(sign, tail.tickCoord, () => tailSize, start, end)) {
|
|
52
|
+
end = tail.tickCoord - sign * (tailSize / 2 + minTickGap);
|
|
53
|
+
result[len - 1] = {
|
|
54
|
+
...tail,
|
|
55
|
+
isShow: true
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const count = preserveEnd ? len - 1 : len;
|
|
60
|
+
for (let i = 0; i < count; i++) {
|
|
61
|
+
let entry = result[i];
|
|
62
|
+
let size;
|
|
63
|
+
const getSize = () => {
|
|
64
|
+
if (size === void 0) size = getTickSize(entry, i);
|
|
65
|
+
return size;
|
|
66
|
+
};
|
|
67
|
+
if (i === 0) {
|
|
68
|
+
const gap = sign * (entry.coordinate - sign * getSize() / 2 - start);
|
|
69
|
+
result[i] = entry = {
|
|
70
|
+
...entry,
|
|
71
|
+
tickCoord: gap < 0 ? entry.coordinate - gap * sign : entry.coordinate
|
|
72
|
+
};
|
|
73
|
+
} else result[i] = entry = {
|
|
74
|
+
...entry,
|
|
75
|
+
tickCoord: entry.coordinate
|
|
76
|
+
};
|
|
77
|
+
if (isVisible(sign, entry.tickCoord, getSize, start, end)) {
|
|
78
|
+
start = entry.tickCoord + sign * (getSize() / 2 + minTickGap);
|
|
79
|
+
result[i] = {
|
|
80
|
+
...entry,
|
|
81
|
+
isShow: true
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
87
|
+
function getTicks(props, fontSize, letterSpacing) {
|
|
88
|
+
const { tick, ticks, viewBox, minTickGap, orientation, interval, tickFormatter, unit, angle } = props;
|
|
89
|
+
if (!ticks || !ticks.length || !tick) return [];
|
|
90
|
+
if (isNumber(interval) || isSsr) return getNumberIntervalTicks(ticks, isNumber(interval) ? interval : 0) ?? [];
|
|
91
|
+
let candidates = [];
|
|
92
|
+
const sizeKey = orientation === "top" || orientation === "bottom" ? "width" : "height";
|
|
93
|
+
const unitSize = unit && sizeKey === "width" ? getStringSize(unit, {
|
|
94
|
+
fontSize,
|
|
95
|
+
letterSpacing
|
|
96
|
+
}) : {
|
|
97
|
+
width: 0,
|
|
98
|
+
height: 0
|
|
99
|
+
};
|
|
100
|
+
const getTickSize = (content, index) => {
|
|
101
|
+
const value = typeof tickFormatter === "function" ? tickFormatter(content.value, index) : content.value;
|
|
102
|
+
return sizeKey === "width" ? getAngledTickWidth(getStringSize(value, {
|
|
103
|
+
fontSize,
|
|
104
|
+
letterSpacing
|
|
105
|
+
}), unitSize, angle) : getStringSize(value, {
|
|
106
|
+
fontSize,
|
|
107
|
+
letterSpacing
|
|
108
|
+
})[sizeKey];
|
|
109
|
+
};
|
|
110
|
+
const sign = ticks.length >= 2 ? mathSign(ticks[1].coordinate - ticks[0].coordinate) : 1;
|
|
111
|
+
const boundaries = getTickBoundaries(viewBox, sign, sizeKey);
|
|
112
|
+
if (interval === "equidistantPreserveStart") return getEquidistantTicks(sign, boundaries, getTickSize, ticks, minTickGap);
|
|
113
|
+
if (interval === "preserveStart" || interval === "preserveStartEnd") candidates = getTicksStart(sign, boundaries, getTickSize, ticks, minTickGap, interval === "preserveStartEnd");
|
|
114
|
+
else candidates = getTicksEnd(sign, boundaries, getTickSize, ticks, minTickGap);
|
|
115
|
+
return candidates.filter((entry) => entry.isShow);
|
|
116
|
+
}
|
|
117
|
+
//#endregion
|
|
118
|
+
export { getTicks };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { implicitZAxis } from "../../state/selectors/axisSelectors.mjs";
|
|
2
|
+
import { useAppDispatch } from "../../state/hooks.mjs";
|
|
3
|
+
import { addZAxis, removeZAxis } from "../../state/cartesianAxisSlice.mjs";
|
|
4
|
+
import { defineComponent, watchEffect } from "vue";
|
|
5
|
+
//#region src/cartesian/z-axis/ZAxis.tsx
|
|
6
|
+
var ZAxis = /* @__PURE__ */ defineComponent({
|
|
7
|
+
name: "ZAxis",
|
|
8
|
+
props: {
|
|
9
|
+
zAxisId: {
|
|
10
|
+
type: [String, Number],
|
|
11
|
+
default: 0
|
|
12
|
+
},
|
|
13
|
+
dataKey: {
|
|
14
|
+
type: [
|
|
15
|
+
String,
|
|
16
|
+
Number,
|
|
17
|
+
Function
|
|
18
|
+
],
|
|
19
|
+
default: void 0
|
|
20
|
+
},
|
|
21
|
+
type: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: implicitZAxis.type
|
|
24
|
+
},
|
|
25
|
+
range: {
|
|
26
|
+
type: Array,
|
|
27
|
+
default: () => implicitZAxis.range
|
|
28
|
+
},
|
|
29
|
+
domain: {
|
|
30
|
+
type: [Array, String],
|
|
31
|
+
default: void 0
|
|
32
|
+
},
|
|
33
|
+
scale: {
|
|
34
|
+
type: [String, Function],
|
|
35
|
+
default: implicitZAxis.scale
|
|
36
|
+
},
|
|
37
|
+
name: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: void 0
|
|
40
|
+
},
|
|
41
|
+
unit: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: void 0
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
setup(props) {
|
|
47
|
+
const dispatch = useAppDispatch();
|
|
48
|
+
watchEffect((onCleanup) => {
|
|
49
|
+
const settings = {
|
|
50
|
+
id: props.zAxisId,
|
|
51
|
+
dataKey: props.dataKey,
|
|
52
|
+
type: props.type,
|
|
53
|
+
range: props.range,
|
|
54
|
+
domain: props.domain,
|
|
55
|
+
scale: props.scale,
|
|
56
|
+
name: props.name,
|
|
57
|
+
unit: props.unit,
|
|
58
|
+
allowDuplicatedCategory: implicitZAxis.allowDuplicatedCategory,
|
|
59
|
+
allowDataOverflow: implicitZAxis.allowDataOverflow,
|
|
60
|
+
reversed: implicitZAxis.reversed,
|
|
61
|
+
includeHidden: implicitZAxis.includeHidden
|
|
62
|
+
};
|
|
63
|
+
dispatch(addZAxis(settings));
|
|
64
|
+
onCleanup(() => {
|
|
65
|
+
dispatch(removeZAxis(settings));
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
return () => null;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
//#endregion
|
|
72
|
+
export { ZAxis };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { arrayTooltipSearcher } from "../state/optionsSlice.mjs";
|
|
2
|
+
import { generateCategoricalChart } from "./generateCategoricalChart.mjs";
|
|
3
|
+
//#region src/chart/AreaChart.ts
|
|
4
|
+
var AreaChart = generateCategoricalChart({
|
|
5
|
+
chartName: "AreaChart",
|
|
6
|
+
tooltipPayloadSearcher: arrayTooltipSearcher
|
|
7
|
+
});
|
|
8
|
+
//#endregion
|
|
9
|
+
export { AreaChart };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { arrayTooltipSearcher } from "../state/optionsSlice.mjs";
|
|
2
|
+
import { generateCategoricalChart } from "./generateCategoricalChart.mjs";
|
|
3
|
+
var BarChart = generateCategoricalChart({
|
|
4
|
+
chartName: "BarChart",
|
|
5
|
+
defaultTooltipEventType: "axis",
|
|
6
|
+
tooltipPayloadSearcher: arrayTooltipSearcher,
|
|
7
|
+
validateTooltipEventTypes: ["axis", "item"]
|
|
8
|
+
});
|
|
9
|
+
//#endregion
|
|
10
|
+
export { BarChart };
|