alpha blending fix in scatterplots (#2033)

* explicitly specify alpha blending; rename NaN flag to accurately describe function

* fix incorret dest alpha blending function
This commit is contained in:
Bruce Martin
2021-02-05 09:34:37 -08:00
committed by GitHub
parent d821f0eac9
commit 3aef21f76c
5 changed files with 59 additions and 28 deletions
@@ -16,10 +16,11 @@ import {
createColorQuery,
} from "../../util/stateManager/colorHelpers";
import renderThrottle from "../../util/renderThrottle";
const flagSelected = 1;
const flagNaN = 2;
const flagHighlight = 4;
import {
flagBackground,
flagSelected,
flagHighlight,
} from "../../util/glHelpers";
function createProjectionTF(viewportWidth, viewportHeight) {
/*
@@ -135,8 +136,9 @@ class Scatterplot extends React.PureComponent {
const flags = new Float32Array(nObs);
if (colorByData) {
for (let i = 0, len = flags.length; i < len; i += 1) {
if (!Number.isFinite(colorByData[i])) {
flags[i] = flagNaN;
const val = colorByData[i];
if (typeof val === "number" && !Number.isFinite(val)) {
flags[i] = flagBackground;
}
}
}