fcapy.visualizer.Visualizer¶
-
class
fcapy.visualizer.Visualizer(lattice=None, node_color='blue', cmap='Blues', node_alpha=1, node_linewidth=1, node_edgecolor='blue', cmap_min=None, cmap_max=None)¶ A class for visualizing the ConceptLattice
-
draw_networkx(...): Draw a ConceptLattice line diagram with networkx package
-
get_plotly_figure(...): Return a Plotly figure with the ConceptLattice line diagram
-
__init__(lattice=None, node_color='blue', cmap='Blues', node_alpha=1, node_linewidth=1, node_edgecolor='blue', cmap_min=None, cmap_max=None)¶ Initialize the Visualizer
- Parameters
lattice (ConceptLattice) – A ConceptLattice to visualize
node_color (str or list of str) – A default color to use for ConceptLattice visualization (can be changed afterwards)
cmap (str) – Colormap to use for ConceptLattice visualization
node_alpha (float) – Transparency of nodes
node_linewidth (float) – Width of borderline (edge) around the nodes in a line diagram
node_edgecolor (float) – Color of borderline (edge) around the nodes in a line diagram
cmap_min (float) – The minimum value of a colormap
cmap_max (float) – The maximum value of a colormap
Methods
__init__([lattice, node_color, cmap, …])Initialize the Visualizer
draw_networkx([draw_node_indices, …])Draw line diagram of the ConceptLattice with networkx package
get_nodes_position([lattice])Return a dict of nodes positions in a line diagram
get_plotly_figure(**kwargs)Get a line diagram of ConceptLattice constructed by plotly package
-
draw_networkx(draw_node_indices=False, edge_radius=None, max_new_extent_count=3, max_new_intent_count=3)¶ Draw line diagram of the ConceptLattice with networkx package
- Parameters
draw_node_indices (bool) – A flag whether to draw indexes of nodes inside the nodes
edge_radius (float) – A value of how much curve the edges on line diagram should be
max_new_extent_count (int) – A number of new objects in concept extent to draw
max_new_intent_count (int) – A number of new attributes in concept intent to draw
-
get_nodes_position(lattice=None)¶ Return a dict of nodes positions in a line diagram
-
get_plotly_figure(**kwargs)¶ Get a line diagram of ConceptLattice constructed by plotly package
- Parameters
kwargs –
- colorbar_title: str
A title of colorbar axis
- max_new_extent_count: int
A number of new objects in concept extent to draw
- max_new_intent_count: int
A number of new objects in concept extent to draw
- xlim: tuple of `float
A tuple of xaxis ranges (x_left, x_right) (default value is (-1, 1))
- figsize: tuple of float
A tuple of size of a figure (width, height) (default value is (1000, 500))
- Returns
fig – A line diagram of ConceptLattice in the form of Plotly Figure
- Return type
plotly.graph_objects.Figure
-