fluency-v8-components 1.5.7 → 1.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fluency-v8-components.es.js +1 -1
- package/dist/fluency-v8-components.umd.js +38 -38
- package/dist/{index-Bubjp5rY.mjs → index-Bf1dowpE.mjs} +579 -565
- package/dist/{index.es-Ch4i5FrM.mjs → index.es-C94FYv2E.mjs} +1 -1
- package/package.json +1 -1
- package/src/components/charts/GradientChart.vue +29 -0
package/package.json
CHANGED
|
@@ -71,6 +71,14 @@ export default {
|
|
|
71
71
|
},
|
|
72
72
|
deep: true,
|
|
73
73
|
},
|
|
74
|
+
theme: {
|
|
75
|
+
handler() {
|
|
76
|
+
if (this.svg) {
|
|
77
|
+
this.updateTheme();
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
immediate: false,
|
|
81
|
+
},
|
|
74
82
|
},
|
|
75
83
|
mounted() {
|
|
76
84
|
this.initializeChart();
|
|
@@ -305,6 +313,27 @@ export default {
|
|
|
305
313
|
exit.call((g) => g.style("opacity", 0).remove());
|
|
306
314
|
}
|
|
307
315
|
},
|
|
316
|
+
updateTheme() {
|
|
317
|
+
if (!this.svg) return;
|
|
318
|
+
|
|
319
|
+
// Update gradient definition
|
|
320
|
+
const color = this.data.color
|
|
321
|
+
? this.data.color
|
|
322
|
+
: colors[this.theme][this.change];
|
|
323
|
+
const gradientFill = this.svg.select("#gradientFill" + this.id);
|
|
324
|
+
if (gradientFill.node()) {
|
|
325
|
+
// Select all stop elements
|
|
326
|
+
const stops = gradientFill.selectAll("stop");
|
|
327
|
+
|
|
328
|
+
// Update first stop (index 0, offset="0%") - canvas color
|
|
329
|
+
d3.select(stops.nodes()[0])
|
|
330
|
+
.style("stop-color", colors[this.theme]["canvas"]);
|
|
331
|
+
|
|
332
|
+
// Update second stop (index 1, offset="100%") - main color
|
|
333
|
+
d3.select(stops.nodes()[1])
|
|
334
|
+
.style("stop-color", color);
|
|
335
|
+
}
|
|
336
|
+
},
|
|
308
337
|
},
|
|
309
338
|
};
|
|
310
339
|
</script>
|