Notebook Utilities¶
The notebook module contains some utility functions that can be used to visualise pywr networks in a Juyter notebook
-
pywr.notebook.
pywr_model_to_d3_json
(model, attributes=False)¶ Convert a Pywr graph to a structure d3 can display
- Parameters
- modelpywr.core.Model
- attributes: bool (default=False)
If True, attribute data for each node is extract
-
pywr.notebook.
pywr_json_to_d3_json
(model, attributes=False)¶ Converts a JSON file or a JSON-derived dict into structure that d3js can use.
- Parameters
- modeldict or str
str inputs should be a path to a json file containing the model.
-
pywr.notebook.
draw_graph
(model, width=500, height=400, labels=False, attributes=False, css=None)¶ Display a Pywr model using D3 in Jupyter
Functionality for creating the d3 graph is now in the PywrSchematic object