cboettig commited on
Commit
227330f
1 Parent(s): 4fe5b0a
Files changed (2) hide show
  1. config.toml +1 -1
  2. main.py +7 -4
config.toml CHANGED
@@ -2,4 +2,4 @@
2
  # Max size, in megabytes, of messages that can be sent via the WebSocket
3
  # connection.
4
  # Default: 200
5
- maxMessageSize = 200
 
2
  # Max size, in megabytes, of messages that can be sent via the WebSocket
3
  # connection.
4
  # Default: 200
5
+ maxMessageSize = 1000
main.py CHANGED
@@ -14,8 +14,11 @@ st.header("H3: Simplifying the World's Map", divider="rainbow")
14
 
15
  # st.set_page_config(page_title="H3 in Streamlit", layout="wide")
16
 
 
 
 
17
  con = ibis.duckdb.connect(extensions=["h3"])
18
- obis_h3 = con.read_parquet("/home/rstudio/source.coop/cboettig/obis/obis_h3.parquet")
19
 
20
  st.subheader("What is H3")
21
 
@@ -44,7 +47,7 @@ with col3:
44
  st.markdown("The lowest resolution is 0, at which the world is divided into 122 hexagons. "
45
  "The highest resolution is 15, at which the size of a hexagon is less than a square meter, "
46
  "and the world can be divided into approximately 600 trillion hexagons."
47
- " You can check different resolutions and play with hierarchy levels using the widget below. Hover on hexagons to see their IDs.")
48
 
49
  # ------ Visualisation 1 ---------
50
  def viridis_color(x) -> str:
@@ -79,7 +82,7 @@ def get_coverage_layer(df: pd.DataFrame) -> pdk.Layer:
79
  line_width_min_pixels=1,
80
  )
81
 
82
- min_v_1, max_v_1, v_1, z_1, lon_1, lat_1 = ( 0, 2, 0, 1, 0.9982847947205775, 2.9819747220001886,)
83
  col1, col2 = st.columns([70, 30])
84
  with col1:
85
  h3_resolut_1 = st.slider(
@@ -98,7 +101,7 @@ st.pydeck_chart(
98
  initial_view_state=pdk.ViewState(
99
  latitude=lat_1, longitude=lon_1, zoom=z_1, height=400
100
  ),
101
- tooltip={"html": "<b>ID:</b> {H3}", "style": {"color": "white"}},
102
  layers=visible_layers_coverage_1,
103
  )
104
  )
 
14
 
15
  # st.set_page_config(page_title="H3 in Streamlit", layout="wide")
16
 
17
+ h3_parquet = "https://data.source.coop/cboettig/obis/obis_h3.parquet"
18
+ h3_parquet = "/home/rstudio/source.coop/cboettig/obis/obis_h3.parquet"
19
+
20
  con = ibis.duckdb.connect(extensions=["h3"])
21
+ obis_h3 = con.read_parquet(h3_parquet)
22
 
23
  st.subheader("What is H3")
24
 
 
47
  st.markdown("The lowest resolution is 0, at which the world is divided into 122 hexagons. "
48
  "The highest resolution is 15, at which the size of a hexagon is less than a square meter, "
49
  "and the world can be divided into approximately 600 trillion hexagons."
50
+ " You can check different resolutions and play with hierarchy levels using the widget below.")
51
 
52
  # ------ Visualisation 1 ---------
53
  def viridis_color(x) -> str:
 
82
  line_width_min_pixels=1,
83
  )
84
 
85
+ min_v_1, max_v_1, v_1, z_1, lon_1, lat_1 = ( 1, 9, 1, 1, 0.9982847947205775, 2.9819747220001886,)
86
  col1, col2 = st.columns([70, 30])
87
  with col1:
88
  h3_resolut_1 = st.slider(
 
101
  initial_view_state=pdk.ViewState(
102
  latitude=lat_1, longitude=lon_1, zoom=z_1, height=400
103
  ),
104
+ tooltip={"html": "<b>ID:</b> {cell}", "style": {"color": "white"}},
105
  layers=visible_layers_coverage_1,
106
  )
107
  )