@primeui/vue-chart 0.0.1-alpha.1
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 +23 -0
- package/README.md +1 -0
- package/dist/Chart.parts.d.ts +39 -0
- package/dist/Chart.vue.d.ts +27 -0
- package/dist/ChartCanvas.mjs +14 -0
- package/dist/ChartCanvas.render.spec.d.ts +1 -0
- package/dist/ChartCanvas.vue.d.ts +23 -0
- package/dist/ChartStacked.spec.d.ts +1 -0
- package/dist/ChartSvg.axes.spec.d.ts +1 -0
- package/dist/ChartSvg.context.spec.d.ts +1 -0
- package/dist/ChartSvg.customizations.spec.d.ts +1 -0
- package/dist/ChartSvg.features.spec.d.ts +1 -0
- package/dist/ChartSvg.legend.spec.d.ts +1 -0
- package/dist/ChartSvg.mjs +14 -0
- package/dist/ChartSvg.registration.spec.d.ts +1 -0
- package/dist/ChartSvg.render.spec.d.ts +1 -0
- package/dist/ChartSvg.vue.d.ts +23 -0
- package/dist/_test/fixtures.d.ts +34 -0
- package/dist/bundle-discipline.spec.d.ts +1 -0
- package/dist/chunk-2D3PWFR2.mjs +214 -0
- package/dist/chunk-32XIRBZ7.mjs +87 -0
- package/dist/chunk-372K2BMN.mjs +1476 -0
- package/dist/chunk-42J32DPD.mjs +70 -0
- package/dist/chunk-44BAFHPK.mjs +51 -0
- package/dist/chunk-4CRHCZV3.mjs +142 -0
- package/dist/chunk-4NJ2PSHV.mjs +230 -0
- package/dist/chunk-4THCGGER.mjs +53 -0
- package/dist/chunk-4UVPCLJ7.mjs +70 -0
- package/dist/chunk-54DLUFIA.mjs +96 -0
- package/dist/chunk-56NMBNNX.mjs +52 -0
- package/dist/chunk-5DWO3G33.mjs +276 -0
- package/dist/chunk-5FTUGKPC.mjs +167 -0
- package/dist/chunk-5SRBQVU5.mjs +6 -0
- package/dist/chunk-62NGBLQ7.mjs +28 -0
- package/dist/chunk-644ROAHU.mjs +362 -0
- package/dist/chunk-6S4JMPKC.mjs +55 -0
- package/dist/chunk-72KINEJ6.mjs +52 -0
- package/dist/chunk-7P6ASYW6.mjs +7 -0
- package/dist/chunk-AAX7FOW3.mjs +210 -0
- package/dist/chunk-AUI5R4DA.mjs +84 -0
- package/dist/chunk-CDXF6ZTL.mjs +50 -0
- package/dist/chunk-CQHNYT2V.mjs +1692 -0
- package/dist/chunk-DLUFOM5K.mjs +218 -0
- package/dist/chunk-DOOXGOOB.mjs +123 -0
- package/dist/chunk-DYVFVVTO.mjs +97 -0
- package/dist/chunk-E2U4W5FW.mjs +288 -0
- package/dist/chunk-E4ROAOPT.mjs +291 -0
- package/dist/chunk-FFBK7Q3W.mjs +91 -0
- package/dist/chunk-FQTWLAVA.mjs +23 -0
- package/dist/chunk-FZ3PZ66C.mjs +12 -0
- package/dist/chunk-GA4VV5V4.mjs +21 -0
- package/dist/chunk-GFC24374.mjs +244 -0
- package/dist/chunk-GX2MK6VT.mjs +255 -0
- package/dist/chunk-HANSF33Z.mjs +169 -0
- package/dist/chunk-HTZVV6VV.mjs +550 -0
- package/dist/chunk-J2P5JBHC.mjs +26 -0
- package/dist/chunk-J43KLCZF.mjs +10 -0
- package/dist/chunk-JKK3D33U.mjs +64 -0
- package/dist/chunk-K326BBF7.mjs +276 -0
- package/dist/chunk-KOWFD2AE.mjs +72 -0
- package/dist/chunk-LD57I4SY.mjs +5 -0
- package/dist/chunk-MDA22SIZ.mjs +29 -0
- package/dist/chunk-NLXOJSKK.mjs +727 -0
- package/dist/chunk-O6L3PNFC.mjs +49 -0
- package/dist/chunk-PJVOZSPF.mjs +55 -0
- package/dist/chunk-PQV55JYI.mjs +38 -0
- package/dist/chunk-PSSXPTLQ.mjs +210 -0
- package/dist/chunk-RQURY2H3.mjs +40 -0
- package/dist/chunk-RRHYGSK6.mjs +29 -0
- package/dist/chunk-RSAZ7V5Z.mjs +42 -0
- package/dist/chunk-RSTIA3KM.mjs +41 -0
- package/dist/chunk-TEOO4OLV.mjs +6 -0
- package/dist/chunk-TIV2FI4S.mjs +53 -0
- package/dist/chunk-UO27BCRL.mjs +86 -0
- package/dist/chunk-VWABO23U.mjs +143 -0
- package/dist/chunk-W5M3BR6N.mjs +26 -0
- package/dist/chunk-WA735Y26.mjs +101 -0
- package/dist/chunk-WKSQR6L5.mjs +247 -0
- package/dist/chunk-WYV2MHP6.mjs +34 -0
- package/dist/chunk-XBDNMPF7.mjs +87 -0
- package/dist/chunk-YGHWUR7K.mjs +45 -0
- package/dist/chunk-YRKAI2R2.mjs +151 -0
- package/dist/chunk-ZHFL3RYO.mjs +228 -0
- package/dist/chunk-ZNINPVG7.mjs +30 -0
- package/dist/chunk-ZRCOVQQM.mjs +47 -0
- package/dist/components/charts/ChartBar.mjs +13 -0
- package/dist/components/charts/ChartBar.vue.d.ts +11 -0
- package/dist/components/charts/ChartCandlestick.mjs +11 -0
- package/dist/components/charts/ChartCandlestick.vue.d.ts +11 -0
- package/dist/components/charts/ChartHeatmap.mjs +11 -0
- package/dist/components/charts/ChartHeatmap.vue.d.ts +11 -0
- package/dist/components/charts/ChartLine.mjs +11 -0
- package/dist/components/charts/ChartLine.vue.d.ts +11 -0
- package/dist/components/charts/ChartPie.mjs +11 -0
- package/dist/components/charts/ChartPie.vue.d.ts +15 -0
- package/dist/components/charts/ChartPolar.mjs +11 -0
- package/dist/components/charts/ChartPolar.vue.d.ts +11 -0
- package/dist/components/charts/ChartRadar.mjs +11 -0
- package/dist/components/charts/ChartRadar.vue.d.ts +11 -0
- package/dist/components/charts/ChartScatter.mjs +11 -0
- package/dist/components/charts/ChartScatter.vue.d.ts +11 -0
- package/dist/components/charts/ChartTreemap.mjs +10 -0
- package/dist/components/charts/ChartTreemap.vue.d.ts +15 -0
- package/dist/components/charts/index.d.ts +2 -0
- package/dist/components/containers/ChartDecimation.mjs +6 -0
- package/dist/components/containers/ChartDecimation.vue.d.ts +29 -0
- package/dist/components/containers/ChartGroup.mjs +4 -0
- package/dist/components/containers/ChartGroup.vue.d.ts +13 -0
- package/dist/components/containers/ChartOverlap.mjs +5 -0
- package/dist/components/containers/ChartOverlap.vue.d.ts +13 -0
- package/dist/components/containers/ChartRange.mjs +6 -0
- package/dist/components/containers/ChartRange.vue.d.ts +13 -0
- package/dist/components/containers/ChartStacked.mjs +6 -0
- package/dist/components/containers/ChartStacked.vue.d.ts +21 -0
- package/dist/components/containers/ChartWaterfall.mjs +5 -0
- package/dist/components/containers/ChartWaterfall.vue.d.ts +17 -0
- package/dist/components/containers/keys.d.ts +5 -0
- package/dist/components/customizations/ChartAccessibility.mjs +9 -0
- package/dist/components/customizations/ChartAccessibility.vue.d.ts +28 -0
- package/dist/components/customizations/ChartAnnotation.mjs +5 -0
- package/dist/components/customizations/ChartAnnotation.vue.d.ts +8 -0
- package/dist/components/customizations/ChartAxisCategory.mjs +3 -0
- package/dist/components/customizations/ChartAxisCategory.vue.d.ts +4 -0
- package/dist/components/customizations/ChartAxisGroup.mjs +3 -0
- package/dist/components/customizations/ChartAxisGroup.vue.d.ts +14 -0
- package/dist/components/customizations/ChartBreadcrumb.mjs +6 -0
- package/dist/components/customizations/ChartBreadcrumb.vue.d.ts +15 -0
- package/dist/components/customizations/ChartCaption.mjs +9 -0
- package/dist/components/customizations/ChartCaption.vue.d.ts +4 -0
- package/dist/components/customizations/ChartColorLegend.mjs +9 -0
- package/dist/components/customizations/ChartColorLegend.vue.d.ts +47 -0
- package/dist/components/customizations/ChartDataLabels.mjs +9 -0
- package/dist/components/customizations/ChartDataLabels.vue.d.ts +53 -0
- package/dist/components/customizations/ChartExportMenu.mjs +9 -0
- package/dist/components/customizations/ChartExportMenu.vue.d.ts +29 -0
- package/dist/components/customizations/ChartHover.mjs +9 -0
- package/dist/components/customizations/ChartHover.vue.d.ts +4 -0
- package/dist/components/customizations/ChartLegend.mjs +9 -0
- package/dist/components/customizations/ChartLegend.vue.d.ts +7 -0
- package/dist/components/customizations/ChartNavigator.mjs +10 -0
- package/dist/components/customizations/ChartNavigator.vue.d.ts +4 -0
- package/dist/components/customizations/ChartReferenceBand.mjs +5 -0
- package/dist/components/customizations/ChartReferenceBand.vue.d.ts +4 -0
- package/dist/components/customizations/ChartReferenceLine.mjs +5 -0
- package/dist/components/customizations/ChartReferenceLine.vue.d.ts +4 -0
- package/dist/components/customizations/ChartResponsive.mjs +9 -0
- package/dist/components/customizations/ChartResponsive.vue.d.ts +12 -0
- package/dist/components/customizations/ChartTitle.mjs +9 -0
- package/dist/components/customizations/ChartTitle.vue.d.ts +4 -0
- package/dist/components/customizations/ChartTooltip.mjs +9 -0
- package/dist/components/customizations/ChartTooltip.vue.d.ts +6 -0
- package/dist/components/customizations/ChartXAxis.mjs +10 -0
- package/dist/components/customizations/ChartXAxis.vue.d.ts +24 -0
- package/dist/components/customizations/ChartYAxis.mjs +10 -0
- package/dist/components/customizations/ChartYAxis.vue.d.ts +23 -0
- package/dist/components/customizations/ChartZoom.mjs +9 -0
- package/dist/components/customizations/ChartZoom.vue.d.ts +4 -0
- package/dist/components/customizations/axisGroupKeys.d.ts +8 -0
- package/dist/components/customizations/index.d.ts +20 -0
- package/dist/components/items/ChartItem.mjs +3 -0
- package/dist/components/items/ChartItem.vue.d.ts +4 -0
- package/dist/components/items/ChartTreemapGroup.mjs +5 -0
- package/dist/components/items/ChartTreemapGroup.vue.d.ts +11 -0
- package/dist/components/items/index.d.ts +1 -0
- package/dist/components/renderers/CartesianRenderer.mjs +9 -0
- package/dist/components/renderers/CartesianRenderer.vue.d.ts +66 -0
- package/dist/components/renderers/ColorLegendRenderer.mjs +2 -0
- package/dist/components/renderers/ColorLegendRenderer.vue.d.ts +15 -0
- package/dist/components/renderers/LegendRenderer.mjs +3 -0
- package/dist/components/renderers/LegendRenderer.vue.d.ts +20 -0
- package/dist/components/renderers/NavigatorRenderer.mjs +5 -0
- package/dist/components/renderers/NavigatorRenderer.vue.d.ts +16 -0
- package/dist/components/renderers/RadialRenderer.mjs +9 -0
- package/dist/components/renderers/RadialRenderer.vue.d.ts +39 -0
- package/dist/components/renderers/RectRenderer.mjs +9 -0
- package/dist/components/renderers/RectRenderer.vue.d.ts +32 -0
- package/dist/components/renderers/TooltipRenderer.mjs +4 -0
- package/dist/components/renderers/TooltipRenderer.vue.d.ts +11 -0
- package/dist/components/renderers/layers/BarLayerCanvas.mjs +10 -0
- package/dist/components/renderers/layers/BarLayerCanvas.vue.d.ts +3 -0
- package/dist/components/renderers/layers/BarLayerSvg.mjs +10 -0
- package/dist/components/renderers/layers/BarLayerSvg.vue.d.ts +3 -0
- package/dist/components/renderers/layers/CandlestickLayer.mjs +9 -0
- package/dist/components/renderers/layers/CandlestickLayer.vue.d.ts +3 -0
- package/dist/components/renderers/layers/HeatmapLayer.mjs +9 -0
- package/dist/components/renderers/layers/HeatmapLayer.vue.d.ts +3 -0
- package/dist/components/renderers/layers/LineLayer.mjs +9 -0
- package/dist/components/renderers/layers/LineLayer.vue.d.ts +3 -0
- package/dist/components/renderers/layers/PieLayer.mjs +9 -0
- package/dist/components/renderers/layers/PieLayer.vue.d.ts +12 -0
- package/dist/components/renderers/layers/PolarLayer.mjs +9 -0
- package/dist/components/renderers/layers/PolarLayer.vue.d.ts +16 -0
- package/dist/components/renderers/layers/RadarLayer.mjs +9 -0
- package/dist/components/renderers/layers/RadarLayer.vue.d.ts +16 -0
- package/dist/components/renderers/layers/ScatterLayer.mjs +9 -0
- package/dist/components/renderers/layers/ScatterLayer.vue.d.ts +3 -0
- package/dist/composables/index.d.ts +35 -0
- package/dist/composables/useAnimationProps.d.ts +21 -0
- package/dist/composables/useAxisComponentBase.d.ts +11 -0
- package/dist/composables/useAxisRegistration.d.ts +7 -0
- package/dist/composables/useAxisTransition.d.ts +6 -0
- package/dist/composables/useBarLayer.d.ts +9 -0
- package/dist/composables/useBarRenderer.canvas.d.ts +2 -0
- package/dist/composables/useBarRenderer.svg.d.ts +2 -0
- package/dist/composables/useBarRendererBase.d.ts +3 -0
- package/dist/composables/useCandlestickRenderer.d.ts +2 -0
- package/dist/composables/useCartesianAnimation.d.ts +2 -0
- package/dist/composables/useCartesianFrame.d.ts +72 -0
- package/dist/composables/useCartesianLayout.d.ts +3 -0
- package/dist/composables/useChartContext.d.ts +40 -0
- package/dist/composables/useChartLayers.d.ts +31 -0
- package/dist/composables/useChartRefreshHook.d.ts +1 -0
- package/dist/composables/useChartSync.d.ts +2 -0
- package/dist/composables/useChartSyncCoordinator.d.ts +23 -0
- package/dist/composables/useControllerLifecycle.d.ts +18 -0
- package/dist/composables/useCustomizationRegistration.d.ts +18 -0
- package/dist/composables/useDatasetAnimationContext.d.ts +14 -0
- package/dist/composables/useDatasetRegistration.d.ts +6 -0
- package/dist/composables/useDrilldownState.d.ts +3 -0
- package/dist/composables/useFamilyRenderers.d.ts +10 -0
- package/dist/composables/useFamilyRenderers.spec.d.ts +1 -0
- package/dist/composables/useHeatmapRenderer.d.ts +2 -0
- package/dist/composables/useItemCollector.d.ts +2 -0
- package/dist/composables/useKeyboardController.d.ts +8 -0
- package/dist/composables/useKeyboardNavigation.d.ts +2 -0
- package/dist/composables/useLineRenderer.d.ts +2 -0
- package/dist/composables/useNavigatorRenderer.d.ts +7 -0
- package/dist/composables/usePieRenderer.d.ts +2 -0
- package/dist/composables/usePolarRenderer.d.ts +2 -0
- package/dist/composables/usePropertyAnimations.d.ts +4 -0
- package/dist/composables/useRadarRenderer.d.ts +2 -0
- package/dist/composables/useRadialFrame.d.ts +39 -0
- package/dist/composables/useResponsiveConfig.d.ts +8 -0
- package/dist/composables/useResponsiveDimensions.d.ts +2 -0
- package/dist/composables/useScatterRenderer.d.ts +2 -0
- package/dist/composables/useTreemapRenderer.d.ts +2 -0
- package/dist/composables/useZoomController.d.ts +9 -0
- package/dist/composables/useZoomPan.d.ts +2 -0
- package/dist/context/ChartContext.d.ts +21 -0
- package/dist/context/index.d.ts +4 -0
- package/dist/context/keys.d.ts +52 -0
- package/dist/context/syncKeys.d.ts +5 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.mjs +67 -0
- package/dist/namespace.d.ts +1 -0
- package/dist/namespace.mjs +112 -0
- package/dist/release-date.d.ts +11 -0
- package/dist/types/animation.types.d.ts +38 -0
- package/dist/types/axes.types.d.ts +27 -0
- package/dist/types/axisComponentBase.types.d.ts +5 -0
- package/dist/types/axisGroup.types.d.ts +1 -0
- package/dist/types/bar.types.d.ts +42 -0
- package/dist/types/breadcrumb.types.d.ts +12 -0
- package/dist/types/candlestick.types.d.ts +41 -0
- package/dist/types/canvas.types.d.ts +5 -0
- package/dist/types/caption.types.d.ts +8 -0
- package/dist/types/cartesian.types.d.ts +22 -0
- package/dist/types/chart.types.d.ts +51 -0
- package/dist/types/heatmap.types.d.ts +58 -0
- package/dist/types/index.d.ts +27 -0
- package/dist/types/item.types.d.ts +25 -0
- package/dist/types/keyboard.types.d.ts +24 -0
- package/dist/types/layout.types.d.ts +35 -0
- package/dist/types/legend.types.d.ts +13 -0
- package/dist/types/line.types.d.ts +64 -0
- package/dist/types/pie.types.d.ts +49 -0
- package/dist/types/polar.types.d.ts +63 -0
- package/dist/types/radar.types.d.ts +56 -0
- package/dist/types/responsiveDimensions.types.d.ts +16 -0
- package/dist/types/scatter.types.d.ts +50 -0
- package/dist/types/svg.types.d.ts +44 -0
- package/dist/types/tooltip.types.d.ts +6 -0
- package/dist/types/treemap.types.d.ts +50 -0
- package/dist/types/zoom.types.d.ts +45 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/styles.d.ts +10 -0
- package/package.json +63 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { registerKeyboardController } from './chunk-CQHNYT2V.mjs';
|
|
2
|
+
import { useCustomizationRegistration } from './chunk-PQV55JYI.mjs';
|
|
3
|
+
import { defineComponent, getCurrentInstance, computed } from 'vue';
|
|
4
|
+
import { KeyboardNavigationController } from '@primeui/chart-core';
|
|
5
|
+
|
|
6
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "ChartAccessibility",
|
|
8
|
+
props: {
|
|
9
|
+
enabled: { type: Boolean },
|
|
10
|
+
description: {},
|
|
11
|
+
typeDescription: {},
|
|
12
|
+
headingLevel: {},
|
|
13
|
+
pointDescriptionThreshold: {},
|
|
14
|
+
dataTableMaxRows: {},
|
|
15
|
+
dataTableCellFormatter: { type: Function },
|
|
16
|
+
pointDescriptionFormatter: { type: Function },
|
|
17
|
+
seriesDescriptionFormatter: { type: Function },
|
|
18
|
+
landmarkVerbosity: {},
|
|
19
|
+
keyboardNavigation: {}
|
|
20
|
+
},
|
|
21
|
+
setup(__props) {
|
|
22
|
+
registerKeyboardController(KeyboardNavigationController);
|
|
23
|
+
const props = __props;
|
|
24
|
+
const instance = getCurrentInstance();
|
|
25
|
+
const registrationProps = computed(() => {
|
|
26
|
+
const vnodeProps = instance?.vnode?.props ?? {};
|
|
27
|
+
return {
|
|
28
|
+
..."enabled" in vnodeProps ? { enabled: props.enabled } : {},
|
|
29
|
+
description: props.description,
|
|
30
|
+
typeDescription: props.typeDescription,
|
|
31
|
+
headingLevel: props.headingLevel,
|
|
32
|
+
pointDescriptionThreshold: props.pointDescriptionThreshold,
|
|
33
|
+
dataTableMaxRows: props.dataTableMaxRows,
|
|
34
|
+
dataTableCellFormatter: props.dataTableCellFormatter,
|
|
35
|
+
pointDescriptionFormatter: props.pointDescriptionFormatter,
|
|
36
|
+
seriesDescriptionFormatter: props.seriesDescriptionFormatter,
|
|
37
|
+
landmarkVerbosity: props.landmarkVerbosity,
|
|
38
|
+
keyboardNavigation: props.keyboardNavigation
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
useCustomizationRegistration("accessibility", registrationProps);
|
|
42
|
+
return (_ctx, _cache) => {
|
|
43
|
+
return null;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
var ChartAccessibility_default = _sfc_main;
|
|
48
|
+
|
|
49
|
+
export { ChartAccessibility_default };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { SYNC_BUS_KEY } from './chunk-LD57I4SY.mjs';
|
|
2
|
+
import { CHART_GROUP_TEXT_KEY } from './chunk-FZ3PZ66C.mjs';
|
|
3
|
+
import { defineComponent, provide, ref, openBlock, createElementBlock, toDisplayString, createCommentVNode, renderSlot } from 'vue';
|
|
4
|
+
import { SyncBus, DEFAULT_CHART_CAPTION_PADDING, DEFAULT_CHART_TITLE_COLOR, DEFAULT_CHART_TITLE_FONT_SIZE, DEFAULT_CHART_TITLE_PADDING, DEFAULT_CHART_CAPTION_COLOR, DEFAULT_CHART_CAPTION_FONT_SIZE } from '@primeui/chart-core';
|
|
5
|
+
|
|
6
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "ChartGroup",
|
|
8
|
+
setup(__props) {
|
|
9
|
+
const bus = new SyncBus();
|
|
10
|
+
provide(SYNC_BUS_KEY, bus);
|
|
11
|
+
const groupTitle = ref(void 0);
|
|
12
|
+
const groupCaption = ref(void 0);
|
|
13
|
+
provide(CHART_GROUP_TEXT_KEY, {
|
|
14
|
+
setTitle: (text) => {
|
|
15
|
+
groupTitle.value = text;
|
|
16
|
+
},
|
|
17
|
+
setCaption: (text) => {
|
|
18
|
+
groupCaption.value = text;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const captionPadding = DEFAULT_CHART_CAPTION_PADDING;
|
|
22
|
+
const titleStyle = {
|
|
23
|
+
margin: `0 0 ${DEFAULT_CHART_TITLE_PADDING}px`,
|
|
24
|
+
fontSize: `${DEFAULT_CHART_TITLE_FONT_SIZE}px`,
|
|
25
|
+
fontWeight: 600,
|
|
26
|
+
lineHeight: 1.3,
|
|
27
|
+
color: DEFAULT_CHART_TITLE_COLOR,
|
|
28
|
+
textAlign: "center"
|
|
29
|
+
};
|
|
30
|
+
const captionStyle = {
|
|
31
|
+
margin: `${captionPadding.top}px 0 ${captionPadding.bottom}px`,
|
|
32
|
+
fontSize: `${DEFAULT_CHART_CAPTION_FONT_SIZE}px`,
|
|
33
|
+
fontWeight: "normal",
|
|
34
|
+
lineHeight: 1.4,
|
|
35
|
+
color: DEFAULT_CHART_CAPTION_COLOR,
|
|
36
|
+
textAlign: "center"
|
|
37
|
+
};
|
|
38
|
+
return (_ctx, _cache) => {
|
|
39
|
+
return openBlock(), createElementBlock("div", null, [
|
|
40
|
+
groupTitle.value ? (openBlock(), createElementBlock("p", {
|
|
41
|
+
key: 0,
|
|
42
|
+
style: titleStyle
|
|
43
|
+
}, toDisplayString(groupTitle.value), 1)) : createCommentVNode("", true),
|
|
44
|
+
renderSlot(_ctx.$slots, "default"),
|
|
45
|
+
groupCaption.value ? (openBlock(), createElementBlock("p", {
|
|
46
|
+
key: 1,
|
|
47
|
+
style: captionStyle
|
|
48
|
+
}, toDisplayString(groupCaption.value), 1)) : createCommentVNode("", true)
|
|
49
|
+
]);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
var ChartGroup_default = _sfc_main;
|
|
54
|
+
|
|
55
|
+
export { ChartGroup_default };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useChartMethods } from './chunk-HANSF33Z.mjs';
|
|
2
|
+
import { CHART_REFRESH_NONCE_KEY } from './chunk-FZ3PZ66C.mjs';
|
|
3
|
+
import { shallowEqual } from '@primeui/chart-core';
|
|
4
|
+
import { inject, ref, watch, shallowRef, onMounted, onUnmounted } from 'vue';
|
|
5
|
+
|
|
6
|
+
function useChartRefreshHook(callback) {
|
|
7
|
+
const refreshNonce = inject(CHART_REFRESH_NONCE_KEY, ref(0));
|
|
8
|
+
watch(refreshNonce, callback);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// src/composables/useCustomizationRegistration.ts
|
|
12
|
+
function useCustomizationRegistration(type, props, methodsOverride) {
|
|
13
|
+
const methods = methodsOverride ?? useChartMethods();
|
|
14
|
+
const stableProps = shallowRef(props.value);
|
|
15
|
+
watch(
|
|
16
|
+
props,
|
|
17
|
+
(newProps) => {
|
|
18
|
+
if (!shallowEqual(stableProps.value, newProps)) {
|
|
19
|
+
stableProps.value = newProps;
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
{ deep: false }
|
|
23
|
+
);
|
|
24
|
+
onMounted(() => {
|
|
25
|
+
methods.registerCustomization(type, stableProps.value);
|
|
26
|
+
});
|
|
27
|
+
watch(stableProps, () => {
|
|
28
|
+
methods.registerCustomization(type, stableProps.value);
|
|
29
|
+
});
|
|
30
|
+
useChartRefreshHook(() => {
|
|
31
|
+
methods.registerCustomization(type, props.value);
|
|
32
|
+
});
|
|
33
|
+
onUnmounted(() => {
|
|
34
|
+
methods.unregisterCustomization(type);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { useChartRefreshHook, useCustomizationRegistration };
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { useCustomizationRegistration } from './chunk-PQV55JYI.mjs';
|
|
2
|
+
import { SYNC_BUS_KEY } from './chunk-LD57I4SY.mjs';
|
|
3
|
+
import { CHART_METHODS_KEY } from './chunk-FZ3PZ66C.mjs';
|
|
4
|
+
import { defineComponent, inject, computed, ref, onMounted, onBeforeUnmount, openBlock, createElementBlock, Fragment, unref, normalizeStyle, normalizeClass, renderList, createBlock, resolveDynamicComponent, createElementVNode, toDisplayString, createCommentVNode } from 'vue';
|
|
5
|
+
import { gradientToCssBackground, buildSharedLegendItems } from '@primeui/chart-core';
|
|
6
|
+
|
|
7
|
+
var _hoisted_1 = ["onClick", "onMouseenter"];
|
|
8
|
+
var _hoisted_2 = ["data-chart-gradient"];
|
|
9
|
+
var SHARED_LEGEND_SOURCE = "__shared_legend__";
|
|
10
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
|
+
__name: "ChartLegend",
|
|
12
|
+
props: {
|
|
13
|
+
render: {},
|
|
14
|
+
class: {},
|
|
15
|
+
style: {},
|
|
16
|
+
position: {},
|
|
17
|
+
align: {},
|
|
18
|
+
verticalAlign: {},
|
|
19
|
+
layout: {},
|
|
20
|
+
interactive: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: true
|
|
23
|
+
},
|
|
24
|
+
width: {},
|
|
25
|
+
height: {},
|
|
26
|
+
maxWidth: {},
|
|
27
|
+
maxHeight: {},
|
|
28
|
+
itemGap: {},
|
|
29
|
+
iconSize: {},
|
|
30
|
+
iconShape: {},
|
|
31
|
+
fontSize: {},
|
|
32
|
+
fontFamily: {},
|
|
33
|
+
fontWeight: {},
|
|
34
|
+
color: {},
|
|
35
|
+
mode: { default: "dataset" },
|
|
36
|
+
onClick: {}
|
|
37
|
+
},
|
|
38
|
+
setup(__props) {
|
|
39
|
+
const props = __props;
|
|
40
|
+
const chartMethods = inject(CHART_METHODS_KEY, null);
|
|
41
|
+
const isInsideChart = !!chartMethods;
|
|
42
|
+
const syncBus = !isInsideChart ? inject(SYNC_BUS_KEY, null) : null;
|
|
43
|
+
const isShared = !isInsideChart && !!syncBus;
|
|
44
|
+
if (isInsideChart) {
|
|
45
|
+
const registrationProps = computed(() => ({
|
|
46
|
+
position: props.position,
|
|
47
|
+
align: props.align,
|
|
48
|
+
verticalAlign: props.verticalAlign,
|
|
49
|
+
layout: props.layout,
|
|
50
|
+
interactive: props.interactive,
|
|
51
|
+
render: props.render,
|
|
52
|
+
width: props.width,
|
|
53
|
+
maxWidth: props.maxWidth,
|
|
54
|
+
height: props.height,
|
|
55
|
+
maxHeight: props.maxHeight,
|
|
56
|
+
itemGap: props.itemGap,
|
|
57
|
+
fontSize: props.fontSize,
|
|
58
|
+
iconSize: props.iconSize,
|
|
59
|
+
iconShape: props.iconShape,
|
|
60
|
+
fontFamily: props.fontFamily,
|
|
61
|
+
fontWeight: props.fontWeight,
|
|
62
|
+
color: props.color,
|
|
63
|
+
onClick: props.onClick
|
|
64
|
+
}));
|
|
65
|
+
useCustomizationRegistration("legend", registrationProps);
|
|
66
|
+
}
|
|
67
|
+
const sharedItems = ref([]);
|
|
68
|
+
const visibilityMap = ref(/* @__PURE__ */ new Map());
|
|
69
|
+
const hoveredId = ref(null);
|
|
70
|
+
function rebuildItems() {
|
|
71
|
+
if (!syncBus) return;
|
|
72
|
+
const allEntries = [...syncBus.getAllDatasets().values()].flat();
|
|
73
|
+
sharedItems.value = buildSharedLegendItems(allEntries, props.mode ?? "dataset", visibilityMap.value);
|
|
74
|
+
}
|
|
75
|
+
function getItemKey(item) {
|
|
76
|
+
return item.type === "item" ? `item:${item.itemLabel}` : item.datasetId;
|
|
77
|
+
}
|
|
78
|
+
function handleSharedClick(item) {
|
|
79
|
+
if (!props.interactive || !syncBus) return;
|
|
80
|
+
if (props.onClick) {
|
|
81
|
+
props.onClick({
|
|
82
|
+
datasetId: item.datasetId,
|
|
83
|
+
label: item.label,
|
|
84
|
+
type: item.type
|
|
85
|
+
});
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const isCategory = item.type === "item";
|
|
89
|
+
const key = getItemKey(item);
|
|
90
|
+
const newVisible = !(visibilityMap.value.get(key) ?? true);
|
|
91
|
+
const next = new Map(visibilityMap.value);
|
|
92
|
+
if (isCategory) {
|
|
93
|
+
next.set(key, newVisible);
|
|
94
|
+
syncBus.broadcastVisibility({
|
|
95
|
+
sourceId: SHARED_LEGEND_SOURCE,
|
|
96
|
+
seriesId: "",
|
|
97
|
+
itemLabel: item.itemLabel,
|
|
98
|
+
visible: newVisible
|
|
99
|
+
});
|
|
100
|
+
} else {
|
|
101
|
+
const allEntries = [...syncBus.getAllDatasets().values()].flat();
|
|
102
|
+
for (const ds of allEntries) {
|
|
103
|
+
if (ds.label === item.label) {
|
|
104
|
+
next.set(ds.datasetId, newVisible);
|
|
105
|
+
syncBus.broadcastVisibility({
|
|
106
|
+
sourceId: SHARED_LEGEND_SOURCE,
|
|
107
|
+
seriesId: ds.datasetId,
|
|
108
|
+
visible: newVisible
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
visibilityMap.value = next;
|
|
114
|
+
rebuildItems();
|
|
115
|
+
}
|
|
116
|
+
if (isShared && syncBus) {
|
|
117
|
+
syncBus.register(SHARED_LEGEND_SOURCE, {
|
|
118
|
+
extremes: false,
|
|
119
|
+
highlight: false,
|
|
120
|
+
visibility: true
|
|
121
|
+
});
|
|
122
|
+
const unsubDatasets = syncBus.subscribeDatasets(() => rebuildItems());
|
|
123
|
+
const unsubVisibility = syncBus.subscribe(SHARED_LEGEND_SOURCE, "visibility", (event) => {
|
|
124
|
+
const next = new Map(visibilityMap.value);
|
|
125
|
+
next.set(event.seriesId, event.visible);
|
|
126
|
+
visibilityMap.value = next;
|
|
127
|
+
rebuildItems();
|
|
128
|
+
});
|
|
129
|
+
let rebuildTimerId;
|
|
130
|
+
onMounted(() => {
|
|
131
|
+
rebuildTimerId = setTimeout(rebuildItems, 50);
|
|
132
|
+
});
|
|
133
|
+
onBeforeUnmount(() => {
|
|
134
|
+
clearTimeout(rebuildTimerId);
|
|
135
|
+
unsubDatasets();
|
|
136
|
+
unsubVisibility();
|
|
137
|
+
syncBus.unregister(SHARED_LEGEND_SOURCE);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
const containerStyle = computed(() => ({
|
|
141
|
+
display: "flex",
|
|
142
|
+
flexDirection: props.layout === "vertical" ? "column" : "row",
|
|
143
|
+
flexWrap: "wrap",
|
|
144
|
+
justifyContent: props.align === "start" ? "flex-start" : props.align === "end" ? "flex-end" : "center",
|
|
145
|
+
gap: `${props.itemGap ?? 8}px`,
|
|
146
|
+
padding: "8px"
|
|
147
|
+
}));
|
|
148
|
+
return (_ctx, _cache) => {
|
|
149
|
+
return isInsideChart ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [], 64)) : unref(isShared) && sharedItems.value.length > 0 ? (openBlock(), createElementBlock("div", {
|
|
150
|
+
key: 1,
|
|
151
|
+
class: normalizeClass(props.class),
|
|
152
|
+
style: normalizeStyle([containerStyle.value, props.style])
|
|
153
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(sharedItems.value, (item) => {
|
|
154
|
+
return openBlock(), createElementBlock(Fragment, { key: getItemKey(item) }, [__props.render ? (openBlock(), createBlock(resolveDynamicComponent(() => __props.render({
|
|
155
|
+
type: item.type,
|
|
156
|
+
datasetId: item.datasetId,
|
|
157
|
+
label: item.label,
|
|
158
|
+
color: item.color,
|
|
159
|
+
colorGradient: item.colorGradient,
|
|
160
|
+
visible: item.visible,
|
|
161
|
+
isHovered: hoveredId.value === getItemKey(item),
|
|
162
|
+
onClick: () => handleSharedClick(item),
|
|
163
|
+
onMouseEnter: () => {
|
|
164
|
+
hoveredId.value = getItemKey(item);
|
|
165
|
+
},
|
|
166
|
+
onMouseLeave: () => {
|
|
167
|
+
hoveredId.value = null;
|
|
168
|
+
}
|
|
169
|
+
})), { key: 0 })) : (openBlock(), createElementBlock("button", {
|
|
170
|
+
key: 1,
|
|
171
|
+
type: "button",
|
|
172
|
+
style: normalizeStyle({
|
|
173
|
+
display: "inline-flex",
|
|
174
|
+
alignItems: "center",
|
|
175
|
+
gap: "6px",
|
|
176
|
+
background: "none",
|
|
177
|
+
border: "none",
|
|
178
|
+
font: "inherit",
|
|
179
|
+
padding: "4px 8px",
|
|
180
|
+
borderRadius: "4px",
|
|
181
|
+
cursor: __props.interactive ? "pointer" : "default",
|
|
182
|
+
opacity: item.visible ? 1 : 0.4,
|
|
183
|
+
fontSize: __props.fontSize ? `${__props.fontSize}px` : "12px",
|
|
184
|
+
...__props.fontFamily ? { fontFamily: __props.fontFamily } : {},
|
|
185
|
+
...__props.fontWeight !== void 0 ? { fontWeight: __props.fontWeight } : {},
|
|
186
|
+
...__props.color ? { color: __props.color } : {},
|
|
187
|
+
transition: "opacity 0.15s",
|
|
188
|
+
backgroundColor: hoveredId.value === getItemKey(item) ? "var(--p-chart-legend-hover-background, rgba(0,0,0,0.05))" : "transparent"
|
|
189
|
+
}),
|
|
190
|
+
onClick: ($event) => handleSharedClick(item),
|
|
191
|
+
onMouseenter: ($event) => hoveredId.value = getItemKey(item),
|
|
192
|
+
onMouseleave: _cache[0] || (_cache[0] = ($event) => hoveredId.value = null)
|
|
193
|
+
}, [createElementVNode("span", {
|
|
194
|
+
"data-chart-gradient": item.colorGradient ? JSON.stringify(item.colorGradient) : void 0,
|
|
195
|
+
style: normalizeStyle({
|
|
196
|
+
width: `${__props.iconSize ?? 12}px`,
|
|
197
|
+
height: __props.iconShape === "line" ? "2px" : `${__props.iconSize ?? 12}px`,
|
|
198
|
+
borderRadius: __props.iconShape === "circle" ? "50%" : __props.iconShape === "line" ? "1px" : "2px",
|
|
199
|
+
backgroundColor: item.color,
|
|
200
|
+
...item.colorGradient ? { backgroundImage: unref(gradientToCssBackground)(item.colorGradient) } : {},
|
|
201
|
+
flexShrink: 0
|
|
202
|
+
})
|
|
203
|
+
}, null, 12, _hoisted_2), createElementVNode("span", null, toDisplayString(item.label), 1)], 44, _hoisted_1))], 64);
|
|
204
|
+
}), 128))], 6)) : createCommentVNode("", true);
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
var ChartLegend_default = _sfc_main;
|
|
209
|
+
|
|
210
|
+
export { ChartLegend_default };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { RANGE_CONTEXT_KEY } from './chunk-TEOO4OLV.mjs';
|
|
2
|
+
import { useChartMethods } from './chunk-HANSF33Z.mjs';
|
|
3
|
+
import { defineComponent, provide, computed, onMounted, watch, onUnmounted, renderSlot } from 'vue';
|
|
4
|
+
|
|
5
|
+
var rangeIdCounter = 0;
|
|
6
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "ChartRange",
|
|
8
|
+
props: {
|
|
9
|
+
color: {},
|
|
10
|
+
fillOpacity: { default: 0.3 },
|
|
11
|
+
id: {}
|
|
12
|
+
},
|
|
13
|
+
setup(__props) {
|
|
14
|
+
const props = __props;
|
|
15
|
+
const methods = useChartMethods();
|
|
16
|
+
const rangeId = props.id || `range-vue-${++rangeIdCounter}`;
|
|
17
|
+
const featureKey = `range:${rangeId}`;
|
|
18
|
+
provide(RANGE_CONTEXT_KEY, { rangeId });
|
|
19
|
+
const config = computed(() => ({
|
|
20
|
+
rangeId,
|
|
21
|
+
color: props.color,
|
|
22
|
+
fillOpacity: props.fillOpacity
|
|
23
|
+
}));
|
|
24
|
+
onMounted(() => {
|
|
25
|
+
methods.registerCustomization(featureKey, config.value);
|
|
26
|
+
});
|
|
27
|
+
watch(config, (cfg) => {
|
|
28
|
+
methods.registerCustomization(featureKey, cfg);
|
|
29
|
+
});
|
|
30
|
+
onUnmounted(() => {
|
|
31
|
+
methods.unregisterCustomization(featureKey);
|
|
32
|
+
});
|
|
33
|
+
return (_ctx, _cache) => {
|
|
34
|
+
return renderSlot(_ctx.$slots, "default");
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
var ChartRange_default = _sfc_main;
|
|
39
|
+
|
|
40
|
+
export { ChartRange_default };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useBarLayer, useBarRendererBase } from './chunk-YRKAI2R2.mjs';
|
|
2
|
+
import { defineComponent, unref, openBlock, createElementBlock, createCommentVNode } from 'vue';
|
|
3
|
+
import { createBarRendererSvg } from '@primeui/chart-core/series/bar/controller-svg';
|
|
4
|
+
|
|
5
|
+
function useBarRenderer(options) {
|
|
6
|
+
return useBarRendererBase(createBarRendererSvg(), options);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// src/components/renderers/layers/BarLayerSvg.vue
|
|
10
|
+
var _hoisted_1 = ["clip-path"];
|
|
11
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
+
__name: "BarLayerSvg",
|
|
13
|
+
setup(__props) {
|
|
14
|
+
const { bar, methods, frame } = useBarLayer(useBarRenderer);
|
|
15
|
+
return (_ctx, _cache) => {
|
|
16
|
+
return unref(methods).renderer === "svg" && unref(bar).hasBarData.value ? (openBlock(), createElementBlock("g", {
|
|
17
|
+
key: 0,
|
|
18
|
+
ref: (el) => {
|
|
19
|
+
unref(bar).groupRef.value = el;
|
|
20
|
+
},
|
|
21
|
+
class: "bar-chart",
|
|
22
|
+
"clip-path": unref(frame).layoutData.value?.cartesianArea ? `url(#${unref(frame).plotClipId})` : void 0
|
|
23
|
+
}, null, 8, _hoisted_1)) : createCommentVNode("", true);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
var BarLayerSvg_default = _sfc_main;
|
|
28
|
+
|
|
29
|
+
export { BarLayerSvg_default };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { DECIMATION_CONTEXT_KEY } from './chunk-TEOO4OLV.mjs';
|
|
2
|
+
import { useChartMethods } from './chunk-HANSF33Z.mjs';
|
|
3
|
+
import { defineComponent, watch, onBeforeUnmount, computed, provide, renderSlot } from 'vue';
|
|
4
|
+
|
|
5
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "ChartDecimation",
|
|
7
|
+
props: {
|
|
8
|
+
algorithm: { default: "lttb" },
|
|
9
|
+
threshold: {},
|
|
10
|
+
samples: { default: 500 }
|
|
11
|
+
},
|
|
12
|
+
setup(__props) {
|
|
13
|
+
const props = __props;
|
|
14
|
+
const methods = useChartMethods();
|
|
15
|
+
watch(() => [
|
|
16
|
+
props.algorithm,
|
|
17
|
+
props.threshold,
|
|
18
|
+
props.samples
|
|
19
|
+
], ([algorithm, threshold, samples]) => {
|
|
20
|
+
methods.registerCustomization("decimation", {
|
|
21
|
+
algorithm,
|
|
22
|
+
threshold,
|
|
23
|
+
samples
|
|
24
|
+
});
|
|
25
|
+
}, { immediate: true });
|
|
26
|
+
onBeforeUnmount(() => {
|
|
27
|
+
methods.unregisterCustomization("decimation");
|
|
28
|
+
});
|
|
29
|
+
const contextValue = computed(() => ({
|
|
30
|
+
algorithm: props.algorithm,
|
|
31
|
+
threshold: props.threshold,
|
|
32
|
+
samples: props.samples
|
|
33
|
+
}));
|
|
34
|
+
provide(DECIMATION_CONTEXT_KEY, contextValue);
|
|
35
|
+
return (_ctx, _cache) => {
|
|
36
|
+
return renderSlot(_ctx.$slots, "default");
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
var ChartDecimation_default = _sfc_main;
|
|
41
|
+
|
|
42
|
+
export { ChartDecimation_default };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useCustomizationRegistration } from './chunk-PQV55JYI.mjs';
|
|
2
|
+
import { defineComponent, computed } from 'vue';
|
|
3
|
+
|
|
4
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "ChartHover",
|
|
6
|
+
props: {
|
|
7
|
+
offset: {},
|
|
8
|
+
brightness: {},
|
|
9
|
+
scale: {},
|
|
10
|
+
backgroundColor: {},
|
|
11
|
+
borderColor: {},
|
|
12
|
+
borderStrokeWidth: {},
|
|
13
|
+
borderDash: {},
|
|
14
|
+
borderDashOffset: {},
|
|
15
|
+
dimOpacity: {},
|
|
16
|
+
radiusMultiplier: {},
|
|
17
|
+
onClick: { type: Function }
|
|
18
|
+
},
|
|
19
|
+
setup(__props) {
|
|
20
|
+
const props = __props;
|
|
21
|
+
const registrationProps = computed(() => ({
|
|
22
|
+
offset: props.offset,
|
|
23
|
+
brightness: props.brightness,
|
|
24
|
+
scale: props.scale,
|
|
25
|
+
backgroundColor: props.backgroundColor,
|
|
26
|
+
borderColor: props.borderColor,
|
|
27
|
+
borderStrokeWidth: props.borderStrokeWidth,
|
|
28
|
+
borderDash: props.borderDash,
|
|
29
|
+
borderDashOffset: props.borderDashOffset,
|
|
30
|
+
dimOpacity: props.dimOpacity,
|
|
31
|
+
onClick: props.onClick
|
|
32
|
+
}));
|
|
33
|
+
useCustomizationRegistration("hover", registrationProps);
|
|
34
|
+
return (_ctx, _cache) => {
|
|
35
|
+
return null;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
var ChartHover_default = _sfc_main;
|
|
40
|
+
|
|
41
|
+
export { ChartHover_default };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// src/components/containers/keys.ts
|
|
2
|
+
var STACKED_CONTEXT_KEY = /* @__PURE__ */ Symbol.for("stacked-context");
|
|
3
|
+
var RANGE_CONTEXT_KEY = /* @__PURE__ */ Symbol.for("range-context");
|
|
4
|
+
var DECIMATION_CONTEXT_KEY = /* @__PURE__ */ Symbol.for("decimation-context");
|
|
5
|
+
|
|
6
|
+
export { DECIMATION_CONTEXT_KEY, RANGE_CONTEXT_KEY, STACKED_CONTEXT_KEY };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { STACKED_CONTEXT_KEY } from './chunk-TEOO4OLV.mjs';
|
|
2
|
+
import { useChartMethods } from './chunk-HANSF33Z.mjs';
|
|
3
|
+
import { defineComponent, onMounted, reactive, watch, onUnmounted, provide, renderSlot } from 'vue';
|
|
4
|
+
|
|
5
|
+
var stackIdCounter = 0;
|
|
6
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "ChartStacked",
|
|
8
|
+
props: {
|
|
9
|
+
id: {},
|
|
10
|
+
gap: { default: 0 },
|
|
11
|
+
mode: { default: "normal" }
|
|
12
|
+
},
|
|
13
|
+
setup(__props) {
|
|
14
|
+
const props = __props;
|
|
15
|
+
const methods = useChartMethods();
|
|
16
|
+
const stackId = props.id || `stack-${++stackIdCounter}`;
|
|
17
|
+
let orderCounter = 0;
|
|
18
|
+
let isRegistered = false;
|
|
19
|
+
function registerStacking() {
|
|
20
|
+
methods.registerCustomization("stacking", {
|
|
21
|
+
stackId,
|
|
22
|
+
gap: props.gap,
|
|
23
|
+
mode: props.mode
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
onMounted(() => {
|
|
27
|
+
registerStacking();
|
|
28
|
+
isRegistered = true;
|
|
29
|
+
});
|
|
30
|
+
const contextValue = reactive({
|
|
31
|
+
stackId,
|
|
32
|
+
gap: props.gap,
|
|
33
|
+
getNextOrder: () => orderCounter++,
|
|
34
|
+
mode: props.mode
|
|
35
|
+
});
|
|
36
|
+
watch([() => props.mode, () => props.gap], ([newMode, newGap]) => {
|
|
37
|
+
contextValue.mode = newMode;
|
|
38
|
+
contextValue.gap = newGap;
|
|
39
|
+
if (isRegistered) registerStacking();
|
|
40
|
+
}, { flush: "post" });
|
|
41
|
+
onUnmounted(() => {
|
|
42
|
+
methods.unregisterCustomization("stacking");
|
|
43
|
+
isRegistered = false;
|
|
44
|
+
});
|
|
45
|
+
provide(STACKED_CONTEXT_KEY, contextValue);
|
|
46
|
+
return (_ctx, _cache) => {
|
|
47
|
+
return renderSlot(_ctx.$slots, "default");
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
var ChartStacked_default = _sfc_main;
|
|
52
|
+
|
|
53
|
+
export { ChartStacked_default };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { usePieRenderer, useRadialFrameRegistration } from './chunk-CQHNYT2V.mjs';
|
|
2
|
+
import { useChartMethods, useChartState, useChartHover } from './chunk-HANSF33Z.mjs';
|
|
3
|
+
import { defineComponent, computed, toRef, unref, openBlock, createElementBlock, Fragment, createElementVNode, renderList, createBlock, createCommentVNode } from 'vue';
|
|
4
|
+
|
|
5
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "PieLayer",
|
|
7
|
+
props: {
|
|
8
|
+
chartArea: {},
|
|
9
|
+
width: {},
|
|
10
|
+
height: {},
|
|
11
|
+
canvasEl: {},
|
|
12
|
+
containerEl: {},
|
|
13
|
+
adaptiveDataLabelFontSize: {}
|
|
14
|
+
},
|
|
15
|
+
setup(__props) {
|
|
16
|
+
const VNodeRenderer = defineComponent({
|
|
17
|
+
props: { node: {
|
|
18
|
+
type: Object,
|
|
19
|
+
required: true
|
|
20
|
+
} },
|
|
21
|
+
render() {
|
|
22
|
+
return this.node;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
const props = __props;
|
|
26
|
+
const methods = useChartMethods();
|
|
27
|
+
const state = useChartState();
|
|
28
|
+
const hoverCtx = useChartHover();
|
|
29
|
+
const pie = usePieRenderer({
|
|
30
|
+
chartArea: computed(() => props.chartArea),
|
|
31
|
+
renderer: methods.renderer,
|
|
32
|
+
canvasEl: toRef(props, "canvasEl"),
|
|
33
|
+
containerEl: toRef(props, "containerEl"),
|
|
34
|
+
datasets: computed(() => state.value.datasets),
|
|
35
|
+
features: computed(() => state.value.features),
|
|
36
|
+
hover: computed(() => hoverCtx.value.hover),
|
|
37
|
+
datasetVisibility: computed(() => state.value.datasetVisibility),
|
|
38
|
+
hiddenItems: computed(() => state.value.hiddenItems),
|
|
39
|
+
chartId: methods.chartId,
|
|
40
|
+
width: computed(() => props.width),
|
|
41
|
+
height: computed(() => props.height),
|
|
42
|
+
globalFont: methods.font,
|
|
43
|
+
adaptiveDataLabelFontSize: computed(() => props.adaptiveDataLabelFontSize),
|
|
44
|
+
dir: computed(() => methods.dir),
|
|
45
|
+
theme: computed(() => methods.theme)
|
|
46
|
+
});
|
|
47
|
+
useRadialFrameRegistration({
|
|
48
|
+
type: "pie",
|
|
49
|
+
hitTest: (x, y) => pie.hitTest(x, y),
|
|
50
|
+
getPointPosition: (datasetId, index) => {
|
|
51
|
+
const pos = pie.getSlicePosition(datasetId, index);
|
|
52
|
+
if (!pos) return null;
|
|
53
|
+
const r = 6;
|
|
54
|
+
return {
|
|
55
|
+
x: pos.x - r,
|
|
56
|
+
y: pos.y - r,
|
|
57
|
+
width: r * 2,
|
|
58
|
+
height: r * 2,
|
|
59
|
+
shape: "circle"
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
getCenter: () => pie.center.value,
|
|
63
|
+
applyPropertyAnimations: (store) => pie.applyPropertyAnimations(store),
|
|
64
|
+
renderFrameCycle: () => pie.renderFrameCycle()
|
|
65
|
+
});
|
|
66
|
+
return (_ctx, _cache) => {
|
|
67
|
+
return unref(methods).renderer === "svg" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
68
|
+
createElementVNode("g", { ref: (el) => {
|
|
69
|
+
unref(pie).groupRef.value = el;
|
|
70
|
+
} }, null, 512),
|
|
71
|
+
createElementVNode("g", { ref: (el) => {
|
|
72
|
+
unref(pie).labelGroupRef.value = el;
|
|
73
|
+
} }, null, 512),
|
|
74
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(pie).svgContent.value, (el) => {
|
|
75
|
+
return openBlock(), createBlock(unref(VNodeRenderer), {
|
|
76
|
+
key: el.key ?? el.props?.key,
|
|
77
|
+
node: el
|
|
78
|
+
}, null, 8, ["node"]);
|
|
79
|
+
}), 128))
|
|
80
|
+
], 64)) : createCommentVNode("", true);
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
var PieLayer_default = _sfc_main;
|
|
85
|
+
|
|
86
|
+
export { PieLayer_default };
|