From 5a77da4d4ae3a96dd7728521ca5ba1b8e4bac2f1 Mon Sep 17 00:00:00 2001 From: chfw Date: Fri, 25 Aug 2017 08:48:25 +0100 Subject: [PATCH 1/3] :bug: make html path as os independent #130 --- pyecharts/template.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pyecharts/template.py b/pyecharts/template.py index 3f98ca15..ed1103a4 100644 --- a/pyecharts/template.py +++ b/pyecharts/template.py @@ -34,8 +34,10 @@ def freeze_js(html_content): js_content = "" for src in src_matches: + src = src.strip() + src = src.split('/') file_path = os.path.join( - get_resource_dir('templates'), src.strip()) + get_resource_dir('templates'), *src) with codecs.open(file_path, "r", "utf-8") as f: js_content += f.read() + '\n' @@ -139,3 +141,7 @@ def ensure_echarts_is_in_the_front(dependencies): def online(host=constants.DEFAULT_HOST): constants.CONFIGURATION['HOST'] = host + + +def make_path_os_independent(html_path_string): + tokens = html_path_string.split('/') From f12d9dab3bfe6850018c51333d53d88b9525c0ff Mon Sep 17 00:00:00 2001 From: chfw Date: Fri, 25 Aug 2017 08:51:49 +0100 Subject: [PATCH 2/3] :books: update change log --- changelog.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index c71f9d8e..b7222f78 100644 --- a/changelog.md +++ b/changelog.md @@ -7,6 +7,10 @@ ## 版本信息 +* version 0.2.1 (dev) + + * 更改 freeze_js [#130] (https://github.com/chenjiandongx/pyecharts/issues/130) + * version 0.2.0(当前版本) * 新增 datazoom_xaxis_index, datazoom_yaxis_index,可使 datazoom 组件同时控制多个 x y 轴。 * 提供 jupyter-notebook 中的 js host 选项,用户可自行决定使用本地后者网络 js 文件,方便转移 notebook 时保证图形可正常显示 @@ -14,6 +18,7 @@ * 修复 Page 类于其他自定义类共用出现问题的 bug * 新增图形种类 Boxplot(箱形图) * 新增图形种类 Sankey(桑基图) + * 更新 echarts 到 3.7.0 * version 0.1.9.7 * 修复 requirements.txt 中 jupyter-pip 版本过旧问题 @@ -93,4 +98,4 @@ * version 0.1.4 * 第一个稳定版本 - \ No newline at end of file + From 1ccd69cfaf194ae60cee9db4be59f490867f73f4 Mon Sep 17 00:00:00 2001 From: chfw Date: Fri, 25 Aug 2017 10:26:20 +0100 Subject: [PATCH 3/3] :fire: remove orphan function --- pyecharts/template.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/pyecharts/template.py b/pyecharts/template.py index ed1103a4..c6b55498 100644 --- a/pyecharts/template.py +++ b/pyecharts/template.py @@ -142,6 +142,3 @@ def ensure_echarts_is_in_the_front(dependencies): def online(host=constants.DEFAULT_HOST): constants.CONFIGURATION['HOST'] = host - -def make_path_os_independent(html_path_string): - tokens = html_path_string.split('/')