edgegraph.output.pyvis.make_pyvis_net#
- edgegraph.output.pyvis.make_pyvis_net(uni, rvfunc=None, refunc=None, network_kwargs=None)#
Convert a given Universe to a PyVis network, suitable for further use within PyVis.
This function accepts a
Universeobject to apyvis.network.Networkobject. The Network object will have all the nodes (edgegraph calls them “vertices”, pyvis calls them “nodes”, same abstract thing) from the given Universe, and all the edges between them. Directionality of the edges assigned to the Network reflects their directionality in the Universe.See also
pyvis_render_customizable(), which provides the same features as this function, but sets up a customization UI as well.- Parameters:
uni (Universe) – The universe to use as input.
rvfunc (Callable) – A callable object to provide the label for any given vertex being added to the network (short for “(R)ender (V)ertex (Func)tion”). If supplied, it must take one argument (an instance of
Vertexor subclass thereof), and must return astr. If not provided,hex(id(vert))will be used.refunc (Callable) – A callable object to provide the label for any given edge being added to the network (short for “(R)ender (E)dge (Func)tion”). If supplied, it must take one argument (an instance of
TwoEndedLink, or subclass thereof), and must return astr. If not provided, edges will not be labelled.network_kwargs (dict) – An optional dictionary of keyword arguments to pass to
network.Network. If not supplied, the default will select"cdn_resources": "local"and nothing else.
- Returns:
A
pyvis.network.Networkinstance containing the data found in the given universe.- Return type: