Kuangdai commited on
Commit
e828314
·
1 Parent(s): 5b21d5e

Better layout in viewer

Browse files
Files changed (1) hide show
  1. viewer_fusion.py +30 -1
viewer_fusion.py CHANGED
@@ -25,6 +25,7 @@ META_NAMES_PATH = FUSION_DIR / "meta_column_names.json"
25
  META_COMPLETE_PATH = FUSION_DIR / "meta_column_complete.json"
26
  DEFAULT_PROPERTY = "texture:USDA_class"
27
  DEFAULT_VIEWPORT = {"lat": 50.0, "lon": 10.0, "zoom": 3.2}
 
28
 
29
  CORE_UI_PROPERTIES = [
30
  {"label": "USDA texture class", "property": "texture:USDA_class"},
@@ -92,6 +93,33 @@ def init_ui_state():
92
  st.session_state.setdefault("ui_agent_messages", [])
93
 
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  @st.cache_data(show_spinner=False)
96
  def list_openai_models(api_key):
97
  try:
@@ -621,7 +649,7 @@ def render_map(df):
621
  map_style="light",
622
  tooltip=tooltip,
623
  )
624
- st.pydeck_chart(deck, use_container_width=True, height=720)
625
  if overlap_records:
626
  st.caption(
627
  f"{len(overlap_records):,} overlapping point markers are shown as rings. "
@@ -856,6 +884,7 @@ def main():
856
  layout="wide",
857
  initial_sidebar_state="expanded",
858
  )
 
859
 
860
  init_ui_state()
861
  names, meta, groups = load_metadata()
 
25
  META_COMPLETE_PATH = FUSION_DIR / "meta_column_complete.json"
26
  DEFAULT_PROPERTY = "texture:USDA_class"
27
  DEFAULT_VIEWPORT = {"lat": 50.0, "lon": 10.0, "zoom": 3.2}
28
+ MAP_HEIGHT_PX = 560
29
 
30
  CORE_UI_PROPERTIES = [
31
  {"label": "USDA texture class", "property": "texture:USDA_class"},
 
93
  st.session_state.setdefault("ui_agent_messages", [])
94
 
95
 
96
+ def apply_compact_layout():
97
+ st.markdown(
98
+ """
99
+ <style>
100
+ .block-container {
101
+ max-width: 100%;
102
+ padding-top: 1.0rem;
103
+ padding-right: 1.25rem;
104
+ padding-left: 1.25rem;
105
+ padding-bottom: 1.25rem;
106
+ }
107
+ [data-testid="stSidebar"] .block-container {
108
+ padding-top: 1.0rem;
109
+ }
110
+ h1 {
111
+ margin-top: 0;
112
+ margin-bottom: 0.35rem;
113
+ }
114
+ div[data-testid="stCaptionContainer"] {
115
+ margin-bottom: 0.4rem;
116
+ }
117
+ </style>
118
+ """,
119
+ unsafe_allow_html=True,
120
+ )
121
+
122
+
123
  @st.cache_data(show_spinner=False)
124
  def list_openai_models(api_key):
125
  try:
 
649
  map_style="light",
650
  tooltip=tooltip,
651
  )
652
+ st.pydeck_chart(deck, use_container_width=True, height=MAP_HEIGHT_PX)
653
  if overlap_records:
654
  st.caption(
655
  f"{len(overlap_records):,} overlapping point markers are shown as rings. "
 
884
  layout="wide",
885
  initial_sidebar_state="expanded",
886
  )
887
+ apply_compact_layout()
888
 
889
  init_ui_state()
890
  names, meta, groups = load_metadata()