vccs 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +151 -0
- package/dist/animation/Animate.d.ts +1 -1
- package/dist/cartesian/area/type.d.ts +3 -3
- package/dist/cartesian/bar/type.d.ts +1 -13
- package/dist/cartesian/brush/components/Slide.d.ts +1 -1
- package/dist/cartesian/brush/components/TravellerLayer.d.ts +1 -1
- package/dist/cartesian/brush/type.d.ts +2 -1
- package/dist/cartesian/cartesian-axis/CartesianAxis.d.ts +2 -1
- package/dist/cartesian/funnel/Funnel.d.ts +2 -0
- package/dist/cartesian/funnel/index.d.ts +2 -0
- package/dist/cartesian/funnel/type.d.ts +74 -6
- package/dist/cartesian/index.d.ts +2 -0
- package/dist/cartesian/line/Line.d.ts +7 -13
- package/dist/cartesian/line/type.d.ts +4 -17
- package/dist/cartesian/reference-area/ReferenceArea.d.ts +16 -16
- package/dist/cartesian/reference-dot/ReferenceDot.d.ts +143 -0
- package/dist/cartesian/reference-dot/index.d.ts +2 -0
- package/dist/cartesian/reference-line/ReferenceLine.d.ts +8 -8
- package/dist/cartesian/scatter/Scatter.d.ts +1 -1
- package/dist/chart/FunnelChart.d.ts +1 -0
- package/dist/chart/RechartsWrapper.d.ts +7 -3
- package/dist/chart/Surface.d.ts +2 -1
- package/dist/chart/Treemap.d.ts +237 -0
- package/dist/chart/generateCategoricalChart.d.ts +2 -1
- package/dist/chart/index.d.ts +2 -0
- package/dist/chart/treemapUtils.d.ts +22 -0
- package/dist/components/Customized.d.ts +23 -0
- package/dist/components/Text.d.ts +4 -4
- package/dist/components/Tooltip.d.ts +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/label/Label.d.ts +3 -3
- package/dist/components/label/types.d.ts +1 -1
- package/dist/container/Surface.d.ts +3 -2
- package/dist/es/animation/Animate.mjs +48 -22
- package/dist/es/cartesian/GraphicalItemClipPath.mjs +16 -15
- package/dist/es/cartesian/area/ActivePoints.mjs +44 -40
- package/dist/es/cartesian/area/Area.mjs +42 -31
- package/dist/es/cartesian/area/ClipRect.mjs +79 -58
- package/dist/es/cartesian/area/RenderArea.mjs +142 -108
- package/dist/es/cartesian/area/hooks/useArea.mjs +71 -47
- package/dist/es/cartesian/area/type.mjs +13 -15
- package/dist/es/cartesian/area/utils.mjs +69 -49
- package/dist/es/cartesian/axis/XAxis.mjs +87 -73
- package/dist/es/cartesian/axis/YAxis.mjs +67 -56
- package/dist/es/cartesian/bar/Bar.mjs +78 -71
- package/dist/es/cartesian/bar/components/BarBackground.mjs +22 -19
- package/dist/es/cartesian/bar/components/BarRectangles.mjs +117 -80
- package/dist/es/cartesian/bar/hooks/useBar.mjs +49 -37
- package/dist/es/cartesian/bar/type.mjs +11 -25
- package/dist/es/cartesian/bar/utils.mjs +97 -70
- package/dist/es/cartesian/cartesian-axis/CartesianAxis.mjs +165 -115
- package/dist/es/cartesian/cartesian-grid/Background.mjs +19 -16
- package/dist/es/cartesian/cartesian-grid/CartesianGrid.mjs +116 -97
- package/dist/es/cartesian/cartesian-grid/HorizontalGridLines.mjs +24 -23
- package/dist/es/cartesian/cartesian-grid/HorizontalStripes.mjs +24 -24
- package/dist/es/cartesian/cartesian-grid/VerticalGridLines.mjs +23 -22
- package/dist/es/cartesian/cartesian-grid/VerticalStripes.mjs +24 -24
- package/dist/es/cartesian/cartesian-grid/const.mjs +317 -10
- package/dist/es/cartesian/cartesian-grid/utils.mjs +18 -13
- package/dist/es/cartesian/error-bar/ErrorBar.mjs +111 -83
- package/dist/es/cartesian/error-bar/ErrorBarContext.mjs +13 -12
- package/dist/es/cartesian/funnel/Funnel.mjs +162 -0
- package/dist/es/cartesian/funnel/type.mjs +78 -0
- package/dist/es/cartesian/funnel/utils.mjs +102 -0
- package/dist/es/cartesian/line/ActivePoints.mjs +45 -41
- package/dist/es/cartesian/line/Line.mjs +41 -37
- package/dist/es/cartesian/line/StaticLine.mjs +191 -122
- package/dist/es/cartesian/line/hooks/useLine.mjs +60 -44
- package/dist/es/cartesian/line/type.mjs +13 -18
- package/dist/es/cartesian/line/utils.mjs +27 -26
- package/dist/es/cartesian/reference-area/ReferenceArea.mjs +79 -78
- package/dist/es/cartesian/reference-dot/ReferenceDot.mjs +134 -0
- package/dist/es/cartesian/reference-line/ReferenceLine.mjs +93 -84
- package/dist/es/cartesian/scatter/Scatter.mjs +168 -140
- package/dist/es/cartesian/scatter/hooks/useScatter.mjs +18 -14
- package/dist/es/cartesian/useNeedsClip.mjs +18 -9
- package/dist/es/cartesian/utils/get-ticks.mjs +103 -68
- package/dist/es/cartesian/z-axis/ZAxis.mjs +30 -28
- package/dist/es/chart/AreaChart.mjs +5 -5
- package/dist/es/chart/BarChart.mjs +5 -5
- package/dist/es/chart/ComposedChart.mjs +5 -5
- package/dist/es/chart/FunnelChart.mjs +11 -0
- package/dist/es/chart/LegendPortalContext.mjs +3 -3
- package/dist/es/chart/LineChart.mjs +5 -5
- package/dist/es/chart/PieChart.mjs +5 -5
- package/dist/es/chart/RadarChart.mjs +5 -5
- package/dist/es/chart/RadialBarChart.mjs +5 -5
- package/dist/es/chart/RechartsWrapper.mjs +113 -89
- package/dist/es/chart/ScatterChart.mjs +5 -5
- package/dist/es/chart/Surface.mjs +3 -3
- package/dist/es/chart/Surface.vue_vue_type_script_setup_true_lang.mjs +51 -45
- package/dist/es/chart/TooltipPortalContext.mjs +3 -3
- package/dist/es/chart/Treemap.mjs +379 -0
- package/dist/es/chart/const.mjs +2 -2
- package/dist/es/chart/generateCategoricalChart.mjs +99 -89
- package/dist/es/chart/provideClipPathId.mjs +12 -7
- package/dist/es/chart/treemapUtils.mjs +32 -0
- package/dist/es/components/Cell.mjs +16 -4
- package/dist/es/components/Customized.mjs +43 -0
- package/dist/es/components/Text.mjs +3 -3
- package/dist/es/components/Text.vue_vue_type_script_setup_true_lang.mjs +106 -69
- package/dist/es/components/Tooltip.mjs +274 -199
- package/dist/es/components/label/Label.mjs +30 -26
- package/dist/es/components/label/LabelList.mjs +45 -39
- package/dist/es/components/label/types.mjs +10 -6
- package/dist/es/components/label/utils.mjs +194 -162
- package/dist/es/components/legend/Legend.mjs +82 -71
- package/dist/es/components/legend/LegendSymbol.mjs +40 -38
- package/dist/es/components/legend/hooks/useLegend.mjs +71 -46
- package/dist/es/components/legend/hooks/useLegendContent.mjs +52 -31
- package/dist/es/components/legend/type.mjs +2 -2
- package/dist/es/components/legend/utils.mjs +19 -11
- package/dist/es/components/utils.mjs +35 -22
- package/dist/es/container/ClipPath.mjs +14 -14
- package/dist/es/container/Layer.mjs +9 -7
- package/dist/es/container/ResponsiveContainer.mjs +3 -3
- package/dist/es/container/ResponsiveContainer.vue_vue_type_script_setup_true_lang.mjs +109 -77
- package/dist/es/container/Surface.mjs +25 -23
- package/dist/es/container/useSizeContext.mjs +3 -3
- package/dist/es/context/ChartDataContextProvider.mjs +19 -13
- package/dist/es/context/PanoramaContextProvider.mjs +15 -10
- package/dist/es/context/accessibilityContext.mjs +3 -3
- package/dist/es/context/cartesianLabelListContext.mjs +3 -3
- package/dist/es/context/chartLayoutContext.mjs +33 -30
- package/dist/es/context/cursorLayerContext.mjs +3 -3
- package/dist/es/context/graphicalLayerContext.mjs +3 -3
- package/dist/es/context/labelLayerContext.mjs +3 -3
- package/dist/es/context/polarLabelViewBoxContext.mjs +5 -5
- package/dist/es/context/useTooltipAxis.mjs +14 -12
- package/dist/es/events/useChartSynchronisation.mjs +91 -66
- package/dist/es/hooks/publicHooks.mjs +207 -0
- package/dist/es/hooks/useIsAnimating.mjs +28 -0
- package/dist/es/hooks/useSetupGraphicalItem.mjs +52 -43
- package/dist/es/index.mjs +54 -42
- package/dist/es/polar/pie/Pie.mjs +131 -115
- package/dist/es/polar/pie/type.mjs +8 -10
- package/dist/es/polar/radar/PolarAngleAxis.mjs +103 -84
- package/dist/es/polar/radar/PolarGrid.mjs +72 -59
- package/dist/es/polar/radar/PolarRadiusAxis.mjs +90 -65
- package/dist/es/polar/radar/Radar.mjs +181 -145
- package/dist/es/polar/radial-bar/RadialBar.mjs +161 -140
- package/dist/es/polar/radial-bar/type.mjs +9 -9
- package/dist/es/shape/Cross.mjs +11 -10
- package/dist/es/shape/Curve.mjs +71 -44
- package/dist/es/shape/Dot.mjs +12 -11
- package/dist/es/shape/Polygon.mjs +19 -0
- package/dist/es/shape/Rectangle.mjs +41 -30
- package/dist/es/shape/Sector.mjs +105 -79
- package/dist/es/shape/Symbols.mjs +45 -34
- package/dist/es/shape/Trapezoid.mjs +50 -0
- package/dist/es/state/ReportChartProps.mjs +23 -24
- package/dist/es/state/ReportMainChartProps.mjs +26 -21
- package/dist/es/state/ReportPolarOptions.mjs +23 -22
- package/dist/es/state/SetGraphicalItem.mjs +42 -27
- package/dist/es/state/SetLegendPayload.mjs +17 -13
- package/dist/es/state/SetTooltipEntrySettings.mjs +14 -12
- package/dist/es/state/brushSlice.mjs +12 -8
- package/dist/es/state/cartesianAxisSlice.mjs +23 -17
- package/dist/es/state/chartDataSlice.mjs +18 -13
- package/dist/es/state/externalEventsMiddleware.mjs +25 -15
- package/dist/es/state/graphicalItemsSlice.mjs +29 -25
- package/dist/es/state/hooks.mjs +24 -3
- package/dist/es/state/keyboardEventsMiddleware.mjs +50 -42
- package/dist/es/state/layoutSlice.mjs +18 -12
- package/dist/es/state/legendSlice.mjs +19 -14
- package/dist/es/state/mouseEventsMiddleware.mjs +31 -24
- package/dist/es/state/optionsSlice.mjs +14 -11
- package/dist/es/state/polarAxisSlice.mjs +15 -13
- package/dist/es/state/polarOptionsSlice.mjs +8 -6
- package/dist/es/state/reduxDevtoolsJsonStringifyReplacer.mjs +5 -3
- package/dist/es/state/referenceElementsSlice.mjs +21 -19
- package/dist/es/state/rootPropsSlice.mjs +20 -9
- package/dist/es/state/selectors/areaSelectors.mjs +65 -55
- package/dist/es/state/selectors/axisSelectors.mjs +784 -569
- package/dist/es/state/selectors/barSelectors.mjs +225 -162
- package/dist/es/state/selectors/brushSelectors.mjs +15 -14
- package/dist/es/state/selectors/combiners/combineActiveLabel.mjs +6 -5
- package/dist/es/state/selectors/combiners/combineActiveTooltipIndex.mjs +36 -27
- package/dist/es/state/selectors/combiners/combineAxisRangeWithReverse.mjs +5 -3
- package/dist/es/state/selectors/combiners/combineCoordinateForDefaultIndex.mjs +13 -11
- package/dist/es/state/selectors/combiners/combineTooltipInteractionState.mjs +26 -21
- package/dist/es/state/selectors/combiners/combineTooltipPayloadConfigurations.mjs +10 -6
- package/dist/es/state/selectors/common.mjs +2 -2
- package/dist/es/state/selectors/containerSelectors.mjs +5 -2
- package/dist/es/state/selectors/dataSelectors.mjs +28 -9
- package/dist/es/state/selectors/funnelSelectors.mjs +38 -0
- package/dist/es/state/selectors/legendSelectors.mjs +7 -6
- package/dist/es/state/selectors/lineSelectors.mjs +54 -47
- package/dist/es/state/selectors/pickAxisId.mjs +2 -2
- package/dist/es/state/selectors/pickAxisType.mjs +2 -2
- package/dist/es/state/selectors/pieSelectors.mjs +116 -81
- package/dist/es/state/selectors/polarAxisSelectors.mjs +113 -94
- package/dist/es/state/selectors/polarGridSelectors.mjs +13 -11
- package/dist/es/state/selectors/polarScaleSelectors.mjs +49 -46
- package/dist/es/state/selectors/polarSelectors.mjs +79 -62
- package/dist/es/state/selectors/radarSelectors.mjs +111 -91
- package/dist/es/state/selectors/radialBarSelectors.mjs +230 -183
- package/dist/es/state/selectors/rootPropsSelectors.mjs +11 -5
- package/dist/es/state/selectors/scatterSelectors.mjs +111 -95
- package/dist/es/state/selectors/selectActivePropsFromChartPointer.mjs +19 -17
- package/dist/es/state/selectors/selectAllAxes.mjs +8 -3
- package/dist/es/state/selectors/selectChartOffset.mjs +59 -50
- package/dist/es/state/selectors/selectChartOffsetInternal.mjs +55 -44
- package/dist/es/state/selectors/selectTooltipEventType.mjs +15 -14
- package/dist/es/state/selectors/selectTooltipPayloadSearcher.mjs +3 -3
- package/dist/es/state/selectors/selectTooltipSettings.mjs +2 -2
- package/dist/es/state/selectors/selectTooltipState.mjs +2 -2
- package/dist/es/state/selectors/selectors.mjs +94 -75
- package/dist/es/state/selectors/tooltipSelectors.mjs +253 -204
- package/dist/es/state/selectors/touchSelectors.mjs +17 -14
- package/dist/es/state/store.mjs +46 -46
- package/dist/es/state/tooltipSlice.mjs +64 -37
- package/dist/es/state/touchEventsMiddleware.mjs +35 -29
- package/dist/es/state/utils/useReportScale.mjs +16 -13
- package/dist/es/synchronisation/syncSelectors.mjs +3 -3
- package/dist/es/synchronisation/useChartSynchronisation.mjs +33 -19
- package/dist/es/types/common.mjs +12 -0
- package/dist/es/types/event.mjs +164 -2
- package/dist/es/utils/ReduceCSSCalc.mjs +81 -49
- package/dist/es/utils/VueUtils.mjs +35 -14
- package/dist/es/utils/attrs.mjs +43 -26
- package/dist/es/utils/cartesian.mjs +47 -15
- package/dist/es/utils/cell.mjs +28 -0
- package/dist/es/utils/chart.mjs +298 -197
- package/dist/es/utils/const.mjs +30 -2
- package/dist/es/utils/createCategoricalInverse.mjs +46 -0
- package/dist/es/utils/createContext.mjs +28 -9
- package/dist/es/utils/data-utils.mjs +9 -8
- package/dist/es/utils/data.mjs +35 -21
- package/dist/es/utils/events.mjs +5 -3
- package/dist/es/utils/getLinearRegression.mjs +28 -11
- package/dist/es/utils/grid.mjs +20 -5
- package/dist/es/utils/isDomainSpecifiedByUser.mjs +105 -54
- package/dist/es/utils/legend.mjs +13 -12
- package/dist/es/utils/log.mjs +10 -7
- package/dist/es/utils/payload/getUniqPayload.mjs +6 -4
- package/dist/es/utils/polar.mjs +37 -30
- package/dist/es/utils/props.mjs +16 -10
- package/dist/es/utils/resolveDefaultProps.mjs +23 -4
- package/dist/es/utils/scale/getNiceTickValues.mjs +127 -49
- package/dist/es/utils/scale/utils/arithmetic.mjs +49 -19
- package/dist/es/utils/scale/utils/utils.mjs +43 -24
- package/dist/es/utils/scale.mjs +46 -0
- package/dist/es/utils/style.mjs +24 -13
- package/dist/es/utils/tick.mjs +34 -23
- package/dist/es/utils/tooltip/translate.mjs +63 -49
- package/dist/es/utils/validate.mjs +40 -29
- package/dist/hooks/publicHooks.d.ts +143 -0
- package/dist/hooks/useIsAnimating.d.ts +14 -0
- package/dist/index.d.ts +1 -0
- package/dist/polar/pie/type.d.ts +2 -2
- package/dist/polar/radar/Radar.d.ts +4 -4
- package/dist/shape/Curve.d.ts +2 -1
- package/dist/shape/Polygon.d.ts +9 -0
- package/dist/shape/Rectangle.d.ts +0 -4
- package/dist/shape/Sector.d.ts +2 -2
- package/dist/shape/Symbols.d.ts +2 -1
- package/dist/shape/Trapezoid.d.ts +30 -0
- package/dist/shape/index.d.ts +2 -0
- package/dist/shape/types.d.ts +4 -5
- package/dist/state/ReportChartProps.d.ts +3 -3
- package/dist/state/graphicalItemsSlice.d.ts +1 -1
- package/dist/state/rootPropsSlice.d.ts +2 -2
- package/dist/state/selectors/axisSelectors.d.ts +5 -0
- package/dist/types/axis.d.ts +2 -2
- package/dist/types/bar.d.ts +2 -6
- package/dist/types/categorical.d.ts +2 -2
- package/dist/types/common.d.ts +7 -1
- package/dist/types/tooltip.d.ts +2 -2
- package/dist/utils/cell.d.ts +11 -0
- package/dist/utils/createCategoricalInverse.d.ts +16 -0
- package/dist/utils/scale.d.ts +23 -0
- package/package.json +2 -1
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { filterProps
|
|
2
|
-
import { createVNode
|
|
1
|
+
import { filterProps } from "../utils/VueUtils.mjs";
|
|
2
|
+
import { createVNode, defineComponent, mergeProps } from "vue";
|
|
3
3
|
//#region src/container/Layer.tsx
|
|
4
|
-
var
|
|
4
|
+
var Layer = /* @__PURE__ */ defineComponent({
|
|
5
5
|
name: "VChartsLayer",
|
|
6
|
-
inheritAttrs:
|
|
7
|
-
setup(
|
|
8
|
-
return () =>
|
|
6
|
+
inheritAttrs: false,
|
|
7
|
+
setup(_, { attrs, slots }) {
|
|
8
|
+
return () => {
|
|
9
|
+
return createVNode("g", mergeProps(attrs, filterProps(attrs, true), { "class": "v-charts-layer" }), [slots.default?.()]);
|
|
10
|
+
};
|
|
9
11
|
}
|
|
10
12
|
});
|
|
11
13
|
//#endregion
|
|
12
|
-
export {
|
|
14
|
+
export { Layer };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ResponsiveContainer_vue_vue_type_script_setup_true_lang_default from "./ResponsiveContainer.vue_vue_type_script_setup_true_lang.mjs";
|
|
2
2
|
//#region src/container/ResponsiveContainer.vue
|
|
3
|
-
var
|
|
3
|
+
var ResponsiveContainer_default = ResponsiveContainer_vue_vue_type_script_setup_true_lang_default;
|
|
4
4
|
//#endregion
|
|
5
|
-
export {
|
|
5
|
+
export { ResponsiveContainer_default as default };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { isPercent
|
|
2
|
-
import { normalizeStyle as
|
|
3
|
-
import { provideSizeContext
|
|
4
|
-
import { Fragment
|
|
5
|
-
import { useThrottleFn
|
|
1
|
+
import { isPercent } from "../utils/validate.mjs";
|
|
2
|
+
import { normalizeStyle as normalizeStyle$1 } from "../utils/style.mjs";
|
|
3
|
+
import { provideSizeContext } from "./useSizeContext.mjs";
|
|
4
|
+
import { Fragment, cloneVNode, computed, createBlock, createElementBlock, defineComponent, normalizeClass, normalizeStyle, onMounted, onUnmounted, openBlock, ref, resolveDynamicComponent, toRef, useSlots } from "vue";
|
|
5
|
+
import { useThrottleFn } from "@vueuse/core";
|
|
6
6
|
//#region src/container/ResponsiveContainer.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var
|
|
7
|
+
var _hoisted_1 = ["id"];
|
|
8
|
+
var ResponsiveContainer_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
8
9
|
name: "ResponsiveContainer",
|
|
9
|
-
inheritAttrs:
|
|
10
|
+
inheritAttrs: false,
|
|
10
11
|
__name: "ResponsiveContainer",
|
|
11
12
|
props: {
|
|
12
13
|
aspect: {},
|
|
@@ -25,88 +26,119 @@ var y = ["id"], b = /* @__PURE__ */ c({
|
|
|
25
26
|
style: {},
|
|
26
27
|
onResize: {}
|
|
27
28
|
},
|
|
28
|
-
setup(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}), E = a(() => {
|
|
36
|
-
let e = w.value;
|
|
37
|
-
return b.aspect && b.aspect > 0 && b.height && (b.width == null || b.width === "auto") && (e = T.value * b.aspect), e;
|
|
29
|
+
setup(__props) {
|
|
30
|
+
const props = __props;
|
|
31
|
+
const slots = useSlots();
|
|
32
|
+
const debounce = toRef(props, "debounce");
|
|
33
|
+
const sizes = ref({
|
|
34
|
+
width: props.initialDimension.width,
|
|
35
|
+
height: props.initialDimension.height
|
|
38
36
|
});
|
|
39
|
-
|
|
40
|
-
sizes:
|
|
41
|
-
calculatedWidth: E,
|
|
42
|
-
calculatedHeight: T
|
|
37
|
+
const calculatedWidth = computed(() => {
|
|
38
|
+
return isPercent(props.width) ? sizes.value.width : props.width;
|
|
43
39
|
});
|
|
44
|
-
|
|
45
|
-
let
|
|
46
|
-
|
|
47
|
-
width
|
|
48
|
-
height
|
|
49
|
-
}
|
|
40
|
+
const calculatedHeight = computed(() => {
|
|
41
|
+
let height = isPercent(props.height) ? sizes.value.height : props.height;
|
|
42
|
+
if (props.aspect && props.aspect > 0) {
|
|
43
|
+
if (props.width && (props.height == null || props.height === "auto")) height = calculatedWidth.value / props.aspect;
|
|
44
|
+
else if (props.height && (props.width == null || props.width === "auto")) {}
|
|
45
|
+
}
|
|
46
|
+
return height;
|
|
47
|
+
});
|
|
48
|
+
const finalCalculatedWidth = computed(() => {
|
|
49
|
+
let width = calculatedWidth.value;
|
|
50
|
+
if (props.aspect && props.aspect > 0) {
|
|
51
|
+
if (props.height && (props.width == null || props.width === "auto")) width = calculatedHeight.value * props.aspect;
|
|
52
|
+
}
|
|
53
|
+
return width;
|
|
54
|
+
});
|
|
55
|
+
provideSizeContext({
|
|
56
|
+
sizes,
|
|
57
|
+
calculatedWidth: finalCalculatedWidth,
|
|
58
|
+
calculatedHeight
|
|
59
|
+
});
|
|
60
|
+
function setContainerSize(width, height) {
|
|
61
|
+
const roundedWidth = Math.round(width);
|
|
62
|
+
const roundedHeight = Math.round(height);
|
|
63
|
+
const { width: containerWidth, height: containerHeight } = sizes.value;
|
|
64
|
+
if (containerWidth === roundedWidth && containerHeight === roundedHeight) return;
|
|
65
|
+
sizes.value = {
|
|
66
|
+
width: roundedWidth,
|
|
67
|
+
height: roundedHeight
|
|
68
|
+
};
|
|
50
69
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
70
|
+
const handleResize = useThrottleFn((entries) => {
|
|
71
|
+
const { width: containerWidth, height: containerHeight } = entries[0].contentRect;
|
|
72
|
+
setContainerSize(containerWidth, containerHeight);
|
|
73
|
+
props.onResize?.(containerWidth, containerHeight);
|
|
74
|
+
}, debounce, true, false);
|
|
75
|
+
const containerRef = ref();
|
|
76
|
+
let observer = null;
|
|
77
|
+
onMounted(() => {
|
|
78
|
+
observer = new ResizeObserver(handleResize);
|
|
79
|
+
const { width: containerWidth, height: containerHeight } = containerRef.value.getBoundingClientRect() ?? {
|
|
58
80
|
width: 0,
|
|
59
81
|
height: 0
|
|
60
82
|
};
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
83
|
+
setContainerSize(containerWidth, containerHeight);
|
|
84
|
+
observer.observe(containerRef.value);
|
|
85
|
+
});
|
|
86
|
+
onUnmounted(() => {
|
|
87
|
+
observer?.disconnect();
|
|
64
88
|
});
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return
|
|
89
|
+
const isReady = computed(() => {
|
|
90
|
+
const { width: containerWidth, height: containerHeight } = sizes.value;
|
|
91
|
+
return containerWidth >= 0 && containerHeight >= 0;
|
|
68
92
|
});
|
|
69
|
-
function
|
|
70
|
-
|
|
71
|
-
for (
|
|
72
|
-
|
|
93
|
+
function flattenSlotChildren(vnodes) {
|
|
94
|
+
const result = [];
|
|
95
|
+
for (const vnode of vnodes) if (vnode.type === Fragment && Array.isArray(vnode.children)) result.push(...flattenSlotChildren(vnode.children));
|
|
96
|
+
else result.push(vnode);
|
|
97
|
+
return result;
|
|
73
98
|
}
|
|
74
|
-
function
|
|
75
|
-
if (!
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
99
|
+
function renderChildren() {
|
|
100
|
+
if (!isReady.value) return;
|
|
101
|
+
const calculatedWidthValue = finalCalculatedWidth.value;
|
|
102
|
+
const calculatedHeightValue = calculatedHeight.value;
|
|
103
|
+
const rawChildren = slots.default?.();
|
|
104
|
+
if (!rawChildren) return void 0;
|
|
105
|
+
return flattenSlotChildren(rawChildren).map((child, index) => {
|
|
106
|
+
return cloneVNode(child, {
|
|
107
|
+
width: calculatedWidthValue,
|
|
108
|
+
height: calculatedHeightValue,
|
|
109
|
+
key: child.key || `responsive-child-${index}`,
|
|
110
|
+
style: {
|
|
111
|
+
...normalizeStyle$1({
|
|
112
|
+
maxHeight: sizes.value.height,
|
|
113
|
+
maxWidth: sizes.value.width
|
|
114
|
+
}),
|
|
115
|
+
height: "100%",
|
|
116
|
+
width: "100%",
|
|
117
|
+
...child.props?.style
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
});
|
|
91
121
|
}
|
|
92
|
-
|
|
93
|
-
...
|
|
94
|
-
...
|
|
95
|
-
width:
|
|
96
|
-
height:
|
|
97
|
-
minWidth:
|
|
98
|
-
minHeight:
|
|
99
|
-
maxHeight:
|
|
122
|
+
const containerStyle = computed(() => ({
|
|
123
|
+
...props.style,
|
|
124
|
+
...normalizeStyle$1({
|
|
125
|
+
width: props.width,
|
|
126
|
+
height: props.height,
|
|
127
|
+
minWidth: props.minWidth,
|
|
128
|
+
minHeight: props.minHeight,
|
|
129
|
+
maxHeight: props.maxHeight
|
|
100
130
|
})
|
|
101
131
|
}));
|
|
102
|
-
return (
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
132
|
+
return (_ctx, _cache) => {
|
|
133
|
+
return openBlock(), createElementBlock("div", {
|
|
134
|
+
id: _ctx.id ? `${_ctx.id}` : void 0,
|
|
135
|
+
ref_key: "containerRef",
|
|
136
|
+
ref: containerRef,
|
|
137
|
+
class: normalizeClass(["vcharts-responsive-container", [props.class]]),
|
|
138
|
+
style: normalizeStyle(containerStyle.value)
|
|
139
|
+
}, [(openBlock(), createBlock(resolveDynamicComponent(() => renderChildren())))], 14, _hoisted_1);
|
|
140
|
+
};
|
|
109
141
|
}
|
|
110
142
|
});
|
|
111
143
|
//#endregion
|
|
112
|
-
export {
|
|
144
|
+
export { ResponsiveContainer_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { classProp } from "../types/common.mjs";
|
|
2
|
+
import { createVNode, defineComponent, mergeProps } from "vue";
|
|
2
3
|
//#region src/container/Surface.tsx
|
|
3
|
-
|
|
4
|
+
/**
|
|
5
|
+
* @fileOverview Surface component for SVG rendering
|
|
6
|
+
*/
|
|
7
|
+
var Surface = /* @__PURE__ */ defineComponent({
|
|
4
8
|
name: "Surface",
|
|
5
9
|
props: {
|
|
6
10
|
width: {
|
|
7
11
|
type: Number,
|
|
8
|
-
required:
|
|
12
|
+
required: true
|
|
9
13
|
},
|
|
10
14
|
height: {
|
|
11
15
|
type: Number,
|
|
12
|
-
required:
|
|
16
|
+
required: true
|
|
13
17
|
},
|
|
14
18
|
viewBox: {
|
|
15
19
|
type: Object,
|
|
16
20
|
default: void 0
|
|
17
21
|
},
|
|
18
|
-
class:
|
|
19
|
-
type: String,
|
|
20
|
-
default: void 0
|
|
21
|
-
},
|
|
22
|
+
class: classProp,
|
|
22
23
|
style: {
|
|
23
24
|
type: Object,
|
|
24
25
|
default: void 0
|
|
@@ -32,27 +33,28 @@ var r = /* @__PURE__ */ t({
|
|
|
32
33
|
default: void 0
|
|
33
34
|
}
|
|
34
35
|
},
|
|
35
|
-
setup(
|
|
36
|
+
setup(props, { slots, attrs }) {
|
|
36
37
|
return () => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
const { width, height, viewBox, class: className, style, title, desc, ...rest } = props;
|
|
39
|
+
const svgView = viewBox || {
|
|
40
|
+
width,
|
|
41
|
+
height,
|
|
40
42
|
x: 0,
|
|
41
43
|
y: 0
|
|
42
44
|
};
|
|
43
|
-
return
|
|
44
|
-
class: ["vcharts-surface",
|
|
45
|
-
width:
|
|
46
|
-
height:
|
|
47
|
-
style:
|
|
48
|
-
viewBox: `${
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
return createVNode("svg", mergeProps({
|
|
46
|
+
"class": ["vcharts-surface", className],
|
|
47
|
+
"width": width,
|
|
48
|
+
"height": height,
|
|
49
|
+
"style": style,
|
|
50
|
+
"viewBox": `${svgView.x} ${svgView.y} ${svgView.width} ${svgView.height}`
|
|
51
|
+
}, rest, attrs), [
|
|
52
|
+
title && createVNode("title", null, [title]),
|
|
53
|
+
desc && createVNode("desc", null, [desc]),
|
|
54
|
+
slots.default?.()
|
|
53
55
|
]);
|
|
54
56
|
};
|
|
55
57
|
}
|
|
56
58
|
});
|
|
57
59
|
//#endregion
|
|
58
|
-
export {
|
|
60
|
+
export { Surface as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createContext
|
|
1
|
+
import { createContext } from "../utils/createContext.mjs";
|
|
2
2
|
//#region src/container/useSizeContext.ts
|
|
3
|
-
var [
|
|
3
|
+
var [useSizeContext, provideSizeContext] = createContext("SizeContext");
|
|
4
4
|
//#endregion
|
|
5
|
-
export {
|
|
5
|
+
export { provideSizeContext };
|
|
@@ -1,21 +1,27 @@
|
|
|
1
|
-
import { useAppDispatch
|
|
2
|
-
import { setChartData
|
|
3
|
-
import { defineComponent
|
|
1
|
+
import { useAppDispatch } from "../state/hooks.mjs";
|
|
2
|
+
import { setChartData } from "../state/chartDataSlice.mjs";
|
|
3
|
+
import { defineComponent, onUnmounted, watch } from "vue";
|
|
4
4
|
//#region src/context/ChartDataContextProvider.ts
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* ChartDataContextProvider for Vue
|
|
7
|
+
* Sets chartData in store on mount/update, clears on unmount. Renders nothing.
|
|
8
|
+
*/
|
|
9
|
+
var ChartDataContextProvider = defineComponent({
|
|
6
10
|
name: "ChartDataContextProvider",
|
|
7
11
|
props: { chartData: {
|
|
8
12
|
type: Array,
|
|
9
|
-
required:
|
|
13
|
+
required: true
|
|
10
14
|
} },
|
|
11
|
-
setup(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}, { immediate:
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
setup(props) {
|
|
16
|
+
const dispatch = useAppDispatch();
|
|
17
|
+
watch(() => props.chartData, (val) => {
|
|
18
|
+
dispatch(setChartData(Array.from(val)));
|
|
19
|
+
}, { immediate: true });
|
|
20
|
+
onUnmounted(() => {
|
|
21
|
+
dispatch(setChartData(void 0));
|
|
22
|
+
});
|
|
23
|
+
return () => null;
|
|
18
24
|
}
|
|
19
25
|
});
|
|
20
26
|
//#endregion
|
|
21
|
-
export {
|
|
27
|
+
export { ChartDataContextProvider };
|
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
import { createContext
|
|
2
|
-
import { defineComponent
|
|
1
|
+
import { createContext } from "../utils/createContext.mjs";
|
|
2
|
+
import { defineComponent } from "vue";
|
|
3
3
|
//#region src/context/PanoramaContextProvider.ts
|
|
4
|
-
var [
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
var [injectPanorama, providePanoramaContext] = createContext("PanoramaContext");
|
|
5
|
+
/**
|
|
6
|
+
* useIsPanorama composable
|
|
7
|
+
* Returns the injected isPanorama value (default: false)
|
|
8
|
+
*/
|
|
9
|
+
function useIsPanorama() {
|
|
10
|
+
return injectPanorama(false);
|
|
7
11
|
}
|
|
8
|
-
|
|
12
|
+
defineComponent({
|
|
9
13
|
name: "PanoramaContextProvider",
|
|
10
14
|
props: { isPanorama: {
|
|
11
15
|
type: Boolean,
|
|
12
|
-
required:
|
|
16
|
+
required: true
|
|
13
17
|
} },
|
|
14
|
-
setup(
|
|
15
|
-
|
|
18
|
+
setup(props, { slots }) {
|
|
19
|
+
providePanoramaContext(true);
|
|
20
|
+
return () => slots.default?.();
|
|
16
21
|
}
|
|
17
22
|
});
|
|
18
23
|
//#endregion
|
|
19
|
-
export {
|
|
24
|
+
export { useIsPanorama };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useAppSelector
|
|
1
|
+
import { useAppSelector } from "../state/hooks.mjs";
|
|
2
2
|
//#region src/context/accessibilityContext.tsx
|
|
3
|
-
var
|
|
3
|
+
var useAccessibilityLayer = () => useAppSelector((state) => state.rootProps.accessibilityLayer);
|
|
4
4
|
//#endregion
|
|
5
|
-
export {
|
|
5
|
+
export { useAccessibilityLayer };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createContext
|
|
1
|
+
import { createContext } from "../utils/createContext.mjs";
|
|
2
2
|
//#region src/context/cartesianLabelListContext.ts
|
|
3
|
-
var [
|
|
3
|
+
var [useCartesianLabelListData, provideCartesianLabelListData] = createContext("CartesianLabelListContext");
|
|
4
4
|
//#endregion
|
|
5
|
-
export {
|
|
5
|
+
export { provideCartesianLabelListData, useCartesianLabelListData };
|
|
@@ -1,46 +1,49 @@
|
|
|
1
|
-
import { useIsPanorama
|
|
2
|
-
import { selectChartHeight
|
|
3
|
-
import { selectChartOffset
|
|
4
|
-
import { selectBrushDimensions
|
|
5
|
-
import { selectChartLayout
|
|
6
|
-
import { useAppSelector
|
|
7
|
-
import { selectChartOffsetInternal
|
|
8
|
-
import { computed
|
|
1
|
+
import { useIsPanorama } from "./PanoramaContextProvider.mjs";
|
|
2
|
+
import { selectChartHeight, selectChartWidth } from "../state/selectors/containerSelectors.mjs";
|
|
3
|
+
import { selectChartOffset, selectChartViewBox } from "../state/selectors/selectChartOffset.mjs";
|
|
4
|
+
import { selectBrushDimensions, selectBrushSettings } from "../state/selectors/brushSelectors.mjs";
|
|
5
|
+
import { selectChartLayout } from "../state/selectors/common.mjs";
|
|
6
|
+
import { useAppSelector } from "../state/hooks.mjs";
|
|
7
|
+
import { selectChartOffsetInternal } from "../state/selectors/selectChartOffsetInternal.mjs";
|
|
8
|
+
import { computed } from "vue";
|
|
9
9
|
//#region src/context/chartLayoutContext.tsx
|
|
10
|
-
function
|
|
11
|
-
return
|
|
10
|
+
function useOffset() {
|
|
11
|
+
return useAppSelector(selectChartOffset);
|
|
12
12
|
}
|
|
13
|
-
var
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
var useChartLayout = () => useAppSelector(selectChartLayout);
|
|
14
|
+
function useViewBox() {
|
|
15
|
+
const panorama = useIsPanorama();
|
|
16
|
+
const rootViewBox = useAppSelector(selectChartViewBox);
|
|
17
|
+
const brushDimensions = useAppSelector(selectBrushDimensions);
|
|
18
|
+
const brushPadding = useAppSelector(selectBrushSettings);
|
|
19
|
+
return computed(() => {
|
|
20
|
+
if (!panorama || !brushDimensions.value || !brushPadding.value) return rootViewBox.value;
|
|
21
|
+
const padding = brushPadding.value.padding;
|
|
19
22
|
return {
|
|
20
|
-
width:
|
|
21
|
-
height:
|
|
22
|
-
x:
|
|
23
|
-
y:
|
|
23
|
+
width: brushDimensions.value.width - padding.left - padding.right,
|
|
24
|
+
height: brushDimensions.value.height - padding.top - padding.bottom,
|
|
25
|
+
x: padding.left,
|
|
26
|
+
y: padding.top
|
|
24
27
|
};
|
|
25
28
|
});
|
|
26
29
|
}
|
|
27
|
-
function
|
|
28
|
-
return
|
|
30
|
+
function useChartWidth() {
|
|
31
|
+
return useAppSelector(selectChartWidth);
|
|
29
32
|
}
|
|
30
|
-
function
|
|
31
|
-
return
|
|
33
|
+
function useChartHeight() {
|
|
34
|
+
return useAppSelector(selectChartHeight);
|
|
32
35
|
}
|
|
33
|
-
function
|
|
34
|
-
return
|
|
36
|
+
function useOffsetInternal() {
|
|
37
|
+
return useAppSelector(selectChartOffsetInternal);
|
|
35
38
|
}
|
|
36
|
-
var
|
|
39
|
+
var manyComponentsThrowErrorsIfMarginIsUndefined = {
|
|
37
40
|
top: 0,
|
|
38
41
|
right: 0,
|
|
39
42
|
bottom: 0,
|
|
40
43
|
left: 0
|
|
41
44
|
};
|
|
42
|
-
function
|
|
43
|
-
return
|
|
45
|
+
function useMargin() {
|
|
46
|
+
return useAppSelector((state) => state.layout.margin ?? manyComponentsThrowErrorsIfMarginIsUndefined);
|
|
44
47
|
}
|
|
45
48
|
//#endregion
|
|
46
|
-
export {
|
|
49
|
+
export { useChartHeight, useChartLayout, useChartWidth, useMargin, useOffset, useOffsetInternal, useViewBox };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createContext
|
|
1
|
+
import { createContext } from "../utils/createContext.mjs";
|
|
2
2
|
//#region src/context/cursorLayerContext.ts
|
|
3
|
-
var [
|
|
3
|
+
var [useCursorLayerRef, provideCursorLayerRef] = createContext("CursorLayerContext");
|
|
4
4
|
//#endregion
|
|
5
|
-
export {
|
|
5
|
+
export { provideCursorLayerRef, useCursorLayerRef };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createContext
|
|
1
|
+
import { createContext } from "../utils/createContext.mjs";
|
|
2
2
|
//#region src/context/graphicalLayerContext.ts
|
|
3
|
-
var [
|
|
3
|
+
var [useGraphicalLayerRef, provideGraphicalLayerRef] = createContext("GraphicalLayerContext");
|
|
4
4
|
//#endregion
|
|
5
|
-
export {
|
|
5
|
+
export { provideGraphicalLayerRef, useGraphicalLayerRef };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createContext
|
|
1
|
+
import { createContext } from "../utils/createContext.mjs";
|
|
2
2
|
//#region src/context/labelLayerContext.ts
|
|
3
|
-
var [
|
|
3
|
+
var [useLabelLayerRef, provideLabelLayerRef] = createContext("LabelLayerContext");
|
|
4
4
|
//#endregion
|
|
5
|
-
export {
|
|
5
|
+
export { provideLabelLayerRef, useLabelLayerRef };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { computed
|
|
1
|
+
import { computed, inject } from "vue";
|
|
2
2
|
//#region src/context/polarLabelViewBoxContext.ts
|
|
3
|
-
var
|
|
4
|
-
function
|
|
5
|
-
return
|
|
3
|
+
var POLAR_LABEL_VIEW_BOX_KEY = Symbol("polar-label-view-box");
|
|
4
|
+
function usePolarLabelViewBox() {
|
|
5
|
+
return inject(POLAR_LABEL_VIEW_BOX_KEY, computed(() => void 0));
|
|
6
6
|
}
|
|
7
7
|
//#endregion
|
|
8
|
-
export {
|
|
8
|
+
export { POLAR_LABEL_VIEW_BOX_KEY, usePolarLabelViewBox };
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { getBandSizeOfAxis
|
|
2
|
-
import { selectTooltipAxis
|
|
3
|
-
import { useAppSelector
|
|
4
|
-
import { computed
|
|
1
|
+
import { getBandSizeOfAxis } from "../utils/chart.mjs";
|
|
2
|
+
import { selectTooltipAxis, selectTooltipAxisScale, selectTooltipAxisTicks } from "../state/selectors/tooltipSelectors.mjs";
|
|
3
|
+
import { useAppSelector } from "../state/hooks.mjs";
|
|
4
|
+
import { computed } from "vue";
|
|
5
5
|
//#region src/context/useTooltipAxis.ts
|
|
6
|
-
var
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
var useTooltipAxis = () => useAppSelector(selectTooltipAxis);
|
|
7
|
+
function useTooltipAxisBandSize() {
|
|
8
|
+
const tooltipAxis = useTooltipAxis();
|
|
9
|
+
const tooltipTicks = useAppSelector(selectTooltipAxisTicks);
|
|
10
|
+
const tooltipAxisScale = useAppSelector(selectTooltipAxisScale);
|
|
11
|
+
return computed(() => getBandSizeOfAxis({
|
|
12
|
+
...tooltipAxis.value,
|
|
13
|
+
scale: tooltipAxisScale.value
|
|
14
|
+
}, tooltipTicks.value));
|
|
13
15
|
}
|
|
14
16
|
//#endregion
|
|
15
|
-
export {
|
|
17
|
+
export { useTooltipAxisBandSize };
|