The canvas draws a frame in three steps. Scene::build works out what's shown and where: folding decides which nodes show, boxes are sized from their wrapped titles (with tags and a +N badge in the bottom border), the camera turns canvas positions into screen cells, and every branch and cross-link gets a right-angle route. The line layer records which arms meet in each cell, so borders and lines join with the right box-drawing character (├ ┼ ┨ ╭), in any mix of light, thick, double, dashed and dotted. Rendering then writes lines, arrowheads and labels, and the nodes on top. Branches leave sideways and bend near their parent, so siblings share one bus; cross-links take the wider gap and carry their label on the longest level run. Far zoom keeps the full width and halves the height (one line per node), Overview shows dots. hjkl picks the nearest node within 45° of the direction, and new nodes find a free spot next to their parent or sibling. The theme works out looks in layers (default, tag style, named style, the node's own), with a mid-tone palette for dark and light terminals, and an ASCII fallback for fonts without box drawing. `cargo run --example canvas` opens a sample document to move around, zoom, fold, edit and drag with the mouse. The tests compare rendered text against the DESIGN.md mockup. Co-Authored-By: Claude Opus 5.5 <[email protected]>
35 lines
1.2 KiB
TOML
35 lines
1.2 KiB
TOML
[package]
|
|
name = "cumulus"
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
# The version cumulus is built and tested with (pinned in rust-toolchain.toml).
|
|
rust-version = "1.90"
|
|
description = "Brainstorm in the terminal: idea graphs on a 2D canvas, with vim keys and the mouse."
|
|
publish = false
|
|
|
|
[dependencies]
|
|
# Document files are RON (Rust Object Notation), read and written through serde.
|
|
serde = { version = "1", features = ["derive"] }
|
|
ron = "0.12"
|
|
# Error types with readable messages, for the parts that report problems.
|
|
thiserror = "2"
|
|
# Terminal user interface. The crossterm backend works on Windows, Linux and
|
|
# macOS. Default features are off to skip widgets cumulus doesn't use.
|
|
ratatui = { version = "0.30", default-features = false, features = ["crossterm_0_29", "layout-cache"] }
|
|
# How many terminal columns text takes (accents, Asian scripts, emoji), for
|
|
# sizing node boxes.
|
|
unicode-width = "0.2"
|
|
|
|
[lints.rust]
|
|
unsafe_code = "forbid"
|
|
|
|
[lints.clippy]
|
|
all = { level = "warn", priority = -1 }
|
|
|
|
[profile.release]
|
|
# A smaller, faster program: optimize across all crates at once (lto, in one
|
|
# piece with codegen-units = 1), and leave out the debug symbols (strip).
|
|
lto = true
|
|
codegen-units = 1
|
|
strip = true
|