Remove: 移除 is_fill 参数 (#763)

* Remove: 移除 is_fill 参数

* Docs: 更新 changelog

* Update: update isort configure file

* Format: format code

* Format: 统一 import 写法
This commit is contained in:
陈键冬 2018-09-13 00:03:07 +08:00 committed by GitHub
parent c6c7fac3c1
commit 907dca2d9f
24 changed files with 28 additions and 25 deletions

View File

@ -1,3 +1,3 @@
[settings]
sections=FUTURE, STDLIB, FIRSTPARTY, THIRDPARTY, LOCALFOLDER
KNOWN_FIRST_PARTY=jinja2, lml, pyecharts_javascripthon, PIL, pandas, numpy
KNOWN_FIRST_PARTY=jinja2, lml, pandas, numpy, nose, mock

View File

@ -1305,7 +1305,7 @@ kline.render()
Line.add() signatures
```python
add(name, x_axis, y_axis, is_symbol_show=True, is_smooth=False, is_stack=False,
is_step=False, is_fill=False, **kwargs)
is_step=False, **kwargs)
```
* name -> str
Series name used for displaying in tooltip and filtering with legend,or updaing data and configuration with setOption.
@ -1332,10 +1332,6 @@ add(name, x_axis, y_axis, is_symbol_show=True, is_smooth=False, is_stack=False,
default -> False
Whether to show as a step line.It can be true, false. Or 'start', 'middle', 'end'.Which will configure the turn point of step line.
* is_fill -> bool
default -> False
Whether to fill area.
```python
from pyecharts import Line
@ -1365,7 +1361,6 @@ line.render()
line = Line("折线图-数据堆叠示例")
line.add("商家A", attr, v1, is_stack=True, is_label_show=True)
line.add("商家B", attr, v2, is_stack=True, is_label_show=True)
line.show_config()
line.render()
```
![line-demo](https://user-images.githubusercontent.com/19553554/35089965-4f880100-fc73-11e7-9861-c43bd4d4bbe1.gif)
@ -1373,16 +1368,15 @@ line.render()
```python
line = Line("折线图-阶梯图示例")
line.add("商家A", attr, v1, is_step=True, is_label_show=True)
line.show_config()
line.render()
```
![line-demo](https://user-images.githubusercontent.com/19553554/35089968-510f3304-fc73-11e7-9159-67ce6ace9fa3.png)
**area_opacity** Opacity of the component. Supports value from 0 to 1, and the component will not be drawn when set to 0.
```python
line = Line("折线图-面积图示例")
line.add("商家A", attr, v1, is_fill=True, line_opacity=0.2, area_opacity=0.4, symbol=None)
line.add("商家B", attr, v2, is_fill=True, area_color='#000', area_opacity=0.3, is_smooth=True)
line.show_config()
line.render()
```
![line-demo](https://user-images.githubusercontent.com/19553554/35089973-53868fd8-fc73-11e7-8ff6-bfb452954267.png)

View File

@ -4,6 +4,9 @@
#### Updated
* 将 pyecharts-javascripthon 合并入主仓库,并对该部分代码进行了重构。导入路径由 `from pyecharts_javascripthon import *` 转变为 `from pyecharts.javascripthon import *`
### Removed
* [issue#762](https://github.com/pyecharts/pyecharts/issues/762) 移除 `is_fill` 配置项,使用 `area_opacity` 指定区域透明度。
* ### version 0.5.11 - 2018.9.9current

View File

@ -1426,8 +1426,7 @@ add(name, x_axis, y_axis,
is_symbol_show=True,
is_smooth=False,
is_stack=False,
is_step=False,
is_fill=False, **kwargs)
is_step=False, **kwargs)
```
* name -> str
图例名称
@ -1444,8 +1443,6 @@ add(name, x_axis, y_axis,
* is_step -> bool/str
是否是阶梯线图。可以设置为 True 显示成阶梯线图。默认为 False
也支持设置成'start', 'middle', 'end'分别配置在当前点,当前点与下个点的中间下个点拐弯。
* is_fill -> bool
是否填充曲线所绘制面积,默认为 False
```python
from pyecharts import Line
@ -1517,13 +1514,13 @@ line.render()
```
![line-demo](https://user-images.githubusercontent.com/19553554/35089968-510f3304-fc73-11e7-9159-67ce6ace9fa3.png)
**使用 area_opacity** area_opacity 用于指定区域透明度0 为完全不透明默认1 为完全透明。
```python
line = Line("折线图-面积图示例")
line.add(
"商家A",
attr,
v1,
is_fill=True,
line_opacity=0.2,
area_opacity=0.4,
symbol=None,

View File

@ -1,3 +1,2 @@
isort $(find pyecharts -name "*.py"|xargs echo) $(find test -name "*.py"|xargs echo) setup.py
black -l 79 pyecharts test

View File

@ -206,7 +206,6 @@ class Chart(Base):
is_convert=None,
is_datazoom_show=None,
is_datazoom_extra_show=None,
is_fill=None,
is_focusnode=None,
is_geo_effect_show=None,
is_grid3d_rotate=None,

View File

@ -27,7 +27,6 @@ class Line(Chart):
is_smooth=False,
is_stack=False,
is_step=False,
is_fill=False,
**kwargs
):
"""
@ -48,8 +47,6 @@ class Line(Chart):
是否是阶梯线图可以设置为 True 显示成阶梯线图默认为 False
也支持设置成'start', 'middle', 'end'分别配置在当前点当前点与下个
点的中间下个点拐弯
:param is_fill:
是否填充曲线所绘制面积默认为 False
:param kwargs:
"""
assert len(x_axis) == len(y_axis)

View File

@ -5,6 +5,7 @@ from __future__ import unicode_literals
from test.constants import RANGE_COLOR, X_TIME, Y_WEEK
from nose.tools import eq_
from pyecharts import Bar3D
data = [

View File

@ -9,11 +9,10 @@ from test.utils import get_default_rendering_file_content
import numpy as np
import pandas as pd
import pyecharts.exceptions as exceptions
from mock import MagicMock, patch
from nose.tools import eq_, raises
from pyecharts import Bar, Map, jupyter_image, online
from pyecharts import Bar, Map, exceptions, jupyter_image, online
from pyecharts.conf import CURRENT_CONFIG
TITLE = "柱状图数据堆叠示例"

View File

@ -6,6 +6,7 @@ from __future__ import unicode_literals
from test.constants import CLOTHES, WEEK
from nose.tools import eq_
from pyecharts import Bar, Grid, Line
from pyecharts.base import Base

View File

@ -7,6 +7,7 @@ Test Target: js_embed (should render <script> in embed mode)
from __future__ import unicode_literals
from nose.tools import eq_, raises
from pyecharts.conf import PyEchartsConfig, _ensure_echarts_is_in_the_front

View File

@ -2,9 +2,10 @@
from __future__ import unicode_literals
import pyecharts.conf as conf
from nose.tools import eq_
import pyecharts.conf as conf
DEFAULT_JS_LIBRARIES = dict(
echarts="echarts.min",
echartsgl="echarts-gl.min",

View File

@ -5,6 +5,7 @@ Test Case for the acccess interface of coordinate dataset
from __future__ import unicode_literals
from nose.tools import assert_dict_equal, eq_, raises
from pyecharts.datasets.coordinates import (
GEO_DATA_BANK,
DefaultChinaDataBank,

View File

@ -3,6 +3,7 @@
from __future__ import unicode_literals
from nose.tools import assert_raises, raises
from pyecharts import Geo, Style
style = Style(

View File

@ -3,6 +3,7 @@
from __future__ import unicode_literals
from nose.tools import assert_raises
from pyecharts import GeoLines, Style
from pyecharts.datasets.coordinates import search_coordinates_by_keyword

View File

@ -1,8 +1,9 @@
import os
import pyecharts.exceptions as exceptions
from mock import patch
from nose.tools import eq_, raises
from pyecharts import exceptions
from pyecharts.js_extensions import JsExtension

View File

@ -99,7 +99,7 @@ def test_line_type_step():
assert '"step": true' in line._repr_html_()
def test_line_type_fil():
def test_line_type_fill():
line = Line("折线图-面积图示例")
line.add(
"商家A",

View File

@ -6,6 +6,7 @@ import math
from test.constants import RANGE_COLOR
from nose.tools import eq_
from pyecharts import Line3D

View File

@ -7,6 +7,7 @@ from test.utils import get_fixture_content
from mock import patch
from nose.tools import eq_
from pyecharts import (
Bar,
Bar3D,

View File

@ -9,6 +9,7 @@ from test.constants import CLOTHES, RANGE_COLOR, WEEK
from mock import MagicMock
from nose.tools import assert_list_equal, eq_, raises
from pyecharts import (
Bar,
Kline,

View File

@ -4,6 +4,7 @@ from __future__ import unicode_literals
from test.constants import RANGE_COLOR
from nose.tools import eq_
from pyecharts import Scatter3D

View File

@ -6,6 +6,7 @@ import math
from test.constants import RANGE_COLOR
from nose.tools import eq_
from pyecharts import Surface3D

View File

@ -6,6 +6,7 @@ Test cases for jinja2 template functions
from __future__ import unicode_literals
from nose.tools import raises
from pyecharts import Bar, Map
from pyecharts.conf import PyEchartsConfig
from pyecharts.engine import BaseEnvironment, EchartsEnvironment

View File

@ -5,6 +5,7 @@ import codecs
import os
from nose.tools import eq_
from pyecharts.utils import (
NULL,
get_resource_dir,