From 1547a864c2f5c1bbf30c0b310e4fff47d95115a9 Mon Sep 17 00:00:00 2001 From: Matt Weiden <538456+mweiden@users.noreply.github.com> Date: Wed, 4 Mar 2020 09:19:12 -0800 Subject: [PATCH] Disable ColorBy button for truncated categories (#1191) * Disable ColorBy button for truncated categories Fixes https://github.com/chanzuckerberg/cellxgene/issues/1156 For categories that have more than 100 labels we truncate the labels in the UI, but still allowed users to ColorBy these categories. Coloring by these categories can cause browsers to get bogged down. This commit disables ColorBy for truncated categories. * Minor documentation spelling and typo fixes * Respond to feedback from @liaprins-czi * Respond to feedback from @colinmegill and @bkmartinjr --- client/src/components/categorical/category.js | 17 +++++++++++++---- client/src/globals.js | 2 +- client/src/reducers/cascade.js | 4 ++-- client/src/util/stateManager/controlsHelpers.js | 2 +- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/client/src/components/categorical/category.js b/client/src/components/categorical/category.js index db812007..4fda6da9 100644 --- a/client/src/components/categorical/category.js +++ b/client/src/components/categorical/category.js @@ -156,6 +156,8 @@ class Category extends React.Component { return this.renderIsStillLoading(); } + const isTruncated = _.get(categoricalSelection, [metadataField, "isTruncated"], false); + return (