import React, { useState } from 'react' import { Dialog, ErrorMessage } from '@jbrowse/core/ui' import { Alert, Button, DialogActions, DialogContent, FormControl, FormControlLabel, FormLabel, Radio, RadioGroup, Typography, useTheme, } from '@mui/material' import Checkbox2 from '../Checkbox2.tsx' import type { MsaViewModel } from '../../model.ts' export default function ExportSVGDialog({ model, onClose, }: { model: MsaViewModel onClose: () => void }) { const [includeMinimap, setIncludeMinimap] = useState(true) const [includeTracks, setIncludeTracks] = useState(true) const [exportType, setExportType] = useState('viewport') const [error, setError] = useState() const theme = useTheme() const { totalWidth, totalHeight, treeAreaWidth, turnedOnTracks } = model const hasTracks = turnedOnTracks.length > 0 const entireWidth = totalWidth + treeAreaWidth const entireHeight = totalHeight const isLargeExport = exportType === 'entire' && (entireWidth > 10000 || entireHeight > 10000) return ( { onClose() }} open title="Export SVG" > {error ? : null} Settings: { setIncludeMinimap(!includeMinimap) }} /> {hasTracks ? ( { setIncludeTracks(!includeTracks) }} /> ) : null}
Export type { setExportType(event.target.value) }} > } label="Entire MSA" /> } label="Current viewport only" />
{isLargeExport ? ( The entire MSA is very large ({Math.round(entireWidth)}x {Math.round(entireHeight)} pixels). Export may be slow or fail. ) : null}
) }