Skip to content

Commit 1284310

Browse files
committed
change path
1 parent 1c23f64 commit 1284310

2 files changed

Lines changed: 29 additions & 29 deletions

File tree

src/app/matrix/page.tsx

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
'use client';
22

33
import { useEffect, useState } from "react";
4+
import MatrixPlot from "@/components/MatrixPlot";
45
import { usePlotSettings } from '@/context/PlotSettingsContext';
56
import { update_df, getEpoch } from '@/utils/matrixUtils';
6-
import D3MatrixPlot from '@/components/D3MatrixPlot';
77

88
const MatrixPage = () => {
99
const {
@@ -22,7 +22,16 @@ 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
2527

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+
};
2635
useEffect(() => {
2736
if (!isValid) return;
2837
setLoading(true);
@@ -55,22 +64,24 @@ const MatrixPage = () => {
5564
<p className="text-red-500">Failed to load matrix data.</p>
5665
) : (
5766
<div className={`grid gap-6 ${dataSelection.length > 5 ? 'grid-rows-2 grid-cols-1' : 'grid-cols-1 lg:grid-cols-2'}`}>
58-
{/* <MatrixPlot */}
59-
<D3MatrixPlot
67+
<MatrixPlot
68+
// <D3MatrixPlot
6069
matrixData={swMatrix}
6170
labelFontSize={labelFontSize}
6271
title="SW Scatter Matrix"
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"
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)}
6575
/>
6676

67-
{/* <MatrixPlot */}
68-
<D3MatrixPlot
77+
<MatrixPlot
78+
// <D3MatrixPlot
6979
matrixData={lwMatrix}
7080
labelFontSize={labelFontSize}
7181
title="LW Scatter Matrix"
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"
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)}
7485
/>
7586
</div>
7687
)}
Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
'use client';
22

33
import { useEffect, useState } from "react";
4-
import MatrixPlot from "@/components/MatrixPlot";
54
import { usePlotSettings } from '@/context/PlotSettingsContext';
65
import { update_df, getEpoch } from '@/utils/matrixUtils';
6+
import D3MatrixPlot from '@/components/D3MatrixPlot';
77

88
const 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

Comments
 (0)