fcapy.visualizer.LineVizNx

class fcapy.visualizer.LineVizNx(mover: Optional[Mover] = None, nodelist: Optional[Tuple[int, ...]] = None, node_color: str = 'lightgray', node_shape: str = 'o', node_alpha: float = 1, node_size: float = 300, node_label_func: Optional[Callable[[int, POSet], str]] = None, node_label_font_size: int = 12, node_border_color: str = 'white', node_border_width: float = 1, edgelist: Optional[Tuple[Tuple[int, int], ...]] = None, edge_color: str = 'lightgray', edge_radius: float = 0, edge_width: float = 1, cmap: str = 'Blues', cmap_min: Optional[float] = None, cmap_max: Optional[float] = None, flg_node_indices: bool = False, flg_axes: bool = False, flg_drop_bottom_concept: bool = False)

A class to draw line visualisations via Networkx package

Parameters
  • mover (Mover) – Mover object, defaults to None

  • nodelist (Tuple[int, ...]) – defaults to None

  • node_color (str) – defaults to 'lightgray'

  • node_shape (str) – defaults to 'o'

  • node_alpha (float) – defaults to 1

  • node_size (float) – defaults to 300

  • node_label_func (Callable[[int, POSet], str]) – defaults to None

  • node_label_font_size (int) – defaults to 12

  • node_border_color (str) – defaults to 'white'

  • node_border_width (float) – defaults to 1

  • edgelist (Tuple[Tuple[int, int], ...]) – defaults to None

  • edge_color (str) – defaults to 'lightgray'

  • edge_radius (float) – defaults to 0

  • edge_width (float) – defaults to 1

  • cmap (str) – defaults to 'Blues'

  • cmap_min (float) – defaults to None

  • cmap_max (float) – defaults to None

  • flg_node_indices (bool) – defaults to False

  • flg_axes (bool) – defaults to False

  • flg_drop_bottom_concept (bool) – defaults to False

__init__(mover: Optional[Mover] = None, nodelist: Optional[Tuple[int, ...]] = None, node_color: str = 'lightgray', node_shape: str = 'o', node_alpha: float = 1, node_size: float = 300, node_label_func: Optional[Callable[[int, POSet], str]] = None, node_label_font_size: int = 12, node_border_color: str = 'white', node_border_width: float = 1, edgelist: Optional[Tuple[Tuple[int, int], ...]] = None, edge_color: str = 'lightgray', edge_radius: float = 0, edge_width: float = 1, cmap: str = 'Blues', cmap_min: Optional[float] = None, cmap_max: Optional[float] = None, flg_node_indices: bool = False, flg_axes: bool = False, flg_drop_bottom_concept: bool = False) None

Method generated by attrs for class AbstractLineViz.

Methods

__init__([mover, nodelist, node_color, ...])

Method generated by attrs for class AbstractLineViz.

concept_lattice_label_func(c_i, lattice[, ...])

A default function to label each concept in the concept lattice visualization

draw_concept_lattice(lattice, **kwargs)

Draw lattice with draw_poset function with node labels generated by concept_lattice_label_func

draw_poset(poset[, ax])

Draw a Partially Ordered Set as a line diagram with Networkx package

draw_quiver(poset, edges[, ax])

Quiver = directed graph with multiple edges between pairs of nodes.

init_mover_per_poset(poset, **kwargs)

Construct mover with default positions given Partially Ordered set

Attributes

LIB_NAME

static concept_lattice_label_func(c_i: int, lattice: ConceptLattice, flg_new_intent_count_prefix: bool = True, max_new_intent_count: int = 2, flg_new_extent_count_prefix: bool = True, max_new_extent_count: int = 2) str

A default function to label each concept in the concept lattice visualization

The label looks somewhat like:

10: m1, m2, m3, m5, ...

3: g1, g2, g6

where m_i are attributes of concept intent, and g_i are objects of concept extent

draw_concept_lattice(lattice: ConceptLattice, **kwargs)

Draw lattice with draw_poset function with node labels generated by concept_lattice_label_func

Important

Please specify the ax parameter from kwargs in order for the function to work properly e.g.

import matplotlib.pyplot as plt
viz = LineVizNx()
L = ConceptLattice(...)

fig, ax = plt.subplots()
viz.draw_concept_lattice(L, ax=ax, ...)
draw_poset(poset: POSet, ax=None, **kwargs)

Draw a Partially Ordered Set as a line diagram with Networkx package

Important

Please specify ax parameter in order for the function to work properly e.g.

import matplotlib.pyplot as plt
viz = LineVizNx()
poset = POSet(...)

fig, ax = plt.subplots()
viz.draw_poset(poset, ax=ax, ...)
draw_quiver(poset: POSet, edges: Tuple[int, int, str], ax=None, **kwargs)

Quiver = directed graph with multiple edges between pairs of nodes.

Warning

It is only a test feature

init_mover_per_poset(poset: POSet, **kwargs)

Construct mover with default positions given Partially Ordered set