mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
UI: Disallow sub-second zoom as this cause inconsistenices in the X axis in uPlot
Fixes #9135 Signed-off-by: Julien <roidelapluie@o11y.eu>
This commit is contained in:
parent
b6107cc888
commit
546f780006
|
@ -380,10 +380,11 @@ export const getUPlotOptions = (
|
||||||
hooks: {
|
hooks: {
|
||||||
setSelect: [
|
setSelect: [
|
||||||
(self: uPlot) => {
|
(self: uPlot) => {
|
||||||
onSelectRange(
|
// Disallow sub-second zoom as this cause inconsistenices in the X axis in uPlot.
|
||||||
self.posToVal(self.select.left, "x"),
|
const leftVal = self.posToVal(self.select.left, "x");
|
||||||
self.posToVal(self.select.left + self.select.width, "x")
|
const rightVal = Math.max(self.posToVal(self.select.left + self.select.width, "x"), leftVal + 1);
|
||||||
);
|
|
||||||
|
onSelectRange(leftVal, rightVal);
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue