Skip to content

Commit 42e63f0

Browse files
committed
VueUiTreemap improved zoom functionality & animations
1 parent 4b51906 commit 42e63f0

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
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.70",
4+
"version": "2.0.71",
55
"type": "module",
66
"description": "A user-empowering data visualization Vue components library",
77
"keywords": [

src/App.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3148,7 +3148,6 @@ function treemapSelect(data) {
31483148
</template>
31493149
<template #dev>
31503150
<TreemapTest :dataset="treemapDataset" :config="treemapConfig" @selectLegend="treemapSelect" @selectDatapoint="treemapSelect">
3151-
31523151
</TreemapTest>
31533152
</template>
31543153
<template #prod>

src/components/vue-ui-treemap.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,11 @@ function useTooltip({ datapoint, seriesIndex }) {
341341
} else {
342342
let html = '';
343343
344-
html += `<div data-cy="donut-tooltip-name" style="width:100%;text-align:center;border-bottom:1px solid #ccc;padding-bottom:6px;margin-bottom:3px;">${datapoint.name}</div>`;
344+
html += `<div data-cy="treemap-tooltip-name" style="width:100%;text-align:center;border-bottom:1px solid #ccc;padding-bottom:6px;margin-bottom:3px;">${datapoint.name}</div>`;
345345
346-
html += `<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect data-cy="donut-tooltip-marker" x="0" y="0" height="12" width="12" stroke="none" fill="${datapoint.color}"/></svg>`;
346+
html += `<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect data-cy="treemap-tooltip-marker" x="0" y="0" height="12" width="12" stroke="none" fill="${datapoint.color}"/></svg>`;
347347
348-
html += `<b data-cy="donut-tooltip-value">${ dataLabel({p: treemapConfig.value.style.chart.layout.labels.prefix, v: datapoint.value, s: treemapConfig.value.style.chart.layout.labels.suffix, r: treemapConfig.value.style.chart.tooltip.roundingValue})}</b>`;
348+
html += `<b data-cy="treemap-tooltip-value">${ dataLabel({p: treemapConfig.value.style.chart.layout.labels.prefix, v: datapoint.value, s: treemapConfig.value.style.chart.layout.labels.suffix, r: treemapConfig.value.style.chart.tooltip.roundingValue})}</b>`;
349349
350350
tooltipContent.value = `<div>${html}</div>`;
351351
}
@@ -374,7 +374,7 @@ function generateCsv() {
374374
const tableXls = [[treemapConfig.value.style.chart.title.text],[treemapConfig.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(labels);
375375
376376
const csvContent = createCsvContent(tableXls);
377-
downloadCsv({ csvContent, title: treemapConfig.value.style.chart.title.text || "vue-ui-donut" })
377+
downloadCsv({ csvContent, title: treemapConfig.value.style.chart.title.text || "vue-ui-treemap" })
378378
});
379379
}
380380
@@ -443,19 +443,20 @@ defineExpose({
443443
:class="`vue-ui-treemap ${isFullscreen ? 'vue-data-ui-wrapper-fullscreen' : ''} ${treemapConfig.useCssAnimation ? '' : 'vue-ui-dna'}`"
444444
:style="`font-family:${treemapConfig.style.fontFamily};width:100%; text-align:center;${!treemapConfig.style.chart.title.text ? 'padding-top:36px' : ''};background:${treemapConfig.style.chart.backgroundColor}`"
445445
:id="`treemap_${uid}`">
446+
446447
<!-- TITLE -->
447448
<div v-if="treemapConfig.style.chart.title.text" :style="`width:100%;background:${treemapConfig.style.chart.backgroundColor};padding-bottom:6px`">
448449
<Title
449450
:config="{
450451
title: {
451-
cy: 'donut-div-title',
452+
cy: 'treemap-div-title',
452453
text: treemapConfig.style.chart.title.text,
453454
color: treemapConfig.style.chart.title.color,
454455
fontSize: treemapConfig.style.chart.title.fontSize,
455456
bold: treemapConfig.style.chart.title.bold
456457
},
457458
subtitle: {
458-
cy: 'donut-div-subtitle',
459+
cy: 'treemap-div-subtitle',
459460
text: treemapConfig.style.chart.title.subtitle.text,
460461
color: treemapConfig.style.chart.title.subtitle.color,
461462
fontSize: treemapConfig.style.chart.title.subtitle.fontSize,

0 commit comments

Comments
 (0)