NetworkX static and dynamic visualizations (pyvipr.networkx_viz.network_viz
)¶
NetworkX visualization views (pyvipr.networkx_viz.views
)¶
-
pyvipr.network_viz.views.
nx_graph_view
(graph, layout_name='cose')[source]¶ Render a networkx Graph or DiGraph :param graph: Graph to render :type graph: nx.Graph or nx.DiGraph :param layout_name: Layout to use :type layout_name: str
-
pyvipr.network_viz.views.
nx_graph_dyn_view
(graph, tspan, node_rel=None, node_tip=None, edge_colors=None, edge_sizes=None, edge_tips=None, layout_name='cose')[source]¶ Render a dynamic visualization of a networkx graph
- Parameters
graph (nx.DiGraph or nx.Graph) – Graph to visualize
tspan (vector-like, optional) – Time values over which to simulate. The first and last values define
node_rel (dict) – A dictionary where the keys are the node ids and the values are lists that contain (0-100) values that are represented in a pie chart within the node
node_tip (dict) – A dictionary where the keys are the node ids and the values are lists that contain any value that can be accessed as a tooltip in the rendered network
edge_colors (dict) – A dictionary where the keys are the edge ids and the values are lists that contain any hexadecimal color value that are represented in the edge colors
edge_sizes (dict) – A dictionary where the keys are the edge ids and the values are lists that contain any numerical value that are represented in the edge size
edge_tips (dict) – A dictionary where the keys are the edge ids and the values are lists that contain any value that can be accessed as a tooltip in the rendered network
layout_name (str) – Layout to use
-
pyvipr.network_viz.views.
graphml_view
(file, layout_name='fcose')[source]¶ Read graph stored in GRAPHML format using NetworkX and render a visualization of it
- Parameters
file (str) – Path to file in graphml format
layout_name (str) – Name of layout to use
-
pyvipr.network_viz.views.
sif_view
(file, layout_name='fcose')[source]¶ Read graph stored in SIF format using NetworkX and render a visualization of it
- Parameters
file (str) – Path to file in sif format
layout_name (str) – Name of layout to use
-
pyvipr.network_viz.views.
sbgn_xml_view
(file, layout_name='fcose')[source]¶ Read graph stored in SBGN XML format using NetworkX and render a visualization of it
- Parameters
file (str) – Path to file in SBGN XML format
layout_name (str) – Name of layout to use
-
pyvipr.network_viz.views.
json_view
(file, layout_name='fcose')[source]¶ Read graph stored in cytoscape json format using NetworkX and render a visualization of it
- Parameters
file (str) – Path to file in cytoscape json format
layout_name (str) – Name of layout to use
-
pyvipr.network_viz.views.
dynamic_json_view
(file, layout_name='fcose')[source]¶ Read graph stored in cytoscape json format using NetworkX and render a visualization of it. This function is for graphs saved from dynamic visualizations.
- Parameters
file (str) – Path to file in cytoscape json format
layout_name (str) – Name of layout to use
-
pyvipr.network_viz.views.
gexf_view
(file, node_type=None, relabel=False, version='1.2draft', layout_name='fcose')[source]¶ Read graph stored in GEXF format using NetworkX and render a visualization of it
- Parameters
file (str) – Path to file in gexf format
node_type (Python type (default: none)) – Convert node ids to this type if not None
relabel (bool (default: False)) – If True relabel the nodes to use the GEXF node “label attribute” instead of the node “id” attribute as the NetworkX node label
version (str (default: 1.2draft)) – Version of GEFX File Format (see https://gephi.org/gexf/format/schema.html). Supported values: “1.1draft”, “1.2dra
layout_name (str) – Name of layout to use
-
pyvipr.network_viz.views.
gml_view
(file, label='label', destringizer=None, layout_name='fcose')[source]¶ Read graph stored in GML format using NetworkX and render a visualization of it
- Parameters
file (str) – Path to file in cytoscape json format
label (str, optional) – If not None, the pased nodes will be renamed according to node attributes indicated by label. Default value: ‘label’
destringizer (callable, optional) – A destringizer that recovers values stored as strings in GML. If it cannot convert a string to a value, a ValueError is raised. Default value: None
layout_name (str) – Name of layout to use