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
from h2o_wave import main, app, Q, ui, on, handle_on | |
@app('/') | |
async def serve(q: Q): | |
if not q.client.initialized: # first time a tab comes this is app | |
q.page['a'] = ui.form_card( | |
box='4 3 4 2', | |
items=[ | |
ui.textbox(name='color_textbox', placeholder='Purple'), |
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
from h2o_wave import main, app, Q, ui, handle_on, on, data | |
from loguru import logger | |
def on_startup(): | |
""" | |
Runs when the app is started, even if there are no browsers connected | |
:return: | |
""" | |
logger.info('http://localhost:10101/') |
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
import os | |
import time | |
from h2o_wave import main, app, Q, ui, data | |
import pandas as pd | |
import numpy as np | |
@app('/') | |
async def serve(q: Q): | |
print(q.args) |
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
# Plot / Dataframe | |
# Examples of how to format pandas data when plotting | |
# Use the `tolist()` function on `df.columns` and `df.values` along with Wave's `data` class | |
# --- | |
from h2o_wave import site, data, ui, main | |
import pandas as pd | |
import numpy as np | |
# Page to hold our charts | |
page = site['/demo'] |
NewerOlder