Render Ant Design Charts in Streamlit
Project description
<h1 align="center">
<b>Streamlit Charts</b>
</h1>
<div align="center">
[Ant Design Charts](https://ant-design-charts.antgroup.com/) is AntV React component library, Simple and easy to use React chart library.
This project was created to allow us to render charts in streamlit, [live demo](https://ant-design-charts.streamlit.app/).



[](https://github.com/ant-design/ant-design-charts/stargazers)
[](https://www.npmjs.com/package/@ant-design/charts)
</div>
## Installation
```
pip3 install streamlit-charts
```
## Usage
```py
import streamlit as st
from streamlit_charts import charts
options = {
"height": 400,
"data": [
{ "genre": "Sports", "sold": 275 },
{ "genre": "Strategy", "sold": 115 },
{ "genre": "Action", "sold": 120 },
{ "genre": "Shooter", "sold": 350 },
{ "genre": "Other", "sold": 150 },
],
"xField": 'genre',
"yField": 'sold',
"colorField": "genre",
"style": {
"radiusTopLeft": 10,
"radiusTopRight": 10,
},
}
charts(type="Column", options=options, key="streamlit-charts")
```
<img src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*aPxqSpQcsUQAAAAAAAAAAAAADmJ7AQ/original" width="640" alt="example">
## API
Now, There is only one API for `streamlit-charts`, named `charts`, see the `type | options` in [Ant Design Charts](https://ant-design-charts.antgroup.com/).
| Property | Description | Type | Default |
| -------- | --------------------------------------------------------------------------------------------------------------- | --------------------- | ------- |
| type | the chart type of the charts, eg: `Line、Column、Bar、Pie...` | `Str` | `Column` |
| options | the options for the visualization | `Options` | - |
## Development
- Building frontend code by running `npm run start` in fold `streamlit_charts/frontend`.
- Run the example by running `streamlit run streamlit_charts/__init__.py` with `_RELEASE = False`.
## License
MIT@[lxfu1](https://github.com/lxfu1).
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file streamlit-charts-0.1.1.tar.gz.
File metadata
- Download URL: streamlit-charts-0.1.1.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c174ab2b98d86a829c4cd33b7927c496ffa2d55c17efc18b82c9b22ef3db495e
|
|
| MD5 |
e789a1ec3cbe149c09b731b65e3984fb
|
|
| BLAKE2b-256 |
7896890a1eca0b96786715279fb90954a92ec5f48a2855006cc6f23a31f5a988
|
File details
Details for the file streamlit_charts-0.1.1-py3-none-any.whl.
File metadata
- Download URL: streamlit_charts-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf8fb19344604b84f15b2a29a10f6c2cb328e562e30f76bd89341fd1448eafbd
|
|
| MD5 |
12c31c24c754246aa2dcd374a11efa73
|
|
| BLAKE2b-256 |
88ec14700756c56146bd442b564b8902a13dbada34beeafbd6f230975918f69c
|