Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charts actually fill screen. #32

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions frontend/app/home/[key]/components/table/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ export default function Table({
}) {
return (
<>
<table className="bg-green-500 table-auto border-separate border-spacing-1 text-sm rounded-lg sm:text-base sm:border-spacing-2">
<table className="bg-green-500 table-auto border-separate border-spacing-1 text-sm rounded-lg sm:text-base sm:border-spacing-2 h-max">
<thead>
{show_headings && <tr>{column_info.map((column) => get_headings(column))}</tr>}
</thead>
<tbody>
{table_data[column_info[0].column_name].map((_, index) =>
get_row(index, table_data, column_info),
get_row(index, table_data, column_info)
)}
</tbody>
</table>
Expand All @@ -32,7 +32,7 @@ function get_headings(column: { column_name: string; column_type: string }) {
function get_row(
index: number,
table_data: { [key: string]: any[] },
column_info: { column_name: string; column_type: string }[],
column_info: { column_name: string; column_type: string }[]
) {
return (
<tr className="bg-green-400 hover:bg-green-600" key={index}>
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/home/[key]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function PageContentComponent({ params, data }: { params: { key: string }; data:
if (data.type == "PlotTab") {
return (
<Plot
className="w-full h-full"
className="grow"
data={data.chart_json.data}
layout={data.chart_json.layout}
config={{
Expand All @@ -60,7 +60,7 @@ function PageContentComponent({ params, data }: { params: { key: string }; data:

if (data.type == "TriviaTab" || data.type == "TableTab") {
return (
<div className="flex justify-center">
<div className="flex">
<Table
table_data={data.chart_json.table_data}
show_headings={data.chart_json.show_headings}
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/home/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export default function HomeLayout({ children }: { children: React.ReactNode })
disabledSidebarSteps={disabledSidebarSteps}
/>
{/* Content */}
<div className="bg-white rounded-lg p-2 h-full overflow-auto grow">
<div className="flex bg-white rounded-lg p-2 overflow-auto grow justify-center">
{children}
</div>
</div>
Expand Down