Skip to content

Commit

Permalink
Release version 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiandongx authored Jul 15, 2019
2 parents 5c2087b + 538b0c9 commit aa52a0b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyecharts/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "1.3.0"
__version__ = "1.3.1"
__author__ = "chenjiandongx"
2 changes: 1 addition & 1 deletion pyecharts/charts/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, init_opts: Union[InitOpts, dict] = InitOpts()):
self.chart_id = _opts.get("chart_id") or uuid.uuid4().hex

self.options: dict = {}
self.js_host: str = _opts.get("js_host", CurrentConfig.ONLINE_HOST)
self.js_host: str = _opts.get("js_host") or CurrentConfig.ONLINE_HOST
self.js_functions: utils.OrderedSet = utils.OrderedSet()
self.js_dependencies: utils.OrderedSet = utils.OrderedSet("echarts")
self.options.update(backgroundColor=_opts.get("bg_color"))
Expand Down
2 changes: 2 additions & 0 deletions pyecharts/options/series_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def __init__(
border_color0: Optional[str] = None,
border_width: Optional[Numeric] = None,
opacity: Optional[Numeric] = None,
area_color: Optional[str] = None,
):
self.opts: dict = {
"color": color,
Expand All @@ -33,6 +34,7 @@ def __init__(
"borderColor0": border_color0,
"borderWidth": border_width,
"opacity": opacity,
"areaColor": area_color
}


Expand Down
3 changes: 2 additions & 1 deletion test/test_base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from nose.tools import eq_
from nose.tools import eq_, assert_not_in

from pyecharts.charts.base import Base

Expand All @@ -18,3 +18,4 @@ def test_base_init_funcs():
c1 = Base(dict(width="110px", height="210px"))
eq_(c1.width, "110px")
eq_(c1.height, "210px")
assert_not_in(c1.js_host, ['', None])
7 changes: 7 additions & 0 deletions test/test_item_style_options.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from pyecharts import options as opts
from nose.tools import eq_


def test_area_color_in_item_styles():
op = opts.ItemStyleOpts(area_color='red')
eq_(op.opts['areaColor'], 'red')
5 changes: 3 additions & 2 deletions test/test_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ def test_map_emphasis():
[list(z) for z in zip(Faker.provinces, Faker.values())],
"china",
emphasis_label_opts=opts.LabelOpts(is_show=False),
emphasis_itemstyle_opts=opts.ItemStyleOpts(border_color="white"),
emphasis_itemstyle_opts=opts.ItemStyleOpts(border_color="white",
area_color="red"),
)
options = json.loads(c.dump_options())
expected = {
"label": {"show": False, "position": "top", "margin": 8},
"itemStyle": {"borderColor": "white"},
"itemStyle": {"borderColor": "white", "areaColor": "red"},
}
eq_(expected, options["series"][0]["emphasis"])

0 comments on commit aa52a0b

Please sign in to comment.