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 details)
Built Distribution
File details
Details for the file streamlit-g2-0.1.1.tar.gz
.
File metadata
- Download URL: streamlit-g2-0.1.1.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7a52fc6844c7be39bab9dce4d138eff7d9942ce4472de1d7bdca154ddb30bbf |
|
MD5 | 24629fbdd75ba6c77ca0ea40e5bcf647 |
|
BLAKE2b-256 | 839d969730c25fa3a9b1647d1a03b86ce068e89d71b8d07d4e4ced146d68e85b |
File details
Details for the file streamlit_g2-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: streamlit_g2-0.1.1-py3-none-any.whl
- Upload date:
- Size: 1.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ccee14cc8bad14c5c76b19bafbafd00d6c9107f9e899d57a506b4a67b9d80f4 |
|
MD5 | e7c009ba7492c9717e36c8b4fdb7560e |
|
BLAKE2b-256 | 0ae5c89d0a5efc83c7410dcfe9b98d911a6a5980eb75c5289893475ce406dee8 |