Spaces:
Sleeping
Sleeping
Update demo2/pages/__init__.py
Browse files- demo2/pages/__init__.py +50 -22
demo2/pages/__init__.py
CHANGED
@@ -111,7 +111,11 @@ lbl_land_use_btn = [{'EN': 'civil societies',
|
|
111 |
{'EN': 'women',
|
112 |
'TR': 'kadınlar'},
|
113 |
{'EN': 'youth',
|
114 |
-
'TR': 'gençler'}
|
|
|
|
|
|
|
|
|
115 |
lbl_maintitle = {'EN': 'Tomorrow\'s Cities Decision Making Simulation','TR': 'Yarının Şehirleri için Karar Verme Simülasyonu'}
|
116 |
lbl_earthquake= {'EN': 'Earthquake', 'TR': 'Deprem'}
|
117 |
lbl_flood = {'EN': 'Flood', 'TR': 'Sel'}
|
@@ -588,6 +592,7 @@ def LandUsePlans():
|
|
588 |
with solara.Row(justify="center"):
|
589 |
solara.Image(f"landuse_tv50_{i+1}.png", width="100%")
|
590 |
|
|
|
591 |
@solara.component
|
592 |
def Page():
|
593 |
def reset_view():
|
@@ -598,6 +603,16 @@ def Page():
|
|
598 |
luf_type_selected[luf_type].value = True
|
599 |
landuseplan_selected.value = 1
|
600 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
601 |
solara.Style(css)
|
602 |
with solara.Columns([1,98,1]):
|
603 |
solara.HTML(unsafe_innerHTML="")
|
@@ -639,27 +654,40 @@ def Page():
|
|
639 |
with solara.Card(title=lbl_infobox_title[lang.value], style={"text-align": "justify"}):
|
640 |
solara.HTML(unsafe_innerHTML=lbl_infobox[lang.value], classes=["infobox"])
|
641 |
with solara.Card(title=lbl_density_map_title[lang.value]):
|
642 |
-
with solara.Columns([
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
with solara.Row(justify="center"):
|
662 |
-
solara.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
663 |
# with solara.Column():
|
664 |
# if hazard_type.value == "debris":
|
665 |
# bgcolor = "background-color: #545454;"
|
|
|
111 |
{'EN': 'women',
|
112 |
'TR': 'kadınlar'},
|
113 |
{'EN': 'youth',
|
114 |
+
'TR': 'gençler'}]
|
115 |
+
lbl_hazard_btn = [{'EN': 'EARTHQUAKE',
|
116 |
+
'TR': 'DEPREM'},
|
117 |
+
{'EN': 'FLOOD',
|
118 |
+
'TR': 'SEL'}]
|
119 |
lbl_maintitle = {'EN': 'Tomorrow\'s Cities Decision Making Simulation','TR': 'Yarının Şehirleri için Karar Verme Simülasyonu'}
|
120 |
lbl_earthquake= {'EN': 'Earthquake', 'TR': 'Deprem'}
|
121 |
lbl_flood = {'EN': 'Flood', 'TR': 'Sel'}
|
|
|
592 |
with solara.Row(justify="center"):
|
593 |
solara.Image(f"landuse_tv50_{i+1}.png", width="100%")
|
594 |
|
595 |
+
hazard_selected = solara.reactive(1)
|
596 |
@solara.component
|
597 |
def Page():
|
598 |
def reset_view():
|
|
|
603 |
luf_type_selected[luf_type].value = True
|
604 |
landuseplan_selected.value = 1
|
605 |
|
606 |
+
def hazard_1():
|
607 |
+
hazard_selected.value = 1
|
608 |
+
hazard_type.set("earthquake")
|
609 |
+
|
610 |
+
def hazard_2():
|
611 |
+
hazard_selected.value = 2
|
612 |
+
hazard_type.set("flood")
|
613 |
+
|
614 |
+
funcs2 = {1: hazard_1, 2: hazard_2}
|
615 |
+
|
616 |
solara.Style(css)
|
617 |
with solara.Columns([1,98,1]):
|
618 |
solara.HTML(unsafe_innerHTML="")
|
|
|
654 |
with solara.Card(title=lbl_infobox_title[lang.value], style={"text-align": "justify"}):
|
655 |
solara.HTML(unsafe_innerHTML=lbl_infobox[lang.value], classes=["infobox"])
|
656 |
with solara.Card(title=lbl_density_map_title[lang.value]):
|
657 |
+
with solara.Columns([50,50]):
|
658 |
+
for i in range(0,2):
|
659 |
+
with solara.Column():
|
660 |
+
if hazard_selected.value == i + 1:
|
661 |
+
solara.Button(lbl_hazard_btn[i][lang.value], value=i+1, text=True,
|
662 |
+
on_click=funcs2[i+1], style="background-color: #545454; height: 26px")
|
663 |
+
with solara.Row(justify="center"):
|
664 |
+
solara.Image(f"/static/public/hazard_{i+1}_selected.png", width="100%")
|
665 |
+
else:
|
666 |
+
solara.Button(lbl_hazard_btn[i][lang.value], value=i+1, text=True,
|
667 |
+
on_click=funcs2[i+1], style=f"width: 100%; height: 26px")
|
668 |
+
with solara.Row(justify="center"):
|
669 |
+
solara.Image(f"/static/public/hazard_{i+1}.png", width="100%")
|
670 |
+
# with solara.Columns([50,50]):
|
671 |
+
# with solara.Column():
|
672 |
+
# if hazard_type.value == "earthquake":
|
673 |
+
# bgcolor = "background-color: #545454;"
|
674 |
+
# else:
|
675 |
+
# bgcolor = ""
|
676 |
+
# with solara.Row(justify="center"):
|
677 |
+
# solara.Button(lbl_earthquake[lang.value], value="earthquake", text=True, on_click=lambda: hazard_type.set("earthquake"), style=f"{bgcolor} width: 100%; height: 26px")
|
678 |
+
# # DensityMap("earthquake")
|
679 |
+
# with solara.Row(justify="center"):
|
680 |
+
# solara.Image("/static/public/eq.png")
|
681 |
+
# with solara.Column():
|
682 |
+
# if hazard_type.value == "flood":
|
683 |
+
# bgcolor = "background-color: #545454;"
|
684 |
+
# else:
|
685 |
+
# bgcolor = ""
|
686 |
+
# with solara.Row(justify="center"):
|
687 |
+
# solara.Button(lbl_flood[lang.value], value="flood", text=True, on_click=lambda: hazard_type.set("flood"), style=f"{bgcolor} width: 100%; height: 26px")
|
688 |
+
# # DensityMap("flood")
|
689 |
+
# with solara.Row(justify="center"):
|
690 |
+
# solara.Image("/static/public/fl.png")
|
691 |
# with solara.Column():
|
692 |
# if hazard_type.value == "debris":
|
693 |
# bgcolor = "background-color: #545454;"
|