Module graph

Source
Expand description

The graphing submodule that handles the creation of graphs from the game state.

Structsยง

Grapher
An object that can create graphs from the game state

Constantsยง

GRAPH_LABEL_SPACE ๐Ÿ”’
GRAPH_MARGIN ๐Ÿ”’
GRAPH_SIZE ๐Ÿ”’
Common graph size in pixels
MAX_Y ๐Ÿ”’
The maximum y value for the death graphs
MIN_Y ๐Ÿ”’
NO_PARENT ๐Ÿ”’
A value indicating that the node has no parent
PARENT_CHILD_MARGIN ๐Ÿ”’
PEER_MARGIN ๐Ÿ”’
TIMELINE_MARGIN ๐Ÿ”’
TREE_MARGIN ๐Ÿ”’
TREE_NODE_SIZE_MULTIPLIER ๐Ÿ”’
Y_LABEL ๐Ÿ”’
The y label for the death graphs

Traitsยง

TreeNode
A trait for objects that can be used in a tree structure

Functionsยง

create_graph ๐Ÿ”’
Creates a graph from a given data set Assumes that the data is sorted by the x value, and that the y value is a percentage
create_timeline_graph
handle_node ๐Ÿ”’
Handles node initialization within the graph. Tree is the tree object we are adding the node to, stack is the stack we are using to traverse the tree, storage is the hashmap we are using to store the node data, fnt is the font we are using to calculate the size of the node, and parent is the parent node id.