11'use client' ;
22
33import { useEffect , useState } from "react" ;
4- import MatrixPlot from "@/components/MatrixPlot" ;
54import { usePlotSettings } from '@/context/PlotSettingsContext' ;
65import { update_df , getEpoch } from '@/utils/matrixUtils' ;
6+ import D3MatrixPlot from '@/components/D3MatrixPlot' ;
77
88const MatrixPage = ( ) => {
99 const {
@@ -22,16 +22,7 @@ const MatrixPage = () => {
2222 const [ lwMatrix , setLwMatrix ] = useState < any [ ] | null > ( null ) ;
2323 const [ loading , setLoading ] = useState ( false ) ;
2424 const [ error , setError ] = useState ( false ) ;
25- const baseHeight = 600 ;
26- const extraPerDimension = 120 ; // adjust as needed
2725
28- // eslint-disable-next-line @typescript-eslint/no-explicit-any
29- const calcPlotHeight = ( matrixData : any [ ] ) => {
30- const dimCount = matrixData . length > 0 ? Object . keys ( matrixData [ 0 ] ) . length : 2 ;
31- return dataSelection . length > 5
32- ? baseHeight + ( dimCount - 2 ) * extraPerDimension
33- : baseHeight ;
34- } ;
3526 useEffect ( ( ) => {
3627 if ( ! isValid ) return ;
3728 setLoading ( true ) ;
@@ -64,24 +55,22 @@ const calcPlotHeight = (matrixData: any[]) => {
6455 < p className = "text-red-500" > Failed to load matrix data.</ p >
6556 ) : (
6657 < div className = { `grid gap-6 ${ dataSelection . length > 5 ? 'grid-rows-2 grid-cols-1' : 'grid-cols-1 lg:grid-cols-2' } ` } >
67- < MatrixPlot
68- // <D3MatrixPlot
58+ { /* <MatrixPlot */ }
59+ < D3MatrixPlot
6960 matrixData = { swMatrix }
7061 labelFontSize = { labelFontSize }
7162 title = "SW Scatter Matrix"
72- subtitle = { `Source Brightness measured with BG annulus at each frame (e.g., SW.<i>r<sub>in</sub></i>.<i>r<sub>out</sub></i> → SW.10.30)` }
73- // subtitle="sw"
74- height = { calcPlotHeight ( swMatrix ) }
63+ // subtitle={`Source Brightness measured with BG annulus at each frame (e.g., SW.<i>r<sub>in</sub></i>.<i>r<sub>out</sub></i> → SW.10.30)`}
64+ subtitle = "sw"
7565 />
7666
77- < MatrixPlot
78- // <D3MatrixPlot
67+ { /* <MatrixPlot */ }
68+ < D3MatrixPlot
7969 matrixData = { lwMatrix }
8070 labelFontSize = { labelFontSize }
8171 title = "LW Scatter Matrix"
82- subtitle = { `Source Brightness measured with BG annulus at each frame (e.g., LW.<i>r<sub>in</sub></i>.<i>r<sub>out</sub></i> → LW.10.30)` }
83- // subtitle="lw"
84- height = { calcPlotHeight ( lwMatrix ) }
72+ // subtitle={`Source Brightness measured with BG annulus at each frame (e.g., LW.<i>r<sub>in</sub></i>.<i>r<sub>out</sub></i> → LW.10.30)`}
73+ subtitle = "lw"
8574 />
8675 </ div >
8776 ) }
0 commit comments