@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,12 @@
|
|
|
1
|
+
// src/context/keys.ts
|
|
2
|
+
var CHART_METHODS_KEY = /* @__PURE__ */ Symbol.for("chart-methods");
|
|
3
|
+
var CHART_STATE_KEY = /* @__PURE__ */ Symbol.for("chart-state");
|
|
4
|
+
var CHART_HOVER_KEY = /* @__PURE__ */ Symbol.for("chart-hover");
|
|
5
|
+
var ITEM_COLLECTOR_KEY = /* @__PURE__ */ Symbol.for("item-collector");
|
|
6
|
+
var RENDERER_HINT_KEY = /* @__PURE__ */ Symbol.for("renderer-hint");
|
|
7
|
+
var CHART_GROUP_TEXT_KEY = /* @__PURE__ */ Symbol.for("chart-group-text");
|
|
8
|
+
var TOOLTIP_CONTEXT_KEY = /* @__PURE__ */ Symbol.for("chart-tooltip");
|
|
9
|
+
var CHART_CORE_INSTANCE_KEY = /* @__PURE__ */ Symbol.for("chart-core-instance");
|
|
10
|
+
var CHART_REFRESH_NONCE_KEY = /* @__PURE__ */ Symbol.for("chart-refresh-nonce");
|
|
11
|
+
|
|
12
|
+
export { CHART_CORE_INSTANCE_KEY, CHART_GROUP_TEXT_KEY, CHART_HOVER_KEY, CHART_METHODS_KEY, CHART_REFRESH_NONCE_KEY, CHART_STATE_KEY, ITEM_COLLECTOR_KEY, RENDERER_HINT_KEY, TOOLTIP_CONTEXT_KEY };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useChartMethods } from './chunk-HANSF33Z.mjs';
|
|
2
|
+
import { defineComponent, onMounted, onUnmounted, renderSlot } from 'vue';
|
|
3
|
+
|
|
4
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "ChartOverlap",
|
|
6
|
+
setup(__props) {
|
|
7
|
+
const methods = useChartMethods();
|
|
8
|
+
onMounted(() => {
|
|
9
|
+
methods.registerCustomization("overlap", {});
|
|
10
|
+
});
|
|
11
|
+
onUnmounted(() => {
|
|
12
|
+
methods.unregisterCustomization("overlap");
|
|
13
|
+
});
|
|
14
|
+
return (_ctx, _cache) => {
|
|
15
|
+
return renderSlot(_ctx.$slots, "default");
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
var ChartOverlap_default = _sfc_main;
|
|
20
|
+
|
|
21
|
+
export { ChartOverlap_default };
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { useCustomizationRegistration } from './chunk-PQV55JYI.mjs';
|
|
2
|
+
import { useChartMethods, useChartState } from './chunk-HANSF33Z.mjs';
|
|
3
|
+
import { defineComponent, computed, ref, onMounted, nextTick, onBeforeUnmount, openBlock, createBlock, Teleport, createElementVNode, withModifiers, normalizeStyle, normalizeClass, resolveDynamicComponent, createElementBlock, unref, Fragment, renderList, toDisplayString, createCommentVNode } from 'vue';
|
|
4
|
+
import { resolveExportMenuProps, filterExportMenuItems, EXPORT_MENU_CONSTANTS, resolveExportMenuPlacement, estimateExportMenuHeight, HAMBURGER_ICON_PATH, isExportMenuSeparator, createChartExporter, getExportAction, buildChartDataTable, dataTableToCsv, EXPORT_MENU_LABELS } from '@primeui/chart-core';
|
|
5
|
+
|
|
6
|
+
var _hoisted_1 = ["aria-expanded"];
|
|
7
|
+
var _hoisted_2 = {
|
|
8
|
+
key: 1,
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
width: "20",
|
|
11
|
+
height: "20",
|
|
12
|
+
fill: "currentColor"
|
|
13
|
+
};
|
|
14
|
+
var _hoisted_3 = ["d"];
|
|
15
|
+
var _hoisted_4 = ["onClick", "onMouseenter"];
|
|
16
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
|
+
__name: "ChartExportMenu",
|
|
18
|
+
props: {
|
|
19
|
+
enabled: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: true
|
|
22
|
+
},
|
|
23
|
+
filename: {},
|
|
24
|
+
menuItems: {},
|
|
25
|
+
buttons: {},
|
|
26
|
+
scale: {},
|
|
27
|
+
backgroundColor: {},
|
|
28
|
+
icon: {},
|
|
29
|
+
render: {},
|
|
30
|
+
buttonClass: {},
|
|
31
|
+
menuClass: {}
|
|
32
|
+
},
|
|
33
|
+
setup(__props) {
|
|
34
|
+
const props = __props;
|
|
35
|
+
const context = useChartMethods();
|
|
36
|
+
const state = useChartState();
|
|
37
|
+
const registrationProps = computed(() => ({
|
|
38
|
+
enabled: props.enabled,
|
|
39
|
+
buttons: props.buttons
|
|
40
|
+
}));
|
|
41
|
+
useCustomizationRegistration("exportMenu", registrationProps);
|
|
42
|
+
const isOpen = ref(false);
|
|
43
|
+
const hoveredItem = ref(null);
|
|
44
|
+
const buttonHovered = ref(false);
|
|
45
|
+
const containerEl = ref(null);
|
|
46
|
+
const exportMethods = ref(null);
|
|
47
|
+
const resolved = computed(() => resolveExportMenuProps({
|
|
48
|
+
enabled: props.enabled,
|
|
49
|
+
filename: props.filename,
|
|
50
|
+
menuItems: props.menuItems,
|
|
51
|
+
buttons: props.buttons,
|
|
52
|
+
scale: props.scale,
|
|
53
|
+
backgroundColor: props.backgroundColor
|
|
54
|
+
}));
|
|
55
|
+
const effectiveMenuItems = computed(() => filterExportMenuItems(resolved.value.menuItems));
|
|
56
|
+
function slugify(text) {
|
|
57
|
+
return text.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "chart";
|
|
58
|
+
}
|
|
59
|
+
const effectiveFilename = computed(() => {
|
|
60
|
+
if (props.filename) return props.filename;
|
|
61
|
+
const titleProps = state.value.features.get("title")?.props;
|
|
62
|
+
if (titleProps?.text) return slugify(titleProps.text);
|
|
63
|
+
const firstDataset = state.value.datasets.values().next().value;
|
|
64
|
+
const seriesName = firstDataset?.props?.name;
|
|
65
|
+
if (seriesName) return slugify(seriesName);
|
|
66
|
+
return "chart";
|
|
67
|
+
});
|
|
68
|
+
const effectiveButtons = computed(() => {
|
|
69
|
+
const raw = resolved.value.buttons;
|
|
70
|
+
if (!props.buttons?.align && context.dir === "rtl") {
|
|
71
|
+
return {
|
|
72
|
+
...raw,
|
|
73
|
+
align: "left"
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
return raw;
|
|
77
|
+
});
|
|
78
|
+
const buttonStyle = computed(() => ({
|
|
79
|
+
position: "absolute",
|
|
80
|
+
width: `${EXPORT_MENU_CONSTANTS.BUTTON_SIZE}px`,
|
|
81
|
+
height: `${EXPORT_MENU_CONSTANTS.BUTTON_SIZE}px`,
|
|
82
|
+
padding: `${EXPORT_MENU_CONSTANTS.BUTTON_PADDING}px`,
|
|
83
|
+
background: "var(--p-chart-export-button-background, transparent)",
|
|
84
|
+
border: "none",
|
|
85
|
+
borderRadius: `${EXPORT_MENU_CONSTANTS.BORDER_RADIUS}px`,
|
|
86
|
+
cursor: "pointer",
|
|
87
|
+
display: "flex",
|
|
88
|
+
alignItems: "center",
|
|
89
|
+
justifyContent: "center",
|
|
90
|
+
transition: "opacity 0.15s ease",
|
|
91
|
+
zIndex: EXPORT_MENU_CONSTANTS.Z_INDEX,
|
|
92
|
+
color: "var(--p-chart-export-button-color, currentColor)",
|
|
93
|
+
opacity: buttonHovered.value ? 1 : 0.85,
|
|
94
|
+
...effectiveButtons.value.align === "right" ? { right: `${Math.abs(effectiveButtons.value.x ?? -10)}px` } : { left: `${Math.abs(effectiveButtons.value.x ?? -10)}px` },
|
|
95
|
+
...effectiveButtons.value.verticalAlign === "top" ? { top: `${effectiveButtons.value.y ?? 10}px` } : { bottom: `${Math.abs(effectiveButtons.value.y ?? 10)}px` }
|
|
96
|
+
}));
|
|
97
|
+
const menuStyle = computed(() => {
|
|
98
|
+
const btn = effectiveButtons.value;
|
|
99
|
+
const placement = resolveExportMenuPlacement({
|
|
100
|
+
align: btn.align ?? "right",
|
|
101
|
+
verticalAlign: btn.verticalAlign ?? "top",
|
|
102
|
+
x: btn.x ?? -10,
|
|
103
|
+
y: btn.y ?? 10,
|
|
104
|
+
buttonSize: EXPORT_MENU_CONSTANTS.BUTTON_SIZE,
|
|
105
|
+
menuWidth: EXPORT_MENU_CONSTANTS.MENU_WIDTH,
|
|
106
|
+
menuHeight: estimateExportMenuHeight(effectiveMenuItems.value),
|
|
107
|
+
chartWidth: context.dimensions.width,
|
|
108
|
+
chartHeight: context.dimensions.height
|
|
109
|
+
});
|
|
110
|
+
return {
|
|
111
|
+
position: "absolute",
|
|
112
|
+
width: `${EXPORT_MENU_CONSTANTS.MENU_WIDTH}px`,
|
|
113
|
+
background: "var(--p-chart-export-menu-background, #fff)",
|
|
114
|
+
border: "1px solid var(--p-chart-export-menu-border-color, #dee2e6)",
|
|
115
|
+
borderRadius: `${EXPORT_MENU_CONSTANTS.BORDER_RADIUS}px`,
|
|
116
|
+
boxShadow: "var(--p-chart-export-menu-shadow, 0 4px 12px rgba(0, 0, 0, 0.15))",
|
|
117
|
+
zIndex: EXPORT_MENU_CONSTANTS.Z_INDEX + 1,
|
|
118
|
+
padding: "4px 0",
|
|
119
|
+
display: isOpen.value ? "block" : "none",
|
|
120
|
+
...placement.left !== void 0 ? { left: `${placement.left}px` } : {},
|
|
121
|
+
...placement.right !== void 0 ? { right: `${placement.right}px` } : {},
|
|
122
|
+
...placement.top !== void 0 ? { top: `${placement.top}px` } : {},
|
|
123
|
+
...placement.bottom !== void 0 ? { bottom: `${placement.bottom}px` } : {}
|
|
124
|
+
};
|
|
125
|
+
});
|
|
126
|
+
function findContainer() {
|
|
127
|
+
const el = document.querySelector(`[data-chart-container="${context.chartId}"]`);
|
|
128
|
+
if (el) {
|
|
129
|
+
containerEl.value = el;
|
|
130
|
+
exportMethods.value = createChartExporter(el, context.dimensions.width, context.dimensions.height, context.renderer);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
async function handleExport(item) {
|
|
134
|
+
isOpen.value = false;
|
|
135
|
+
const action = getExportAction(item);
|
|
136
|
+
if (action.format === "csv") {
|
|
137
|
+
const a11yProps = state.value.features.get("accessibility")?.props;
|
|
138
|
+
const table = buildChartDataTable(state.value.datasets, Infinity, a11yProps?.dataTableCellFormatter);
|
|
139
|
+
if (table && typeof document !== "undefined") {
|
|
140
|
+
const filename = effectiveFilename.value;
|
|
141
|
+
const blob = new Blob(["\uFEFF" + dataTableToCsv(table)], { type: "text/csv;charset=utf-8;" });
|
|
142
|
+
const url = URL.createObjectURL(blob);
|
|
143
|
+
const link = document.createElement("a");
|
|
144
|
+
link.href = url;
|
|
145
|
+
link.download = filename.endsWith(".csv") ? filename : `${filename}.csv`;
|
|
146
|
+
document.body.appendChild(link);
|
|
147
|
+
link.click();
|
|
148
|
+
document.body.removeChild(link);
|
|
149
|
+
URL.revokeObjectURL(url);
|
|
150
|
+
}
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if (!exportMethods.value) return;
|
|
154
|
+
const exportFilename = action.transparent ? `${effectiveFilename.value}-transparent` : effectiveFilename.value;
|
|
155
|
+
const exportBg = action.transparent ? "transparent" : resolved.value.backgroundColor;
|
|
156
|
+
try {
|
|
157
|
+
await exportMethods.value.toImage({
|
|
158
|
+
format: action.format,
|
|
159
|
+
filename: exportFilename,
|
|
160
|
+
scale: resolved.value.scale,
|
|
161
|
+
backgroundColor: exportBg
|
|
162
|
+
});
|
|
163
|
+
} catch {
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function getItemLabel(item) {
|
|
167
|
+
return EXPORT_MENU_LABELS[item] ?? String(item);
|
|
168
|
+
}
|
|
169
|
+
function onDocumentClick(e) {
|
|
170
|
+
const target = e.target;
|
|
171
|
+
if (!target.closest(".chart-export-menu") && !target.closest(".chart-export-button")) {
|
|
172
|
+
isOpen.value = false;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function onDocumentKeydown(e) {
|
|
176
|
+
if (e.key === "Escape") isOpen.value = false;
|
|
177
|
+
}
|
|
178
|
+
onMounted(() => {
|
|
179
|
+
nextTick(findContainer);
|
|
180
|
+
document.addEventListener("click", onDocumentClick);
|
|
181
|
+
document.addEventListener("keydown", onDocumentKeydown);
|
|
182
|
+
});
|
|
183
|
+
onBeforeUnmount(() => {
|
|
184
|
+
document.removeEventListener("click", onDocumentClick);
|
|
185
|
+
document.removeEventListener("keydown", onDocumentKeydown);
|
|
186
|
+
});
|
|
187
|
+
return (_ctx, _cache) => {
|
|
188
|
+
return resolved.value.enabled && containerEl.value ? (openBlock(), createBlock(Teleport, {
|
|
189
|
+
key: 0,
|
|
190
|
+
to: containerEl.value
|
|
191
|
+
}, [createElementVNode("button", {
|
|
192
|
+
type: "button",
|
|
193
|
+
class: normalizeClass(["chart-export-button", __props.buttonClass]),
|
|
194
|
+
style: normalizeStyle(buttonStyle.value),
|
|
195
|
+
"aria-label": "Chart export menu",
|
|
196
|
+
"aria-haspopup": "true",
|
|
197
|
+
"aria-expanded": isOpen.value,
|
|
198
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => isOpen.value = !isOpen.value, ["stop"])),
|
|
199
|
+
onMouseenter: _cache[1] || (_cache[1] = ($event) => buttonHovered.value = true),
|
|
200
|
+
onMouseleave: _cache[2] || (_cache[2] = ($event) => buttonHovered.value = false)
|
|
201
|
+
}, [__props.icon ? (openBlock(), createBlock(resolveDynamicComponent(() => __props.icon({ isOpen: isOpen.value })), { key: 0 })) : (openBlock(), createElementBlock("svg", _hoisted_2, [createElementVNode("path", { d: unref(HAMBURGER_ICON_PATH) }, null, 8, _hoisted_3)]))], 46, _hoisted_1), createElementVNode("div", {
|
|
202
|
+
class: normalizeClass(["chart-export-menu", __props.menuClass]),
|
|
203
|
+
style: normalizeStyle(menuStyle.value),
|
|
204
|
+
role: "menu"
|
|
205
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(effectiveMenuItems.value, (item, index) => {
|
|
206
|
+
return openBlock(), createElementBlock(Fragment, { key: index }, [unref(isExportMenuSeparator)(item) ? (openBlock(), createElementBlock("div", {
|
|
207
|
+
key: 0,
|
|
208
|
+
style: normalizeStyle({
|
|
209
|
+
height: `${unref(EXPORT_MENU_CONSTANTS).SEPARATOR_HEIGHT}px`,
|
|
210
|
+
background: "var(--p-chart-export-menu-separator-color, #dee2e6)",
|
|
211
|
+
margin: "4px 8px"
|
|
212
|
+
})
|
|
213
|
+
}, null, 4)) : __props.render ? (openBlock(), createBlock(resolveDynamicComponent(() => __props.render({
|
|
214
|
+
item,
|
|
215
|
+
label: getItemLabel(item),
|
|
216
|
+
onClick: () => handleExport(item),
|
|
217
|
+
isHovered: hoveredItem.value === item
|
|
218
|
+
})), { key: 1 })) : (openBlock(), createElementBlock("button", {
|
|
219
|
+
key: 2,
|
|
220
|
+
type: "button",
|
|
221
|
+
role: "menuitem",
|
|
222
|
+
style: normalizeStyle({
|
|
223
|
+
display: "block",
|
|
224
|
+
width: "100%",
|
|
225
|
+
padding: "8px 12px",
|
|
226
|
+
background: hoveredItem.value === item ? "var(--p-chart-export-menu-item-hover-background, #f8f9fa)" : "transparent",
|
|
227
|
+
border: "none",
|
|
228
|
+
textAlign: "left",
|
|
229
|
+
cursor: "pointer",
|
|
230
|
+
fontSize: "13px",
|
|
231
|
+
color: "var(--p-chart-export-menu-color, #212529)",
|
|
232
|
+
transition: "background-color 0.1s ease"
|
|
233
|
+
}),
|
|
234
|
+
onClick: ($event) => handleExport(item),
|
|
235
|
+
onMouseenter: ($event) => hoveredItem.value = item,
|
|
236
|
+
onMouseleave: _cache[3] || (_cache[3] = ($event) => hoveredItem.value = null)
|
|
237
|
+
}, toDisplayString(getItemLabel(item)), 45, _hoisted_4))], 64);
|
|
238
|
+
}), 128))], 6)], 8, ["to"])) : createCommentVNode("", true);
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
var ChartExportMenu_default = _sfc_main;
|
|
243
|
+
|
|
244
|
+
export { ChartExportMenu_default };
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { TOOLTIP_DEFAULT_STYLE, TOOLTIP_BASE_STYLE } from './chunk-J43KLCZF.mjs';
|
|
2
|
+
import { TOOLTIP_CONTEXT_KEY } from './chunk-FZ3PZ66C.mjs';
|
|
3
|
+
import { defineComponent, inject, shallowRef, computed, ref, watch, onBeforeUnmount, openBlock, createElementBlock, normalizeClass, normalizeStyle, createBlock, resolveDynamicComponent, Fragment, createElementVNode, toDisplayString, renderList, createCommentVNode, createTextVNode } from 'vue';
|
|
4
|
+
import { computeTooltipPosition, buildTooltipContent, gradientToCssBackground } from '@primeui/chart-core';
|
|
5
|
+
|
|
6
|
+
var _hoisted_1 = { class: "p-chart-tooltip__title" };
|
|
7
|
+
var _hoisted_2 = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "p-chart-tooltip__row",
|
|
10
|
+
style: {
|
|
11
|
+
"flex-direction": "column",
|
|
12
|
+
"align-items": "stretch",
|
|
13
|
+
"gap": "2px"
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
var _hoisted_3 = { class: "p-chart-tooltip__row" };
|
|
17
|
+
var _hoisted_4 = { class: "p-chart-tooltip__label" };
|
|
18
|
+
var _hoisted_5 = {
|
|
19
|
+
class: "p-chart-tooltip__label",
|
|
20
|
+
style: { "text-transform": "capitalize" }
|
|
21
|
+
};
|
|
22
|
+
var _hoisted_6 = { class: "p-chart-tooltip__value" };
|
|
23
|
+
var _hoisted_7 = {
|
|
24
|
+
key: 1,
|
|
25
|
+
class: "p-chart-tooltip__row"
|
|
26
|
+
};
|
|
27
|
+
var _hoisted_8 = { class: "p-chart-tooltip__label" };
|
|
28
|
+
var _hoisted_9 = { class: "p-chart-tooltip__value" };
|
|
29
|
+
var _hoisted_10 = { class: "p-chart-tooltip__title" };
|
|
30
|
+
var _hoisted_11 = { class: "p-chart-tooltip__label" };
|
|
31
|
+
var _hoisted_12 = {
|
|
32
|
+
class: "p-chart-tooltip__row",
|
|
33
|
+
style: { "margin-bottom": "4px" }
|
|
34
|
+
};
|
|
35
|
+
var _hoisted_13 = {
|
|
36
|
+
class: "p-chart-tooltip__title",
|
|
37
|
+
style: { "margin-bottom": "0" }
|
|
38
|
+
};
|
|
39
|
+
var _hoisted_14 = {
|
|
40
|
+
class: "p-chart-tooltip__label",
|
|
41
|
+
style: { "text-transform": "capitalize" }
|
|
42
|
+
};
|
|
43
|
+
var _hoisted_15 = { class: "p-chart-tooltip__value" };
|
|
44
|
+
var _hoisted_16 = {
|
|
45
|
+
class: "p-chart-tooltip__row",
|
|
46
|
+
style: { "margin-bottom": "4px" }
|
|
47
|
+
};
|
|
48
|
+
var _hoisted_17 = {
|
|
49
|
+
class: "p-chart-tooltip__title",
|
|
50
|
+
style: { "margin-bottom": "0" }
|
|
51
|
+
};
|
|
52
|
+
var _hoisted_18 = { class: "p-chart-tooltip__row" };
|
|
53
|
+
var _hoisted_19 = { class: "p-chart-tooltip__value" };
|
|
54
|
+
var _hoisted_20 = { class: "p-chart-tooltip__row" };
|
|
55
|
+
var _hoisted_21 = { class: "p-chart-tooltip__value" };
|
|
56
|
+
var _hoisted_22 = {
|
|
57
|
+
key: 0,
|
|
58
|
+
class: "p-chart-tooltip__row"
|
|
59
|
+
};
|
|
60
|
+
var _hoisted_23 = { class: "p-chart-tooltip__value" };
|
|
61
|
+
var _hoisted_24 = {
|
|
62
|
+
key: 5,
|
|
63
|
+
class: "p-chart-tooltip__row"
|
|
64
|
+
};
|
|
65
|
+
var _hoisted_25 = { class: "p-chart-tooltip__label" };
|
|
66
|
+
var _hoisted_26 = { class: "p-chart-tooltip__value" };
|
|
67
|
+
var _hoisted_27 = {
|
|
68
|
+
key: 0,
|
|
69
|
+
style: {
|
|
70
|
+
"opacity": "0.6",
|
|
71
|
+
"font-weight": "400"
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
75
|
+
__name: "TooltipRenderer",
|
|
76
|
+
props: {
|
|
77
|
+
tooltipConfig: {},
|
|
78
|
+
rtl: { type: Boolean },
|
|
79
|
+
locale: {},
|
|
80
|
+
width: {},
|
|
81
|
+
height: {}
|
|
82
|
+
},
|
|
83
|
+
setup(__props) {
|
|
84
|
+
const props = __props;
|
|
85
|
+
const tooltip = inject(TOOLTIP_CONTEXT_KEY, shallowRef(null));
|
|
86
|
+
const isSharedMode = computed(() => props.tooltipConfig?.mode === "shared");
|
|
87
|
+
const tooltipEl = ref(null);
|
|
88
|
+
const lingeringSnapshot = ref(null);
|
|
89
|
+
const showPending = ref(false);
|
|
90
|
+
let timerId = null;
|
|
91
|
+
function clearPendingTimer() {
|
|
92
|
+
if (timerId != null) {
|
|
93
|
+
clearTimeout(timerId);
|
|
94
|
+
timerId = null;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const visibleTooltip = computed(() => {
|
|
98
|
+
if (showPending.value) return null;
|
|
99
|
+
if (tooltip.value?.visible) return tooltip.value;
|
|
100
|
+
return lingeringSnapshot.value;
|
|
101
|
+
});
|
|
102
|
+
watch(tooltip, (next, prev) => {
|
|
103
|
+
clearPendingTimer();
|
|
104
|
+
const showDelay = props.tooltipConfig?.showDelay ?? 0;
|
|
105
|
+
const hideDelay = props.tooltipConfig?.hideDelay ?? 0;
|
|
106
|
+
const wasVisible = !!prev?.visible || !!lingeringSnapshot.value;
|
|
107
|
+
if (next?.visible) {
|
|
108
|
+
lingeringSnapshot.value = null;
|
|
109
|
+
if (!wasVisible && showDelay > 0) {
|
|
110
|
+
showPending.value = true;
|
|
111
|
+
timerId = setTimeout(() => {
|
|
112
|
+
showPending.value = false;
|
|
113
|
+
}, showDelay);
|
|
114
|
+
} else {
|
|
115
|
+
showPending.value = false;
|
|
116
|
+
}
|
|
117
|
+
} else if (wasVisible) {
|
|
118
|
+
showPending.value = false;
|
|
119
|
+
if (hideDelay > 0 && prev?.visible) {
|
|
120
|
+
lingeringSnapshot.value = prev;
|
|
121
|
+
timerId = setTimeout(() => {
|
|
122
|
+
lingeringSnapshot.value = null;
|
|
123
|
+
}, hideDelay);
|
|
124
|
+
} else {
|
|
125
|
+
lingeringSnapshot.value = null;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
onBeforeUnmount(clearPendingTimer);
|
|
130
|
+
const tooltipStyle = computed(() => {
|
|
131
|
+
if (!visibleTooltip.value?.visible) return {};
|
|
132
|
+
const tc = props.tooltipConfig;
|
|
133
|
+
const appearance = tc.render ? {} : TOOLTIP_DEFAULT_STYLE;
|
|
134
|
+
const position = computeTooltipPosition({
|
|
135
|
+
position: tc.position ?? "cursor",
|
|
136
|
+
cursorX: visibleTooltip.value.x,
|
|
137
|
+
cursorY: visibleTooltip.value.y,
|
|
138
|
+
offsetX: tc.offsetX ?? 0,
|
|
139
|
+
offsetY: tc.offsetY ?? 0,
|
|
140
|
+
tooltipWidth: tooltipEl.value?.offsetWidth ?? 0,
|
|
141
|
+
tooltipHeight: tooltipEl.value?.offsetHeight ?? 0,
|
|
142
|
+
containerWidth: props.width ?? 0,
|
|
143
|
+
containerHeight: props.height ?? 0,
|
|
144
|
+
isSharedMode: isSharedMode.value,
|
|
145
|
+
rtl: props.rtl
|
|
146
|
+
});
|
|
147
|
+
return {
|
|
148
|
+
...TOOLTIP_BASE_STYLE,
|
|
149
|
+
...appearance,
|
|
150
|
+
...position
|
|
151
|
+
};
|
|
152
|
+
});
|
|
153
|
+
const content = computed(() => {
|
|
154
|
+
if (!visibleTooltip.value?.visible) return null;
|
|
155
|
+
return buildTooltipContent(visibleTooltip.value, isSharedMode.value, {
|
|
156
|
+
locale: props.locale,
|
|
157
|
+
valueFormatter: props.tooltipConfig?.valueFormatter
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
const hasCustomRender = computed(() => !!props.tooltipConfig?.render);
|
|
161
|
+
function swatchStyle(color, gradient, swatchColor) {
|
|
162
|
+
const background = swatchColor ?? color;
|
|
163
|
+
return gradient ? {
|
|
164
|
+
backgroundColor: background,
|
|
165
|
+
backgroundImage: gradientToCssBackground(gradient)
|
|
166
|
+
} : { backgroundColor: background };
|
|
167
|
+
}
|
|
168
|
+
return (_ctx, _cache) => {
|
|
169
|
+
return visibleTooltip.value?.visible && __props.tooltipConfig ? (openBlock(), createElementBlock("div", {
|
|
170
|
+
key: 0,
|
|
171
|
+
ref_key: "tooltipEl",
|
|
172
|
+
ref: tooltipEl,
|
|
173
|
+
style: normalizeStyle(tooltipStyle.value),
|
|
174
|
+
class: normalizeClass(["chart-tooltip", { "p-chart-tooltip": !hasCustomRender.value }])
|
|
175
|
+
}, [hasCustomRender.value ? (openBlock(), createBlock(resolveDynamicComponent(() => __props.tooltipConfig.render({
|
|
176
|
+
datasetId: visibleTooltip.value.datasetId,
|
|
177
|
+
index: visibleTooltip.value.index,
|
|
178
|
+
label: visibleTooltip.value.label,
|
|
179
|
+
value: visibleTooltip.value.value,
|
|
180
|
+
percentage: visibleTooltip.value.percentage,
|
|
181
|
+
color: visibleTooltip.value.color,
|
|
182
|
+
x: visibleTooltip.value.x,
|
|
183
|
+
y: visibleTooltip.value.y,
|
|
184
|
+
ohlc: visibleTooltip.value?.ohlc,
|
|
185
|
+
allSeries: isSharedMode.value && visibleTooltip.value.allSeriesHits ? visibleTooltip.value.allSeriesHits.map((h) => ({
|
|
186
|
+
datasetId: h.datasetId,
|
|
187
|
+
name: h.name,
|
|
188
|
+
label: h.name ?? h.datasetId,
|
|
189
|
+
color: h.color,
|
|
190
|
+
value: h.value,
|
|
191
|
+
percentage: h.percentage,
|
|
192
|
+
ohlc: h.ohlc,
|
|
193
|
+
formattedValue: h.formattedValue
|
|
194
|
+
})) : void 0
|
|
195
|
+
})), { key: 0 })) : content.value?.type === "multi-series" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createElementVNode("div", _hoisted_1, toDisplayString(content.value.label), 1), (openBlock(true), createElementBlock(Fragment, null, renderList(content.value.series, (row) => {
|
|
196
|
+
return openBlock(), createElementBlock(Fragment, { key: row.datasetId }, [row.ohlc ? (openBlock(), createElementBlock("div", _hoisted_2, [createElementVNode("div", _hoisted_3, [createElementVNode("span", {
|
|
197
|
+
class: "p-chart-tooltip__swatch",
|
|
198
|
+
style: normalizeStyle(swatchStyle(row.color, row.colorGradient, row.swatchColor))
|
|
199
|
+
}, null, 4), createElementVNode("span", _hoisted_4, toDisplayString(row.label), 1)]), (openBlock(), createElementBlock(Fragment, null, renderList([
|
|
200
|
+
"open",
|
|
201
|
+
"high",
|
|
202
|
+
"low",
|
|
203
|
+
"close"
|
|
204
|
+
], (key) => {
|
|
205
|
+
return createElementVNode("div", {
|
|
206
|
+
key,
|
|
207
|
+
class: "p-chart-tooltip__row",
|
|
208
|
+
style: { "padding-left": "14px" }
|
|
209
|
+
}, [createElementVNode("span", _hoisted_5, toDisplayString(key), 1), createElementVNode("span", _hoisted_6, toDisplayString(row.ohlc[key]), 1)]);
|
|
210
|
+
}), 64))])) : (openBlock(), createElementBlock("div", _hoisted_7, [
|
|
211
|
+
createElementVNode("span", {
|
|
212
|
+
class: "p-chart-tooltip__swatch",
|
|
213
|
+
style: normalizeStyle(swatchStyle(row.color, row.colorGradient, row.swatchColor))
|
|
214
|
+
}, null, 4),
|
|
215
|
+
createElementVNode("span", _hoisted_8, toDisplayString(row.label), 1),
|
|
216
|
+
createElementVNode("span", _hoisted_9, toDisplayString(row.formattedValue), 1)
|
|
217
|
+
]))], 64);
|
|
218
|
+
}), 128))], 64)) : content.value?.type === "rows" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [createElementVNode("div", _hoisted_10, toDisplayString(content.value.label), 1), (openBlock(true), createElementBlock(Fragment, null, renderList(content.value.rows, (row, i) => {
|
|
219
|
+
return openBlock(), createElementBlock("div", {
|
|
220
|
+
key: i,
|
|
221
|
+
class: "p-chart-tooltip__row"
|
|
222
|
+
}, [createElementVNode("span", _hoisted_11, toDisplayString(row.label), 1), createElementVNode("span", {
|
|
223
|
+
class: "p-chart-tooltip__value",
|
|
224
|
+
style: normalizeStyle(row.color ? { color: row.color } : void 0)
|
|
225
|
+
}, toDisplayString(row.value), 5)]);
|
|
226
|
+
}), 128))], 64)) : content.value?.type === "ohlc" ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [createElementVNode("div", _hoisted_12, [createElementVNode("span", {
|
|
227
|
+
class: "p-chart-tooltip__swatch",
|
|
228
|
+
style: normalizeStyle(swatchStyle(content.value.color, content.value.colorGradient, content.value.swatchColor))
|
|
229
|
+
}, null, 4), createElementVNode("span", _hoisted_13, toDisplayString(content.value.label), 1)]), (openBlock(true), createElementBlock(Fragment, null, renderList(content.value.rows, (row) => {
|
|
230
|
+
return openBlock(), createElementBlock("div", {
|
|
231
|
+
key: row.key,
|
|
232
|
+
class: "p-chart-tooltip__row"
|
|
233
|
+
}, [createElementVNode("span", _hoisted_14, toDisplayString(row.key), 1), createElementVNode("span", _hoisted_15, toDisplayString(row.value), 1)]);
|
|
234
|
+
}), 128))], 64)) : content.value?.type === "scatter" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
235
|
+
createElementVNode("div", _hoisted_16, [createElementVNode("span", {
|
|
236
|
+
class: "p-chart-tooltip__swatch",
|
|
237
|
+
style: normalizeStyle(swatchStyle(content.value.color, content.value.colorGradient, content.value.swatchColor))
|
|
238
|
+
}, null, 4), createElementVNode("span", _hoisted_17, toDisplayString(content.value.label), 1)]),
|
|
239
|
+
createElementVNode("div", _hoisted_18, [_cache[0] || (_cache[0] = createElementVNode("span", { class: "p-chart-tooltip__label" }, "x", -1)), createElementVNode("span", _hoisted_19, toDisplayString(content.value.xValue.toLocaleString()), 1)]),
|
|
240
|
+
createElementVNode("div", _hoisted_20, [_cache[1] || (_cache[1] = createElementVNode("span", { class: "p-chart-tooltip__label" }, "y", -1)), createElementVNode("span", _hoisted_21, toDisplayString(content.value.yValue.toLocaleString()), 1)]),
|
|
241
|
+
content.value.bubbleValue != null ? (openBlock(), createElementBlock("div", _hoisted_22, [_cache[2] || (_cache[2] = createElementVNode("span", { class: "p-chart-tooltip__label" }, "value", -1)), createElementVNode("span", _hoisted_23, toDisplayString(content.value.bubbleValue.toLocaleString()), 1)])) : createCommentVNode("", true)
|
|
242
|
+
], 64)) : content.value?.type === "simple" ? (openBlock(), createElementBlock("div", _hoisted_24, [
|
|
243
|
+
createElementVNode("span", {
|
|
244
|
+
class: "p-chart-tooltip__swatch",
|
|
245
|
+
style: normalizeStyle(swatchStyle(content.value.color, content.value.colorGradient, content.value.swatchColor))
|
|
246
|
+
}, null, 4),
|
|
247
|
+
createElementVNode("span", _hoisted_25, toDisplayString(content.value.label), 1),
|
|
248
|
+
createElementVNode("span", _hoisted_26, [createTextVNode(toDisplayString(content.value.value), 1), content.value.percentage != null ? (openBlock(), createElementBlock("span", _hoisted_27, " (" + toDisplayString(content.value.percentage) + "%)", 1)) : createCommentVNode("", true)])
|
|
249
|
+
])) : createCommentVNode("", true)], 6)) : createCommentVNode("", true);
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
var TooltipRenderer_default = _sfc_main;
|
|
254
|
+
|
|
255
|
+
export { TooltipRenderer_default };
|