reno.diagrams.FlowDiagramNode#
- class reno.diagrams.FlowDiagramNode(ref, diagram)#
Bases:
DiagramNodeNode for a flow component.
Methods
__init__(ref, diagram)Initialize a new node for the passed parent diagram and the provided reno component.
add_edge(edge)Add the given edge to _both_ involved nodes.
add_to_graphviz([g])Add this node to the digraphviz Digraph, accounting for sparklines if needed.
check_str_or_listpart_in_dict(keys, dictionary)Utility function to retrieve the value in a dictionary where the key is found in the passed value (either a singular string which would be a direct match, or a list where the key is found in that list).
check_str_or_listpart_in_list(vals, ...)Utility function to determine if a passed value (either a string or list of strings) is in (or at least one instance of the list is in) the passed containing list.
configure_color(config)Determine what colors should be used for this node given the configuration.
configure_render(config)Decide if this node should be rendered based on configuration and underlying reference.
configure_sparklines(config)Set whether to render a sparkline for this reference based on config.
Edges that connect to implicit flows (especially if inflows to a stock) have to be moved to the previous references in the chain to avoid incorrect breaks in the diagram.
generate_sparkline()Returns the filepath of the saved plot so graphviz can display in a node.
graphviz_ref_node([g])Add a node for the reference itself to the graph.
Find and add all the necessary edges that connect to this stock.
Attributes
default_font_colordefault_sparkline_edge_colorother_attrsstyle- Parameters:
ref (reno.Reference)
diagram (ModelDiagram)
- __annotations__ = {'default_color': 'ClassVar[dict[str, str]]', 'shape': 'ClassVar[str]'}#
- __module__ = 'reno.diagrams'#
- configure_sparklines(config)#
Set whether to render a sparkline for this reference based on config.
- Parameters:
config (RenderConfig)
- Return type:
None
- default_color: ClassVar[dict[str, str]] = {'dark': 'transparent', 'light': 'transparent'}#
- fix_implicit_inflow_edges()#
Edges that connect to implicit flows (especially if inflows to a stock) have to be moved to the previous references in the chain to avoid incorrect breaks in the diagram.
Any StockIO edges previously connected to this node as a source get moved (and duplicated if it was an implicit flow made up of several other flows) to the previous flow nodes.
All other reference edges get moved to the previous references in the chain.
- Return type:
None
- map_edges()#
Find and add all the necessary edges that connect to this stock.
This is based on any refs found in the equation.
- Return type:
None
- shape: ClassVar[str] = 'plain'#