mirror of https://github.com/gsi-upm/soil
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
539 B
Python
27 lines
539 B
Python
import solara
|
|
|
|
@solara.component
|
|
def MainPage(clicks):
|
|
color = "green"
|
|
if clicks.value >= 5:
|
|
color = "red"
|
|
|
|
def increment():
|
|
clicks.value += 1
|
|
print("clicks", clicks) # noqa
|
|
|
|
solara.Button(label=f"Clicked: {clicks}", on_click=increment, color=color)
|
|
|
|
@solara.component
|
|
def Page():
|
|
v = Visualization()
|
|
v.viz()
|
|
|
|
class Visualization:
|
|
def __init__(self):
|
|
self.clicks = solara.reactive(0)
|
|
|
|
def viz(self):
|
|
from sol_lib import MainPage
|
|
return MainPage(self.clicks)
|