New Component: Streamlit Google Charts

Hi all,

I needed Google’s Word Tree chart for an app I’m writing so I made a Streamlit component for react-google-charts. There’s not much to it - really just a lightweight wrapper - but I hope it’s useful to someone.

Install
pip install streamlit-gchart

Usage

import streamlit as st
import streamlit_gchart as gchart

cat_data = [
    ['Phrases'],
    ['cats are better than dogs'],
    ['cats eat kibble'],
    ['cats are better than hamsters'],
    ['cats are awesome'],
    ['cats are people too'],
    ['cats eat mice'],
    ['cats meowing'],
    ['cats in the cradle'],
    ['cats eat mice'],
    ['cats in the cradle lyrics'],
    ['cats eat kibble'],
    ['cats for adoption'],
    ['cats are family'],
    ['cats eat mice'],
    ['cats are better than kittens'],
    ['cats are evil'],
    ['cats are weird'],
    ['cats eat mice']
]
    
gchart.gchart(key="cat_chart", data=cat_data, chartType="WordTree", 
    width=600, height=400, wordtree={"format": "implicit", "word": "cats"}

Regards,
Miles

4 Likes

Yo, this is awesome, Thanks!
Pretty sure I personally will find this useful.

1 Like

Looks awesome @MilesG, always happy to see new Streamlit charting components :slight_smile:

Could you add it to the Components Tracker so we can keep track of it :slight_smile: ? Thanks!

(should build a bot to write this message on each component topic automatically one day)

Cheers,
Fanilo

1 Like

Thanks Fanilo! Have added it to the post now.