ragraph.plot.components#

Re-usable plot components.

This module contains several re-usable plot components that contain the data for a Plotly (sub) figure. See Component for the definition of a plot component.

Submodules#

Package Contents#

Classes#

Blank

Blank plot component

Labels

Labels plot component.

Legend

Legend component.

PieMap

A map of piecharts plot component.

Tree

Hierarchy tree plot component of leaf nodes up to their roots.

class ragraph.plot.components.Blank(style=Style())#

Bases: ragraph.plot.generic.Component

Blank plot component

Parameters:

style – Plot style mapping.

class ragraph.plot.components.Labels(leafs: List[ragraph.node.Node], style: ragraph.plot.generic.Style = Style())#

Bases: ragraph.plot.generic.Component

Labels plot component.

Parameters:
  • leafs – List of leaf nodes.

  • style – Plot style mapping.

class ragraph.plot.components.Legend(edges: List[ragraph.edge.Edge], style: ragraph.plot.generic.Style = Style())#

Bases: ragraph.plot.generic.Component

Legend component.

Parameters:
  • edges – List displayed edges.

  • style – Plot style mapping.

class ragraph.plot.components.PieMap(rows: List[ragraph.node.Node], cols: List[ragraph.node.Node], edges: List[ragraph.edge.Edge] = [], style: ragraph.plot.generic.Style = Style(), **kwargs)#

Bases: ragraph.plot.generic.Component

A map of piecharts plot component.

This map, or matrix, of pie-charts display the edges between leaf nodes.

Parameters:
  • rows – The nodes to be placed on the rows of the matrix.

  • cols – The columns to be placed on the columns of the matrix.

  • edges – Edges to be displayed between leaf nodes.

  • style – Plot style option mapping.

  • rows – The nodes to be placed on the rows of the matrix.

  • cols – The columns to be placed on the columns of the matrix.

Note

The pie-charts can represent a number of things, including edge weights, edge labels as well as other metrics. The node hierarchy is included using squares drawn around the diagonal.

Furthermore, bus nodes have their respective row and column in a shaded background color. This sets apart the buses’ “highly integrative” edges from the regular edges between nodes.

class ragraph.plot.components.Tree(leafs: List[ragraph.node.Node], style: ragraph.plot.generic.Style = Style())#

Bases: ragraph.plot.generic.Component

Hierarchy tree plot component of leaf nodes up to their roots.

Leaf nodes are plotted as a vertical list with their roots on the left side.

Parameters:
  • leafs – List of leaf nodes.

  • style – Plot style mapping.