Kanaries / pygwalker

PyGWalker: Turn your pandas dataframe into an interactive UI for visual analysis
https://kanaries.net/pygwalker
Apache License 2.0
13.45k stars 704 forks source link

When deploying pyg walker over streamlit the save button is missing #239

Closed JeevankumarDharmalingam closed 1 year ago

longxiaofei commented 1 year ago

pyg.walk(df, debug=True)

refer: https://github.com/Kanaries/pygwalker/releases/tag/0.3.7

JeevankumarDharmalingam commented 1 year ago

spec="./chart_meta_0.json", # this json file will save your chart state, you need to click save button in ui mannual when you finish a chart, 'autosave' will be supported in the future. Like i want to reload the old charts when we select the same dataset again, this is not happening

longxiaofei commented 1 year ago

Is ./chart_meta_0.json written correctly?

Or can you tell me your steps of using pygwalker?

JeevankumarDharmalingam commented 1 year ago
init_streamlit_comm()

# When using `use_kernel_calc=True`, you should cache your pygwalker html, if you don't want your memory to explode
@st.cache_resource
def get_pyg_html(df: pd.DataFrame) -> str:
    # When you need to publish your application, you need set `debug=False`,prevent other users to write your config file.
    html = get_streamlit_html(df, spec="./gw0.json", use_kernel_calc=True, debug=True,themekey='vega')
    return html

@st.cache_data
def get_df() -> pd.DataFrame:
    return st.session_state.df

if('df' in st.session_state):
   df = get_df()

   components.html(get_pyg_html(df), width=1300, height=1000, scrolling=True)
JeevankumarDharmalingam commented 1 year ago

Can we integrate this to react application or do we need to use graphic walker ?

longxiaofei commented 1 year ago
init_streamlit_comm()

# When using `use_kernel_calc=True`, you should cache your pygwalker html, if you don't want your memory to explode
@st.cache_resource
def get_pyg_html(df: pd.DataFrame) -> str:
    # When you need to publish your application, you need set `debug=False`,prevent other users to write your config file.
    html = get_streamlit_html(df, spec="./gw0.json", use_kernel_calc=True, debug=True,themekey='vega')
    return html

@st.cache_data
def get_df() -> pd.DataFrame:
    return st.session_state.df

if('df' in st.session_state):
   df = get_df()

   components.html(get_pyg_html(df), width=1300, height=1000, scrolling=True)

I'll try to reproduce it later

longxiaofei commented 1 year ago

Can we integrate this to react application or do we need to use graphic walker ?

We recommend you to use graphic walker to customize your own needs and apis.

JeevankumarDharmalingam commented 1 year ago

But the feature use_kernal_calc = True will work in Graphic Walker , I mean how to handle the computation for large dataset in Graphic walker Thanks in advance !!!

longxiaofei commented 1 year ago
  1. coding your custom computation function, you can request api to get datas.

    <GraphicWalker ... computation={computationCallback} ... />

  2. in server end, use gw-dsl-parser convert workflow to sql.

JeevankumarDharmalingam commented 1 year ago

In pygwalker if want the visualization to be layout mode to be fixed always can be done in code

JeevankumarDharmalingam commented 1 year ago

Also found need update when i set config privacy to meta , how to add up the external server information, or it will be your server

longxiaofei commented 1 year ago

Also found need update when i set config privacy to meta , how to add up the external server information, or it will be your server

I don't understand what you mean. If you don't want to get updated information, set privacy to offline.

what mean how to add up the external server information?

JeevankumarDharmalingam commented 1 year ago

I mean if set privacy='meta' where my computations will be happening , if answer is on my server then how to set up connection params

longxiaofei commented 1 year ago

If you develop a custom server, you should use graphic-walker to connect to your server, instead of pygwalker.

In addition, all feature of datas and computations in pygwalker all occur in your own python process and will not communicate with kananries' server.