fcapy.visualizer.ConceptLatticeVisualizer
- class fcapy.visualizer.ConceptLatticeVisualizer(lattice: Optional[ConceptLattice] = None, node_color='lightgray', edge_color='lightgrey', node_edgecolor='white', cmap='Blues', node_alpha=1, node_linewidth=1, cmap_min=None, cmap_max=None, label_font_size=12, node_size=300)
A class for visualizing the ConceptLattice .. method:: draw_networkx(…):
Draw a ConceptLattice line diagram with networkx package
- get_plotly_figure(...):
Return a Plotly figure with the ConceptLattice line diagram
- __init__(lattice: Optional[ConceptLattice] = None, node_color='lightgray', edge_color='lightgrey', node_edgecolor='white', cmap='Blues', node_alpha=1, node_linewidth=1, cmap_min=None, cmap_max=None, label_font_size=12, node_size=300)
Initialize the Visualizer :param lattice: A ConceptLattice to visualize :type lattice: ConceptLattice :param node_color: A default color to use for ConceptLattice visualization (can be changed afterwards) :type node_color: str or list of str :param cmap: Colormap to use for ConceptLattice visualization :type cmap: str :param node_alpha: Transparency of nodes :type node_alpha: float :param node_linewidth: Width of borderline (edge) around the nodes in a line diagram :type node_linewidth: float :param node_edgecolor: Color of borderline (edge) around the nodes in a line diagram :type node_edgecolor: str :param cmap_min: The minimum value of a colormap :type cmap_min: float :param cmap_max: The maximum value of a colormap :type cmap_max: float :param label_font_size: The size of a font size when labeling the nodes :type label_font_size: int :param node_size: The size of a node in the visualization :type node_size: int
Methods
__init__([lattice, node_color, edge_color, ...])Initialize the Visualizer :param lattice: A ConceptLattice to visualize :type lattice: ConceptLattice :param node_color: A default color to use for ConceptLattice visualization (can be changed afterwards) :type node_color: str or list of str :param cmap: Colormap to use for ConceptLattice visualization :type cmap: str :param node_alpha: Transparency of nodes :type node_alpha: float :param node_linewidth: Width of borderline (edge) around the nodes in a line diagram :type node_linewidth: float :param node_edgecolor: Color of borderline (edge) around the nodes in a line diagram :type node_edgecolor: str :param cmap_min: The minimum value of a colormap :type cmap_min: float :param cmap_max: The maximum value of a colormap :type cmap_max: float :param label_font_size: The size of a font size when labeling the nodes :type label_font_size: int :param node_size: The size of a node in the visualization :type node_size: int
draw_networkx([draw_node_indices, ...])Draw line diagram of the ConceptLattice with networkx package :param draw_node_indices: A flag whether to draw indexes of nodes inside the nodes :type draw_node_indices: bool :param edge_radius: A value of how much curve the edges on line diagram should be :type edge_radius: float :param ax: A matplotlib axis to draw a lattice on :type ax: Matplotlib Axes :param nodelist: Indexes of lattice elements to draw :type nodelist: list`[`int] :param draw_bottom_concept: A flag whether to draw the bottom concept of a lattice :type draw_bottom_concept: bool :param label_func: A function to create a label for a given element defined by an index :type label_func: int -> str :param max_new_extent_count: A number of new objects in concept extent to draw (used by default
label_func) :type max_new_extent_count: int :param draw_new_extent_len: A flag whether to draw a size of a concept extent before the extent itself (used by defaultlabel_func) :type draw_new_extent_len: bool :param max_new_intent_count: A number of new attributes in concept intent to draw (used by defaultlabel_func) :type max_new_intent_count: int :param draw_new_intent_len: A flag whether to draw a size of a concept intent before the intent itself (used by defaultlabel_func) :type draw_new_intent_len: booldraw_plotly([max_new_extent_count, ...])Draw line diagram of the ConceptLattice with plotly package :param draw_node_indices: A flag whether to draw indexes of nodes inside the nodes :type draw_node_indices: bool :param edge_radius: A value of how much curve the edges on line diagram should be :type edge_radius: float :param max_new_extent_count: A number of new objects in concept extent to draw :type max_new_extent_count: int :param max_new_intent_count: A number of new attributes in concept intent to draw :type max_new_intent_count: int
get_nodes_position(poset[, layout])Return a dict of nodes positions in a line diagram
- draw_networkx(draw_node_indices=False, edge_radius=None, max_new_extent_count=3, max_new_intent_count=3, draw_bottom_concept=True, draw_new_extent_len=True, draw_new_intent_len=True, label_func=None, ax=None, nodelist=None)
Draw line diagram of the ConceptLattice with networkx package :param draw_node_indices: A flag whether to draw indexes of nodes inside the nodes :type draw_node_indices: bool :param edge_radius: A value of how much curve the edges on line diagram should be :type edge_radius: float :param ax: A matplotlib axis to draw a lattice on :type ax: Matplotlib Axes :param nodelist: Indexes of lattice elements to draw :type nodelist: list`[`int] :param draw_bottom_concept: A flag whether to draw the bottom concept of a lattice :type draw_bottom_concept: bool :param label_func: A function to create a label for a given element defined by an index :type label_func: int -> str :param max_new_extent_count: A number of new objects in concept extent to draw (used by default
label_func) :type max_new_extent_count: int :param draw_new_extent_len: A flag whether to draw a size of a concept extent before the extent itself (used by defaultlabel_func) :type draw_new_extent_len: bool :param max_new_intent_count: A number of new attributes in concept intent to draw (used by defaultlabel_func) :type max_new_intent_count: int :param draw_new_intent_len: A flag whether to draw a size of a concept intent before the intent itself (used by defaultlabel_func) :type draw_new_intent_len: bool
- draw_plotly(max_new_extent_count=3, max_new_intent_count=3, draw_new_extent_len=True, draw_new_intent_len=True, label_func=None, nodelist=None)
Draw line diagram of the ConceptLattice with plotly package :param draw_node_indices: A flag whether to draw indexes of nodes inside the nodes :type draw_node_indices: bool :param edge_radius: A value of how much curve the edges on line diagram should be :type edge_radius: float :param max_new_extent_count: A number of new objects in concept extent to draw :type max_new_extent_count: int :param max_new_intent_count: A number of new attributes in concept intent to draw :type max_new_intent_count: int
- static get_nodes_position(poset, layout='fcart', **kwargs)
Return a dict of nodes positions in a line diagram