11#!/usr/bin/env python
2- #coding=utf-8
2+ # coding=utf-8
33
44from pyecharts .base import Base
55from pyecharts .option import get_all_options
66
7+
78class Graph (Base ):
89 """
910 <<< Graph chart >>>
11+
1012 Graph is a diagram to represent nodes and the links connecting nodes.
1113 """
1214 def __init__ (self , title = "" , subtitle = "" , ** kwargs ):
@@ -64,15 +66,17 @@ def __add(self, name, nodes, links, categories=None,
6466 :param graph_edge_length:
6567 The distance between 2 nodes on edge. This distance is also affected by repulsion.
6668 It can be an array to represent the range of edge length.In this case edge with
67- larger value will be shorter, which means two nodes are closer. And edge with smaller value will be longer.
69+ larger value will be shorter, which means two nodes are closer.
70+ And edge with smaller value will be longer.
6871 :param graph_gravity:
6972 The gravity factor enforcing nodes approach to the center.
7073 The nodes will be closer to the center as the value becomes larger.
7174 :param graph_repulsion:
72- The repulsion factor between nodes. The repulsion will be stronger and the distance between 2 nodes
73- becomes further as this value becomes larger.
75+ The repulsion factor between nodes. The repulsion will be stronger and the
76+ distance between 2 nodes becomes further as this value becomes larger.
7477 It can be an array to represent the range of repulsion.
75- In this case larger value have larger repulsion and smaller value will have smaller repulsion.
78+ In this case larger value have larger repulsion and smaller value
79+ will have smaller repulsion.
7680 :param graph_edge_symbol:
7781 Symbol of two ends of edge line.
7882 For example: edgeSymbol: ['circle', 'arrow']
@@ -94,10 +98,14 @@ def __add(self, name, nodes, links, categories=None,
9498 "name" : name ,
9599 "layout" : graph_layout ,
96100 "symbol" : chart ['symbol' ],
97- "circular" : {"rotateLabel" : is_rotatelabel },
98- "force" : {"repulsion" : graph_repulsion ,
99- "edgeLength" : graph_edge_length ,
100- "gravity" : graph_gravity },
101+ "circular" : {
102+ "rotateLabel" : is_rotatelabel
103+ },
104+ "force" : {
105+ "repulsion" : graph_repulsion ,
106+ "edgeLength" : graph_edge_length ,
107+ "gravity" : graph_gravity
108+ },
101109 "label" : chart ['label' ],
102110 "lineStyle" : chart ['line_style' ],
103111 "roam" : is_roam ,
0 commit comments