From 23a71b71df1dde059c9beeed6dfb5f252ee4045b Mon Sep 17 00:00:00 2001 From: Colin Megill Date: Thu, 5 Apr 2018 15:35:48 -0700 Subject: [PATCH] count on class --- src/components/expression/expressionButtons.js | 3 +++ src/components/graph/graph.js | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/expression/expressionButtons.js b/src/components/expression/expressionButtons.js index 9e884257..eaf6cf58 100644 --- a/src/components/expression/expressionButtons.js +++ b/src/components/expression/expressionButtons.js @@ -43,6 +43,9 @@ class Expression extends React.Component { return (
+
+ There are currently 10 cells selected, click a cell set button to store them. +
diff --git a/src/components/graph/graph.js b/src/components/graph/graph.js index 1c240217..3afcc8fc 100644 --- a/src/components/graph/graph.js +++ b/src/components/graph/graph.js @@ -51,6 +51,7 @@ class Graph extends React.Component { constructor(props) { super(props); + this.count = 0; this.state = { drawn: false, svg: null, @@ -76,7 +77,6 @@ class Graph extends React.Component { const colorBuffer = regl.buffer(generateColors(count)) const sizeBuffer = regl.buffer(generateSizes(count)) - regl.frame(({viewportWidth, viewportHeight}) => { regl.clear({ @@ -89,7 +89,7 @@ class Graph extends React.Component { distance: camera.distance, color: colorBuffer, position: pointBuffer, - count: count, + count: this.count, view: camera.view(), scale: viewportHeight / viewportWidth }) @@ -101,7 +101,7 @@ class Graph extends React.Component { regl, pointBuffer, colorBuffer, - sizeBuffer, + sizeBuffer }) } @@ -139,7 +139,7 @@ class Graph extends React.Component { const s = d3.scaleLinear() .domain([0,1]) - .range([-.95, .95]) /* padding */ + .range([-.95, .95]) /* padding */ /* Construct Vectors @@ -169,7 +169,7 @@ class Graph extends React.Component { ]); } - sizes.push(cell["__selected__"] ? 4 : 1) + sizes.push(cell["__selected__"] ? 4 : .2) /* make this a function of the number of total cells, including regraph */ } }) @@ -177,6 +177,7 @@ class Graph extends React.Component { this.state.pointBuffer(positions) this.state.colorBuffer(colors) this.state.sizeBuffer(sizes) + this.count = positions.length } } handleBrushSelectAction() {