You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -71,7 +71,7 @@ Visualization of Bipartite Graph
71
71
>>> plt.show()
72
72
73
73
74
-
Visualization of Hypergraph
74
+
超图的可视化
75
75
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
76
76
77
77
.. image:: ../../_static/img/vis_hypergraph.png
@@ -89,16 +89,19 @@ Visualization of Hypergraph
89
89
90
90
91
91
92
-
Advanced Usages
92
+
高级用法
93
93
---------------------
94
94
95
-
Customize Labels
95
+
自定义标签
96
96
^^^^^^^^^^^^^^^^^^^^^^^^^
97
-
The labels of the vertices could be customized by the ``v_label`` argument. The ``v_label`` could be a list of strings. The labels of the vertices are the strings in the list.
98
-
For example, the following code shows how to customize the labels of the vertices of a graph.
99
-
If the ``v_label`` is not specified, no labels will be shown in the figure.
100
-
The ``font_size`` argument for ``dhg.Graph``, ``dhg.DiGraph``, and ``dhg.Hypergraph``, as well as ``u_font_size`` and ``v_font_size`` for ``dhg.BiGraph`` is used to specify the relative size of the font of the labels, and the default value is ``1.0``.
101
-
The ``font_family`` argument is used to specify the font family of the labels, and the default value is ``'sans-serif'``.
@@ -115,9 +118,16 @@ The ``font_family`` argument is used to specify the font family of the labels, a
115
118
:height:400px
116
119
117
120
118
-
Customize Colors
121
+
自定义颜色
119
122
^^^^^^^^^^^^^^^^^^^^^^^^^
120
-
For ``dhg.Graph``, ``dhg.DiGraph``, and ``dhg.Hypergraph``, the colors of the vertices could be customized by the ``v_color`` argument and the colors of the edges could be customized by the ``e_color`` argument. While for ``dhg.BiGraph``, the colors of the vertices in :math:`\mathcal{U}` could be customized by the ``u_color`` argument and the colors of the vertices in :math:`\mathcal{V}` could be customized by the ``v_color`` argument. Both the ``v_color``, ``u_color``, and ``e_color`` could be a string or list of strings. If a string is provided, all the vertices or edges will be colored by the string. If a list of strings is provided, the colors of the vertices or edges are the strings in the list. For example, the following code shows how to customize the colors of the vertices and edges of a hypergraph.
@@ -133,10 +143,19 @@ For ``dhg.Graph``, ``dhg.DiGraph``, and ``dhg.Hypergraph``, the colors of the ve
133
143
:height:400px
134
144
135
145
136
-
Customize Sizes
146
+
自定义大小
137
147
^^^^^^^^^^^^^^^^^^^^^^^^^
138
-
For ``dhg.Graph``, ``dhg.DiGraph``, and ``dhg.Hypergraph``, the sizes of the vertices could be customized by the ``v_size`` argument and the sizes of the edges could be customized by the ``e_size`` argument. While for ``dhg.BiGraph``, the sizes of the vertices in :math:`\mathcal{U}` could be customized by the ``u_size`` argument and the sizes of the vertices in :math:`\mathcal{V}` could be customized by the ``v_size`` argument. Both the ``v_size``, ``u_size``, and ``e_size`` could be a float or list of float. If a float is provided, all the vertices or edges will be sized by the float. If a list of floats is provided, the sizes of the vertices or edges are the floats in the list. ``v_line_width`` represents the width of the surrounding line of the vertices. ``e_line_width`` represents the width of the line of the edges.
139
-
All of the sizes above represent the relative size, and the default values are ``1.0``. For example, the following code shows how to customize the sizes of the vertices and edges of a hypergraph.
@@ -153,10 +172,17 @@ All of the sizes above represent the relative size, and the default values are `
153
172
154
173
155
174
156
-
Customize Layout
175
+
自定义布局
157
176
^^^^^^^^^^^^^^^^^^^^^^^^^
158
-
The layout of the structures is based on the modified directed-force layout algorithm. There are four forces to determine the position of the nodes, *i.e.*, node attraction force :math:`f_{na}`, node repulsion force :math:`f_{nr}`, edge repulsion force :math:`f_{er}`, and the center force :math:`f_c`. :math:`f_{na}` is the spring force which attracts the adjacent nodes. :math:`f_{nr}` is used to repel the nodes from each other. :math:`f_{er}` is used to repel the hyperedges from each other, which only make sense for hypergraph visualization. :math:`f_c` is used to attract the nodes to the center (two centers for the bipartite graphs).
159
-
The strength of the forces could be customized by ``forces`` argument, which is a dictionary with the keys ``Simulator.NODE_ATTRACTION``, ``Simulator.NODE_REPULSION``, ``Simulator.EDGE_REPULSION``, and ``Simulator.CENTER_GRAVITY``. The default values of the forces are ``1.0``.
0 commit comments