Closed ymurong closed 2 months ago
Hi @ymurong
pygwalker already supports returning events when the spec changes in streamlit.
from pygwalker.api.streamlit import StreamlitRenderer
import pandas as pd
import streamlit as st
@st.cache_resource
def get_pyg_renderer() -> "StreamlitRenderer":
df = pd.read_csv("xxx")
return StreamlitRenderer(df)
renderer = get_pyg_renderer()
event = renderer.explorer()
print(event)
you can refer this issue: https://github.com/Kanaries/pygwalker/issues/580
Hi @longxiaofei, Thank you for you rapid feedback. It works perfectly !
Currently, the walker instance does not have updated spec unless you click on the save button that inject the newest spec back to python backend (which does not work when spec param is not json_file).
I am providing pygwalker in streamlit as a standalone application for a group of people as an online tool. Instead of having a json file on server for each user, it is more practical to keep their spec in their session/localstorage. However, as the save does not work for spec in memory mode, the user has to export first their spec and then copy back so that I could regenerate a renderer with the new spec.
Is it technically feasible?
Thank you !