From 5595762515a1e21d7fe4762b6922a0eb1e673807 Mon Sep 17 00:00:00 2001 From: Victor Lin <13424970+victorlin@users.noreply.github.com> Date: Tue, 29 Oct 2024 16:30:09 -0700 Subject: [PATCH] Remove broken/unused searchNodes parameter There is a type error that prevents this from working properly: includes() takes a single string, but an array of PhyloNodes is given. It's not used on any existing calls to updateTipRadii, so just remove it entirely. --- src/actions/tree.ts | 7 ++----- src/util/tipRadiusHelpers.ts | 7 +------ 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/actions/tree.ts b/src/actions/tree.ts index a0b04405f..a4d61215b 100644 --- a/src/actions/tree.ts +++ b/src/actions/tree.ts @@ -224,7 +224,6 @@ export const updateTipRadii = ( tipSelectedIdx = false, selectedLegendItem = false, geoFilter = [], - searchNodes = false }: { /** the strain to highlight (always tree 1) */ tipSelectedIdx?: number | false, @@ -234,8 +233,6 @@ export const updateTipRadii = ( /** a filter to apply to the strains. Empty array or array of len 2. [0]: geoResolution, [1]: value to filter to */ geoFilter?: [string, string] | [], - - searchNodes?: PhyloNode[] | false } = {} ) => { return (dispatch: AppDispatch, getState: () => RootState) => { @@ -252,8 +249,8 @@ export const updateTipRadii = ( d.dataToo = calcTipRadii({tipSelectedIdx: idx, colorScale, tree: treeToo}); } } else { - d.data = calcTipRadii({selectedLegendItem, geoFilter, searchNodes, colorScale, tree}); - if (tt) d.dataToo = calcTipRadii({selectedLegendItem, geoFilter, searchNodes, colorScale, tree: treeToo}); + d.data = calcTipRadii({selectedLegendItem, geoFilter, colorScale, tree}); + if (tt) d.dataToo = calcTipRadii({selectedLegendItem, geoFilter, colorScale, tree: treeToo}); } dispatch(d); }; diff --git a/src/util/tipRadiusHelpers.ts b/src/util/tipRadiusHelpers.ts index e66e45fad..5e3b2b654 100644 --- a/src/util/tipRadiusHelpers.ts +++ b/src/util/tipRadiusHelpers.ts @@ -1,7 +1,7 @@ import { tipRadius, tipRadiusOnLegendMatch } from "./globals"; import { getTipColorAttribute, numDate } from "./colorHelpers"; import { getTraitFromNode } from "./treeMiscHelpers"; -import { ColorScale, PhyloNode } from "../components/tree/phyloTree/types"; +import { ColorScale } from "../components/tree/phyloTree/types"; import { TreeState } from "../components/tree/tree"; /** @@ -59,7 +59,6 @@ export const calcTipRadii = ({ tipSelectedIdx = false, selectedLegendItem = false, geoFilter = [], - searchNodes = false, colorScale, tree }: { @@ -71,8 +70,6 @@ export const calcTipRadii = ({ geoFilter?: [string, string] | [] - searchNodes?: PhyloNode[] | false - /** node (tip) in question */ colorScale: any @@ -82,8 +79,6 @@ export const calcTipRadii = ({ return tree.nodes.map((d) => determineLegendMatch(selectedLegendItem, d, colorScale) ? tipRadiusOnLegendMatch : tipRadius); } else if (geoFilter.length===2 && tree && tree.nodes) { return tree.nodes.map((d) => determineLocationMatch(d, geoFilter[0], geoFilter[1]) ? tipRadiusOnLegendMatch : tipRadius); - } else if (searchNodes) { - return tree.nodes.map((d) => d.name.toLowerCase().includes(searchNodes) ? tipRadiusOnLegendMatch : tipRadius); } else if (tipSelectedIdx) { const radii = tree.nodes.map(() => tipRadius); radii[tipSelectedIdx] = tipRadiusOnLegendMatch + 3;