diff --git a/test/output/rasterMixedOpacity.svg b/test/output/rasterMixedOpacity.svg new file mode 100644 index 0000000000..ee8bf1d8ec --- /dev/null +++ b/test/output/rasterMixedOpacity.svg @@ -0,0 +1,67 @@ + + + + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + + + + 0.0 + 0.5 + 1.0 + 1.5 + 2.0 + 2.5 + 3.0 + 3.5 + 4.0 + + + + + \ No newline at end of file diff --git a/test/plots/raster-precision.ts b/test/plots/raster-precision.ts index ced5801cc1..059589afd5 100644 --- a/test/plots/raster-precision.ts +++ b/test/plots/raster-precision.ts @@ -39,3 +39,16 @@ test(async function rasterFacet() { ] }); }); + +test(async function rasterMixedOpacity() { + return Plot.plot({ + marks: [ + Plot.raster({ + width: 4, + height: 10, + imageRendering: "pixelated", + fill: (x: number, y: number) => (x < 2 ? d3.schemeObservable10[y | 0] : `rgba(128, 128, 128, ${y / 10})`) + }) + ] + }); +});