From d2171b9a2f9935b8b92c3103c93405d1d74ef2b3 Mon Sep 17 00:00:00 2001 From: Bruce Martin Date: Mon, 25 Nov 2019 18:16:49 -0800 Subject: [PATCH] fix perf regression introduced by user anno changes (#1060) --- client/src/components/categorical/occupancy.js | 2 +- client/src/components/categorical/value.js | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/client/src/components/categorical/occupancy.js b/client/src/components/categorical/occupancy.js index fdf7a2b1..ca6689fc 100644 --- a/client/src/components/categorical/occupancy.js +++ b/client/src/components/categorical/occupancy.js @@ -10,7 +10,7 @@ import { } from "@blueprintjs/core"; @connect() -class Occupancy extends React.Component { +class Occupancy extends React.PureComponent { _WIDTH = 100; _HEIGHT = 11; diff --git a/client/src/components/categorical/value.js b/client/src/components/categorical/value.js index eaafdc7b..643ea6e6 100644 --- a/client/src/components/categorical/value.js +++ b/client/src/components/categorical/value.js @@ -191,7 +191,8 @@ class CategoryValue extends React.Component { const worldChange = props.world !== nextProps.world; const colorAccessorChange = props.colorAccessor !== nextProps.colorAccessor; const annotationsChange = props.annotations !== nextProps.annotations; - const crossfilterChange = props.crossfilter !== nextProps.crossfilter; + const crossfilterChange = + props.isUserAnno && props.crossfilter !== nextProps.crossfilter; const editingLabel = state.editedLabelText !== nextState.editedLabelText; return ( @@ -554,9 +555,7 @@ class CategoryValue extends React.Component { data-testclass="handleDeleteValue" data-testid={`handleDeleteValue-${metadataField}`} onClick={this.handleDeleteValue} - text={`Delete this label, and reassign all cells to type '${ - globals.unassignedCategoryLabel - }'`} + text={`Delete this label, and reassign all cells to type '${globals.unassignedCategoryLabel}'`} /> ) : null}