diff --git a/src/components/AppBar.tsx b/src/components/AppBar.tsx index c91a9422..2b2799fe 100644 --- a/src/components/AppBar.tsx +++ b/src/components/AppBar.tsx @@ -19,7 +19,6 @@ import MainWalkthrough, { Handle as MainWalkthroughRef, } from './walkthrough/MainWalkthrough'; import { useColors } from '../stores/colors'; -import type { ColorsState } from '../stores/colors'; import ColorPaletteSelect from './ui/ColorPaletteSelect'; import { categoricalPalettes, continuousPalettes } from '../palettes'; diff --git a/src/hooks/useColorTransferFunction.ts b/src/hooks/useColorTransferFunction.ts index 3b3f4d1e..1939342c 100644 --- a/src/hooks/useColorTransferFunction.ts +++ b/src/hooks/useColorTransferFunction.ts @@ -112,7 +112,7 @@ export const createConstantTransferFunction = ( export const createColorTransferFunction = ( data: ColumnData | undefined, dType: DataType | undefined, - robust: boolean = false, + robust = false, continuousInts = false, continuousCategories = false, classBreaks?: number[] @@ -163,7 +163,7 @@ export const useColorTransferFunction = (data: any[], dtype: DataType) => { colors.continuousInts, colors.continuousCategories ), - [dtype, data] + [dtype, data, colors.robust, colors.continuousInts, colors.continuousCategories] ); }; diff --git a/src/stores/dataset/colorTransferFunctionFactory.tsx b/src/stores/dataset/colorTransferFunctionFactory.tsx index 318692ab..a868bfa2 100644 --- a/src/stores/dataset/colorTransferFunctionFactory.tsx +++ b/src/stores/dataset/colorTransferFunctionFactory.tsx @@ -2,7 +2,6 @@ import { createColorTransferFunction, TransferFunction, } from '../../hooks/useColorTransferFunction'; -import _ from 'lodash'; import { DataColumn, TableData } from '../../types'; import { useColors } from '../colors'; @@ -14,7 +13,7 @@ type ColumnsTransferFunctions = Record< export const makeColumnsColorTransferFunctions = ( columns: DataColumn[], data: TableData, - filteredMask: boolean[] + filteredIndices: Int32Array ): ColumnsTransferFunctions => { const colors = useColors.getState(); @@ -28,7 +27,7 @@ export const makeColumnsColorTransferFunctions = ( colors.continuousCategories ), filtered: createColorTransferFunction( - data[column.key].filter((_, i) => filteredMask[i]), + filteredIndices.map((i) => data[column.key][i]), column.type, colors.robust, colors.continuousInts, diff --git a/src/stores/dataset/dataset.ts b/src/stores/dataset/dataset.ts index 154f204d..123ec75d 100644 --- a/src/stores/dataset/dataset.ts +++ b/src/stores/dataset/dataset.ts @@ -430,7 +430,7 @@ export const useDataset = create( const newTransferFunctions = makeColumnsColorTransferFunctions( get().columns.filter(({ key }) => columnsToCompute.includes(key)), get().columnData, - get().isIndexFiltered + get().filteredIndices ); set({