-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scroll zoom, pan buttons, and better scroll boundaries to dotplot (…
…#3561) * Add pan buttons on dotplot * Add wheel mode * Wheel zoom * New zoom/pan options, with ctrl+click and drag performing toggleable action * Min/max zoom levels on dotplot * Much tighter 1d bounds restrictions to avoid scrolling offscreen
- Loading branch information
Showing
10 changed files
with
332 additions
and
134 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
26 changes: 26 additions & 0 deletions
26
plugins/dotplot-view/src/DotplotView/components/DotplotWarnings.tsx
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,26 @@ | ||
import React, { lazy, useState } from 'react' | ||
import { Alert, Button } from '@mui/material' | ||
import { observer } from 'mobx-react' | ||
|
||
// locals | ||
import { DotplotViewModel } from '../model' | ||
|
||
// lazy components | ||
const WarningDialog = lazy(() => import('./WarningDialog')) | ||
|
||
export default observer(function ({ model }: { model: DotplotViewModel }) { | ||
const trackWarnings = model.tracks.filter(t => t.displays[0].warnings?.length) | ||
const [shown, setShown] = useState(false) | ||
return trackWarnings.length ? ( | ||
<Alert severity="warning"> | ||
Warnings during render{' '} | ||
<Button onClick={() => setShown(true)}>More info</Button> | ||
{shown ? ( | ||
<WarningDialog | ||
trackWarnings={trackWarnings} | ||
handleClose={() => setShown(false)} | ||
/> | ||
) : null} | ||
</Alert> | ||
) : null | ||
}) |
Oops, something went wrong.