- Pass flag
_release
toTrue
- Rebuild frontend:
cd package/frontend
rm -rf build/
npm run build
cd ../../
- Rebuild Python:
import streamlit as st | |
import streamlit.components.v1 as components | |
def left_callback(): | |
st.write('Left button was clicked') | |
def right_callback(): | |
st.write('Right button was clicked') |
from streamlit.report_thread import get_report_ctx | |
from streamlit.hashing import _CodeHasher | |
from streamlit.server.server import Server | |
from prometheus_client.registry import REGISTRY | |
from prometheus_client import Counter | |
class _SessionState: | |
def __init__(self, session, hash_funcs): | |
"""Initialize SessionState instance.""" |
# https://gist.github.com/FranzDiebold/898396a6be785d9b5ca6f3706ef9b0bc | |
"""Hack to add per-session state to Streamlit. | |
Works for Streamlit >= v0.65 | |
Usage | |
----- | |
>>> import SessionState | |
>>> |
_release
to True
cd package/frontend
rm -rf build/
npm run build
cd ../../
.unreset { | |
a { | |
@apply text-blue-700 underline; | |
} | |
p { | |
@apply my-4; | |
} | |
blockquote, | |
figure { |
from tkinter import * | |
from PIL import ImageTk,Image | |
import time | |
import os | |
targetImageWidth = 850 | |
targetImageHeight = 400 | |
inputImageWidth = 0 | |
inputImageHeight = 0 |
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; |
"""Hack to add per-session state to Streamlit. | |
Usage | |
----- | |
>>> import SessionState | |
>>> | |
>>> session_state = SessionState.get(user_name='', favorite_color='black') | |
>>> session_state.user_name | |
'' |
import React, { useRef, useEffect } from 'react'; | |
import * as d3 from 'd3'; | |
interface IProps { | |
data?: number[]; | |
} | |
/* Component */ | |
export const MyD3Component = (props: IProps) => { | |
/* The useRef Hook creates a variable that "holds on" to a value across rendering |