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,97 @@
|
|
|
1
|
+
//#region src/polar/radial-bar/type.ts
|
|
2
|
+
var RadialBarVueProps = {
|
|
3
|
+
dataKey: {
|
|
4
|
+
type: [
|
|
5
|
+
String,
|
|
6
|
+
Number,
|
|
7
|
+
Function
|
|
8
|
+
],
|
|
9
|
+
required: true
|
|
10
|
+
},
|
|
11
|
+
name: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: void 0
|
|
14
|
+
},
|
|
15
|
+
angleAxisId: {
|
|
16
|
+
type: [String, Number],
|
|
17
|
+
default: 0
|
|
18
|
+
},
|
|
19
|
+
radiusAxisId: {
|
|
20
|
+
type: [String, Number],
|
|
21
|
+
default: 0
|
|
22
|
+
},
|
|
23
|
+
fill: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: void 0
|
|
26
|
+
},
|
|
27
|
+
stroke: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: void 0
|
|
30
|
+
},
|
|
31
|
+
fillOpacity: {
|
|
32
|
+
type: Number,
|
|
33
|
+
default: void 0
|
|
34
|
+
},
|
|
35
|
+
strokeWidth: {
|
|
36
|
+
type: Number,
|
|
37
|
+
default: void 0
|
|
38
|
+
},
|
|
39
|
+
strokeDasharray: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: void 0
|
|
42
|
+
},
|
|
43
|
+
hide: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false
|
|
46
|
+
},
|
|
47
|
+
legendType: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: "rect"
|
|
50
|
+
},
|
|
51
|
+
tooltipType: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: void 0
|
|
54
|
+
},
|
|
55
|
+
background: {
|
|
56
|
+
type: [Boolean, Object],
|
|
57
|
+
default: false
|
|
58
|
+
},
|
|
59
|
+
label: {
|
|
60
|
+
type: [Boolean, Object],
|
|
61
|
+
default: false
|
|
62
|
+
},
|
|
63
|
+
isAnimationActive: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: true
|
|
66
|
+
},
|
|
67
|
+
minPointSize: {
|
|
68
|
+
type: Number,
|
|
69
|
+
default: 0
|
|
70
|
+
},
|
|
71
|
+
maxBarSize: {
|
|
72
|
+
type: Number,
|
|
73
|
+
default: void 0
|
|
74
|
+
},
|
|
75
|
+
barSize: {
|
|
76
|
+
type: [Number, String],
|
|
77
|
+
default: void 0
|
|
78
|
+
},
|
|
79
|
+
stackId: {
|
|
80
|
+
type: [String, Number],
|
|
81
|
+
default: void 0
|
|
82
|
+
},
|
|
83
|
+
cornerRadius: {
|
|
84
|
+
type: [Number, String],
|
|
85
|
+
default: 0
|
|
86
|
+
},
|
|
87
|
+
forceCornerRadius: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
default: false
|
|
90
|
+
},
|
|
91
|
+
cornerIsExternal: {
|
|
92
|
+
type: Boolean,
|
|
93
|
+
default: false
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
//#endregion
|
|
97
|
+
export { RadialBarVueProps };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { isNumber } from "../utils/validate.mjs";
|
|
2
|
+
import { createVNode, mergeProps } from "vue";
|
|
3
|
+
//#region src/shape/Cross.tsx
|
|
4
|
+
function getCrossPath(x, y, width, height, top, left) {
|
|
5
|
+
return `M${x},${top}v${height}M${left},${y}h${width}`;
|
|
6
|
+
}
|
|
7
|
+
function Cross(props) {
|
|
8
|
+
const { x = 0, y = 0, top = 0, left = 0, width = 0, height = 0, ...rest } = props;
|
|
9
|
+
if (!isNumber(x) || !isNumber(y) || !isNumber(width) || !isNumber(height) || !isNumber(top) || !isNumber(left)) return null;
|
|
10
|
+
return createVNode("path", mergeProps(rest, {
|
|
11
|
+
"class": "v-charts-cross",
|
|
12
|
+
"d": getCrossPath(x, y, width, height, top, left)
|
|
13
|
+
}), null);
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Cross };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { isNumber } from "../utils/validate.mjs";
|
|
2
|
+
import { computed, createVNode, defineComponent, mergeProps } from "vue";
|
|
3
|
+
import { area, curveBasis, curveBasisClosed, curveBasisOpen, curveBumpX, curveBumpY, curveLinear, curveLinearClosed, curveMonotoneX, curveMonotoneY, curveNatural, curveStep, curveStepAfter, curveStepBefore, line } from "victory-vendor/d3-shape";
|
|
4
|
+
import { upperFirst } from "es-toolkit/compat";
|
|
5
|
+
//#region src/shape/Curve.tsx
|
|
6
|
+
/**
|
|
7
|
+
* @fileOverview Curve
|
|
8
|
+
*/
|
|
9
|
+
var CURVE_FACTORIES = {
|
|
10
|
+
curveBasisClosed,
|
|
11
|
+
curveBasisOpen,
|
|
12
|
+
curveBasis,
|
|
13
|
+
curveBumpX,
|
|
14
|
+
curveBumpY,
|
|
15
|
+
curveLinearClosed,
|
|
16
|
+
curveLinear,
|
|
17
|
+
curveMonotoneX,
|
|
18
|
+
curveMonotoneY,
|
|
19
|
+
curveNatural,
|
|
20
|
+
curveStep,
|
|
21
|
+
curveStepAfter,
|
|
22
|
+
curveStepBefore
|
|
23
|
+
};
|
|
24
|
+
var defined = (p) => p.x === +p.x && p.y === +p.y;
|
|
25
|
+
var getX = (p) => p.x;
|
|
26
|
+
var getY = (p) => p.y;
|
|
27
|
+
function getCurveFactory(type, layout) {
|
|
28
|
+
if (typeof type === "function") return type;
|
|
29
|
+
const name = `curve${upperFirst(type)}`;
|
|
30
|
+
if ((name === "curveMonotone" || name === "curveBump") && layout) return CURVE_FACTORIES[`${name}${layout === "vertical" ? "Y" : "X"}`];
|
|
31
|
+
return CURVE_FACTORIES[name] || curveLinear;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Calculate the path of curve. Returns null if points is an empty array.
|
|
35
|
+
* @return path or null
|
|
36
|
+
*/
|
|
37
|
+
function getPath({ type = "linear", points = [], baseLine, layout, connectNulls = false }) {
|
|
38
|
+
const curveFactory = getCurveFactory(type, layout);
|
|
39
|
+
const formatPoints = connectNulls ? points.filter((entry) => defined(entry)) : points;
|
|
40
|
+
let lineFunction;
|
|
41
|
+
if (Array.isArray(baseLine)) {
|
|
42
|
+
const formatBaseLine = connectNulls ? baseLine.filter((base) => defined(base)) : baseLine;
|
|
43
|
+
const areaPoints = formatPoints.map((entry, index) => ({
|
|
44
|
+
...entry,
|
|
45
|
+
base: formatBaseLine[index]
|
|
46
|
+
}));
|
|
47
|
+
if (layout === "vertical") lineFunction = area().y(getY).x1(getX).x0((d) => d.base.x);
|
|
48
|
+
else lineFunction = area().x(getX).y1(getY).y0((d) => d.base.y);
|
|
49
|
+
lineFunction.defined(defined).curve(curveFactory);
|
|
50
|
+
return lineFunction(areaPoints);
|
|
51
|
+
}
|
|
52
|
+
if (layout === "vertical" && isNumber(baseLine)) lineFunction = area().y(getY).x1(getX).x0(baseLine);
|
|
53
|
+
else if (isNumber(baseLine)) lineFunction = area().x(getX).y1(getY).y0(baseLine);
|
|
54
|
+
else lineFunction = line().x(getX).y(getY);
|
|
55
|
+
lineFunction.defined(defined).curve(curveFactory);
|
|
56
|
+
return lineFunction(formatPoints);
|
|
57
|
+
}
|
|
58
|
+
var CurveVueProps = {
|
|
59
|
+
type: { type: [String, Function] },
|
|
60
|
+
layout: { type: String },
|
|
61
|
+
baseLine: { type: [Number, Array] },
|
|
62
|
+
points: { type: Array },
|
|
63
|
+
connectNulls: { type: Boolean },
|
|
64
|
+
path: { type: String },
|
|
65
|
+
class: { type: [String, Array] }
|
|
66
|
+
};
|
|
67
|
+
var Curve = /* @__PURE__ */ defineComponent({
|
|
68
|
+
name: "Curve",
|
|
69
|
+
props: CurveVueProps,
|
|
70
|
+
inheritAttrs: false,
|
|
71
|
+
setup(props, { attrs }) {
|
|
72
|
+
const realPath = computed(() => {
|
|
73
|
+
if ((!props.points || !props.points.length) && !props.path) return;
|
|
74
|
+
return props.points && props.points.length ? getPath(props) : props.path;
|
|
75
|
+
});
|
|
76
|
+
return () => {
|
|
77
|
+
if (realPath.value === null && !props.path) return null;
|
|
78
|
+
return createVNode("path", mergeProps(attrs, {
|
|
79
|
+
"class": ["v-charts-curve", props.class],
|
|
80
|
+
"d": realPath.value
|
|
81
|
+
}), null);
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
//#endregion
|
|
86
|
+
export { Curve, CurveVueProps, getPath };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createVNode, defineComponent } from "vue";
|
|
2
|
+
var Dot = /* @__PURE__ */ defineComponent({
|
|
3
|
+
name: "Dot",
|
|
4
|
+
props: {
|
|
5
|
+
cx: { type: [Number, String] },
|
|
6
|
+
cy: { type: [Number, String] },
|
|
7
|
+
r: { type: [Number, String] },
|
|
8
|
+
clipDot: { type: Boolean }
|
|
9
|
+
},
|
|
10
|
+
setup(props) {
|
|
11
|
+
return () => {
|
|
12
|
+
const { cx, cy, r } = props;
|
|
13
|
+
if (cx === +cx && cy === +cy && r === +r) return createVNode("circle", {
|
|
14
|
+
"class": ["v-charts-dot", props.class],
|
|
15
|
+
"cx": cx,
|
|
16
|
+
"cy": cy,
|
|
17
|
+
"r": r
|
|
18
|
+
}, null);
|
|
19
|
+
return null;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
//#endregion
|
|
24
|
+
export { Dot };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { createVNode, defineComponent, mergeProps } from "vue";
|
|
2
|
+
//#region src/shape/Rectangle.tsx
|
|
3
|
+
/**
|
|
4
|
+
* @fileOverview Rectangle
|
|
5
|
+
*/
|
|
6
|
+
var RectangleVueProps = {
|
|
7
|
+
className: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: void 0
|
|
10
|
+
},
|
|
11
|
+
x: {
|
|
12
|
+
type: Number,
|
|
13
|
+
default: 0
|
|
14
|
+
},
|
|
15
|
+
y: {
|
|
16
|
+
type: Number,
|
|
17
|
+
default: 0
|
|
18
|
+
},
|
|
19
|
+
width: {
|
|
20
|
+
type: Number,
|
|
21
|
+
default: 0
|
|
22
|
+
},
|
|
23
|
+
height: {
|
|
24
|
+
type: Number,
|
|
25
|
+
default: 0
|
|
26
|
+
},
|
|
27
|
+
radius: {
|
|
28
|
+
type: [Number, Array],
|
|
29
|
+
default: void 0
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
function getRectanglePath(x, y, width, height, radius) {
|
|
33
|
+
const maxRadius = Math.min(Math.abs(width) / 2, Math.abs(height) / 2);
|
|
34
|
+
const ySign = height >= 0 ? 1 : -1;
|
|
35
|
+
const xSign = width >= 0 ? 1 : -1;
|
|
36
|
+
const clockWise = height >= 0 && width >= 0 || height < 0 && width < 0 ? 1 : 0;
|
|
37
|
+
if (maxRadius > 0 && Array.isArray(radius)) {
|
|
38
|
+
const newRadius = [
|
|
39
|
+
0,
|
|
40
|
+
0,
|
|
41
|
+
0,
|
|
42
|
+
0
|
|
43
|
+
];
|
|
44
|
+
for (let i = 0; i < 4; i++) {
|
|
45
|
+
const r = radius[i] ?? 0;
|
|
46
|
+
newRadius[i] = r > maxRadius ? maxRadius : r;
|
|
47
|
+
}
|
|
48
|
+
let path = `M${x},${y + ySign * newRadius[0]}`;
|
|
49
|
+
if (newRadius[0] > 0) path += `A ${newRadius[0]},${newRadius[0]},0,0,${clockWise},${x + xSign * newRadius[0]},${y}`;
|
|
50
|
+
path += `L ${x + width - xSign * newRadius[1]},${y}`;
|
|
51
|
+
if (newRadius[1] > 0) path += `A ${newRadius[1]},${newRadius[1]},0,0,${clockWise},${x + width},${y + ySign * newRadius[1]}`;
|
|
52
|
+
path += `L ${x + width},${y + height - ySign * newRadius[2]}`;
|
|
53
|
+
if (newRadius[2] > 0) path += `A ${newRadius[2]},${newRadius[2]},0,0,${clockWise},${x + width - xSign * newRadius[2]},${y + height}`;
|
|
54
|
+
path += `L ${x + xSign * newRadius[3]},${y + height}`;
|
|
55
|
+
if (newRadius[3] > 0) path += `A ${newRadius[3]},${newRadius[3]},0,0,${clockWise},${x},${y + height - ySign * newRadius[3]}`;
|
|
56
|
+
path += "Z";
|
|
57
|
+
return path;
|
|
58
|
+
}
|
|
59
|
+
if (maxRadius > 0 && typeof radius === "number" && radius > 0) {
|
|
60
|
+
const r = Math.min(maxRadius, radius);
|
|
61
|
+
return `M ${x},${y + ySign * r}A ${r},${r},0,0,${clockWise},${x + xSign * r},${y}L ${x + width - xSign * r},${y}A ${r},${r},0,0,${clockWise},${x + width},${y + ySign * r}L ${x + width},${y + height - ySign * r}A ${r},${r},0,0,${clockWise},${x + width - xSign * r},${y + height}L ${x + xSign * r},${y + height}A ${r},${r},0,0,${clockWise},${x},${y + height - ySign * r} Z`;
|
|
62
|
+
}
|
|
63
|
+
return `M ${x},${y} h ${width} v ${height} h ${-width} Z`;
|
|
64
|
+
}
|
|
65
|
+
var Rectangle = /* @__PURE__ */ defineComponent({
|
|
66
|
+
name: "Rectangle",
|
|
67
|
+
props: RectangleVueProps,
|
|
68
|
+
setup(props, { attrs }) {
|
|
69
|
+
return () => {
|
|
70
|
+
const { x, y, width, height, radius } = props;
|
|
71
|
+
if (x !== +x || y !== +y || width !== +width || height !== +height || width === 0 || height === 0) return null;
|
|
72
|
+
return createVNode("path", mergeProps(attrs, {
|
|
73
|
+
"x": x,
|
|
74
|
+
"y": y,
|
|
75
|
+
"width": width,
|
|
76
|
+
"height": height,
|
|
77
|
+
"d": getRectanglePath(x, y, width, height, radius)
|
|
78
|
+
}), null);
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
//#endregion
|
|
83
|
+
export { Rectangle };
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { RADIAN, polarToCartesian } from "../utils/polar.mjs";
|
|
2
|
+
import { getPercentValue, mathSign } from "../utils/data.mjs";
|
|
3
|
+
import { createVNode, defineComponent, mergeProps } from "vue";
|
|
4
|
+
//#region src/shape/Sector.tsx
|
|
5
|
+
/**
|
|
6
|
+
* @fileOverview Sector - SVG arc path shape for pie/donut chart segments
|
|
7
|
+
*/
|
|
8
|
+
var SectorVueProps = {
|
|
9
|
+
cx: {
|
|
10
|
+
type: Number,
|
|
11
|
+
default: 0
|
|
12
|
+
},
|
|
13
|
+
cy: {
|
|
14
|
+
type: Number,
|
|
15
|
+
default: 0
|
|
16
|
+
},
|
|
17
|
+
innerRadius: {
|
|
18
|
+
type: Number,
|
|
19
|
+
default: 0
|
|
20
|
+
},
|
|
21
|
+
outerRadius: {
|
|
22
|
+
type: Number,
|
|
23
|
+
default: 0
|
|
24
|
+
},
|
|
25
|
+
startAngle: {
|
|
26
|
+
type: Number,
|
|
27
|
+
default: 0
|
|
28
|
+
},
|
|
29
|
+
endAngle: {
|
|
30
|
+
type: Number,
|
|
31
|
+
default: 0
|
|
32
|
+
},
|
|
33
|
+
cornerRadius: {
|
|
34
|
+
type: [Number, String],
|
|
35
|
+
default: 0
|
|
36
|
+
},
|
|
37
|
+
forceCornerRadius: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: false
|
|
40
|
+
},
|
|
41
|
+
cornerIsExternal: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false
|
|
44
|
+
},
|
|
45
|
+
className: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: void 0
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
function getDeltaAngle(startAngle, endAngle) {
|
|
51
|
+
return mathSign(endAngle - startAngle) * Math.min(Math.abs(endAngle - startAngle), 359.999);
|
|
52
|
+
}
|
|
53
|
+
function getTangentCircle({ cx, cy, radius, angle, sign, isExternal, cornerRadius, cornerIsExternal }) {
|
|
54
|
+
const centerRadius = cornerRadius * (isExternal ? 1 : -1) + radius;
|
|
55
|
+
const theta = Math.asin(cornerRadius / centerRadius) / RADIAN;
|
|
56
|
+
const centerAngle = cornerIsExternal ? angle : angle + sign * theta;
|
|
57
|
+
const center = polarToCartesian(cx, cy, centerRadius, centerAngle);
|
|
58
|
+
const circleTangency = polarToCartesian(cx, cy, radius, centerAngle);
|
|
59
|
+
const lineTangencyAngle = cornerIsExternal ? angle - sign * theta : angle;
|
|
60
|
+
return {
|
|
61
|
+
center,
|
|
62
|
+
circleTangency,
|
|
63
|
+
lineTangency: polarToCartesian(cx, cy, centerRadius * Math.cos(theta * RADIAN), lineTangencyAngle),
|
|
64
|
+
theta
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function getSectorPath(cx, cy, innerRadius, outerRadius, startAngle, endAngle) {
|
|
68
|
+
const angle = getDeltaAngle(startAngle, endAngle);
|
|
69
|
+
const tempEndAngle = startAngle + angle;
|
|
70
|
+
const outerStart = polarToCartesian(cx, cy, outerRadius, startAngle);
|
|
71
|
+
const outerEnd = polarToCartesian(cx, cy, outerRadius, tempEndAngle);
|
|
72
|
+
const largeArcFlag = +(Math.abs(angle) > 180);
|
|
73
|
+
const sweepOuter = +(startAngle > tempEndAngle);
|
|
74
|
+
let path = `M ${outerStart.x},${outerStart.y} A ${outerRadius},${outerRadius},0,${largeArcFlag},${sweepOuter},${outerEnd.x},${outerEnd.y}`;
|
|
75
|
+
if (innerRadius > 0) {
|
|
76
|
+
const innerStart = polarToCartesian(cx, cy, innerRadius, startAngle);
|
|
77
|
+
const innerEnd = polarToCartesian(cx, cy, innerRadius, tempEndAngle);
|
|
78
|
+
const sweepInner = +(startAngle <= tempEndAngle);
|
|
79
|
+
path += ` L ${innerEnd.x},${innerEnd.y} A ${innerRadius},${innerRadius},0,${largeArcFlag},${sweepInner},${innerStart.x},${innerStart.y} Z`;
|
|
80
|
+
} else path += ` L ${cx},${cy} Z`;
|
|
81
|
+
return path;
|
|
82
|
+
}
|
|
83
|
+
function getSectorWithCorner(cx, cy, innerRadius, outerRadius, cornerRadius, forceCornerRadius, cornerIsExternal, startAngle, endAngle) {
|
|
84
|
+
const sign = mathSign(endAngle - startAngle);
|
|
85
|
+
const { circleTangency: soct, lineTangency: solt, theta: sot } = getTangentCircle({
|
|
86
|
+
cx,
|
|
87
|
+
cy,
|
|
88
|
+
radius: outerRadius,
|
|
89
|
+
angle: startAngle,
|
|
90
|
+
sign,
|
|
91
|
+
cornerRadius,
|
|
92
|
+
cornerIsExternal
|
|
93
|
+
});
|
|
94
|
+
const { circleTangency: eoct, lineTangency: eolt, theta: eot } = getTangentCircle({
|
|
95
|
+
cx,
|
|
96
|
+
cy,
|
|
97
|
+
radius: outerRadius,
|
|
98
|
+
angle: endAngle,
|
|
99
|
+
sign: -sign,
|
|
100
|
+
cornerRadius,
|
|
101
|
+
cornerIsExternal
|
|
102
|
+
});
|
|
103
|
+
const outerArcAngle = cornerIsExternal ? Math.abs(startAngle - endAngle) : Math.abs(startAngle - endAngle) - sot - eot;
|
|
104
|
+
if (outerArcAngle < 0) {
|
|
105
|
+
if (forceCornerRadius) return `M ${solt.x},${solt.y} a${cornerRadius},${cornerRadius},0,0,1,${cornerRadius * 2},0 a${cornerRadius},${cornerRadius},0,0,1,${-cornerRadius * 2},0`;
|
|
106
|
+
return getSectorPath(cx, cy, innerRadius, outerRadius, startAngle, endAngle);
|
|
107
|
+
}
|
|
108
|
+
let path = `M ${solt.x},${solt.y} A${cornerRadius},${cornerRadius},0,0,${+(sign < 0)},${soct.x},${soct.y} A${outerRadius},${outerRadius},0,${+(outerArcAngle > 180)},${+(sign < 0)},${eoct.x},${eoct.y} A${cornerRadius},${cornerRadius},0,0,${+(sign < 0)},${eolt.x},${eolt.y}`;
|
|
109
|
+
if (innerRadius > 0) {
|
|
110
|
+
const { circleTangency: sict, lineTangency: silt, theta: sit } = getTangentCircle({
|
|
111
|
+
cx,
|
|
112
|
+
cy,
|
|
113
|
+
radius: innerRadius,
|
|
114
|
+
angle: startAngle,
|
|
115
|
+
sign,
|
|
116
|
+
isExternal: true,
|
|
117
|
+
cornerRadius,
|
|
118
|
+
cornerIsExternal
|
|
119
|
+
});
|
|
120
|
+
const { circleTangency: eict, lineTangency: eilt, theta: eit } = getTangentCircle({
|
|
121
|
+
cx,
|
|
122
|
+
cy,
|
|
123
|
+
radius: innerRadius,
|
|
124
|
+
angle: endAngle,
|
|
125
|
+
sign: -sign,
|
|
126
|
+
isExternal: true,
|
|
127
|
+
cornerRadius,
|
|
128
|
+
cornerIsExternal
|
|
129
|
+
});
|
|
130
|
+
const innerArcAngle = cornerIsExternal ? Math.abs(startAngle - endAngle) : Math.abs(startAngle - endAngle) - sit - eit;
|
|
131
|
+
if (innerArcAngle < 0 && cornerRadius === 0) return `${path}L${cx},${cy}Z`;
|
|
132
|
+
path += `L${eilt.x},${eilt.y} A${cornerRadius},${cornerRadius},0,0,${+(sign < 0)},${eict.x},${eict.y} A${innerRadius},${innerRadius},0,${+(innerArcAngle > 180)},${+(sign > 0)},${sict.x},${sict.y} A${cornerRadius},${cornerRadius},0,0,${+(sign < 0)},${silt.x},${silt.y}Z`;
|
|
133
|
+
} else path += `L${cx},${cy}Z`;
|
|
134
|
+
return path;
|
|
135
|
+
}
|
|
136
|
+
var Sector = /* @__PURE__ */ defineComponent({
|
|
137
|
+
name: "Sector",
|
|
138
|
+
props: SectorVueProps,
|
|
139
|
+
setup(props, { attrs }) {
|
|
140
|
+
return () => {
|
|
141
|
+
const { cx, cy, innerRadius, outerRadius, startAngle, endAngle, cornerRadius, forceCornerRadius, cornerIsExternal, className } = props;
|
|
142
|
+
if (outerRadius <= 0 || outerRadius < innerRadius || startAngle === endAngle) return null;
|
|
143
|
+
const deltaRadius = outerRadius - innerRadius;
|
|
144
|
+
const cr = getPercentValue(cornerRadius, deltaRadius, 0, true);
|
|
145
|
+
let path;
|
|
146
|
+
if (cr > 0 && Math.abs(startAngle - endAngle) < 360) path = getSectorWithCorner(cx, cy, innerRadius, outerRadius, Math.min(cr, deltaRadius / 2), forceCornerRadius, cornerIsExternal, startAngle, endAngle);
|
|
147
|
+
else path = getSectorPath(cx, cy, innerRadius, outerRadius, startAngle, endAngle);
|
|
148
|
+
return createVNode("path", mergeProps(attrs, {
|
|
149
|
+
"class": ["v-charts-sector", className],
|
|
150
|
+
"d": path
|
|
151
|
+
}), null);
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
//#endregion
|
|
156
|
+
export { Sector };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { isNumber } from "../utils/validate.mjs";
|
|
2
|
+
import { createVNode, mergeProps } from "vue";
|
|
3
|
+
import { symbol, symbolCircle, symbolCross, symbolDiamond, symbolSquare, symbolStar, symbolTriangle, symbolWye } from "victory-vendor/d3-shape";
|
|
4
|
+
import { upperFirst } from "es-toolkit/compat";
|
|
5
|
+
//#region src/shape/Symbols.tsx
|
|
6
|
+
var symbolFactories = {
|
|
7
|
+
symbolCircle,
|
|
8
|
+
symbolCross,
|
|
9
|
+
symbolDiamond,
|
|
10
|
+
symbolSquare,
|
|
11
|
+
symbolStar,
|
|
12
|
+
symbolTriangle,
|
|
13
|
+
symbolWye
|
|
14
|
+
};
|
|
15
|
+
var RADIAN = Math.PI / 180;
|
|
16
|
+
var getSymbolFactory = (type) => {
|
|
17
|
+
return symbolFactories[`symbol${upperFirst(type)}`] || symbolCircle;
|
|
18
|
+
};
|
|
19
|
+
var calculateAreaSize = (size, sizeType, type) => {
|
|
20
|
+
if (sizeType === "area") return size;
|
|
21
|
+
switch (type) {
|
|
22
|
+
case "cross": return 5 * size * size / 9;
|
|
23
|
+
case "diamond": return .5 * size * size / Math.sqrt(3);
|
|
24
|
+
case "square": return size * size;
|
|
25
|
+
case "star": {
|
|
26
|
+
const angle = 18 * RADIAN;
|
|
27
|
+
return 1.25 * size * size * (Math.tan(angle) - Math.tan(angle * 2) * Math.tan(angle) ** 2);
|
|
28
|
+
}
|
|
29
|
+
case "triangle": return Math.sqrt(3) * size * size / 4;
|
|
30
|
+
case "wye": return (21 - 10 * Math.sqrt(3)) * size * size / 8;
|
|
31
|
+
default: return Math.PI * size * size / 4;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
function Symbols(props) {
|
|
35
|
+
const { type = "circle", size = 64, sizeType = "area", cx, cy, className, ...rest } = props;
|
|
36
|
+
let realType = "circle";
|
|
37
|
+
if (typeof type === "string") realType = type;
|
|
38
|
+
const getPath = () => {
|
|
39
|
+
const symbolFactory = getSymbolFactory(realType);
|
|
40
|
+
const s = symbol().type(symbolFactory).size(calculateAreaSize(size, sizeType, realType))();
|
|
41
|
+
if (s === null) return;
|
|
42
|
+
return s;
|
|
43
|
+
};
|
|
44
|
+
if (isNumber(cx) && isNumber(cy) && isNumber(size)) return createVNode("path", mergeProps(rest, {
|
|
45
|
+
"class": ["v-charts-symbols", className].filter(Boolean).join(" "),
|
|
46
|
+
"transform": `translate(${cx}, ${cy})`,
|
|
47
|
+
"d": getPath()
|
|
48
|
+
}), null);
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
export { Symbols };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { createVNode, defineComponent, mergeProps } from "vue";
|
|
2
|
+
//#region src/shape/Trapezoid.tsx
|
|
3
|
+
var TrapezoidVueProps = {
|
|
4
|
+
className: {
|
|
5
|
+
type: String,
|
|
6
|
+
default: void 0
|
|
7
|
+
},
|
|
8
|
+
x: {
|
|
9
|
+
type: Number,
|
|
10
|
+
default: 0
|
|
11
|
+
},
|
|
12
|
+
y: {
|
|
13
|
+
type: Number,
|
|
14
|
+
default: 0
|
|
15
|
+
},
|
|
16
|
+
upperWidth: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 0
|
|
19
|
+
},
|
|
20
|
+
lowerWidth: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default: 0
|
|
23
|
+
},
|
|
24
|
+
height: {
|
|
25
|
+
type: Number,
|
|
26
|
+
default: 0
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
function getTrapezoidPath(x, y, upperWidth, lowerWidth, height) {
|
|
30
|
+
const upperLeft = x;
|
|
31
|
+
const upperRight = x + upperWidth;
|
|
32
|
+
const lowerLeft = x + (upperWidth - lowerWidth) / 2;
|
|
33
|
+
const lowerRight = x + (upperWidth + lowerWidth) / 2;
|
|
34
|
+
const bottom = y + height;
|
|
35
|
+
return `M ${upperLeft},${y} L ${upperRight},${y} L ${lowerRight},${bottom} L ${lowerLeft},${bottom} Z`;
|
|
36
|
+
}
|
|
37
|
+
var Trapezoid = /* @__PURE__ */ defineComponent({
|
|
38
|
+
name: "Trapezoid",
|
|
39
|
+
props: TrapezoidVueProps,
|
|
40
|
+
setup(props, { attrs }) {
|
|
41
|
+
return () => {
|
|
42
|
+
const { x, y, upperWidth, lowerWidth, height, className } = props;
|
|
43
|
+
if (x !== +x || y !== +y || upperWidth !== +upperWidth || lowerWidth !== +lowerWidth || height !== +height || height === 0) return null;
|
|
44
|
+
return createVNode("path", mergeProps(attrs, {
|
|
45
|
+
"class": ["v-charts-trapezoid", className],
|
|
46
|
+
"d": getTrapezoidPath(x, y, upperWidth, lowerWidth, height)
|
|
47
|
+
}), null);
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
//#endregion
|
|
52
|
+
export { Trapezoid };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { useAppDispatch } from "./hooks.mjs";
|
|
2
|
+
import { updateOptions } from "./rootPropsSlice.mjs";
|
|
3
|
+
import { defineComponent, watchEffect } from "vue";
|
|
4
|
+
//#region src/state/ReportChartProps.tsx
|
|
5
|
+
var ReportChartProps_default = /* @__PURE__ */ defineComponent({
|
|
6
|
+
name: "ReportChartProps",
|
|
7
|
+
props: {
|
|
8
|
+
accessibilityLayer: {
|
|
9
|
+
type: Boolean,
|
|
10
|
+
default: true
|
|
11
|
+
},
|
|
12
|
+
barCategoryGap: {
|
|
13
|
+
type: [Number, String],
|
|
14
|
+
default: "10%"
|
|
15
|
+
},
|
|
16
|
+
barGap: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 4
|
|
19
|
+
},
|
|
20
|
+
barSize: {
|
|
21
|
+
type: [String, Number],
|
|
22
|
+
default: void 0
|
|
23
|
+
},
|
|
24
|
+
class: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: void 0
|
|
27
|
+
},
|
|
28
|
+
maxBarSize: {
|
|
29
|
+
type: Number,
|
|
30
|
+
default: void 0
|
|
31
|
+
},
|
|
32
|
+
stackOffset: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "none"
|
|
35
|
+
},
|
|
36
|
+
syncId: {
|
|
37
|
+
type: [Number, String],
|
|
38
|
+
default: void 0
|
|
39
|
+
},
|
|
40
|
+
syncMethod: {
|
|
41
|
+
type: [String, Function],
|
|
42
|
+
default: "index"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
setup(props) {
|
|
46
|
+
const dispatch = useAppDispatch();
|
|
47
|
+
watchEffect(() => {
|
|
48
|
+
dispatch(updateOptions({
|
|
49
|
+
accessibilityLayer: props.accessibilityLayer,
|
|
50
|
+
barCategoryGap: props.barCategoryGap,
|
|
51
|
+
barGap: props.barGap,
|
|
52
|
+
barSize: props.barSize,
|
|
53
|
+
class: props.class,
|
|
54
|
+
maxBarSize: props.maxBarSize,
|
|
55
|
+
stackOffset: props.stackOffset,
|
|
56
|
+
syncId: props.syncId,
|
|
57
|
+
syncMethod: props.syncMethod
|
|
58
|
+
}));
|
|
59
|
+
});
|
|
60
|
+
return () => null;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
//#endregion
|
|
64
|
+
export { ReportChartProps_default as default };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { useAppDispatch } from "./hooks.mjs";
|
|
2
|
+
import { setChartSize, setLayout, setMargin } from "./layoutSlice.mjs";
|
|
3
|
+
import { defineComponent, watch } from "vue";
|
|
4
|
+
//#region src/state/ReportMainChartProps.ts
|
|
5
|
+
var ReportMainChartProps = defineComponent({
|
|
6
|
+
name: "ReportMainChartProps",
|
|
7
|
+
props: {
|
|
8
|
+
width: {
|
|
9
|
+
type: Number,
|
|
10
|
+
required: true
|
|
11
|
+
},
|
|
12
|
+
height: {
|
|
13
|
+
type: Number,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
layout: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: true
|
|
19
|
+
},
|
|
20
|
+
margin: {
|
|
21
|
+
type: Object,
|
|
22
|
+
required: true
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
setup(props) {
|
|
26
|
+
const dispatch = useAppDispatch();
|
|
27
|
+
watch([
|
|
28
|
+
() => props.width,
|
|
29
|
+
() => props.height,
|
|
30
|
+
() => props.layout,
|
|
31
|
+
() => props.margin
|
|
32
|
+
], () => {
|
|
33
|
+
dispatch(setLayout(props.layout));
|
|
34
|
+
dispatch(setChartSize({
|
|
35
|
+
width: props.width,
|
|
36
|
+
height: props.height
|
|
37
|
+
}));
|
|
38
|
+
dispatch(setMargin(props.margin));
|
|
39
|
+
}, { immediate: true });
|
|
40
|
+
return () => {
|
|
41
|
+
return null;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
//#endregion
|
|
46
|
+
export { ReportMainChartProps };
|