From 246a30dc21aacd4979fbf9ba803dfbe9dbbea0b3 Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Thu, 2 Jul 2026 14:06:51 +0200 Subject: [PATCH] Flat / pixellated 2D plots for mcplot-html --- tools/Python/mcplot/html/plotfuncs.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/Python/mcplot/html/plotfuncs.js b/tools/Python/mcplot/html/plotfuncs.js index 86bdb47e62..0902e3c660 100644 --- a/tools/Python/mcplot/html/plotfuncs.js +++ b/tools/Python/mcplot/html/plotfuncs.js @@ -476,7 +476,12 @@ class Plot2D { .attr('width', wi) .attr('height', hi) .attr('preserveAspectRatio', 'none') - .attr("xlink:href","data:image/jpg;base64," + img2dData); + .attr("xlink:href","data:image/jpg;base64," + img2dData) + .attr("style", + "image-rendering: optimizeSpeed;" + // legacy SVG value (old Firefox/IE) + "image-rendering: -moz-crisp-edges;" + // older Firefox + "image-rendering: crisp-edges;" + // spec value + "image-rendering: pixelated;"); // Chrome/Safari/modern Firefox (nearest-neighbor) var cbScale = d3.scaleLinear() .domain([cbMin, cbMax])