feat: gate sectioon

This commit is contained in:
2026-07-31 13:24:24 +02:00
parent 06710b68d4
commit daf2bf32aa
18 changed files with 717 additions and 68 deletions
@@ -196,11 +196,27 @@ export const LinearGraph = forwardRef<LinearGraphHandle, LinearGraphProps>(funct
}
// clip to plot area so user drawing can't bleed into labels
const clipPad = 2;
ctx.save();
ctx.beginPath();
ctx.rect(plot.x, plot.y, plot.width, plot.height);
ctx.rect(
plot.x - clipPad,
plot.y - clipPad,
plot.width + clipPad * 2,
plot.height + clipPad * 2
);
ctx.clip();
// draw the frame border first, so data drawn on the edge sits on top of it
ctx.strokeStyle = axisColor;
ctx.lineWidth = 1;
ctx.strokeRect(
Math.round(plot.x) + 0.5,
Math.round(plot.y) + 0.5,
Math.round(plot.width) - 1,
Math.round(plot.height) - 1
);
if (showGrid) {
ctx.strokeStyle = gridColor;
ctx.lineWidth = 1;