mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-04 01:48:11 +08:00
count on class
This commit is contained in:
@@ -43,6 +43,9 @@ class Expression extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div style={{margin: 10}}>
|
<div style={{margin: 10}}>
|
||||||
|
<div style={{margin: 10, width: 300}}>
|
||||||
|
There are currently 10 cells selected, click a cell set button to store them.
|
||||||
|
</div>
|
||||||
<CellSetButton
|
<CellSetButton
|
||||||
{...this.props}
|
{...this.props}
|
||||||
eitherCellSetOneOrTwo={1}/>
|
eitherCellSetOneOrTwo={1}/>
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ class Graph extends React.Component {
|
|||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
this.count = 0;
|
||||||
this.state = {
|
this.state = {
|
||||||
drawn: false,
|
drawn: false,
|
||||||
svg: null,
|
svg: null,
|
||||||
@@ -76,7 +77,6 @@ class Graph extends React.Component {
|
|||||||
const colorBuffer = regl.buffer(generateColors(count))
|
const colorBuffer = regl.buffer(generateColors(count))
|
||||||
const sizeBuffer = regl.buffer(generateSizes(count))
|
const sizeBuffer = regl.buffer(generateSizes(count))
|
||||||
|
|
||||||
|
|
||||||
regl.frame(({viewportWidth, viewportHeight}) => {
|
regl.frame(({viewportWidth, viewportHeight}) => {
|
||||||
|
|
||||||
regl.clear({
|
regl.clear({
|
||||||
@@ -89,7 +89,7 @@ class Graph extends React.Component {
|
|||||||
distance: camera.distance,
|
distance: camera.distance,
|
||||||
color: colorBuffer,
|
color: colorBuffer,
|
||||||
position: pointBuffer,
|
position: pointBuffer,
|
||||||
count: count,
|
count: this.count,
|
||||||
view: camera.view(),
|
view: camera.view(),
|
||||||
scale: viewportHeight / viewportWidth
|
scale: viewportHeight / viewportWidth
|
||||||
})
|
})
|
||||||
@@ -101,7 +101,7 @@ class Graph extends React.Component {
|
|||||||
regl,
|
regl,
|
||||||
pointBuffer,
|
pointBuffer,
|
||||||
colorBuffer,
|
colorBuffer,
|
||||||
sizeBuffer,
|
sizeBuffer
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -139,7 +139,7 @@ class Graph extends React.Component {
|
|||||||
|
|
||||||
const s = d3.scaleLinear()
|
const s = d3.scaleLinear()
|
||||||
.domain([0,1])
|
.domain([0,1])
|
||||||
.range([-.95, .95]) /* padding */
|
.range([-.95, .95]) /* padding */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Construct Vectors
|
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.pointBuffer(positions)
|
||||||
this.state.colorBuffer(colors)
|
this.state.colorBuffer(colors)
|
||||||
this.state.sizeBuffer(sizes)
|
this.state.sizeBuffer(sizes)
|
||||||
|
this.count = positions.length
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
handleBrushSelectAction() {
|
handleBrushSelectAction() {
|
||||||
|
|||||||
Reference in New Issue
Block a user