mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-22 06:18:11 +08:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user