cosapp.tools.views.visjs¶
Build a VISjs view of a System.
Functions
|
Export a system as HTML using vis.JS library. |
|
Returns vis.JS HTML content of system. |
Classes
|
Utility class to export a system as HTML using vis.JS library. |
- class cosapp.tools.views.visjs.VisJsRenderer(system: System, embeddable=False)[source]¶
Bases:
BaseRendererUtility class to export a system as HTML using vis.JS library.
- Parameters:
system (System) – System to export
embeddable (bool, optional) – Is the HTML to be embedded in an existing page? Default: False
- get_data() Dict[source]¶
Convert the System in a dictionary with 4 keys: title, nodes, edges and groups.
The title is a string with the Module name. The nodes is a list of dictionaries defining node for vis JS library. The edges is a list of dictionaries defining edge for vis JS library. The groups is a list of string defining the nodes clusters for vis JS library.
- Parameters:
focus_system (System or None) – System on which the visualization should focus by default
- Returns:
Dictionary containing elements to draw the System using visJS library
- Return type:
dict
- cosapp.tools.views.visjs.to_visjs(system: System, filename: str, embeddable=False) None[source]¶
Export a system as HTML using vis.JS library.
- Parameters:
system (System) – System to export
filename (str) – Filename to write to
embeddable (bool, optional) – Is the HTML to be embedded in an existing page? Default: False