Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
andrec84j opened this issue Jun 19, 2024 · 6 comments
Assignees

Comments

@andrec84j
Copy link

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?

@longxiaofei
Copy link
Contributor

longxiaofei commented Jun 19, 2024

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
Copy link
Contributor

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 longxiaofei self-assigned this Jul 31, 2024
@zd1990
Copy link

zd1990 commented Jul 31, 2024

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)  

@longxiaofei
Copy link
Contributor

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 .

@zd1990
Copy link

zd1990 commented Jul 31, 2024

@longxiaofei
Yes, thanks for your work

@andrec84j
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants