Skip to content

Commit 910dc5b

Browse files
committed
back to %
1 parent ea13204 commit 910dc5b

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed

backend/zeno_backend/processing/project_home.py

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@
2121
async def create_project_home(project_uuid) -> list[ProjectHomeElement]:
2222
"""Create the data for a project's home page.
2323
24-
The home page is a 3x3 grid of elements indexed from 1.
25-
X and Y positions indicate the grid position, width and height the
26-
number of grid cells the element occupies.
27-
2824
Args:
2925
project_uuid (str): the uuid of the project for which to create home elements.
3026
@@ -44,10 +40,10 @@ async def create_project_home(project_uuid) -> list[ProjectHomeElement]:
4440
ProjectHomeElement(
4541
id=-1,
4642
type=ProjectHomeElementType.LIST,
47-
x_pos=2,
48-
y_pos=1,
49-
width=2,
50-
height=3,
43+
x_pos=30,
44+
y_pos=0,
45+
width=70,
46+
height=100,
5147
),
5248
)
5349

@@ -98,10 +94,10 @@ async def create_overview_table(project_uuid: str):
9894
id=-1,
9995
type=ProjectHomeElementType.CHART,
10096
data=str(table_id),
101-
x_pos=1,
102-
y_pos=1,
103-
width=1,
104-
height=1,
97+
x_pos=0,
98+
y_pos=0,
99+
width=30,
100+
height=50,
105101
),
106102
)
107103

@@ -144,10 +140,10 @@ async def create_overview_charts(project_uuid: str, metrics: list[Metric]):
144140
id=-1,
145141
type=ProjectHomeElementType.CHART,
146142
data=str(chart_id),
147-
x_pos=1,
148-
y_pos=2,
149-
width=1,
150-
height=1,
143+
x_pos=0,
144+
y_pos=50,
145+
width=30,
146+
height=50,
151147
),
152148
)
153149
else:

frontend/src/routes/(app)/project/[uuid]/[name]/+page.svelte

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
}
1212
</script>
1313

14-
<div class="grid h-full min-h-0 w-full min-w-0 gap-4 overflow-auto bg-yellowish p-4">
14+
<div class="relative h-full w-full">
1515
{#each data.elements as element}
1616
<div
17-
class="min-w-[300px] overflow-auto bg-white shadow"
18-
style="grid-column: {element.xPos} / span {element.width}; grid-row: {element.yPos} / span {element.width};"
17+
class="absolute overflow-auto p-2"
18+
style="width: {element.width}%; height: {element.height}%; top: {element.yPos}%; left: {element.xPos}%;"
1919
>
20-
<Element {element} />
20+
<div class="h-full w-full p-4">
21+
<Element {element} />
22+
</div>
2123
</div>
2224
{/each}
2325
</div>

0 commit comments

Comments
 (0)