@oliasoft-open-source/charts-library 3.4.3 → 3.4.5-beta-1
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/index.js
CHANGED
|
@@ -13161,7 +13161,9 @@ const ANNOTATION_DASH = [10, 2];
|
|
|
13161
13161
|
const DEFAULT_FONT_SIZE = 13;
|
|
13162
13162
|
const DEFAULT_FONT_FAMILY = '"Lato", sans-serif';
|
|
13163
13163
|
const DEFAULT_COLOR = "rgba(0,0,0,.87)";
|
|
13164
|
-
const LEGEND_LABEL_BOX_SIZE =
|
|
13164
|
+
const LEGEND_LABEL_BOX_SIZE = 12;
|
|
13165
|
+
const TOOLTIP_PADDING = 8;
|
|
13166
|
+
const TOOLTIP_BOX_PADDING = 4;
|
|
13165
13167
|
const LOGARITHMIC_STEPS = [1, 10, 100, 1e3, 1e4];
|
|
13166
13168
|
const COLORS = [
|
|
13167
13169
|
"#3366cc",
|
|
@@ -22087,6 +22089,9 @@ const reducer$1 = (state, action) => {
|
|
|
22087
22089
|
if (draft.zoomEnabled) {
|
|
22088
22090
|
draft.zoomEnabled = false;
|
|
22089
22091
|
}
|
|
22092
|
+
if (draft.enableDragPoints) {
|
|
22093
|
+
draft.enableDragPoints = false;
|
|
22094
|
+
}
|
|
22090
22095
|
break;
|
|
22091
22096
|
}
|
|
22092
22097
|
case TOGGLE_POINTS: {
|
|
@@ -25089,7 +25094,7 @@ const getLineChartToolTips = (options) => {
|
|
|
25089
25094
|
return `${roundedValue} ${titleAxisLabel}`;
|
|
25090
25095
|
};
|
|
25091
25096
|
const labelCallback = (tooltipItem) => {
|
|
25092
|
-
const { showLabelsInTooltips
|
|
25097
|
+
const { showLabelsInTooltips } = options.tooltip;
|
|
25093
25098
|
let label = tooltipItem.dataset.label || "";
|
|
25094
25099
|
const labels = getTooltipLabels(tooltipItem.dataset);
|
|
25095
25100
|
const { valueLabel, valueAxisLabel } = labels;
|
|
@@ -25100,18 +25105,25 @@ const getLineChartToolTips = (options) => {
|
|
|
25100
25105
|
roundScientificCoefficient: 4
|
|
25101
25106
|
}) : displayNumber(labelNumber);
|
|
25102
25107
|
};
|
|
25103
|
-
const
|
|
25104
|
-
|
|
25108
|
+
const getTooltipItemUnits = () => {
|
|
25109
|
+
const matches = valueAxisLabel.match(/\[(.*?)\]/g);
|
|
25110
|
+
const units2 = matches && matches.length > 0 ? matches[0] : "";
|
|
25111
|
+
return units2;
|
|
25112
|
+
};
|
|
25105
25113
|
const tooltipItemValue = getTooltipItemValue();
|
|
25106
|
-
const
|
|
25114
|
+
const units = getTooltipItemUnits();
|
|
25107
25115
|
const tooltipLabel = getTooltipLabel(tooltipItem, showLabelsInTooltips);
|
|
25108
|
-
return `${label}: ${tooltipItemValue} ${
|
|
25116
|
+
return `${label}: ${tooltipItemValue} ${units} ${tooltipLabel}`;
|
|
25109
25117
|
};
|
|
25110
25118
|
return {
|
|
25111
25119
|
enabled: options.tooltip.tooltips,
|
|
25112
25120
|
mode: ChartHoverMode.Nearest,
|
|
25113
25121
|
intersect: true,
|
|
25114
|
-
padding:
|
|
25122
|
+
padding: TOOLTIP_PADDING,
|
|
25123
|
+
usePointStyle: true,
|
|
25124
|
+
boxWidth: LEGEND_LABEL_BOX_SIZE,
|
|
25125
|
+
boxHeight: LEGEND_LABEL_BOX_SIZE,
|
|
25126
|
+
boxPadding: TOOLTIP_BOX_PADDING,
|
|
25115
25127
|
callbacks: {
|
|
25116
25128
|
title: titleCallback,
|
|
25117
25129
|
label: labelCallback,
|
|
@@ -26093,7 +26105,12 @@ const PieChart = (props) => {
|
|
|
26093
26105
|
const formattedValue = Math.abs(labelValue) < 1 ? roundNumberToPrecision(labelValue, { n: 3 }) : round$2(labelValue, 3);
|
|
26094
26106
|
return `${dataLabel} ${formattedValue} ${unit}`;
|
|
26095
26107
|
}
|
|
26096
|
-
}
|
|
26108
|
+
},
|
|
26109
|
+
padding: TOOLTIP_PADDING,
|
|
26110
|
+
boxWidth: LEGEND_LABEL_BOX_SIZE,
|
|
26111
|
+
boxHeight: LEGEND_LABEL_BOX_SIZE,
|
|
26112
|
+
boxPadding: TOOLTIP_BOX_PADDING,
|
|
26113
|
+
usePointStyle: true
|
|
26097
26114
|
};
|
|
26098
26115
|
};
|
|
26099
26116
|
return /* @__PURE__ */ jsx(
|
|
@@ -38771,7 +38788,10 @@ const getBarChartToolTips = (options) => {
|
|
|
38771
38788
|
enabled: options.tooltip.tooltips,
|
|
38772
38789
|
mode: ChartHoverMode.Nearest,
|
|
38773
38790
|
intersect: true,
|
|
38774
|
-
padding:
|
|
38791
|
+
padding: TOOLTIP_PADDING,
|
|
38792
|
+
boxWidth: LEGEND_LABEL_BOX_SIZE,
|
|
38793
|
+
boxHeight: LEGEND_LABEL_BOX_SIZE,
|
|
38794
|
+
boxPadding: TOOLTIP_BOX_PADDING,
|
|
38775
38795
|
callbacks: {
|
|
38776
38796
|
title: titleCallback,
|
|
38777
38797
|
label: labelCallback,
|