Skip to content

Commit 9c91756

Browse files
committed
Make tooltips headless in customFormat mode
1 parent b940cac commit 9c91756

16 files changed

+22
-22
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-data-ui",
33
"private": false,
4-
"version": "2.0.8",
4+
"version": "2.0.9",
55
"type": "module",
66
"description": "A user-empowering data visualization Vue components library",
77
"keywords": [

src/App.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2319,12 +2319,12 @@ const donutConfig = ref({
23192319
23202320
const xyConfig = ref({
23212321
chart: {
2322-
// tooltip: {
2323-
// customFormat: ({ seriesIndex, datapoint, series, bars, lines, plots, config }) => {
2324-
// console.log({seriesIndex, datapoint, series, bars, lines, plots, config});
2325-
// return 'TEST'
2326-
// }
2327-
// }
2322+
tooltip: {
2323+
customFormat: ({ seriesIndex, datapoint, series, bars, lines, plots, config }) => {
2324+
console.log({seriesIndex, datapoint, series, bars, lines, plots, config});
2325+
return 'TEST'
2326+
}
2327+
}
23282328
}
23292329
})
23302330

src/atoms/Tooltip.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const position = computed(() => {
5050
data-cy="tooltip"
5151
:class="{'vue-data-ui-custom-tooltip' : isCustom, 'vue-data-ui-tooltip': !isCustom}"
5252
v-if="show"
53-
:style="`top:${position.top}px;left:${position.left}px;${props.isCustom ? '' : `background:${props.backgroundColor};color:${props.color};max-width:${props.maxWidth}`}`"
53+
:style="`top:${position.top}px;left:${position.left}px;${isCustom ? '' : `background:${backgroundColor};color:${color};max-width:${maxWidth}`}`"
5454
>
5555
<slot/>
5656
<div v-html="content"/>

src/components/vue-ui-age-pyramid.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ defineExpose({
610610
:color="agePyramidConfig.style.tooltip.color"
611611
:parent="agePyramid"
612612
:content="tooltipContent"
613-
:isCustom="!!agePyramidConfig.style.tooltip.customFormat"
613+
:isCustom="agePyramidConfig.style.tooltip.customFormat && typeof agePyramidConfig.style.tooltip.customFormat === 'function'"
614614
/>
615615

616616
<!-- DATA TABLE -->

src/components/vue-ui-candlestick.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ defineExpose({
615615
:color="candlestickConfig.style.tooltip.color"
616616
:parent="candlestickChart"
617617
:content="tooltipContent"
618-
:isCustom="!!candlestickConfig.style.tooltip.customFormat"
618+
:isCustom="candlestickConfig.style.tooltip.customFormat && typeof candlestickConfig.style.tooltip.customFormat === 'function'"
619619
/>
620620

621621
<!-- DATA TABLE -->

src/components/vue-ui-donut.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ defineExpose({
638638
:color="donutConfig.style.chart.tooltip.color"
639639
:parent="donutChart"
640640
:content="tooltipContent"
641-
:isCustom="!!donutConfig.style.chart.tooltip.customFormat"
641+
:isCustom="donutConfig.style.chart.tooltip.customFormat && typeof donutConfig.style.chart.tooltip.customFormat === 'function'"
642642
/>
643643

644644
<!-- DATA TABLE -->

src/components/vue-ui-heatmap.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ defineExpose({
529529
:color="heatmapConfig.style.tooltip.color"
530530
:parent="heatmapChart"
531531
:content="tooltipContent"
532-
:isCustom="!!heatmapConfig.style.tooltip.customFormat"
532+
:isCustom="heatmapConfig.style.tooltip.customFormat && typeof heatmapConfig.style.tooltip.customFormat === 'function'"
533533
/>
534534

535535
<!-- DATA TABLE -->

src/components/vue-ui-molecule.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ defineExpose({
555555
:color="moleculeConfig.style.chart.tooltip.color"
556556
:parent="moleculeChart"
557557
:content="tooltipContent"
558-
:isCustom="!!moleculeConfig.style.chart.tooltip.customFormat"
558+
:isCustom="moleculeConfig.style.chart.tooltip.customFormat && typeof moleculeConfig.style.chart.tooltip.customFormat === 'function'"
559559
/>
560560
<div :style="`${isPrinting ? '' : 'max-height:400px'};overflow:auto;width:100%;margin-top:48px`" v-if="mutableConfig.showTable">
561561
<DataTable

src/components/vue-ui-quadrant.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ defineExpose({
930930
:color="quadrantConfig.style.chart.tooltip.color"
931931
:parent="quadrantChart"
932932
:content="tooltipContent"
933-
:isCustom="!!quadrantConfig.style.chart.tooltip.customFormat"
933+
:isCustom="quadrantConfig.style.chart.tooltip.customFormat && typeof quadrantConfig.style.chart.tooltip.customFormat === 'function'"
934934
>
935935
<svg height="14" width="14" viewBox="0 0 20 20" v-if="quadrantConfig.style.chart.tooltip.showShape">
936936
<Shape

src/components/vue-ui-radar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ defineExpose({
610610
:color="radarConfig.style.chart.tooltip.color"
611611
:parent="radarChart"
612612
:content="tooltipContent"
613-
:isCustom="!!radarConfig.style.chart.tooltip.customFormat"
613+
:isCustom="radarConfig.style.chart.tooltip.customFormat && typeof radarConfig.style.chart.tooltip.customFormat === 'function'"
614614
>
615615
<template #content-after>
616616
<div style="max-width: 200px;margin:0 auto">

src/components/vue-ui-rings.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ defineExpose({
537537
:color="ringsConfig.style.chart.tooltip.color"
538538
:parent="ringsChart"
539539
:content="tooltipContent"
540-
:isCustom="!!ringsConfig.style.chart.tooltip.customFormat"
540+
:isCustom="ringsConfig.style.chart.tooltip.customFormat && typeof ringsConfig.style.chart.tooltip.customFormat === 'function'"
541541
/>
542542

543543
<!-- DATA TABLE -->

src/components/vue-ui-scatter.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ defineExpose({
657657
:color="scatterConfig.style.tooltip.color"
658658
:parent="scatterChart"
659659
:content="tooltipContent"
660-
:isCustom="!!scatterConfig.style.tooltip.customFormat"
660+
:isCustom="scatterConfig.style.tooltip.customFormat && typeof scatterConfig.style.tooltip.customFormat === 'function'"
661661
>
662662
<div style="width: 100%; display: flex; align-items:center;justify-content:center;" v-if="scatterConfig.style.tooltip.showShape">
663663
<svg viewBox="0 0 20 20" height="20" width="20" style="overflow: hidden;background:transparent;">

src/components/vue-ui-vertical-bar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ defineExpose({
676676
:color="verticalBarConfig.style.chart.tooltip.color"
677677
:parent="verticalBarChart"
678678
:content="tooltipContent"
679-
:isCustom="!!verticalBarConfig.style.chart.tooltip.customFormat"
679+
:isCustom="verticalBarConfig.style.chart.tooltip.customFormat && typeof verticalBarConfig.style.chart.tooltip.customFormat === 'function'"
680680
/>
681681

682682
<!-- DATA TABLE -->

src/components/vue-ui-waffle.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ defineExpose({
603603
:color="waffleConfig.style.chart.tooltip.color"
604604
:parent="waffleChart"
605605
:content="tooltipContent"
606-
:isCustom="!!waffleConfig.style.chart.tooltip.customFormat"
606+
:isCustom="waffleConfig.style.chart.tooltip.customFormat && typeof waffleConfig.style.chart.tooltip.customFormat === 'function'"
607607
/>
608608

609609
<!-- DATA TABLE -->

src/components/vue-ui-xy.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@
647647
:color="chartConfig.chart.tooltip.color"
648648
:parent="$refs.chart"
649649
:content="tooltipContent"
650-
:isCustom="!!chartConfig.chart.tooltip.customFormat"
650+
:isCustom="chartConfig.chart.tooltip.customFormat && typeof chartConfig.chart.tooltip.customFormat === 'function'"
651651
/>
652652

653653
<!-- DATA TABLE -->

0 commit comments

Comments
 (0)