Skip to content

Commit

Permalink
Version 0.4.0 (pyecharts#433)
Browse files Browse the repository at this point in the history
* 扁平化 areaStyle 配置项,解决部分图默认显示问题

* 完善 renderer 参数的介绍文档

* pyecharts#432 解决水球图和词云图不能指定 toolbox 选项的问题

* 部分注释格式调整

* 版本号更新至 V0.4.0

* changelog 跟新以及注释细节修正

* changelog 更新
  • Loading branch information
chenjiandongx authored Mar 9, 2018
1 parent 438f9c9 commit dad882a
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 18 deletions.
11 changes: 7 additions & 4 deletions docs/zh-cn/changelog.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
# 版本日志

* ### version 0.4.1 (development)
* TODO

* ### version 0.4.0 (development)
* ### version 0.4.0 - 2018.03.09(Current)

#### Added
* `EchartsEnvironment` 类性增 `render_chart_to_file`
* [issue#425](https://github.com/pyecharts/pyecharts/issues/425) 新增 `pieces` 配置项,为 visualMap 组件提供自定义分段标签的功能
* 新增 `tooltip_border_width`, `tooltip_border_color`, `tooltip_background_color` 三个参数用与提示框背景颜色及边框的配置
* [issue#376](https://github.com/pyecharts/pyecharts/issues/376) 新增 `mark_line_coords` 配置项用于指定标记线的起点和终点

* [issue#431](https://github.com/pyecharts/pyecharts/issues/431) pyecharts.Chart 图表类新增 renderer 参数,用于指定渲染方式,支持 canvas / svg 两种方式

#### Updated
* 更新 jupyter-echarts 至 1.4.0: echarts 3.6.2 -> 4.0.2, echarts-gl 1.0.0-b4 -> 1.0.0-b6, echarts-liquidfill 1.0.5 -> 1.1.1,
* 更新 jupyter-echarts 至 1.4.0: echarts 3.6.2 -> 4.0.4, echarts-gl 1.0.0-b4 -> 1.1.0, echarts-liquidfill 1.0.5 -> 2.0.0, echarts-wordcloud 1.1.0 -> 1.1.2
* 优化内部渲染逻辑,提高渲染效率。

#### Fixed
* 修正 width / height 在 Jupyter Notebook 渲染错误的 Bug
* [issue#432](https://github.com/pyecharts/pyecharts/issues/432) 修复水球图和词云图不能指定 Toolbox 等选项的 Bug

* ### version 0.3.3 - 2018.03.01(Current)

Expand All @@ -23,7 +27,6 @@
* 新增 `name_map`[允许用户采用自己地图名称](http://echarts.baidu.com/option.html#series-map.nameMap)

#### Changed

* `Chart.render_embed` 返回 `jinja2.Markup` 实例
* `Base.show_config` 重命名为 `Base.print_echarts_options`
* 移除 `EchartsEnvironment.configure_pyecharts` 方法
Expand Down
2 changes: 2 additions & 0 deletions docs/zh-cn/charts.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
画布背景颜色,默认为 '#fff'
* page_title -> str
指定生成的 html 文件中 `<title>` 标签的值。默认为'Echarts'
* renderer -> str
指定使用渲染方式,有 'svg' 和 'canvas' 可选,默认为 'canvas'。3D 图仅能使用 'canvas'。


# 通用配置项
Expand Down
2 changes: 1 addition & 1 deletion pyecharts/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = '0.4.0.dev1'
__version__ = '0.4.0'
__author__ = 'chenjiandongx'
7 changes: 4 additions & 3 deletions pyecharts/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ def __init__(self,
画布宽度,默认为 800(px)
:param height:
画布高度,默认为 400(px)
:param renderer:
指定使用渲染方式,有 'svg' 和 'canvas' 可选,默认为 'canvas'。
3D 图仅能使用 'canvas'。
:param page_title:
指定生成的 html 文件中 <title> 标签的值。默认为'Echarts'
:param jshost:
自定义每个实例的 JavaScript host
指定生成的 html 文件中 <title> 标签的值。默认为 'Echarts'
"""
self._option = {}
self._js_dependencies = set()
Expand Down
5 changes: 4 additions & 1 deletion pyecharts/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ def __init__(self, title, subtitle,
:param background_color:
画布背景颜色,默认为 '#fff'
:param page_title:
指定生成的 html 文件中 <title> 标签的值。默认为'Echarts'
指定生成的 html 文件中 <title> 标签的值。默认为 'Echarts'
:param renderer:
指定使用渲染方式,有 'svg' 和 'canvas' 可选,默认为 'canvas'。
3D 图仅能使用 'canvas'。
"""
super(Chart, self).__init__(
width=width, height=height,
Expand Down
5 changes: 2 additions & 3 deletions pyecharts/charts/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,14 @@ def __add(self, name, x_axis, y_axis,
:param kwargs:
"""
assert len(x_axis) == len(y_axis)
kwargs.update(x_axis=x_axis, type="line")
kwargs.update(x_axis=x_axis, type="line", flag=True)
chart = get_all_options(**kwargs)

xaxis, yaxis = chart['xy_axis']
if is_stack:
is_stack = "stack_" + str(self._option['series_id'])
else:
is_stack = ""
_area_style = {"normal": chart['area_style']} if is_fill else {}
self._option.update(xAxis=xaxis, yAxis=yaxis)
self._option.get('legend')[0].get('data').append(name)

Expand All @@ -71,7 +70,7 @@ def __add(self, name, x_axis, y_axis,
"data": y_axis,
"label": chart['label'],
"lineStyle": chart['line_style'],
"areaStyle": _area_style,
"areaStyle": chart['area_style'],
"markPoint": chart['mark_point'],
"markLine": chart['mark_line'],
"seriesId": self._option.get('series_id'),
Expand Down
4 changes: 3 additions & 1 deletion pyecharts/charts/liquid.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def __add(self, name, data,
shape='circle',
liquid_color=None,
is_liquid_animation=True,
is_liquid_outline_show=True):
is_liquid_outline_show=True,
**kwargs):
"""
:param name:
Expand Down Expand Up @@ -59,3 +60,4 @@ def __add(self, name, data,
"show": is_liquid_outline_show
}
})
self._config_components(**kwargs)
2 changes: 1 addition & 1 deletion pyecharts/charts/polar.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def __add(self, name, data,
if len(axis_range) == 2:
_amin, _amax = axis_range

_area_style = {"normal": chart['area_style']}
_area_style = chart['area_style']
if kwargs.get('area_color', None) is None:
_area_style = None

Expand Down
4 changes: 1 addition & 3 deletions pyecharts/charts/radar.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ def __add(self, name, value, item_color=None, **kwargs):
"color": item_color
}},
"lineStyle": chart['line_style'],
"areaStyle": {
"normal": chart['area_style']
},
"areaStyle": chart['area_style'],
})
self._config_components(**kwargs)
4 changes: 3 additions & 1 deletion pyecharts/charts/wordcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def __add(self, name, attr, value,
shape="circle",
word_gap=20,
word_size_range=None,
rotate_step=45):
rotate_step=45,
**kwargs):
"""
:param name:
Expand Down Expand Up @@ -75,3 +76,4 @@ def __add(self, name, attr, value,
"sizeRange": [_min, _max],
"data": _data
})
self._config_components(**kwargs)
3 changes: 3 additions & 0 deletions pyecharts/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ def render_chart_to_file(
):
"""
Render a chart or page to local html files.
:param chart: A Chart or Page object
:param object_name: Variable name for chart/page used in template
:param path: The destination file which the html code write to
Expand All @@ -192,6 +193,7 @@ def render_chart_to_file(
def render_chart_to_notebook(self, **context):
"""
Return html string for rendering a chart/page to a notebook cell.
:param context: A dictionary containing data.
:return: A unicode string that will be displayed in notebook cell.
"""
Expand All @@ -202,6 +204,7 @@ def render_chart_to_notebook(self, **context):
def create_default_environment():
"""
Create environment object with pyecharts default single PyEchartsConfig.
:return: A new EchartsEnvironment object.
"""
config = conf.CURRENT_CONFIG
Expand Down
2 changes: 2 additions & 0 deletions pyecharts/js_extensions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# coding=utf-8

import os
import json
import codecs
Expand Down
2 changes: 2 additions & 0 deletions pyecharts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def to_css_length(x):
"""
Return the standard length string of css.
It's compatible with number values in old versions.
:param x:
:return:
"""
Expand All @@ -74,6 +75,7 @@ def merge_js_dependencies(*chart_or_name_list):
"""
Merge multiple dependencies to a total list.
This will ensure the order and unique in the items.
:param chart_or_name_list:
:return: A list containing dependency items.
"""
Expand Down

0 comments on commit dad882a

Please sign in to comment.