gemseo / utils / n2d3

n2_html module

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

Classes:

N2HTML([file_path, open_browser])

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

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

Bases: object

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

Parameters
  • file_path (Union[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.

Return type

None

Methods:

from_graph(graph)

Create the HTML file from a dependency graph.

from_json(file_path)

Create the HTML file from a JSON file.

from_graph(graph)[source]

Create the HTML file from a dependency graph.

Parameters

graph (DependencyGraph) – The dependency graph.

Return type

None

from_json(file_path)[source]

Create the HTML file from a JSON file.

Parameters

file_path (Union[str, pathlib.Path]) – The JSON file containing the JSON structure of the N2 chart.

Return type

None