import React from 'react' import { Dialog } from '@jbrowse/core/ui' import { Button, DialogActions, DialogContent, MenuItem, Slider, TextField, Typography, } from '@mui/material' import { observer } from 'mobx-react' import { makeStyles } from 'tss-react/mui' import colorSchemes from '../../colorSchemes.ts' import Checkbox2 from '../Checkbox2.tsx' import type { MsaViewModel } from '../../model.ts' const useStyles = makeStyles()(theme => ({ field: { margin: theme.spacing(4), }, flex: { display: 'flex', }, minw: { width: '80em', }, })) const toP = (s = 0) => +s.toFixed(1) const SettingsContent = observer(function ({ model }: { model: MsaViewModel }) { return ( <> ) }) const TreeSettings = observer(function TreeSettings({ model, }: { model: MsaViewModel }) { const { drawTree, drawLabels, drawNodeBubbles, labelsAlignRight, showBranchLen, } = model return (

Tree options

{ model.setShowBranchLen(!showBranchLen) }} /> { model.setDrawNodeBubbles(!drawNodeBubbles) }} /> { model.setDrawTree(!drawTree) }} /> { model.setLabelsAlignRight(!labelsAlignRight) }} /> { model.setDrawLabels(!drawLabels) }} />
) }) const MSASettings = observer(function MSASettings({ model, }: { model: MsaViewModel }) { const { classes } = useStyles() const { bgColor, colWidth, allowedGappyness, drawMsaLetters, colorSchemeName, hideGaps, rowHeight, } = model return (

MSA options

{ model.setDrawMsaLetters(!drawMsaLetters) }} /> { model.setBgColor(!bgColor) }} /> { model.setHideGaps(!hideGaps) }} /> {hideGaps ? (
Hide columns w/ >{allowedGappyness}% gaps { model.setAllowedGappyness(val) }} />
) : null}
Column width ({toP(colWidth)}px) { model.setColWidth(val) }} />
Row height ({toP(rowHeight)}px) { model.setRowHeight(val) }} />
{ model.setColorSchemeName(event.target.value) }} > {Object.keys(colorSchemes).map(option => ( {option} ))}
) }) const SettingsDialog = observer(function ({ model, onClose, }: { model: MsaViewModel onClose: () => void }) { const { classes } = useStyles() return ( { onClose() }} > ) }) export default SettingsDialog