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 startin foldstreamlit_g2/frontend. - Run the example by running
streamlit run streamlit_g2/__init__.pywith_RELEASE = False.
License
MIT@hustcc.
Metadata
Release files for streamlit-g2 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| streamlit-g2-0.1.1.tar.gz | 1.5 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| streamlit_g2-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.1 MB
Release files / streamlit-g2-0.1.1.tar.gz
| Download URL | streamlit-g2-0.1.1.tar.gz |
|---|---|
| Size | 1.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d7a52fc6844c7be39bab9dce4d138eff7d9942ce4472de1d7bdca154ddb30bbf
|
|
BLAKE2b-256 checksum How to use checksums |
839d969730c25fa3a9b1647d1a03b86ce068e89d71b8d07d4e4ced146d68e85b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.1
|
Release files / streamlit_g2-0.1.1-py3-none-any.whl
| Download URL | streamlit_g2-0.1.1-py3-none-any.whl |
|---|---|
| Size | 1.6 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3ccee14cc8bad14c5c76b19bafbafd00d6c9107f9e899d57a506b4a67b9d80f4
|
|
BLAKE2b-256 checksum How to use checksums |
0ae5c89d0a5efc83c7410dcfe9b98d911a6a5980eb75c5289893475ce406dee8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.1
|