1 Star 0 Fork 0

himawork / pyecharts-assets

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 1.40 KB
一键复制 编辑 原始数据 按行查看 历史
chenjiandongx 提交于 2019-09-12 09:06 . Docs: update

pyecharts-assets

pyecharts-assets 提供了 pyecharts 的静态资源文件。

可通过 localhost-server 或者 notebook-server 启动本地服务。首先将项目下载到本地

# 通过 git clone
$ git clone https://github.com/pyecharts/pyecharts-assets.git

# 或者直接下载压缩包
$ wget https://github.com/pyecharts/pyecharts-assets/archive/master.zip

Localhost-Server

启动服务器

$ cd pyecharts-assets
$ python -m http.server

设置 host

# 只需要在顶部声明 CurrentConfig.ONLINE_HOST 即可
from pyecharts.globals import CurrentConfig

CurrentConfig.ONLINE_HOST = "http://127.0.0.1:8000/assets/"

# 接下来所有图形的静态资源文件都会来自刚启动的服务器
from pyecharts.charts import Bar
bar = Bar()

Notebook-Server

安装扩展插件

$ cd pyecharts-assets
# 安装并激活插件
$ jupyter nbextension install assets
$ jupyter nbextension enable assets/main

设置 host

 # 只需要在顶部声明 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()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/himawork/pyecharts-assets.git
git@gitee.com:himawork/pyecharts-assets.git
himawork
pyecharts-assets
pyecharts-assets
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891