scale point size for graph and scatter plots (#903)

* scale point size for graph and scatter plots

* improve comments
This commit is contained in:
Bruce Martin
2019-08-27 14:12:53 -07:00
committed by GitHub
parent b309367bb0
commit b0562a11fd
3 changed files with 52 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
import { glPointFlags } from "../../util/glHelpers";
import { glPointFlags, glPointSize } from "../../util/glHelpers";
export default function(regl) {
return regl({
@@ -22,11 +22,14 @@ export default function(regl) {
// import getFlags()
${glPointFlags}
// get pointSize()
${glPointSize}
void main() {
bool isNaN, isSelected, isHighlight;
getFlags(flag, isNaN, isSelected, isHighlight);
gl_PointSize = isHighlight ? 8. : isSelected ? 4. : 1.;
gl_PointSize = pointSize(nPoints, minViewportDimension, isSelected, isHighlight);
float z = isNaN ? zBottom : (isHighlight ? zTop : zMiddle);
vec3 xy = projection * vec3(position, 1.);