mirror of
https://github.com/pyecharts/pyecharts.git
synced 2026-01-25 17:06:27 +00:00
19 lines
550 B
Python
19 lines
550 B
Python
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)
|
|
assert c.theme == "white"
|
|
assert c.renderer == "canvas"
|
|
c.render("render.html")
|