mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-27 23:18:12 +08:00
[DO NOT MERGE] performance improvements in color-by feature (#535)
performance improvements in color-by feature
This commit is contained in:
@@ -26,7 +26,7 @@ import actions from "../../actions";
|
||||
obsAnnotations: _.get(state.controls.world, "obsAnnotations", null)
|
||||
}))
|
||||
class HistogramBrush extends React.Component {
|
||||
calcHistogramCache = memoize((obsAnnotations, field, ranges) => {
|
||||
calcHistogramCache = memoize((obsAnnotations, field, rangeMin, rangeMax) => {
|
||||
const { world } = this.props;
|
||||
const histogramCache = {};
|
||||
|
||||
@@ -40,7 +40,7 @@ class HistogramBrush extends React.Component {
|
||||
|
||||
histogramCache.x = d3
|
||||
.scaleLinear()
|
||||
.domain([ranges.min, ranges.max])
|
||||
.domain([rangeMin, rangeMax])
|
||||
.range([0, this.width]);
|
||||
|
||||
histogramCache.bins = d3
|
||||
@@ -130,7 +130,8 @@ class HistogramBrush extends React.Component {
|
||||
const histogramCache = this.calcHistogramCache(
|
||||
obsAnnotations,
|
||||
field,
|
||||
ranges
|
||||
ranges.min,
|
||||
ranges.max
|
||||
);
|
||||
|
||||
const { x, y, bins, numValues } = histogramCache;
|
||||
|
||||
Reference in New Issue
Block a user