-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(wmg): updates to data source action (#6210)
- Loading branch information
Showing
34 changed files
with
661 additions
and
508 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { fontHeaderS } from "@czi-sds/components"; | ||
import styled from "@emotion/styled"; | ||
import { gray100, gray300, gray500 } from "src/common/theme"; | ||
|
||
interface CellProps { | ||
align?: boolean; | ||
} | ||
|
||
export const DivTable = styled.div` | ||
display: table; | ||
width: 100%; | ||
max-width: 600px; | ||
border-collapse: collapse; | ||
`; | ||
|
||
export const DivTableRow = styled.div` | ||
display: table-row; | ||
line-height: 24px; | ||
&:nth-of-type(even) { | ||
background-color: ${gray100}; | ||
} | ||
`; | ||
|
||
export const DivTableCell = styled.div<CellProps>` | ||
display: table-cell; | ||
padding: 4px, 0px, 4px, 0px; | ||
text-align: ${(props) => (props.align ? "right" : "left")}; | ||
@media (max-width: 600px) { | ||
display: block; | ||
width: 100%; | ||
box-sizing: border-box; | ||
&:not(:last-child) { | ||
margin-bottom: 0.625rem; | ||
} | ||
} | ||
`; | ||
|
||
export const DivTableHead = styled.div` | ||
display: table-row; | ||
${fontHeaderS} | ||
font-weight: 500; | ||
color: ${gray500}; | ||
`; | ||
|
||
export const DivTableLegend = styled.div` | ||
display: table-row; | ||
font-weight: bold; | ||
font-size: 1.2em; | ||
color: ${gray500}; | ||
border-bottom: 1px solid ${gray300}; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -287,6 +287,5 @@ export const useConnect = ({ | |
DropdownMenuProps, | ||
isHeatmapShown, | ||
InputDropdownProps, | ||
datasets, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
frontend/src/views/WheresMyGeneV2/components/InfoPanel/components/Legend/connect.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { useCallback, useState } from "react"; | ||
import { useFilterDimensions } from "src/common/queries/wheresMyGene"; | ||
import { EVENTS } from "src/common/analytics/events"; | ||
import { track } from "src/common/analytics"; | ||
import { COLOR_LEGEND } from "../RelativeGeneExpression/constants"; | ||
import { HOVER_START_TIME_MS } from "src/views/WheresMyGeneV2/common/constants"; | ||
import { EMPTY_ARRAY } from "src/common/constants/utils"; | ||
|
||
export const useConnect = () => { | ||
const [hoverStartTime, setHoverStartTime] = useState(0); | ||
const useHandleHoverEnd = (event: EVENTS, payload = {}) => { | ||
return useCallback(() => { | ||
if (Date.now() - hoverStartTime > HOVER_START_TIME_MS) { | ||
track(event, payload); | ||
} | ||
}, [event, payload]); | ||
}; | ||
|
||
const handleLegendHoverEnd = useHandleHoverEnd( | ||
EVENTS.WMG_LEGEND_QUESTION_BUTTON_HOVER, | ||
{ label: COLOR_LEGEND } | ||
); | ||
|
||
const { data: filterDimensions } = useFilterDimensions(); | ||
|
||
const { datasets = EMPTY_ARRAY } = filterDimensions; | ||
|
||
const datasetsCount = datasets.length; | ||
|
||
return { datasetsCount, setHoverStartTime, handleLegendHoverEnd }; | ||
}; |
Oops, something went wrong.