diff --git a/package.json b/package.json index ead0a49..9c4da16 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cellpop", "private": false, - "version": "0.0.7", + "version": "0.0.13", "license": "MIT", "author": "Thomas Smits", "description": "A React component for visualizing cell populations in two-dimensional array data.", diff --git a/src/CellPopComponent.tsx b/src/CellPopComponent.tsx index 4ea062d..4ad141b 100644 --- a/src/CellPopComponent.tsx +++ b/src/CellPopComponent.tsx @@ -86,7 +86,11 @@ export const CellPop = withParentSize( return ( -
+
idx / 255); - console.log({ range }); const scale = scaleLinear({ range: range.map((t) => theme(t)), domain: range.map((r) => r * maxCount), diff --git a/src/contexts/ScaleContext.tsx b/src/contexts/ScaleContext.tsx index 005bcfc..62f0fd1 100644 --- a/src/contexts/ScaleContext.tsx +++ b/src/contexts/ScaleContext.tsx @@ -65,8 +65,8 @@ export function ScaleProvider({ children }: PropsWithChildren) { if ( // if no rows are selected/all rows are selected [0, rows.length].includes(expandedRows.size) || - // if all selected rows are hidden - [...expandedRows].every((row) => !rows.includes(row)) + // if there are very few rows + rows.length < 5 ) { const scale = scaleBand({ range: [height, 0], diff --git a/src/visx-visualization/Controls.tsx b/src/visx-visualization/Controls.tsx index 5dc47f8..808f397 100644 --- a/src/visx-visualization/Controls.tsx +++ b/src/visx-visualization/Controls.tsx @@ -152,13 +152,27 @@ function NormalizationControl() { }); const id = useId(); + + const currentTheme = useSetTheme((state) => state.currentTheme); + if (normalizationIsDisabled) { return null; } return ( - Heatmap Normalization + ({ + background: + currentTheme === "dark" + ? theme.palette.background.default + : theme.palette.grey[100], + paddingRight: 2, + })} + > + Heatmap Normalization +