Skip to content

Commit fcf5460

Browse files
committed
VueUiOnion improved gradient implementation
1 parent 7f110ae commit fcf5460

File tree

5 files changed

+25
-17
lines changed

5 files changed

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

src/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4052,7 +4052,7 @@ function selectBar(bar) {
40524052
</template>
40534053
</Box>
40544054

4055-
<Box open @copy="copyConfig(PROD_CONFIG.vue_ui_scatter)">
4055+
<Box @copy="copyConfig(PROD_CONFIG.vue_ui_scatter)">
40564056
<template #title>
40574057
<BaseIcon name="chartScatter" />
40584058
VueUiScatter
@@ -4151,7 +4151,7 @@ function selectBar(bar) {
41514151
</template>
41524152
</Box>
41534153

4154-
<Box @copy="copyConfig(PROD_CONFIG.vue_ui_onion)">
4154+
<Box open @copy="copyConfig(PROD_CONFIG.vue_ui_onion)">
41554155
<template #title>
41564156
<BaseIcon name="chartOnion" />
41574157
VueUiOnion

src/components/vue-ui-onion.vue

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -409,13 +409,13 @@ defineExpose({
409409
<!-- CHART -->
410410
<svg v-if="isDataset" :class="{ 'vue-data-ui-fullscreen--on': isFullscreen, 'vue-data-ui-fulscreen--off': !isFullscreen }" :viewBox="`0 0 ${svg.width} ${svg.height}`" :style="`max-width:100%;overflow:visible;background:${onionConfig.style.chart.backgroundColor};color:${onionConfig.style.chart.color}`" >
411411
412-
<defs>
412+
<!-- <defs>
413413
<radialGradient :id="`onion_gradient_${uid}`">
414414
<stop offset="0%" :stop-color="`${convertColorToHex(onionConfig.style.chart.backgroundColor)}00`" />
415415
<stop offset="90%" :stop-color="'#FFFFFF' + opacity[onionConfig.style.chart.gradientIntensity]" />
416416
<stop offset="100%" :stop-color="`${convertColorToHex(onionConfig.style.chart.backgroundColor)}00`" />
417417
</radialGradient>
418-
</defs>
418+
</defs> -->
419419
420420
<!-- TITLE AS G -->
421421
<g v-if="onionConfig.style.chart.title.text && mutableConfig.inside && !isPrinting">
@@ -477,18 +477,26 @@ defineExpose({
477477
style="transform:rotate(-90deg);transform-origin: 50% 50%"
478478
/>
479479
480-
481-
482480
<!-- GRADIENT -->
483-
<g v-if="onionConfig.style.chart.useGradient">
484-
<circle
485-
v-for="onion in mutableDataset"
481+
<defs>
482+
<filter :id="`blur_${uid}`" x="-50%" y="-50%" width="200%" height="200%">
483+
<feGaussianBlur in="SourceGraphic" :stdDeviation="100 / onionConfig.style.chart.gradientIntensity" />
484+
</filter>
485+
</defs>
486+
487+
<g :filter="`url(#blur_${uid})`" v-if="onionConfig.style.chart.useGradient">
488+
<circle
489+
v-for="(onion, i) in mutableDataset"
486490
:cx="drawableArea.centerX"
487491
:cy="drawableArea.centerY"
488-
:r="onion.radius * 1.1"
489-
stroke="none"
490-
:fill="`url(#onion_gradient_${uid})`"
491-
style="transform:rotate(-90deg);transform-origin: 50% 50%"
492+
:r="onion.radius"
493+
:stroke="`white`"
494+
:stroke-width="onionSkin.track / 3"
495+
fill="none"
496+
stroke-linecap="round"
497+
:stroke-dasharray="onion.path.dashArray"
498+
:stroke-dashoffset="onion.path.dashOffset"
499+
style="transform:rotate(-90deg);transform-origin: 50% 50%;"
492500
/>
493501
</g>
494502

src/default_configs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@
12061206
"chart": {
12071207
"backgroundColor": "#FFFFFF",
12081208
"color": "#2D353C",
1209-
"useGradient": false,
1209+
"useGradient": true,
12101210
"gradientIntensity": 20,
12111211
"layout": {
12121212
"useDiv": true,

0 commit comments

Comments
 (0)