
About this notebook
This notebook shows the EdgeDraw widget from the wigglystuff library. It runs inside marimo and uses no external dataset. You start with four named nodes: "a", "b", "c", and "d". You draw a graph by hand and connect these nodes with edges. The example builds a directed graph.
You draw edges directly in the widget to create the graph. The widget wraps in mo.ui.anywidget, so marimo reads its state. As you interact, several attributes update. The notebook reads widget.names and widget.links. It also calls get_adjacency_matrix and get_neighbors("c"). Each cell shows the current value for the graph you drew.
The widget can detect cycles in the graph. The notebook calls has_cycle for both the undirected and the directed case. You choose whether to treat the graph as directed or undirected with the directed argument. The results change when you change the edges.











