Create animated charts easily! A ipyvizzu wrapper for intuitive usage of ipyvizzu functions and Streamlit embed support.
pip install st-vizzu
-
Create ipyvizzu object using,
create_vizzu_obj()
or define preset ipyvizzu charts for example,bar charts using,bar_chart()
-
Animate the charts using, generalized function,
vizzu_animate()
or argument specific function,beta_vizzu_animate()
-
Embed the charts within Streamlit front-end using,
vizzu_plot()
from st_vizzu import *
import pandas as pd
import streamlit as st
# Load Data
df = pd.read_csv("Data/music_data.csv", index_col=0)
# Create ipyvizzu Object with the DataFrame
obj = create_vizzu_obj(df)
# Preset plot usage. Preset plots works directly with DataFrames.
bar_obj = bar_chart(df,
x = "Kinds",
y = "Popularity",
title= "1.Using preset plot function `bar_chart()`"
)
# Animate with defined arguments
anim_obj = beta_vizzu_animate( bar_obj,
x = "Genres",
y = ["Popularity", "Kinds"],
title = "Animate with beta_vizzu_animate () function",
label= "Popularity",
color="Genres",
legend="color",
sort="byValue",
reverse=True,
align="center",
split=False,
)
# Animate with general dict based arguments
_dict = {"size": {"set": "Popularity"},
"geometry": "circle",
"coordSystem": "polar",
"title": "Animate with vizzu_animate () function",
}
anim_obj2 = vizzu_animate(anim_obj,_dict)
# Visualize within Streamlit
with st.container(): # Maintaining the aspect ratio
st.button("Animate")
vizzu_plot(anim_obj2)