Expand description
Reusable ratatui widget that renders a dartboard Canvas.
CanvasWidget borrows a CanvasWidgetState and draws the canvas cells,
optional selection overlay, and optional floating-selection overlay into a
ratatui buffer. The widget carries only styling; per-session view data
lives in the state. Each consumer (standalone app, late-sh integration,
etc.) builds its own state per render, similar to how ratatui’s
Paragraph::new(text).style(...) works.
Structs§
- Canvas
Style - Styling hooks for
CanvasWidget. Each consumer supplies colors from its own theme. Defaults are sensible for a dark terminal background. - Canvas
Widget - Widget that renders the canvas + overlays.
- Canvas
Widget State - Per-render data the widget reads. The
canvasreference and optional selection/floating views are what make each session’s view distinct. - Floating
View - View of a floating selection pinned to
anchor. Consumers pass a flat cells slice of lengthwidth * height(row-major).Noneentries are rendered as background in opaque mode and skipped in transparent mode. - Selection
View - View of an in-flight selection.
anchoris the fixed corner,cursoris the moving corner.
Enums§
- Selection
Shape - Selection shape as it appears to the renderer. Mirrors the shape used by
standalone dartboard; kept here (rather than in
dartboard-core) because the shape is strictly about how selection is drawn, not how it’s stored.