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

0 commit comments

Comments
 (0)