pyecharts/test/test_sankey.py
陈键冬 3172dff53a
Update: set_series_opts 新增 kwargs,允许传入任意变量 (#1090)
* Update: set_series_opts 新增 kwargs,允许传入任意变量

* Update: 统一测试 eq_ 方式

* Docs: update
2019-05-08 10:44:59 +08:00

24 lines
651 B
Python

from nose.tools import eq_
from pyecharts import options as opts
from pyecharts.charts import Sankey
def test_sankey_base():
nodes = [{"name": "category1"}, {"name": "category2"}, {"name": "category3"}]
links = [
{"source": "category1", "target": "category2", "value": 10},
{"source": "category2", "target": "category3", "value": 15},
]
c = Sankey().add(
"sankey",
nodes,
links,
linestyle_opt=opts.LineStyleOpts(opacity=0.2, curve=0.5, color="source"),
label_opts=opts.LabelOpts(position="right"),
)
eq_(c.theme, "white")
eq_(c.renderer, "canvas")
c.render()