Emil Skogsund (aider) commited on
Commit ·
6583aeb
1
Parent(s): 351be70
feat: Set Streamlit layout to wide mode and adjust canvas size to full width
Browse files
app.py
CHANGED
|
@@ -1,5 +1,8 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import numpy as np
|
|
|
|
|
|
|
|
|
|
| 3 |
import time
|
| 4 |
from streamlit_js_eval import streamlit_js_eval
|
| 5 |
|
|
@@ -62,7 +65,7 @@ def game_step():
|
|
| 62 |
print("Current snake position:", st.session_state.snake)
|
| 63 |
print("Current direction:", st.session_state.direction)
|
| 64 |
print("Current food position:", st.session_state.food)
|
| 65 |
-
canvas.image(grid,
|
| 66 |
|
| 67 |
# Move snake
|
| 68 |
new_direction = st.session_state.direction
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import numpy as np
|
| 3 |
+
|
| 4 |
+
# Set Streamlit layout to wide mode
|
| 5 |
+
st.set_page_config(layout="wide")
|
| 6 |
import time
|
| 7 |
from streamlit_js_eval import streamlit_js_eval
|
| 8 |
|
|
|
|
| 65 |
print("Current snake position:", st.session_state.snake)
|
| 66 |
print("Current direction:", st.session_state.direction)
|
| 67 |
print("Current food position:", st.session_state.food)
|
| 68 |
+
canvas.image(grid, use_column_width=True) # Use full column width for canvas
|
| 69 |
|
| 70 |
# Move snake
|
| 71 |
new_direction = st.session_state.direction
|