cosapp.tools.views.d3js¶
Build a D3js view of a System.
Functions
|
Return D3.JS HTML content of system. |
|
Return the representation of this system in HTML format. |
Classes
|
Utility class to export a system as HTML using D3.JS library. |
- class cosapp.tools.views.d3js.D3JsRenderer(system: System, embeddable=False)[source]¶
Bases:
BaseRendererUtility class to export a system as HTML using D3.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 self.system into a dictionary with 4 keys: name, full_name, children and size.
name key is a string with the system name.
full_name key is a string with Module contextual name.
children key is a list containing dictionaries of same format for children system .
size key is the display size of system in D3 plot.
- Returns:
Dictionary containing elements to draw the System using D3JS library
- Return type:
Dict
- html_content() str[source]¶
Return D3 HTML content of renderer’s system as a character string.
- Return type:
str
- classmethod html_resources() Dict[str, str][source]¶
Return a dictionary of three keys.
d3_js key holds the content of D3.js library.
draw_js key holds the content of the draw function implemented in d3_draw.js.
d3_styles key holds the css style of D3 plot.
- Returns:
The necessary resources to render Jinja template
- Return type:
Dict[str, Dict]