Expand description
Rust-native Dioxus mind maps, styled through inheritable CSS variables.
Renderer-independent checked tree operations, JSON persistence and snapshot
history with four HTML/CSS layouts and measured SVG connectors. Use
use_mind_map and EditableMindMap for a shared editable document.
Optional typed plugins add interaction, outlines and Rust export formats.
§Platform support
The default crate enables no renderer. The host selects Dioxus Web or Desktop.
Enable the web feature for live CSS/font capture to SVG and raster images on
wasm32-unknown-unknown. Desktop live capture is currently unsupported and
returns a recoverable error; tree operations and XMind encoding are portable.
Static HTML exports contain no interactive editor. Data compatibility is a
strict plain-text subset; unknown JSON fields are rejected.
§Optional plugins
Keep the guards returned by use_plugins or MindMapHandle::register_plugin
alive for as long as their capabilities are needed. Views share one handle’s
document and history, while each view retains its own viewport and editor.
Source examples and validation notes are in the project repository.
use dioxus::prelude::*;
use dioxus_mind_elixir::{MindMap, MindMapData, Node};
fn app() -> Element {
let data = use_signal(|| MindMapData::new(
Node::new("root", "Ideas").with_children(vec![Node::new("child", "Rust")])
));
rsx! { MindMap { data } }
}Re-exports§
pub use outline::Outline;pub use outline::Outline;pub use outline::OutlineProps;pub use outline::Toolbar;pub use outline::Toolbar;pub use outline::ToolbarProps;pub use view::Alignment;pub use view::EditableMindMap;pub use view::EditableMindMap;pub use view::EditableMindMapProps;pub use view::MindMap;pub use view::MindMapProps;
Modules§
- plugins
- Typed optional extensions. All document changes still use core transactions.
- text
- Deliberately small, loss-aware Mind Elixir plaintext subset.
Structs§
- Editable
Mind MapProps - Properties for the
EditableMindMapcomponent. - Mind
MapData - Nested persistent document. Runtime selection, viewports and history are excluded.
- Mind
MapHandle - Copyable shared document handle. Mutation always passes through checked core transactions. Individual views own their viewport, editor and mounted nodes.
- Mind
MapProps - Properties of the read-only
MindMaprenderer. - Mind
MapState - Validated document with private tree/index/selection and bounded history.
- Node
- A plain-text node in the persistent nested tree.
- Node
Style - Supported plain-text styles, mapped to upstream field names.
- Operation
Options - Recording options for a single operation.
- Operation
Result - A transaction result; no-op operations return
changed = false. - Outline
Props - Properties for the
Outlinecomponent. - Plugin
Guard - Registration lifetime and owned event subscriptions for one plugin instance.
- Point
- A point in CSS pixels.
- Subscription
- An event subscription; dropping it releases the callback, including on unmount.
- Theme
- Explicit optional theme. The default component sets no theme variables, so
ancestor CSS remains effective. A supplied theme takes precedence over
inherited values; the component’s
stylecan override the theme again. - Toolbar
Props - Properties for the
Toolbarcomponent. - Viewport
- Per-view viewport, excluded from document serialization and history.
Enums§
- Alignment
- Vertical alignment of the root and side groups.
- Core
Event - Observable core events. Operation is delivered before selection changes.
- Layout
Direction - Document layout; numeric values match Mind Elixir JSON.
- Mind
MapError - A recoverable document, operation or renderer failure.
- Node
Direction - Per-main-branch side, independent of the document layout.
- Operation
- A mutation performed atomically through the core state.
- Placement
- Where an ordered group is inserted.
Constants§
- STYLESHEET
- Component stylesheet embedded in the crate; no asset-copy step is needed.
Functions§
- Editable
Mind Map - Editable view of a shared checked document. Double-click a node to edit. Enter/Tab commit, Shift+Enter inserts a line break, Escape cancels. Wheel pans; Ctrl/Meta+wheel zooms. Viewport state belongs to this view, never to history.
- MindMap
- Render a reactive document without an editing controller.
- Outline
- Shared document outline. Edits and moves use the same history as the map. Browsing a collapsed branch here does not expand the map automatically.
- Toolbar
- Optional toolbar. Host applications can also render their own command menus.
- use_
mind_ map - Create one shared document for any number of views in the current scope. The initial value is consumed only when the component first mounts.
- use_
plugins - Install plugins for the current component’s lifetime. Returns errors explicitly.