Skip to content

Commit 52bb423

Browse files
Merge pull request #3 from Danielpeter-99/main
2 parents d130598 + 305b71c commit 52bb423

File tree

5 files changed

+33
-7
lines changed

5 files changed

+33
-7
lines changed

backend/app/main.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,25 @@ async def upload_file(file: UploadFile = File(...), model: str = Form(...)):
8484
processed_data = preprocess_data(file, file_path)
8585

8686
reduced_data = select_features(processed_data)
87+
print("Selected features:")
88+
print(reduced_data.columns.tolist())
8789

8890
predictions = predict_sample(reduced_data, model)
91+
print("Predictions:")
92+
93+
def chunk_list(lst, n):
94+
return [lst[i:i + n] for i in range(0, len(lst), n)]
95+
96+
cleaned_features = [f.replace("hsa-", "") for f in reduced_data.columns.tolist()]
97+
chunked = chunk_list(cleaned_features, 6)
98+
pretty_features = "\n".join([", ".join(chunk) for chunk in chunked])
99+
89100

90101
results = [
91102
{"target": "Diagnosis", "result": predictions[0]},
92103
{"target": "Stage", "result": predictions[1]},
93-
{"target": "Subtype", "result": predictions[2]}
104+
{"target": "Subtype", "result": predictions[2]},
105+
{"target": "Selected Features", "result": pretty_features}
94106
]
95107

96108
results_cache[file_id] = {

frontend/app/globals.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ body {
1010
.text-balance {
1111
text-wrap: balance;
1212
}
13+
.bg-shine {
14+
@apply bg-[linear-gradient(120deg,hsl(var(--background))_0%,hsl(var(--secondary))_40%,hsl(var(--background))_80%)]
15+
dark:bg-[linear-gradient(120deg,hsl(var(--background))_0%,hsl(var(--secondary)/0.1)_40%,hsl(var(--background))_80%)]
16+
bg-200%
17+
animate-gradient-x;
18+
}
1319
}
1420

1521
@layer base {

frontend/app/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default function RootLayout({
2828
return (
2929
<html lang="en">
3030
<body
31-
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
31+
className={`${geistSans.variable} ${geistMono.variable} antialiased bg-shine`}
3232
>
3333
{children}
3434
<Toaster />

frontend/components/filedrop.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export default function Filedrop({ onUploadSuccess }) {
119119
};
120120

121121
return (
122-
<Card className="w-full max-w-md">
122+
<Card className="w-full max-w-md bg-shine shadow-xl">
123123
<CardContent className="p-6 space-y-4">
124124
<div className="flex items-center justify-between">
125125
<Label className="text-lg font-medium">Upload CSV or TXT File</Label>
@@ -196,8 +196,8 @@ export default function Filedrop({ onUploadSuccess }) {
196196
<div className="flex items-center justify-between">
197197
<div className="flex items-center gap-2">
198198
<FileText className="h-4 w-4 text-blue-500" />
199-
<span className="text-sm font-medium text-gray-700 truncate">
200-
{fileName}
199+
<span className="text-sm font-medium text-gray-700 mt-2 truncate max-w-[12rem] text-center">
200+
{fileName}
201201
</span>
202202
</div>
203203
<Button

frontend/tailwind.config.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ const config: Config = {
1010
],
1111
theme: {
1212
extend: {
13+
backgroundSize: {
14+
'200%': '200% 200%', // for gradient movement
15+
},
1316
colors: {
1417
background: 'hsl(var(--background))',
1518
foreground: 'hsl(var(--foreground))',
@@ -90,12 +93,17 @@ const config: Config = {
9093
opacity: "1",
9194
transform: "scale(1)"
9295
}
93-
}
96+
},
97+
'gradient-x': {
98+
'0%, 100%': { backgroundPosition: '0% 50%' },
99+
'50%': { backgroundPosition: '100% 50%' },
100+
},
94101
},
95102
animation: {
96103
"fade-up": "fade-up 0.5s ease-out",
97104
"fade-down": "fade-down 0.5s ease-out",
98-
"scale-up": "scale-up 0.3s ease-out"
105+
"scale-up": "scale-up 0.3s ease-out",
106+
'gradient-x': 'gradient-x 20s ease-in-out infinite',
99107
}
100108
}
101109
},

0 commit comments

Comments
 (0)