Skip to content

Commit 901ca81

Browse files
committed
feat: add average line to raw data plot on average point click
1 parent cb213bb commit 901ca81

10 files changed

Lines changed: 548 additions & 536 deletions

File tree

src/app/layout.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
import './globals.css';
33
import { ReactNode } from 'react';
44
import Navbar from '@/components/Navbar/Navbar';
5-
// import Controller from '@/components/Controller';
6-
import SidebarLayout from '@/components/Sidebar/SidebarLayout';
5+
import Sidebar from '@/components/Sidebar/Sidebar';
76
import { PlotSettingsProvider } from '@/context/PlotSettingsContext';
87
export const metadata = {
98
title: 'JWST Precision Timing',
@@ -18,8 +17,8 @@ export default function RootLayout({ children }: { children: ReactNode }) {
1817
<PlotSettingsProvider>
1918
<Navbar />
2019
<div className="flex flex-1 overflow-hidden">
21-
<SidebarLayout />
22-
<main className="flex-1 h-[calc(100vh-4rem)] overflow-auto">
20+
<Sidebar />
21+
<main className="flex-1 h-[calc(100vh-52px)] overflow-auto">
2322
{children}
2423
</main>
2524
</div>

src/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import LightCurvePlot from '@/components/LightCurvePlot';
22

33
export default function HomePage() {
44
return (
5-
<main className="min-h-screen bg-gray-50">
5+
<main className="min-h-full bg-gray-50 overflow-auto">
66
<LightCurvePlot />
77
</main>
88
);

src/components/Controller.tsx

Lines changed: 0 additions & 162 deletions
This file was deleted.

src/components/ImageModal.tsx

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

3-
import { Fragment } from 'react';
3+
import { Fragment } from 'react';
44
import { Dialog, Transition } from '@headlessui/react';
55

66
/*
@@ -18,6 +18,7 @@ interface ImageModalProps {
1818
mjd?: number;
1919
filename?: string;
2020
rows?: Array<{
21+
color?: string;
2122
epoch: string;
2223
r_in: string;
2324
r_out: string;
@@ -74,6 +75,7 @@ export function ImageModal({
7475
<table className="min-w-full text-sm border border-gray-300 rounded overflow-hidden">
7576
<thead className="bg-gray-100 text-black font-semibold">
7677
<tr>
78+
<th className="px-3 py-2 text-left"> </th>
7779
<th className="px-3 py-2 text-left">Epoch</th>
7880
<th className="px-3 py-2 text-left">r_in</th>
7981
<th className="px-3 py-2 text-left">r_out</th>
@@ -83,10 +85,22 @@ export function ImageModal({
8385
<tbody>
8486
{details.rows.map((row, idx) => (
8587
<tr key={idx} className="border-t hover:bg-gray-50">
88+
<td className="px-3 py-1">
89+
{row.color ? (
90+
<div
91+
className="w-4 h-4 rounded-full border border-gray-300"
92+
style={{ backgroundColor: row.color }}
93+
title={row.color}
94+
/>
95+
) : (
96+
<div className="w-4 h-4 rounded-full border border-gray-200 bg-white" title="No color" />
97+
)}
98+
</td>
8699
<td className="px-3 py-1 font-mono text-black">{row.epoch}</td>
87100
<td className="px-3 py-1 font-mono text-black">{row.r_in}</td>
88101
<td className="px-3 py-1 font-mono text-black">{row.r_out}</td>
89-
<td className="px-3 py-1 text-blue-600 font-semibold">{row.y.toFixed(2)}</td>
102+
<td className="px-3 py-1 text-black font-semibold">{row.y.toFixed(2)}</td>
103+
{/* <td className="px-3 py-1 text-blue-600 font-semibold">{row.y.toFixed(2)}</td> */}
90104
</tr>
91105
))}
92106
</tbody>

0 commit comments

Comments
 (0)