[WIP] JS lint and dead code removal (#1053)

* lint and dead code removal

* fix regressions
This commit is contained in:
Bruce Martin
2019-11-21 14:10:02 -08:00
committed by GitHub
parent 9a540a4f0a
commit ee62dd355f
16 changed files with 118 additions and 155 deletions
+2 -9
View File
@@ -1,5 +1,3 @@
import calcCentroid from "../util/centroid";
const initialState = {
metadataField: "",
categoryIndex: -1,
@@ -8,7 +6,7 @@ const initialState = {
};
const CentroidLabel = (state = initialState, action, sharedNextState) => {
const { categoricalSelection, world, layoutChoice } = sharedNextState;
const { categoricalSelection } = sharedNextState;
const { metadataField, categoryIndex } = action;
const categoryField =
categoricalSelection?.[metadataField]?.categoryValues[categoryIndex];
@@ -19,12 +17,7 @@ const CentroidLabel = (state = initialState, action, sharedNextState) => {
metadataField,
categoryIndex,
categoryField,
centroidXY: null /* calcCentroid( This function call is computationally heavy and also leading to large GC. Before reimplementation, look into optimization and memoization
world,
metadataField,
categoryField,
layoutChoice.currentDimNames
) */
centroidXY: null
};
case "category value mouse hover end":
+1 -1
View File
@@ -55,7 +55,7 @@ const ColorsReducer = (
case "annotation: delete category": {
const { colorAccessor } = state;
if (action.metadataField != colorAccessor) {
if (action.metadataField !== colorAccessor) {
return state;
}
/* else reset */