Skip to content

Commit

Permalink
fixup(frontend): reword buttons, add help topic and ? button
Browse files Browse the repository at this point in the history
  • Loading branch information
rileyhgrant committed May 30, 2024
1 parent 7f6847c commit 42a8a5a
Show file tree
Hide file tree
Showing 4 changed files with 3,943 additions and 1,355 deletions.
8 changes: 8 additions & 0 deletions browser/help/topics/hidden-reads-visualizations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
id: hidden-reads-visualization
title: 'Reads visualization hidden by default'
---

Visualizations of reads data is hidden by default. This helps to save cost on egress fees.

Users can opt into loading the reads data for a variant once by clicking the "Load read data" button, and can opt to have the read data always load on variant pages by checking the "Always load read data" box.
58 changes: 31 additions & 27 deletions browser/src/ReadData/ReadData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { BaseQuery } from '../Query'
import StatusMessage from '../StatusMessage'
import { CheckboxInput } from '../ChartStyles'
import { logButtonClick } from '../analytics'
import InfoButton from '../help/InfoButton'

const IGVBrowser = lazy(() => import('./IGVBrowser'))

Expand Down Expand Up @@ -544,33 +545,36 @@ const ReadDataContainer = ({ datasetId, variantIds }: ReadDataContainerProps) =>
return (
<>
<LoadReadsControls>
<Button
id="load-once"
disabled={loadOnce}
onClick={() => {
logButtonClick('User loaded readviz data once')
setLoadOnce(!loadOnce)
}}
>
Load once
</Button>
<div>
<br />
<span>
<CheckboxInput
id="always-load"
checked={alwaysLoad}
onChange={(e: any) => {
if (e.target.checked) {
logButtonClick('User toggled option to always load readviz data on')
}
setAlwaysLoad(e.target.checked)
setLoadOnce(true)
}}
/>
Always load Read data
</span>
</div>
<span>
<InfoButton topic="hidden-reads-visualization" />{' '}
<Button
id="load-once"
disabled={loadOnce}
onClick={() => {
logButtonClick('User loaded readviz data once')
setLoadOnce(!loadOnce)
}}
>
Load read data
</Button>
<div>
<br />
<span>
<CheckboxInput
id="always-load"
checked={alwaysLoad}
onChange={(e: any) => {
if (e.target.checked) {
logButtonClick('User toggled option to always load readviz data on')
}
setAlwaysLoad(e.target.checked)
setLoadOnce(true)
}}
/>
Always load read data
</span>
</div>
</span>
</LoadReadsControls>
{!loadOnce && !alwaysLoad && <NoReadsSpacer />}
{(loadOnce || alwaysLoad) && (
Expand Down
Loading

0 comments on commit 42a8a5a

Please sign in to comment.