gemseo.utils.n2d3.n2_html module#

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

class N2HTML(file_path='n2.html', show_html=False)[source]#

Bases: object

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

Parameters:
  • file_path (str | Path) --

    The file path of the HTML file.

    By default it is set to "n2.html".

  • show_html (bool) --

    Whether open the browser and display the HTML file.

    By default it is set to False.

from_graph(graph, self_coupled_disciplines=())[source]#

Create the HTML file from a dependency graph.

Parameters:
  • graph (DependencyGraph) -- The dependency graph.

  • self_coupled_disciplines (Sequence[str]) --

    The names of the self-coupled disciplines, if any.

    By default it is set to ().

Return type:

None

from_json(file_path)[source]#

Create the HTML file from a JSON file.

Parameters:

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

Return type:

None