-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Griffin Adams
committed
Sep 30, 2024
1 parent
d32fe0c
commit 8703258
Showing
5 changed files
with
105 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,9 @@ | |
# AUTOGENERATED! DO NOT EDIT! File to edit: ../ex_nbs/03_dashboard.ipynb. | ||
|
||
# %% auto 0 | ||
__all__ = ['rev', 'sub', 'sal', 'act', 'top_info_row', 'recent_sales', 'db_nav', 'teams', 'opt_hdrs', 'team_dropdown', 'hotkeys', | ||
'logout', 'user', 'avatar', 'avatar_dropdown', 'top_nav', 'dashboard_homepage', 'InfoCard', 'AvatarItem', | ||
'generate_chart', 'NavTab', 'UkTab', 'space', 'page'] | ||
__all__ = ['rev', 'sub', 'sal', 'act', 'top_info_row', 'recent_sales', 'teams', 'opt_hdrs', 'team_dropdown', 'hotkeys', 'logout', | ||
'user', 'avatar', 'avatar_dropdown', 'top_nav', 'dashboard_homepage', 'InfoCard', 'AvatarItem', | ||
'generate_chart', 'space', 'page'] | ||
|
||
# %% ../ex_nbs/03_dashboard.ipynb 2 | ||
from fasthtml.common import * | ||
|
@@ -50,7 +50,9 @@ def AvatarItem(name, email, amount): | |
("Sofia Davis", "[email protected]", "+$39.00"))]), | ||
header=Div( | ||
UkH3("Recent Sales"), | ||
P("You made 265 sales this month.", cls=TextT.muted_sm))) | ||
P("You made 265 sales this month.", cls=TextT.muted_sm)), | ||
|
||
cls='lg:col-span-3') | ||
|
||
# %% ../ex_nbs/03_dashboard.ipynb 16 | ||
@matplotlib2fasthtml | ||
|
@@ -59,17 +61,6 @@ def generate_chart(num_points): | |
plt.plot(range(len(plotdata)), plotdata) | ||
|
||
# %% ../ex_nbs/03_dashboard.ipynb 19 | ||
def NavTab(text, active=False): | ||
return Li(cls="uk-active" if active else " ")( | ||
A(text, href="#demo", uk_toggle=True)) | ||
|
||
def UkTab(*items): | ||
return Ul(cls="uk-tab-alt max-w-96")(*[NavTab(item) for i, item in enumerate(items)]) | ||
|
||
db_nav = UkTab("Overview", "Analytics", "Reports", "Notifications") | ||
show(db_nav) | ||
|
||
# %% ../ex_nbs/03_dashboard.ipynb 21 | ||
teams = [ | ||
["Alicia Koch"], | ||
['Acme Inc', 'Monster Inc.'], | ||
|
@@ -84,7 +75,7 @@ def UkTab(*items): | |
label=teams[0][0] | ||
) | ||
|
||
# %% ../ex_nbs/03_dashboard.ipynb 22 | ||
# %% ../ex_nbs/03_dashboard.ipynb 20 | ||
hotkeys = [ | ||
('Profile','⇧⌘P'), | ||
('Billing','⌘B'), | ||
|
@@ -109,22 +100,22 @@ def space(*c): return A(FullySpacedContainer(*c, wrap_tag=P)) | |
|
||
show(avatar_dropdown) | ||
|
||
# %% ../ex_nbs/03_dashboard.ipynb 23 | ||
# %% ../ex_nbs/03_dashboard.ipynb 21 | ||
top_nav = UkNavbar( | ||
lnav=[team_dropdown, Li(A("Overview")), Li(A("Customers")), Li(A("Products")), Li(A("Settings"))], | ||
rnav=[UkInput(placeholder='Search'), avatar_dropdown], | ||
) | ||
|
||
# %% ../ex_nbs/03_dashboard.ipynb 24 | ||
# %% ../ex_nbs/03_dashboard.ipynb 22 | ||
def page(): | ||
return Div(cls="space-y-4")( | ||
Div(cls="border-b border-border px-4")(top_nav), | ||
UkH2('Dashboard'), | ||
db_nav, | ||
UkTab("Overview", "Analytics", "Reports", "Notifications"), | ||
top_info_row, | ||
Grid(Card(generate_chart(10),cls='lg:col-span-4'), | ||
Card(recent_sales,cls='lg:col-span-3'), | ||
recent_sales, | ||
gap=4,cls='lg:grid-cols-7')) | ||
|
||
# %% ../ex_nbs/03_dashboard.ipynb 26 | ||
# %% ../ex_nbs/03_dashboard.ipynb 24 | ||
dashboard_homepage = page() |
Oops, something went wrong.