@hestia-earth/ui-components 0.41.27 → 0.41.29
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.
|
@@ -6012,9 +6012,9 @@ const lollipopChartPlugin = settings => ({
|
|
|
6012
6012
|
clickableDictionary.push((clientX, clientY) => isMouseInsideCircle({ clientX, clientY }, { x: xValue, y }, circleRadius));
|
|
6013
6013
|
circle(ctx, xValue, y, color, circleRadius);
|
|
6014
6014
|
// draw the line between the 2 cricles if necessary
|
|
6015
|
-
Array.isArray(data)
|
|
6015
|
+
[Array.isArray(data), !!lineWidth].every(Boolean) && line(ctx, base, x, y, color, lineWidth);
|
|
6016
6016
|
// when drawing from the data, draw both ends if its an array
|
|
6017
|
-
if (
|
|
6017
|
+
if (isUndefined(overrideValue)) {
|
|
6018
6018
|
clickableDictionary.push((clientX, clientY) => isMouseInsideCircle({ clientX, clientY }, { x: base, y }, circleRadius));
|
|
6019
6019
|
Array.isArray(data) && circle(ctx, base, y, color, circleRadius);
|
|
6020
6020
|
}
|
|
@@ -6121,11 +6121,12 @@ const convertToSvg = (config, metadata = {}) => new Promise((resolve, reject) =>
|
|
|
6121
6121
|
// 4. Register Export-Specific Plugins
|
|
6122
6122
|
chartConfig.plugins = [
|
|
6123
6123
|
afterBarDrawPlugin({
|
|
6124
|
-
textFn: ({ data }) => [toPrecision(data), metadata.units].filter(Boolean).join(' '),
|
|
6125
|
-
emptyValueLabel: 'No data'
|
|
6124
|
+
textFn: ({ data }) => [toPrecision(Array.isArray(data) ? data[0] : data), metadata.units].filter(Boolean).join(' '),
|
|
6125
|
+
emptyValueLabel: 'No data',
|
|
6126
|
+
...(metadata?.afterBarDrawConfig || {})
|
|
6126
6127
|
}),
|
|
6127
6128
|
metadata.lollipopConfig ? lollipopChartPlugin(metadata.lollipopConfig) : null
|
|
6128
|
-
].filter(
|
|
6129
|
+
].filter(Boolean);
|
|
6129
6130
|
chart = new Chart(mockCanvas, chartConfig);
|
|
6130
6131
|
});
|
|
6131
6132
|
const exportAsSVG = async (config, metadata) => {
|
|
@@ -6523,12 +6524,12 @@ class ChartTooltipComponent {
|
|
|
6523
6524
|
this.tooltipX = signal(0, ...(ngDevMode ? [{ debugName: "tooltipX" }] : []));
|
|
6524
6525
|
this.tooltipY = signal(0, ...(ngDevMode ? [{ debugName: "tooltipY" }] : []));
|
|
6525
6526
|
}
|
|
6526
|
-
show(data, x, y, options = {
|
|
6527
|
+
show(data, x, y, options = {}) {
|
|
6527
6528
|
this.tooltipX.set(x);
|
|
6528
6529
|
this.tooltipY.set(y);
|
|
6529
6530
|
const text = this.tooltipFn()(data);
|
|
6530
6531
|
this.tooltip().container = options?.container;
|
|
6531
|
-
this.tooltip().placement = options?.placement;
|
|
6532
|
+
this.tooltip().placement = options?.placement || 'bottom';
|
|
6532
6533
|
text && setTimeout(() => this.tooltip().open({ data: text }));
|
|
6533
6534
|
}
|
|
6534
6535
|
hide() {
|