Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
Griffin Adams committed Sep 30, 2024
1 parent d32fe0c commit 8703258
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 144 deletions.
33 changes: 12 additions & 21 deletions ex_app/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down Expand Up @@ -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
Expand All @@ -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.'],
Expand All @@ -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'),
Expand All @@ -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()
Loading

0 comments on commit 8703258

Please sign in to comment.