fcapy.visualizer.Mover

class fcapy.visualizer.Mover(pos: Optional[Dict[int, Tuple[float, float]]] = None, direction: frozenset({'v', 'h'}) = 'v')

Class to make node moving in Hasse Diagrams easier

__init__(pos: Optional[Dict[int, Tuple[float, float]]] = None, direction: frozenset({'v', 'h'}) = 'v')

Methods

__init__([pos, direction])

initialize_pos(poset[, layout])

Return a dict of nodes float positions in a line diagram

jitter_node(node_i, dx)

Move the position of node node_i by dx

place_node(node_i, x)

Put the node node_i in the x coordinate

shift_node(node_i, n_nodes_right)

Move the node node_i over n_nodes_right nodes to the right (if positive) or to the left (othw.)

swap_nodes(el_a, el_b)

Put the node el_a in the position of node el_b and node el_b in the position of node el_a

Attributes

direction

Whether the diagram is oriented vertically "v" (from top to bottom) or horizontally "h"

pos

(x_coord, y_coord)}

posx

Property to get/set nodes coordinates along X-axis

posy

Property to get/set nodes coordinates along Y-axis

levels

peers_order

pos_levels

pos_peers

property direction

Whether the diagram is oriented vertically “v” (from top to bottom) or horizontally “h”

initialize_pos(poset: POSet, layout='fcart', **kwargs) None

Return a dict of nodes float positions in a line diagram

jitter_node(node_i: int, dx: float) None

Move the position of node node_i by dx

place_node(node_i: int, x: float) None

Put the node node_i in the x coordinate

property pos: Optional[Dict[int, Tuple[float, float]]]

(x_coord, y_coord)}

Type

Property to get/set the nodes positions in the form of dictionary {node_i

property posx: Optional[Tuple[float, ...]]

Property to get/set nodes coordinates along X-axis

property posy: Optional[Tuple[float, ...]]

Property to get/set nodes coordinates along Y-axis

shift_node(node_i: int, n_nodes_right: int) None

Move the node node_i over n_nodes_right nodes to the right (if positive) or to the left (othw.)

swap_nodes(el_a: int, el_b: int) None

Put the node el_a in the position of node el_b and node el_b in the position of node el_a