EdgeDraw API#
Bases: AnyWidget
Sketch node/link diagrams and sync edges as adjacency-friendly data.
Examples:
Create an EdgeDraw widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
names
|
List[str]
|
Ordered list of node labels. |
required |
height
|
int
|
Canvas height in pixels. |
400
|
width
|
int
|
Canvas width in pixels. |
600
|
directed
|
bool
|
Whether to draw directed edges with arrowheads. |
True
|
links
|
Optional[Iterable[Union[Sequence[str], dict]]]
|
Optional list of (source, target) pairs to seed the widget. |
None
|
Source code in wigglystuff/edge_draw.py
get_adjacency_matrix #
Create an adjacency matrix from links and node names.
Source code in wigglystuff/edge_draw.py
get_neighbors #
Return neighbors of a node.
Source code in wigglystuff/edge_draw.py
has_cycle #
Synced traitlets#
| Traitlet | Type | Notes |
|---|---|---|
names |
list[str] |
Ordered node labels. |
links |
list[dict] |
Link dicts with source and target keys. |
directed |
bool |
Draw directed edges when true. |
width |
int |
Canvas width in pixels. |
height |
int |
Canvas height in pixels. |