import {memo, useState} from 'react'; import Paper from '@mui/material/Paper'; import {Box, Checkbox, FormControlLabel, Grid} from "@mui/material"; import DataProcessingPlot from "./DataProcessingPlot"; import Toolbar from "@mui/material/Toolbar"; import MenuItem from "@mui/material/MenuItem"; import FormControl from "@mui/material/FormControl"; import Select, {SelectChangeEvent} from "@mui/material/Select"; import {azint_unit, plot_type} from "../client"; type MyProps = { type: plot_type, height: number } function DataProcessingPlots({type: initialType, height}: MyProps) { const [type, setType] = useState(initialType); const [binning, setBinning] = useState("0"); const [tab, setTab] = useState(initialType); const [angleUnits, setAngleUnits] = useState(true); const [azintUnit, setAzintUnit] = useState(azint_unit.Q_RECIP_A); const plotTypeChange = (event : SelectChangeEvent) => { let val = String(event.target.value).toString(); setTab(val); setType(val as plot_type); }; const handleChange = (event : SelectChangeEvent) => { setBinning(String(event.target.value).toString()); }; return setAngleUnits(e.target.checked)} /> } label="X-axis exp. units" /> setAzintUnit( e.target.checked ? azint_unit.TWO_THETA_DEG : azint_unit.Q_RECIP_A )} /> } label="2θ (az. int.)" /> } export default memo(DataProcessingPlots);