base_graph_component
BaseGraphComponent
from dara.components.graphs.components.base_graph_component import BaseGraphComponent
class BaseGraphComponent(StyledComponentInstance)
Base class meant to be inherited by various graph viewer and editor components.
Arguments:
additional_legends
: Optional additional legends to showallow_selection_when_not_editable
: Whether to allow nodes/edges to be selected even wheneditable=False
available_inputs
: Optional list of all available inputs. If provided, all nodes that aren't outputs and aren't included present in the list will be treated as latent nodes (will be renamable). If left blank, no nodes will be treated as latent.default_legends
: A dict containing the default legends that should appear on the graph depending on the EditorMode selected.disable_edge_add
: Optional flag for disabling edge additiondisable_latent_node_add
: Optional flag for disabling latent node additiondisable_node_removal
: Optional flag for disabling node removalnon_removable_nodes
: Optional list of node names that cannot be removedon_click_edge
: Event handler for clicking on an edgeon_click_node
: Event handler for clicking on a nodeon_update
: Optional action that will be executed whenever the graph is updated; by default will also update thecausal_graph
provided, if it's a plain Variable instancerequire_focus_to_zoom
: Optional flag to require focus to be on the graph for the zoom to be active. Defaults to True.simultaneous_edge_node_selection
: Optional allows for both a ndoe and an edge to be selected at the same time. When set to True will not reset edge when node selected and vice versa.tooltip_size
: Optional parameter to force the tooltips to use a particular font sizeverbose_descriptions
: Optional flag to show verbose descriptions in the editor framezoom_thresholds
: Optional user-defined zoom thresholds. See ZoomThresholds for more details.
Attributes
- additional_legends: Optional[List[GraphLegend]]
- allow_selection_when_not_editable: Optional[bool]
- available_inputs: Optional[List[str]]
- default_legends: Dict[Union[EditorMode, str], List[GraphLegend]]
- disable_edge_add: Optional[bool]
- disable_latent_node_add: Optional[bool]
- disable_node_removal: Optional[bool]
- editable: Optional[bool]
- graph_layout: Optional[GraphLayout]
- non_removable_nodes: Optional[List[str]]
- on_click_edge: Optional[Action]
- on_click_node: Optional[Action]
- on_update: Optional[Action]
- require_focus_to_zoom: Optional[bool]
- simultaneous_edge_node_selection: Optional[bool]
- tooltip_size: Optional[int]
- verbose_descriptions: Optional[bool]
- zoom_thresholds: Optional[ZoomThresholds]