Data I/O module¶
A data input/output module for netwulf.
-
netwulf.io.
load
(f)[source]¶ Parameters: f (file-like object or str) – The file to which to write. Returns: - stylized_network (dict) – dictionary returned by
netwulf.interactive.visualize
- config (dict) – dictionary returned by
netwulf.interactive.visualize
- G (networkx.Graph or similar, default : None) – Graph object from which the whole thing was generated.
Example
>>> G = networkx.fast_gnp_random_graph(10,0.3) >>> style_nw, cf = netwulf.visualize(G) >>> netwulf.save("ER.json",style_nw,cf,G) >>> style_nw,cf,G = netwulf.load("ER.json")
- stylized_network (dict) – dictionary returned by
-
netwulf.io.
save
(f, stylized_network, config, G=None)[source]¶ Parameters: - f (file-like object or str) – The file to which to write.
- stylized_network (dict) – dictionary returned by
netwulf.interactive.visualize
- config (dict) – dictionary returned by
netwulf.interactive.visualize
- G (networkx.Graph or similar, default : None) – Graph object from which the whole thing was generated.
Example
>>> G = networkx.fast_gnp_random_graph(10,0.3) >>> style_nw, cf = netwulf.visualize(G) >>> netwulf.save("ER.json",style_nw,cf,G)