Py.Cafe

paulamallas/

solara-cool-viewer-performance-analysis

Solara Cool Viewer Performance Analysis

DocsPricing
  • app.py
  • requirements.txt
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import solara
import solara.lab
import datetime

end_date = datetime.date.today()

@solara.component
def Page():

    # Default date range
    date_range = solara.use_reactive((end_date - datetime.timedelta(days=-7), end_date))
   
    with solara.AppBar():
        with solara.AppBarTitle():
            with solara.Row(style={"background-color": "transparent", "align-items": "center"}):
                solara.HTML(tag="img", attributes={"src": "https://picsum.photos/400/200", "style": "height: 40px"})
                solara.Text("Cool Viewer")
        solara.v.Spacer()
        solara.Button(label="Quit", on_click = lambda: None)
    
    with solara.Row():
        Control(date_range)
    
    with solara.Column(align = 'center'):
        View()

@solara.component
def Control(date_range):

    solara.Select('control 1', value = 'where', values = ['here', 'there', 'everywhere'])

    # Component to change to desired data range 
    solara.lab.InputDateRange(date_range, sort=True) 

    solara.Select('control 3', value = 'type', values = ['fast', 'slow', 'broken'])
        
     
@solara.component
def View():
    solara.Text(f'Map takes up whole area')