From 3ba4cf4483ee9ed4c8845454607bed1143424c93 Mon Sep 17 00:00:00 2001 From: Severiano Badajoz Date: Wed, 11 Mar 2020 15:20:20 -0700 Subject: [PATCH] fix bug created from master rebase (#1216) --- client/src/util/centroid.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/client/src/util/centroid.js b/client/src/util/centroid.js index 77cbee66..4dc6ba60 100644 --- a/client/src/util/centroid.js +++ b/client/src/util/centroid.js @@ -33,15 +33,14 @@ const getCoordinatesByCategoricalValues = ( const layoutXArray = obsLayout.col(layoutDimNames[0]).asArray(); const layoutYArray = obsLayout.col(layoutDimNames[1]).asArray(); - const { categoryValueIndices, categoryValueCounts } = categoricalSelection[ - categoryName - ]; + const { categoryValueIndices, categoryValueCounts } = + categoricalSelection?.[categoryName] || {}; // If the coloredBy is not a categorical col if (categoryValueIndices === undefined) { - return coordinates; + return coordsByCategoryLabel; } - + // Check to see if the current category is a user created annotation const isUserAnno = schemaObsByName[categoryName].writable;