mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-09 02:08:11 +08:00
debounce function in continuous
This commit is contained in:
@@ -106,16 +106,16 @@ class Continuous extends React.Component {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
maybeDrawLines(nextProps) {
|
maybeDrawLines = _.debounce((nextProps) => { /* https://stackoverflow.com/questions/23123138/perform-debounce-in-react-js */
|
||||||
if (
|
if (
|
||||||
nextProps.ranges &&
|
nextProps.ranges &&
|
||||||
nextProps.continuousSelection &&
|
nextProps.continuousSelection &&
|
||||||
nextProps.axesHaveBeenDrawn
|
nextProps.axesHaveBeenDrawn
|
||||||
) {
|
) {
|
||||||
|
|
||||||
// if (this.state._drawLinesCanvas) {
|
if (this.state._drawLinesCanvas) {
|
||||||
// this.state._drawLinesCanvas.invalidate(); /* this is only necessary if the internals of drawLinesCanvas are using the render queue */
|
this.state._drawLinesCanvas.invalidate(); /* this is only necessary if the internals of drawLinesCanvas are using the render queue */
|
||||||
// }
|
}
|
||||||
|
|
||||||
this.state.ctx.clearRect(0, 0, width, height);
|
this.state.ctx.clearRect(0, 0, width, height);
|
||||||
|
|
||||||
@@ -130,12 +130,12 @@ class Continuous extends React.Component {
|
|||||||
nextProps.colorScale,
|
nextProps.colorScale,
|
||||||
);
|
);
|
||||||
|
|
||||||
// this.setState({
|
this.setState({
|
||||||
// // dimensions,
|
// dimensions,
|
||||||
// _drawLinesCanvas, /* this will only exist if the internals of drawLinesCanvas are using the render queue */
|
_drawLinesCanvas, /* this will only exist if the internals of drawLinesCanvas are using the render queue */
|
||||||
// })
|
})
|
||||||
}
|
}
|
||||||
}
|
}, 200)
|
||||||
|
|
||||||
handleBrushAction (selection) {
|
handleBrushAction (selection) {
|
||||||
this.props.dispatch({
|
this.props.dispatch({
|
||||||
|
|||||||
Reference in New Issue
Block a user