diff --git a/frontend/src/components/Common/UplotChart.tsx b/frontend/src/components/Common/UplotChart.tsx index c3f2850..42a1055 100644 --- a/frontend/src/components/Common/UplotChart.tsx +++ b/frontend/src/components/Common/UplotChart.tsx @@ -270,6 +270,25 @@ export function UplotChart({ // is not, and this must run exactly once per position. move: (self, left, top) => refine(self.rect.width / self.over.clientWidth, left, top), + drag: { + // No drag-to-zoom. `setData` below re-ranges the scales from the + // data and runs on every render, so a dragged range was erased by + // the next reading — all it ever did here was flash a selection + // box over a live chart. + // + // Which also settles the guard that comes with it. uPlot swallows + // the click that ends a drag, and decides one happened by + // comparing the position it took at mousedown — refined through + // `cursor.move` — against the one it holds at mouseup, which it + // re-reads raw and never refines. On a scaled panel those never + // agree, so *every* click on a plot read as a drag and was + // stopped: a chart tile could not be selected by clicking the + // chart. With no drag there is no click to protect. + x: false, + y: false, + setScale: false, + click: () => {}, + }, }, legend: { live: true,