pyecharts Graph图表类型
  X5zJxoD00Cah 2023年11月02日 20 0
from pyecharts import options as opts
from pyecharts.charts import Graph

nodes = [
    {"name": "节点1", "symbolSize": 30},
    {"name": "节点2", "symbolSize": 20},
    {"name": "节点3", "symbolSize": 15},
    {"name": "节点4", "symbolSize": 25},
    {"name": "节点5", "symbolSize": 18},
    {"name": "节点6", "symbolSize": 22},
    {"name": "节点7", "symbolSize": 16},
    {"name": "节点8", "symbolSize": 28},
]

links = [
    {"source": "节点1", "target": "节点2"},
    {"source": "节点1", "target": "节点3"},
    {"source": "节点1", "target": "节点4"},
    {"source": "节点1", "target": "节点5"},
    {"source": "节点2", "target": "节点6"},
    {"source": "节点2", "target": "节点7"},
    {"source": "节点4", "target": "节点8"},
]

graph = (
    Graph()
    .add("", nodes, links, repulsion=8000, layout="force", label_opts=opts.LabelOpts())
    .set_global_opts(title_opts=opts.TitleOpts(title="Graph示例"))
)

# graph.render("graph.html")
graph.render_notebook()
【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

推荐阅读
  X5zJxoD00Cah   2023年11月19日   40   0   0 管理系统githtml
  X5zJxoD00Cah   2023年11月26日   47   0   0 Pythonhtml
  zhRhucGD3dLm   2023年11月22日   41   0   0 属性选择器选择器html
  X5zJxoD00Cah   2023年11月13日   36   0   0 HTML5html
X5zJxoD00Cah