pygwalker icon indicating copy to clipboard operation
pygwalker copied to clipboard

How do I get data in vis_spec and save it to a variable (pygwalker.api.streamlit )?

Open andrec84j opened this issue 1 year ago • 6 comments

Streamlit from pygwalker.api.streamlit import StreamlitRenderer

Is it possible to take the data from vis_spec after finishing the construction of a graph and save the data in a variable?

andrec84j avatar Jun 19 '24 13:06 andrec84j

Hi @andrec84j ,This feature is not currently supported.

I'm interested to know what things you would be able to accomplish with this feature.

Could you please share some details?

longxiaofei avatar Jun 19 '24 13:06 longxiaofei

Hi, @andrec84j

pygwalker already support this feature in pygwalker==0.4.9.4a0.

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)

longxiaofei avatar Jul 31 '24 02:07 longxiaofei

hi,@longxiaofei Is it possible to obtain the last filtered dataframe object in Gradio?

    df = pd.DataFrame(dj)  
    pyg_app = get_html_on_gradio(df, spec="./viz-config.json",spec_io_mode="rw",default_tab="data")  
    gr.HTML(pyg_app)  

zd1990 avatar Jul 31 '24 08:07 zd1990

Hi @zd1990

Do you want to get the filtered data by operating in the data tab?

This feature is not currently supported, but I am developing it .

longxiaofei avatar Jul 31 '24 09:07 longxiaofei

@longxiaofei Yes, thanks for your work

zd1990 avatar Jul 31 '24 10:07 zd1990

Hi @andrec84j ,This feature is not currently supported.

I'm interested to know what things you would be able to accomplish with this feature.

Could you please share some details?

Hello @longxiaofei By achieving this, you add the functionality to save and share the analysis with other customers without the need to send or load the viz_spec.

I created an area to save the viz_spec with the possibility of sharing but it would be interesting for the user to be able to save and share without worrying about copying and pasting the PyGWalker Code

image

andrec84j avatar Aug 01 '24 16:08 andrec84j

Hi @zd1990

Do you want to get the filtered data by operating in the data tab?

This feature is not currently supported, but I am developing it.

Thank you for your contribution. Has this feature been implemented?

zhentai-SMU avatar Feb 09 '25 07:02 zhentai-SMU

Hello I need to obtain the viz code to save the visualization in a database and allow users to save and view the saved visualizations.

Thank you for replying.

Em dom., 9 de fev. de 2025 às 04:33, zhentai @.***> escreveu:

Hi @zd1990 https://github.com/zd1990

Do you want to get the filtered data by operating in the data tab?

This feature is not currently supported, but I am developing it.

Thank you for your contribution. Has this feature been implemented?

— Reply to this email directly, view it on GitHub https://github.com/Kanaries/pygwalker/issues/580#issuecomment-2646107883, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL3GBN3FSPZCAAYZ4IDHAB32O4AC7AVCNFSM6AAAAABJSBVQ62VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNBWGEYDOOBYGM . You are receiving this because you were mentioned.Message ID: @.***>

-- Att; André CJ @.***

andrec84j avatar Jun 03 '25 14:06 andrec84j