This file contains 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 | |
from bokeh.models import ColumnDataSource, CustomJS | |
from bokeh.plotting import figure | |
import pandas as pd | |
import numpy as np | |
from streamlit_bokeh_events import streamlit_bokeh_events | |
from state import provide_state | |
@provide_state | |
def main(state): |
This file contains 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://gist.github.com/FranzDiebold/898396a6be785d9b5ca6f3706ef9b0bc | |
"""Hack to add per-session state to Streamlit. | |
Works for Streamlit >= v0.65 | |
Usage | |
----- | |
>>> import SessionState | |
>>> |
This file contains 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
"""Hack to add per-session state to Streamlit. | |
Usage | |
----- | |
>>> import SessionState | |
>>> | |
>>> session_state = SessionState.get(user_name='', favorite_color='black') | |
>>> session_state.user_name | |
'' |