pyecharts/test/test_graph.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

21 lines
557 B
Python

from nose.tools import eq_
from pyecharts.charts import Graph
def test_graph_base():
nodes = [
{"name": "结点1", "symbolSize": 10},
{"name": "结点2", "symbolSize": 20},
{"name": "结点3", "symbolSize": 30},
{"name": "结点4", "symbolSize": 40},
]
links = []
for i in nodes:
for j in nodes:
links.append({"source": i.get("name"), "target": j.get("name")})
c = Graph().add("", nodes, links, repulsion=8000)
eq_(c.theme, "white")
eq_(c.renderer, "canvas")
c.render()