0.3.8a7
Pre-release
Pre-release
About PyGWalker 0.3.8-pre
Streamlit Multiple Rendering Modes
In pygwalker==0.3.7
, we added a new communication feature in streamlit, which can help us implement many new feature in streamlit.
In pygwalker==0.3.8a7
, pygwalker provide two rendering modes in streamlit,include explore and renderer mode.
explore mode helps developers explore datas and develop the charts they need to display.
renderer mode can only render the chart without displaying other tool buttons.
example url: https://pygwalker-in-app-vipsfjjsyx2p6wwmm8yey9.streamlit.app/
example code:
from pygwalker.api.streamlit import init_streamlit_comm, StreamlitRenderer
# Initialize pygwalker communication
init_streamlit_comm()
# You should cache your pygwalker renderer, if you don't want your memory to explode
@st.cache_resource
def get_pyg_renderer() -> "StreamlitRenderer":
df = get_data()
# When you need to publish your application, you need set `debug=False`,prevent other users to write your config file.
return StreamlitRenderer(df, spec="./billion_config.json", debug=True)
renderer = get_pyg_renderer()
# Display explore ui, Developers can use this to prepare the charts you need to display.
renderer.render_explore()
# Display pure chart, index is the order of charts in explore mode, starting from 0.
renderer.render_pure_chart(0)
add pre-filters param in streamlit renderer.
We can pre-filter the data in the renderer and use it with other components of streamlit.
example url: https://pygwalker-in-app-vipsfjjsyx2p6wwmm8yey9.streamlit.app/
example code:
...
from pygwalker.api.streamlit import PreFilter
pre_filters = []
pre_filters.append(PreFilter(
field="country",
op="one of",
value=["CN", "US", "EN"]
))
# set global pre-filters in renderer
renderer.set_global_pre_filters(pre_filters)
# Set a pre-filter for a certain chart, it will overwrite global pre-filters
renderer.render_pure_chart(0, pre_filters=pre_filters)
...
Others
- We will release the official version 0.3.8 as soon as possible.
- Hoping anyone can provide us with any suggestions for improvements, thank anyone all in advance.
- We will improve the documentation and tutorials of pygwalker in the next few days.
Feat
- feat: streamlit support renderer mode of graphic-walker #258
- feat: update grpahic-walker to support fold feature #259
- feat: modify single chart renderer in streamlit #261
- feat: size of chart remains the same as size of html #262
- fix: adjust returned value of StreamlitRenderer #263
- feat: streamlit add pre-filters feature #265
- feat: pure_renderer support to switch explore mode #267
Fix
- fix: snowflake connection data types #237
- fix: format sql in database parser #241
- fix: communication is not established when render geo chart #243
- fix: temporary fix for sqlglot conversion error #244
- fix: fix date feature bugs #245
- fix: DatabaseDataParser format_sql #246
- fix: DatabaseDataParser parse sub_query #249
- fix: streamlit base url #255
- fix: temporal range bug #268
Chore
Refactor
- refactor: use shadcn components #253
@ObservedObserver @longxiaofei
Full Changelog: 0.3.7...0.3.8a7