mlfinlab.networks.dash_graph

This class takes in a Graph object and creates interactive visualisations using Plotly’s Dash. The DashGraph class contains private functions used to generate the frontend components needed to create the UI.

Running run_server() will produce the warning “Warning: This is a development server. Do not use app.run_server in production, use a production WSGI server like gunicorn instead.”. However, this is okay and the Dash server will run without a problem.

Module Contents

Classes

DashGraph

This DashGraph class creates a server for Dash cytoscape visualisations.

PMFGDash

PMFGDash class, a child of DashGraph, is the Dash interface class to display the PMFG.

class DashGraph(input_graph, app_display='default')

This DashGraph class creates a server for Dash cytoscape visualisations.

get_server()

Returns a small Flask server.

Returns:

(Dash) Returns the Dash app object, which can be run using run_server. Returns a Jupyter Dash object if DashGraph has been initialised for Jupyter Notebook.

get_graph_summary()

Returns the Graph Summary statistics. The following statistics are included - the number of nodes and edges, smallest and largest edge, average node connectivity, normalised tree length and the average shortest path.

Returns:

(Dict) Dictionary of graph summary statistics.

class PMFGDash(input_graph, app_display='default')

Bases: DashGraph

PMFGDash class, a child of DashGraph, is the Dash interface class to display the PMFG.

get_server()

Returns a small Flask server.

Returns:

(Dash) Returns the Dash app object, which can be run using run_server. Returns a Jupyter Dash object if DashGraph has been initialised for Jupyter Notebook.

get_graph_summary()

Returns the Graph Summary statistics. The following statistics are included - the number of nodes and edges, smallest and largest edge, average node connectivity, normalised tree length and the average shortest path.

Returns:

(Dict) Dictionary of graph summary statistics.