mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-25 07:58:11 +08:00
* Refactor CSS layout and react logic for layout Fixes https://github.com/chanzuckerberg/cellxgene/issues/1022 * Menubar should wrap inside middle pane instead of overlapping left sidebar when window is scrunched * cellxgene should have a minimum width of 1240px 1. Replace absolute positioning and dimension calculation with css grid 2. Use flexbox for wrapping menubar buttons * Middle pane (graph) can calculate its own size * Removing components calculating their size/position relative to eachother increases modularity, decreases use of global variables * Improved some scrollbar behavior * Removed responsive reducer, propagating window size to components triggers unnecessary events and encourages breaking modularity; doing this made some components state agnostic Reference: https://css-tricks.com/snippets/css/complete-guide-grid/ * Reposition the continuous legend * Small fixes * Respond to feedback from @colinmegill * Respond to feedback from @colinmegill Add more documentation on the renderGraph method.
49 lines
1.2 KiB
JavaScript
49 lines
1.2 KiB
JavaScript
import React from "react";
|
|
import { AnchorButton, ButtonGroup, Tooltip } from "@blueprintjs/core";
|
|
import styles from "./menubar.css";
|
|
import * as globals from "../../globals";
|
|
|
|
function Subset(props) {
|
|
const {
|
|
subsetPossible,
|
|
subsetResetPossible,
|
|
handleSubset,
|
|
handleSubsetReset,
|
|
} = props;
|
|
|
|
return (
|
|
<ButtonGroup
|
|
className={styles.menubarButton}
|
|
>
|
|
<Tooltip
|
|
content="Subset to currently selected cells and associated metadata"
|
|
position="bottom"
|
|
hoverOpenDelay={globals.tooltipHoverOpenDelay}
|
|
>
|
|
<AnchorButton
|
|
type="button"
|
|
data-testid="subset-button"
|
|
disabled={!subsetPossible}
|
|
icon="pie-chart"
|
|
onClick={handleSubset}
|
|
/>
|
|
</Tooltip>
|
|
<Tooltip
|
|
content="Undo subset and show all cells and associated metadata"
|
|
position="bottom"
|
|
hoverOpenDelay={globals.tooltipHoverOpenDelay}
|
|
>
|
|
<AnchorButton
|
|
type="button"
|
|
data-testid="reset-subset-button"
|
|
disabled={!subsetResetPossible}
|
|
icon="full-circle"
|
|
onClick={handleSubsetReset}
|
|
/>
|
|
</Tooltip>
|
|
</ButtonGroup>
|
|
);
|
|
}
|
|
|
|
export default Subset;
|