This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streamlit as st | |
st.header('Experiments with forms') | |
st.markdown('There is no connection between the forms here. The purpose is to demonstrate 3 different ways to run operations with form values.') | |
state = st.session_state | |
if 'word_choices' not in state: | |
state.word_choices = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streamlit as st | |
def main(): | |
pages = { | |
"Home": page_home, | |
"Settings": page_settings, | |
} | |
if "page" not in st.session_state: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""From https://matplotlib.org/3.1.0/gallery/mplot3d/voxels.html in Streamlit""" | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import streamlit as st | |
# This import registers the 3D projection, but is otherwise unused. | |
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import | |
@st.cache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import streamlit as st | |
from datetime import datetime | |
st.set_page_config(layout="wide") | |
st.markdown( | |
""" | |
<style> | |
.time { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Run Streamlit apps inside other apps. See: https://discuss.streamlit.io/t/multiple-apps-from-a-folder-file-list/181 | |
''' | |
import streamlit as st | |
import os | |
import sys | |
import importlib.util | |
# https://gist.github.com/tvst/f13b24198e256c1c4d9b5ccbc6991cc2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streamlit as st | |
import pandas as pd | |
import pydeck as pdk | |
view_state = pdk.ViewState(latitude=32, | |
longitude=35, | |
zoom=7, | |
pitch=0) | |
d1 = {'lon': [35, 35.1], 'lat': [32.5, 32.6], 'name':['meA', 'meB'], 'prec':[100,300], 'temp':[10,30], 'elevationValue':[100,300]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streamlit as st | |
import traceback | |
# https://gist.github.com/tvst/6e62360a712ed0595e7a0749127fba58 | |
class opt_echo: | |
"""Replacement for st.echo that includes a checkbox saying "show code". | |
Usage | |
----- | |
>>> with opt_echo(): | |
... a = 1337 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See this thread: https://discuss.streamlit.io/t/best-fastest-practice-to-display-live-2d-data/19895 | |
# Code below is lifted from @andfanilo's comment | |
# https://realpython.com/async-io-python/#using-a-queue | |
import asyncio | |
from datetime import datetime | |
# pip install opencv-python-headless | |
import cv2 | |
import numpy as np |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import random | |
import time | |
import streamlit as st | |
# pip install streamlit-echarts | |
from streamlit_echarts import st_echarts | |
st.title("I ❤️ ECharts") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://discuss.streamlit.io/t/selection-is-sometimes-not-returned-from-custom-widgets/21202 | |
import streamlit as st | |
# https://github.com/PablocFonseca/streamlit-aggrid | |
from st_aggrid import AgGrid, GridOptionsBuilder | |
import pandas as pd | |
import numpy as np | |
np.random.seed(42) |