Skip to main content

Crate dioxus_mind_elixir

Crate dioxus_mind_elixir 

Source
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§

EditableMindMapProps
Properties for the EditableMindMap component.
MindMapData
Nested persistent document. Runtime selection, viewports and history are excluded.
MindMapHandle
Copyable shared document handle. Mutation always passes through checked core transactions. Individual views own their viewport, editor and mounted nodes.
MindMapProps
Properties of the read-only MindMap renderer.
MindMapState
Validated document with private tree/index/selection and bounded history.
Node
A plain-text node in the persistent nested tree.
NodeStyle
Supported plain-text styles, mapped to upstream field names.
OperationOptions
Recording options for a single operation.
OperationResult
A transaction result; no-op operations return changed = false.
OutlineProps
Properties for the Outline component.
PluginGuard
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 style can override the theme again.
ToolbarProps
Properties for the Toolbar component.
Viewport
Per-view viewport, excluded from document serialization and history.

Enums§

Alignment
Vertical alignment of the root and side groups.
CoreEvent
Observable core events. Operation is delivered before selection changes.
LayoutDirection
Document layout; numeric values match Mind Elixir JSON.
MindMapError
A recoverable document, operation or renderer failure.
NodeDirection
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§

EditableMindMap
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.