Skip to content

Commit 68767d6

Browse files
committed
Improvement - VueUiTreemap - Add home icon on breadcrumbs
1 parent 7e6b6dd commit 68767d6

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,4 @@
107107
"vitest": "^3.1.1",
108108
"vue": "^3.5.13"
109109
}
110-
}
110+
}

src/atoms/BaseIcon.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ const icons = computed(() => {
178178
chartFunnel: `<path fill="none" stroke="${props.stroke}" stroke-width="${props.strokeWidth}" stroke-linecap="round" stroke-linejoin="round" d="M 9 18 C 10 19 11 18 11 18 L 12 10 L 18 5 L 18 3 C 18 3 18 2 17 2 L 3 2 C 3 2 2 2 2 3 L 2 5 L 8 10 L 9 18 M 4 4 C 7 6 13 6 16 4"/>`,
179179
chartHistoryPlot: `<path fill="none" stroke="${props.stroke}" stroke-width="${props.strokeWidth}" stroke-linecap="round" d="M 4 4 A 1 1 0 0 0 6 4 A 1 1 0 0 0 4 4 M 12 2 A 1 1 0 0 0 12 4 A 1 1 0 0 0 12 2 M 17 7 A 1 1 0 0 0 17 9 A 1 1 0 0 0 17 7 M 12 14 A 1 1 0 0 0 12 16 A 1 1 0 0 0 12 14 M 5 12 A 1 1 0 0 0 5 14 A 1 1 0 0 0 5 12 M 6 4 L 11 3 M 12.84 3.582 L 16.267 7.265 M 16.625 8.953 L 12.763 14.297 M 10.999 14.732 L 5.987 13.326 M 1 1 L 1 19 L 19 19"/>`,
180180
chartTableSparkline: `<path fill="none" stroke="${props.stroke}" stroke-width="${props.strokeWidth}" stroke-linecap="round" stroke-linejoin="round" d="M 1 1 L 7 1 L 7 5 L 1 5 L 1 1 M 1 8 L 7 8 L 7 12 L 1 12 L 1 8 M 1 15 L 7 15 L 7 19 L 1 19 L 1 15 M 9 3 C 9.3333 2.3333 9.261 1.027 10 1 C 11 2 10.139 4.975 11.421 5.009 C 12.231 5.009 12 3 13 3 C 14 4 14.053 4.03 14 4 C 16 4 16 1 17 1 C 18 1 18 3 19 3 M 9 12 C 9.3333 11 9.126 9.531 10 9 C 11 9 11 11 11.759 11.084 C 12.771 10.915 12.231 8.012 13.21 8.012 C 14.29 7.945 14 12 15 12 C 16 12 16 10 17 10 C 18 10 18 11 19 11 M 9 16 C 9.6667 17 9.734 18.981 10.645 19.048 C 11.691 18.609 11.117 14.965 12 15 C 13 15 12.636 17.158 13.682 17.293 C 15 17 14 15 15 15 C 16 15 16 19 17 19 C 18 19 18 15 19 15" />`,
181-
chartCirclePack: `<path fill="none" stroke="${props.stroke}" stroke-width="${props.strokeWidth}" stroke-linecap="round" stroke-linejoin="round" d="M 10 7 A 1 1 0 0 0 10 13 A 1 1 0 0 0 10 7 M 5 5 A 1 1 0 0 0 7.716 8.039 A 1 1 0 0 0 5 5 M 13 4 A 1 1 0 0 0 11.354 7.322 A 1 1 0 0 0 13 4 M 8.506 12.628 A 1 1 0 0 0 5.05 16.755 A 1 1 0 0 0 8.506 12.628 M 14.965 6.988 A 1 1 0 0 0 13.535 9.758 A 1 1 0 0 0 14.965 6.988 M 16 11 A 1 1 0 0 0 13.084 14.742 A 1 1 0 0 0 16 11"/>`
181+
chartCirclePack: `<path fill="none" stroke="${props.stroke}" stroke-width="${props.strokeWidth}" stroke-linecap="round" stroke-linejoin="round" d="M 10 7 A 1 1 0 0 0 10 13 A 1 1 0 0 0 10 7 M 5 5 A 1 1 0 0 0 7.716 8.039 A 1 1 0 0 0 5 5 M 13 4 A 1 1 0 0 0 11.354 7.322 A 1 1 0 0 0 13 4 M 8.506 12.628 A 1 1 0 0 0 5.05 16.755 A 1 1 0 0 0 8.506 12.628 M 14.965 6.988 A 1 1 0 0 0 13.535 9.758 A 1 1 0 0 0 14.965 6.988 M 16 11 A 1 1 0 0 0 13.084 14.742 A 1 1 0 0 0 16 11"/>`,
182+
home: `<path fill="none" stroke="${props.stroke}" stroke-width="${props.strokeWidth}" stroke-linecap="round" stroke-linejoin="round" d="M 2 6 L 10 2 L 18 6 M 4 7 L 4 17 C 4 18 4 18 5 18 L 8 18 L 8 12 L 12 12 L 12 18 L 15 18 C 16 18 16 18 16 17 L 16 7 M 8 18 L 12 18"/>`
182183
}
183184
});
184185

src/components/vue-ui-treemap.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import PackageVersion from '../atoms/PackageVersion.vue';
3838
import PenAndPaper from '../atoms/PenAndPaper.vue';
3939
import { useUserOptionState } from '../useUserOptionState';
4040
import { useChartAccessibility } from '../useChartAccessibility';
41+
import BaseIcon from '../atoms/BaseIcon.vue';
4142
4243
const { vue_ui_treemap: DEFAULT_CONFIG } = useConfig()
4344
@@ -721,8 +722,15 @@ defineExpose({
721722
class="vue-ui-treemap-crumb-unit"
722723
>
723724
<span class="vue-ui-treemap-crumb-unit-label">
724-
<slot name="breadcrumb-label" v-bind="{crumb}">
725-
{{ crumb.label }}
725+
<slot name="breadcrumb-label" v-bind="{ crumb, isRoot: i === 0 }">
726+
<template v-if="i === 0">
727+
<div style="width: 24px; display:flex; align-items:center">
728+
<BaseIcon name="home" :stroke="FINAL_CONFIG.style.chart.color"/>
729+
</div>
730+
</template>
731+
<template v-else>
732+
{{ crumb.label }}
733+
</template>
726734
</slot>
727735
</span>
728736

types/vue-data-ui.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,8 @@ declare module "vue-data-ui" {
11511151
| "unstack"
11521152
| "vueDataUi"
11531153
| "zoomMinus"
1154-
| "zoomPlus";
1154+
| "zoomPlus"
1155+
| "home";
11551156

11561157
export const VueUiIcon: DefineComponent<{
11571158
name: VueUiIconName;

0 commit comments

Comments
 (0)