gemseo / utils / n2d3

n2_html module

Generator of the HTML file containing a D3.js version of the N2 chart.

class gemseo.utils.n2d3.n2_html.N2HTML(file_path='n2.html', open_browser=False)[source]

Bases: object

Generate an HTML file to visualize a dynamic and interactive N2 chart.

  • file_path (str | Path) –

    The file path of the HTML file.

    By default it is set to “n2.html”.

  • open_browser (bool) –

    If True, open the browser and display the HTML file.

    By default it is set to False.

from_graph(graph, self_coupled_disciplines=None)[source]

Create the HTML file from a dependency graph.

  • graph (DependencyGraph) – The dependency graph.

  • self_coupled_disciplines (Sequence[str] | None) – The names of the self-coupled disciplines, if any.

Return type:



Create the HTML file from a JSON file.


file_path (str | Path) – The JSON file containing the JSON structure of the N2 chart.

Return type: