11<script setup lang="ts">
22import { ref , computed } from ' vue'
33import { VueUiHorizontalBar } from ' vue-data-ui/vue-ui-horizontal-bar'
4+ import { VueUiPatternSeed } from ' vue-data-ui/vue-ui-pattern-seed'
45import type { VueUiHorizontalBarConfig , VueUiHorizontalBarDatasetItem } from ' vue-data-ui'
56import { getFrameworkColor , isListedFramework } from ' ~/utils/frameworks'
6- import { createChartPatternSlotMarkup } from ' ~ /utils/charts '
7+ import { createPatternDef } from ' vue-data-ui /utils'
78import { drawSmallNpmxLogoAndTaglineWatermark } from ' ~/composables/useChartWatermark'
89
910import {
@@ -12,6 +13,7 @@ import {
1213 sanitise ,
1314 applyEllipsis ,
1415 copyAltTextForCompareFacetBarChart ,
16+ CHART_PATTERN_CONFIG ,
1517} from ' ~/utils/charts'
1618
1719import (' vue-data-ui/style.css' )
@@ -227,14 +229,15 @@ const config = computed<VueUiHorizontalBarConfig>(() => {
227229 const patternId = ` tooltip-pattern-${safeSeriesIndex } `
228230 const usePattern = safeSeriesIndex !== 0
229231
230- const patternMarkup = usePattern
231- ? createChartPatternSlotMarkup ({
232+ const patternDef = usePattern
233+ ? createPatternDef ({
232234 id: patternId ,
233235 seed: safeSeriesIndex ,
234236 foregroundColor: colors .value .bg ! ,
235- fallbackColor: ' transparent' ,
236- maxSize: 24 ,
237- minSize: 16 ,
237+ backgroundColor: ' transparent' ,
238+ maxSize: CHART_PATTERN_CONFIG .maxSize ,
239+ minSize: CHART_PATTERN_CONFIG .minSize ,
240+ disambiguator: CHART_PATTERN_CONFIG .disambiguator ,
238241 })
239242 : ' '
240243
@@ -252,9 +255,7 @@ const config = computed<VueUiHorizontalBarConfig>(() => {
252255 <div class="grid grid-cols-[12px_minmax(0,1fr)_max-content] items-center gap-x-3">
253256 <div class="w-3 h-3">
254257 <svg viewBox="0 0 20 20" class="w-full h-full" aria-hidden="true">
255- <defs>
256- ${patternMarkup }
257- </defs>
258+ ${patternDef }
258259 ${markerMarkup }
259260 </svg>
260261 </div>
@@ -286,14 +287,15 @@ const config = computed<VueUiHorizontalBarConfig>(() => {
286287 </template >
287288
288289 <template #pattern =" { patternId , seriesIndex } " >
289- <ChartPatternSlot
290+ <VueUiPatternSeed
290291 v-if =" seriesIndex != 0"
291292 :id =" patternId"
292293 :seed =" seriesIndex"
293294 :foreground-color =" colors.bg!"
294- fallback-color =" transparent"
295- :max-size =" 24"
296- :min-size =" 16"
295+ background-color =" transparent"
296+ :max-size =" CHART_PATTERN_CONFIG.maxSize"
297+ :min-size =" CHART_PATTERN_CONFIG.minSize"
298+ :disambiguator =" CHART_PATTERN_CONFIG.disambiguator"
297299 />
298300 </template >
299301
0 commit comments