@geotab/zenith 3.2.0-beta.1 → 3.2.0-beta.2
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.
|
@@ -4,7 +4,6 @@ exports.TooltipPlugin = void 0;
|
|
|
4
4
|
const getBarTooltipItems_1 = require("../../barChart/getBarTooltipItems");
|
|
5
5
|
const getPieTooltipItems_1 = require("../../pieChart/getPieTooltipItems");
|
|
6
6
|
const renderTooltip_1 = require("./renderTooltip");
|
|
7
|
-
const getScrollableParent_1 = require("../../../utils/getScrollableParent");
|
|
8
7
|
const getCenterOfSector = (element) => {
|
|
9
8
|
const midAngle = (element.startAngle + element.endAngle) / 2;
|
|
10
9
|
const centerRadius = (element.innerRadius + element.outerRadius) / 2;
|
|
@@ -75,6 +74,7 @@ const TooltipPlugin = (containerId, options, alignment = "top", isHidden, isDark
|
|
|
75
74
|
});
|
|
76
75
|
},
|
|
77
76
|
afterDraw: (chart) => {
|
|
77
|
+
var _a, _b;
|
|
78
78
|
if (options === false) {
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
@@ -97,10 +97,8 @@ const TooltipPlugin = (containerId, options, alignment = "top", isHidden, isDark
|
|
|
97
97
|
values = (0, getPieTooltipItems_1.getPieTooltipItems)(chart.data, datasetIndex, index, options);
|
|
98
98
|
}
|
|
99
99
|
const chartRect = chart.canvas.getBoundingClientRect();
|
|
100
|
-
document.body.
|
|
101
|
-
const
|
|
102
|
-
const scrollTop = scrollableParent ? scrollableParent.scrollTop : 0;
|
|
103
|
-
const scrollLeft = scrollableParent ? scrollableParent.scrollLeft : 0;
|
|
100
|
+
const scrollTop = document.body.scrollTop + (((_a = document.body.parentElement) === null || _a === void 0 ? void 0 : _a.scrollTop) || 0);
|
|
101
|
+
const scrollLeft = document.body.scrollLeft + (((_b = document.body.parentElement) === null || _b === void 0 ? void 0 : _b.scrollLeft) || 0);
|
|
104
102
|
const top = chartRect.top + y + scrollTop;
|
|
105
103
|
const left = chartRect.left + x + scrollLeft;
|
|
106
104
|
if (values.length > 0) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { getBarTooltipItems, getBarTooltipTitle } from "../../barChart/getBarTooltipItems";
|
|
2
2
|
import { getPieTooltipItems } from "../../pieChart/getPieTooltipItems";
|
|
3
3
|
import { destroyTooltip, hideTooltip, renderTooltip } from "./renderTooltip";
|
|
4
|
-
import { getScrollableParent } from "../../../utils/getScrollableParent";
|
|
5
4
|
const getCenterOfSector = (element) => {
|
|
6
5
|
const midAngle = (element.startAngle + element.endAngle) / 2;
|
|
7
6
|
const centerRadius = (element.innerRadius + element.outerRadius) / 2;
|
|
@@ -72,6 +71,7 @@ export const TooltipPlugin = (containerId, options, alignment = "top", isHidden,
|
|
|
72
71
|
});
|
|
73
72
|
},
|
|
74
73
|
afterDraw: (chart) => {
|
|
74
|
+
var _a, _b;
|
|
75
75
|
if (options === false) {
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
@@ -94,10 +94,8 @@ export const TooltipPlugin = (containerId, options, alignment = "top", isHidden,
|
|
|
94
94
|
values = getPieTooltipItems(chart.data, datasetIndex, index, options);
|
|
95
95
|
}
|
|
96
96
|
const chartRect = chart.canvas.getBoundingClientRect();
|
|
97
|
-
document.body.
|
|
98
|
-
const
|
|
99
|
-
const scrollTop = scrollableParent ? scrollableParent.scrollTop : 0;
|
|
100
|
-
const scrollLeft = scrollableParent ? scrollableParent.scrollLeft : 0;
|
|
97
|
+
const scrollTop = document.body.scrollTop + (((_a = document.body.parentElement) === null || _a === void 0 ? void 0 : _a.scrollTop) || 0);
|
|
98
|
+
const scrollLeft = document.body.scrollLeft + (((_b = document.body.parentElement) === null || _b === void 0 ? void 0 : _b.scrollLeft) || 0);
|
|
101
99
|
const top = chartRect.top + y + scrollTop;
|
|
102
100
|
const left = chartRect.left + x + scrollLeft;
|
|
103
101
|
if (values.length > 0) {
|