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

feat: Render dashboard demo app links in header and add h2o logo #1935

Merged
merged 3 commits into from
Apr 17, 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
16 changes: 7 additions & 9 deletions py/demo/common.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
from h2o_wave import ui

global_nav = [
ui.nav_group('Dashboards', items=[
ui.nav_item(name='#dashboards/red', label='Red'),
ui.nav_item(name='#dashboards/blue', label='Blue'),
ui.nav_item(name='#dashboards/orange', label='Orange'),
ui.nav_item(name='#dashboards/cyan', label='Cyan'),
ui.nav_item(name='#dashboards/grey', label='Grey'),
ui.nav_item(name='#dashboards/mint', label='Mint'),
ui.nav_item(name='#dashboards/purple', label='Purple'),
]),
ui.tab(name='#dashboards/red', label='Red'),
ui.tab(name='#dashboards/blue', label='Blue'),
ui.tab(name='#dashboards/orange', label='Orange'),
ui.tab(name='#dashboards/cyan', label='Cyan'),
ui.tab(name='#dashboards/grey', label='Grey'),
ui.tab(name='#dashboards/mint', label='Mint'),
ui.tab(name='#dashboards/purple', label='Purple'),
]
6 changes: 4 additions & 2 deletions py/demo/dashboard_blue.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ async def show_blue_dashboard(q: Q):
breakpoint='xs',
width='1200px',
zones=[
ui.zone('header', size='65px'),
ui.zone('header', size='76px'),
ui.zone('title'),
ui.zone('top', direction=ui.ZoneDirection.ROW, size='200px'),
ui.zone('middle', direction=ui.ZoneDirection.ROW, size='385px'),
Expand All @@ -20,7 +20,9 @@ async def show_blue_dashboard(q: Q):
])

q.page['header'] = ui.header_card(box='header', title='H2O Wave Demo', subtitle='Blue Dashboard',
nav=global_nav)
image='https://wave.h2o.ai/img/h2o-logo.svg',
items=[ui.tabs(name='Dashboards', value='#dashboards/blue',
items=global_nav),])

q.page['title'] = ui.section_card(
box='title',
Expand Down
6 changes: 4 additions & 2 deletions py/demo/dashboard_cyan.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ async def show_cyan_dashboard(q: Q):
breakpoint='xs',
width='1200px',
zones=[
ui.zone('header', size='65px'),
ui.zone('header', size='76px'),
ui.zone('body', size='1400px', direction=ui.ZoneDirection.ROW, zones=[
ui.zone('content', size='75%', zones=[
ui.zone('top', size='600px'),
Expand All @@ -27,7 +27,9 @@ async def show_cyan_dashboard(q: Q):
])

q.page['header'] = ui.header_card(box='header', title='H2O Wave Demo', subtitle='Cyan Dashboard',
nav=global_nav)
image='https://wave.h2o.ai/img/h2o-logo.svg',
items=[ui.tabs(name='Dashboards', value='#dashboards/cyan',
items=global_nav),])
q.page['section'] = ui.section_card(
box=ui.box('top', order=1, size=0),
title=next(sample_title),
Expand Down
6 changes: 4 additions & 2 deletions py/demo/dashboard_grey.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ async def show_grey_dashboard(q: Q):
breakpoint='xs',
min_width='800px',
zones=[
ui.zone('header', size='65px'),
ui.zone('header', size='76px'),
ui.zone('title'),
ui.zone('body', size='1000px', zones=[
ui.zone('top', direction=ui.ZoneDirection.ROW, size='25%'),
Expand All @@ -23,7 +23,9 @@ async def show_grey_dashboard(q: Q):
])

q.page['header'] = ui.header_card(box='header', title='H2O Wave Demo', subtitle='Grey Dashboard',
nav=global_nav)
image='https://wave.h2o.ai/img/h2o-logo.svg',
items=[ui.tabs(name='Dashboards', value='#dashboards/grey',
items=global_nav),])
q.page['section'] = ui.section_card(
box='title',
title=next(sample_title),
Expand Down
6 changes: 4 additions & 2 deletions py/demo/dashboard_mint.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ async def show_mint_dashboard(q: Q):
breakpoint='xs',
width='1200px',
zones=[
ui.zone('header', size='65px'),
ui.zone('header', size='76px'),
ui.zone('main_section'),
ui.zone('overview', direction=ui.ZoneDirection.ROW, size='425px'),
ui.zone('tickers', direction=ui.ZoneDirection.ROW, size='175px'),
Expand All @@ -20,7 +20,9 @@ async def show_mint_dashboard(q: Q):
)
])
q.page['header'] = ui.header_card(box='header', title='H2O Wave Demo', subtitle='Mint Dashboard',
nav=global_nav)
image='https://wave.h2o.ai/img/h2o-logo.svg',
items=[ui.tabs(name='Dashboards', value='#dashboards/mint',
items=global_nav),])
q.page['main_section'] = ui.section_card(
box='main_section',
title=next(sample_title),
Expand Down
6 changes: 4 additions & 2 deletions py/demo/dashboard_orange.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ async def show_orange_dashboard(q: Q):
breakpoint='xs',
width='1200px',
zones=[
ui.zone('header', size='65px'),
ui.zone('header', size='76px'),
ui.zone('control'),
ui.zone('top', direction=ui.ZoneDirection.ROW, size='385px', zones=[
ui.zone('top_left', direction=ui.ZoneDirection.ROW, size='66%'),
Expand All @@ -23,7 +23,9 @@ async def show_orange_dashboard(q: Q):
])

q.page['header'] = ui.header_card(box='header', title='H2O Wave Demo', subtitle='Orange Dashboard',
nav=global_nav)
image='https://wave.h2o.ai/img/h2o-logo.svg',
items=[ui.tabs(name='Dashboards', value='#dashboards/orange',
items=global_nav),])

q.page['section'] = ui.section_card(
box='control',
Expand Down
10 changes: 6 additions & 4 deletions py/demo/dashboard_purple.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ async def show_purple_dashboard(q: Q):
ui.layout(
breakpoint='xs',
zones=[
ui.zone('header', size='65px'),
ui.zone('header', size='76px'),
ui.zone('title', size='60px'),
ui.zone('body'),
ui.zone('footer', size='80px'),
Expand All @@ -17,7 +17,7 @@ async def show_purple_dashboard(q: Q):
ui.layout(
breakpoint='m',
zones=[
ui.zone('header', size='65px'),
ui.zone('header', size='76px'),
ui.zone('title', size='60px'),
ui.zone('body', direction=ui.ZoneDirection.ROW, zones=[
ui.zone('main', zones=[
Expand All @@ -35,7 +35,7 @@ async def show_purple_dashboard(q: Q):
breakpoint='xl',
width='1200px',
zones=[
ui.zone('header', size='65px'),
ui.zone('header', size='76px'),
ui.zone('title', size='60px'),
ui.zone('body', size='1150px', direction=ui.ZoneDirection.ROW, zones=[
ui.zone('main', size='3', zones=[
Expand All @@ -51,7 +51,9 @@ async def show_purple_dashboard(q: Q):
)
])
q.page['header'] = ui.header_card(box='header', title='H2O Wave Demo', subtitle='Purple Dashboard',
nav=global_nav)
image='https://wave.h2o.ai/img/h2o-logo.svg',
items=[ui.tabs(name='Dashboards', value='#dashboards/purple',
items=global_nav),])

q.page['title'] = ui.section_card(
box='title',
Expand Down
6 changes: 4 additions & 2 deletions py/demo/dashboard_red.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ async def show_red_dashboard(q: Q):
breakpoint='xs',
width='1200px',
zones=[
ui.zone('header', size='65px'),
ui.zone('header', size='76px'),
ui.zone('title'),
ui.zone('top', direction=ui.ZoneDirection.ROW, size='385px', zones=[
ui.zone('top_left'),
Expand All @@ -29,7 +29,9 @@ async def show_red_dashboard(q: Q):
])

q.page['header'] = ui.header_card(box='header', title='H2O Wave Demo', subtitle='Red Dashboard',
nav=global_nav)
image='https://wave.h2o.ai/img/h2o-logo.svg',
items=[ui.tabs(name='Dashboards', value='#dashboards/red',
items=global_nav),])
q.page['title'] = ui.section_card(
box='title',
title=next(sample_title),
Expand Down