forked from Kanaries/pygwalker-in-streamlit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pygwalker_app.py
34 lines (29 loc) · 1009 Bytes
/
pygwalker_app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import pygwalker as pyg
import streamlit.components.v1 as components
import pandas as pd
import streamlit as st
# Adjust the width of the Streamlit page
st.set_page_config(
page_title="Use Pygwalker In Streamlit",
layout="wide"
)
# Add Title
st.title("Use Pygwalker In Streamlit")
# Add subtitle
SUB_TITLE = """
<div>
<span>Don't know how to use PyGWalker? Check out the </span>
<a target="_blank" href="https://docs.kanaries.net/graphic-walker/create-data-viz">document</a>
<span> for more details!</span>
</div>
<br/>
<div>
<span>Reference: </span>
<a target="_blank" href="https://docs.kanaries.net/pygwalker/use-pygwalker-with-streamlit.en">Exploring Data and Sharing Findings with Pygwalker and Streamlit</a>
</div>
"""
components.html(SUB_TITLE, height=80)
# Generate the HTML using Pygwalker
pyg_html = pyg.walk(pd.DataFrame(), return_html=True, hideDataSourceConfig=False)
# Embed the HTML into the Streamlit app
components.html(pyg_html, height=1000, scrolling=True)