reno.diagrams.MetricDiagramNode#

class reno.diagrams.MetricDiagramNode(ref, diagram)#

Bases: DiagramNode

Node for a metric 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.

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.

map_edges()

Find and add all the necessary edges that connect to this stock.

Attributes

default_color

default_font_color

default_sparkline_edge_color

other_attrs

shape

style

Parameters:
__annotations__ = {'default_color': 'ClassVar[dict[str, str]]', 'default_font_color': 'ClassVar[dict[str, str]]', 'other_attrs': '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': '#551133', 'light': 'purple'}#
default_font_color: ClassVar[dict[str, str]] = {'dark': '#e6e6e6', 'light': '#e6e6e6'}#
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

other_attrs: ClassVar[dict[str, str]] = {'fontsize': '10pt', 'height': '.2'}#
shape: ClassVar[str] = 'ellipse'#