Render G2 charts in Streamlit
Project description
Streamlit G2
G2 is a visualization grammar for dashboard building, data exploration and storytelling.
This project was created to allow us to render G2 charts in streamlit. Live Demo.
Installation
pip install streamlit-g2
Usage
import streamlit as st
from streamlit_g2 import g2
options = {
"type": "interval",
"data": [
{ "genre": 'Sports', "sold": 275 },
{ "genre": 'Strategy', "sold": 115 },
{ "genre": 'Action', "sold": 120 },
{ "genre": 'Shooter', "sold": 350 },
{ "genre": 'Other', "sold": 150 },
],
"encode": {
"x": "genre",
"y": "sold",
"color": "genre",
}
}
g2(options=options, style=None, key="streamlit_g2")
API
Now, There is only one API for streamlit-g2
, named g2
, see the options
in G2 Spec API.
Property | Description | Type | Default |
---|---|---|---|
options | the options for the visualization, say chart.options(options) |
G2options | null |
- |
style | the style of the container | CSSProperties |
- |
Development
- Building frontend code by running
npm run start
in foldstreamlit_g2/frontend
. - Run the example by running
streamlit run streamlit_g2/__init__.py
with_RELEASE = False
.
License
MIT@hustcc.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
streamlit-g2-0.1.1.tar.gz
(1.5 MB
view hashes)
Built Distribution
Close
Hashes for streamlit_g2-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ccee14cc8bad14c5c76b19bafbafd00d6c9107f9e899d57a506b4a67b9d80f4 |
|
MD5 | e7c009ba7492c9717e36c8b4fdb7560e |
|
BLAKE2b-256 | 0ae5c89d0a5efc83c7410dcfe9b98d911a6a5980eb75c5289893475ce406dee8 |