import styled from '@emotion/styled'; import { memo, useMemo, useState } from 'react'; import { useWatch } from 'react-hook-form'; import { Sections } from '../../../../elements/Sections.tsx'; import PlotChart from './PlotChart.js'; import { processSnapPlot } from './processSnapPlot.js'; const Container = styled.div` border-top: 1px solid #ededed; display: flex; flex-direction: row; justify-content: space-evenly; padding: 10px; `; interface Spectrum2DHistogramProps { color?: string; data: any; } const yLogBase = 2; function Spectrum2DHistogram({ color = 'red', data, }: Spectrum2DHistogramProps) { const [isOpen, setIsOpen] = useState(false); const processedData = useMemo(() => { return processSnapPlot('2D', data.rr, yLogBase); }, [data]); const isApplyToAllSelected = useWatch({ name: 'applyToAll' }); if (isApplyToAllSelected) return null; return ( setIsOpen(!isOpen)} > ); } export default memo(Spectrum2DHistogram);