https://github.com/pyecharts/pyecharts-assets
🗂 All assets in pyecharts
https://github.com/pyecharts/pyecharts-assets
pyecharts
Last synced: 5 months ago
JSON representation
🗂 All assets in pyecharts
- Host: GitHub
- URL: https://github.com/pyecharts/pyecharts-assets
- Owner: pyecharts
- License: mit
- Created: 2019-03-27T14:42:37.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2025-11-14T16:29:34.000Z (7 months ago)
- Last Synced: 2025-11-14T18:28:46.175Z (7 months ago)
- Topics: pyecharts
- Language: JavaScript
- Homepage: https://assets.pyecharts.org/.
- Size: 10.1 MB
- Stars: 113
- Watchers: 4
- Forks: 72
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pyecharts-assets
pyecharts-assets 提供了 [pyecharts](https://github.com/pyecharts/pyecharts) 的静态资源文件。
可通过 localhost-server 或者 notebook-server 启动本地服务。首先将项目下载到本地
```shell
# 通过 git clone
$ git clone https://github.com/pyecharts/pyecharts-assets.git
# 或者直接下载压缩包
$ wget https://github.com/pyecharts/pyecharts-assets/archive/master.zip
```
**Localhost-Server**
启动服务器
```shell
$ cd pyecharts-assets
$ python -m http.server
```
设置 host
```python
# 只需要在顶部声明 CurrentConfig.ONLINE_HOST 即可
# 注意:如果使用 pyecharts 2.x 版本,则使用 http://127.0.0.1:8000/assets/v5 进行加载
from pyecharts.globals import CurrentConfig
CurrentConfig.ONLINE_HOST = "http://127.0.0.1:8000/assets/"
# 接下来所有图形的静态资源文件都会来自刚启动的服务器
from pyecharts.charts import Bar
bar = Bar()
```
**Notebook-Server**
安装扩展插件
```shell
$ cd pyecharts-assets
# 安装并激活插件
$ jupyter nbextension install assets
$ jupyter nbextension enable assets/main
```
设置 host
```python
# 只需要在顶部声明 CurrentConfig.ONLINE_HOST 即可
from pyecharts.globals import CurrentConfig, OnlineHostType
# OnlineHostType.NOTEBOOK_HOST 默认值为 http://localhost:8888/nbextensions/assets/
CurrentConfig.ONLINE_HOST = OnlineHostType.NOTEBOOK_HOST
# 接下来所有图形的静态资源文件都会来自刚启动的服务器
from pyecharts.charts import Bar
bar = Bar()
```