Bases: object
Adds names for the columns in the diagram. Used for labelling the diagram.
Adds connections between nodes in the network. Each entry in the connections list should be a tuple containing the source node name (string), destination node name (string) and the connection weight (real).
Tuple is ([(source, destination, weight)])
source -> string
destination -> string
weight -> real
Nodes should already have been added through either
iesve.VESankey.add_node_names_in_order() or
iesve.VESankey.add_node_columns()
Sets the colour each node should be generated with. colours is a dictionary of {string : tuple}, where the string is the name of the node, and the tuple holds the RGB values for the colour of that node.
Adds nodes to the diagram, in the specified column index.
nodeColumns is a dictionary, where each entry is {node_name (str) : column_index (int)}.
Adds names for the nodes to be used as labels in the diagram. Python Dictionaries do not retain ordering of items; this function can be used to ensure nodes are added to the diagram in the order they appear in the list. Can be useful to control positions of nodes in the final diagram.
iesve.VESankey.add_node_columns() still needs to be called, regardless of
whether iesve.VESankey.add_node_names_in_order() is called or not.
Clears all added data from the sankey generator. Necessary if you wish to reuse the same VESankey object to generate multiple different sankey diagrams.
Once all nodes and connections have been added, calling generate_sankey will generate an in-memory representation of the sankey diagram, ready for exporting.
Returns the recommended ratio for the connection weight:line width rations that
will be used if no ratio is specified through
iesve.VESankey.set_weight_width_ratio().
After generate_sankey has been called, save_png will export the sankey diagram as a .png file.
After generate_sankey has been called, save_svg will export the sankey diagram as a .svg file.
Sets the title of the diagram.
Sets the string to be used as a legend for representing the units the connection weights are in.
Sets the weight:line width ratio the diagram should use. Can be used to somewhat control how thick the connection lines should be with vastly differing weights.