Expand description
Presentar: WASM-first visualization and rapid application framework.
Built on the Sovereign AI Stack (Trueno, Aprender, Realizar, Pacha).
§Browser Usage (WASM)
import init, { App, log } from './presentar.js';
async function main() {
await init();
const app = new App('canvas');
app.render_json('[{"Rect": {...}}]');
}Re-exports§
pub use browser::BrowserRouter;pub use browser::RouteMatch;pub use browser::RouteMatcher;pub use presentar_layout as layout;pub use presentar_widgets as widgets;pub use presentar_yaml as yaml;
Modules§
- accessibility
- Accessibility support for screen readers and assistive technology.
- animation
- Animation system with spring physics, easing, and keyframe support.
- binding
- Interactive state binding for reactive UI.
- brick_
widget - Brick-based Widget helpers (PROBAR-SPEC-009)
- browser
- Browser runtime for Presentar WASM applications.
- cache
- chart
- Chart rendering algorithms for Presentar.
- clipboard
- Clipboard API for copy, cut, and paste operations.
- diff
- Widget tree diffing for efficient UI updates.
- dnd
- Drag and drop system for interactive data transfer.
- draw
- Draw commands for GPU rendering.
- gesture
- Gesture recognition from touch/pointer events.
- history
- lifecycle
- Widget lifecycle hooks for mount, update, and unmount callbacks.
- shortcut
- Keyboard shortcut management system.
- simd
- SIMD-accelerated operations using Trueno.
- streaming
- Data streaming and live updates for Presentar.
- theme
- Theme system for consistent styling.
- validation
- Declarative validation system for forms and inputs.
- virtualization
- widget
- Widget trait and related types.
Structs§
- Accessibility
Tree - Accessibility tree for hit testing and navigation.
- Accessibility
Tree Builder - Builder for constructing accessibility trees.
- Accessible
Node - An accessible element in the accessibility tree.
- Accessible
Node Id - Unique identifier for an accessible node.
- Anim
Color - Color for animation (RGBA as f32 0-1).
- Animated
Property - An animated property that smoothly transitions between values.
- Animation
Controller - Controller for managing multiple animations.
- Animation
Instance - An animation instance that can be managed by an Animator.
- Animator
- Manages multiple animations.
- ArcGeometry
- Arc geometry for pie charts.
- BoxStyle
- Box style for rectangles and circles.
- Brick
Budget - Performance budget for a brick.
- Brick
Verification - Result of verifying brick assertions
- Budget
Violation - Budget violation report
- Cache
Builder - Builder for cache entries
- Cache
Config - Configuration for cache
- Cache
Key - Unique identifier for a cache entry
- Cache
Metadata - Cache entry metadata
- Cache
Options - Cache entry options
- Cache
Stats - Cache statistics
- Catmull
Rom - Catmull-Rom spline interpolation.
- Cell
Layout - Cell layout information
- Checkpoint
- Checkpoint in history
- Checkpoint
Id - Unique identifier for a checkpoint
- Clipboard
- Clipboard manager for handling copy/cut/paste operations.
- Clipboard
Data - Data stored in the clipboard.
- Clipboard
Event - Event triggered by clipboard changes.
- Clipboard
History - Clipboard history for undo support.
- Color
- RGBA color with values in the range [0.0, 1.0].
- Color
Palette - A color palette for theming.
- Command
Executor - Command executor for synchronous commands.
- Command
History - Command history manager
- Command
Id - Unique identifier for a command in history
- Composite
Command - Builder for creating composite commands
- Constraints
- Layout constraints that specify minimum and maximum sizes.
- Contrast
Check - Result of a WCAG contrast check.
- Corner
Radius - Corner radii for rounded rectangles.
- Counter
State - A simple counter state for testing.
- Cubic
Bezier - Bezier curve segment.
- Cubic
Spline - Cubic spline interpolation (natural spline).
- Data
Cache - In-memory data cache
- Data
Normalizer - Data normalization for chart rendering.
- Data
Refresh Manager - Manages periodic data refresh for data sources.
- Data
Stream - Data stream manager.
- Default
Brick - Default Brick implementation for simple widgets.
- Diff
Node - A node in the widget tree for diffing.
- Diff
Result - Result of diffing two widget trees.
- Drag
Data - Data associated with a drag operation.
- Drag
Drop Manager - Drag and drop manager.
- DragId
- Unique identifier for a drag operation.
- Drag
Payload - Type-erased payload for drag data.
- Drag
State - State of an active drag operation.
- Draw
Batch - Draw call batching for GPU efficiency.
- Draw
Transform - 2D transformation matrix.
- Drop
Result - Result of a drop operation.
- Drop
Target - Configuration for a drop target.
- Eased
Value - An easing-based animated value.
- Effect
- Effect hook that runs a callback and optionally cleans up.
- Effect
Manager - Manager for effects with automatic cleanup.
- Executor
Config - Command executor configuration.
- Field
Config - Configuration for a validated field.
- Field
State - Field validation state.
- Focus
Manager - Manages keyboard focus for widgets.
- Focus
Trap - A focus trap that restricts focus to a subset of widgets.
- Form
Validator - Form validation state manager.
- Frame
Timer - Frame timer for 60fps animations.
- Gesture
Config - Configuration for gesture recognition.
- Gesture
Recognizer - Multi-touch gesture recognizer.
- GpuInstance
- GPU instance data for batched rendering.
- GpuUniforms
- Uniforms for the shader.
- GpuVertex
- GPU vertex data.
- Grid
Cell - Grid cell position
- GroupId
- Unique identifier for a command group
- Histogram
Bins - Histogram binning configuration.
- History
Config - Configuration for command history
- HitTester
- Hit tester for finding accessible elements at a point.
- HookId
- Unique ID for a lifecycle hook registration.
- Item
Index - Index of an item in a virtualized list
- Item
Layout - Item layout information
- Keyframe
- A keyframe in an animation.
- Keyframe
Track - Keyframe animation track.
- Layout
Result - Result of laying out a widget.
- Lifecycle
Event - Event passed to lifecycle callbacks.
- Lifecycle
Manager - Manager for widget lifecycle hooks.
- Linear
Interpolator - Linear interpolation between points.
- MaxLength
- Maximum length validator.
- Memory
Router - In-memory router for testing.
- Memory
Storage - In-memory storage for testing.
- Message
Buffer - Message buffer for ordering and deduplication.
- MinLength
- Minimum length validator.
- Modifiers
- Modifier keys for keyboard shortcuts.
- Path
Tessellator - Path tessellation for GPU rendering.
- Pattern
- Pattern validator using regex-like patterns. Note: Uses simple pattern matching, not full regex.
- Point
- A 2D point with x and y coordinates.
- Point2D
- 2D point for chart calculations.
- Pointer
Gesture Recognizer - Pointer gesture recognizer that unifies mouse, touch, and pen input.
- Pointer
Id - Pointer identifier for pointer events.
- Pointer
Info - Information about an active pointer.
- Radii
- Border radius presets.
- Range
- Range validator for numeric values.
- Rate
Limiter - Rate limiter for backpressure handling.
- Reconnect
Config - Reconnection configuration.
- Recording
Canvas - A Canvas implementation that records draw operations as
DrawCommands. - Rect
- A rectangle defined by position and size.
- Refresh
Task - A scheduled data refresh task.
- Required
- Required field validator.
- SetValue
Command - Simple value change command
- Shadow
- Shadow configuration.
- Shadows
- Shadow presets.
- Shortcut
- A keyboard shortcut (key + modifiers).
- Shortcut
Builder - Builder for creating shortcuts with fluent API.
- Shortcut
Id - Unique ID for a shortcut binding.
- Shortcut
Manager - Manager for keyboard shortcuts.
- Simple
Brick - Simple Brick implementation for common use cases.
- Size
- A 2D size with width and height.
- Spacing
- Spacing scale.
- Spring
- A spring-animated value.
- Spring
Animation - Spring-based animation for physics-like motion.
- Spring
Config - Spring physics configuration.
- Store
- Store manages state lifecycle with subscriptions and time-travel debugging.
- Stream
Config - Configuration for stream connection.
- Stream
Subscription - Subscription to a data source.
- Stroke
Style - Stroke style for path rendering.
- Text
Style - Text style for rendering.
- Theme
- Complete theme definition.
- Timer
- A timer that fires at regular intervals.
- TouchId
- Touch identifier for multi-touch tracking.
- Touch
Point - Active touch point being tracked.
- Transform2D
- 2D affine transform.
- Transition
Config - Configuration for property transitions.
- Tree
Differ - Widget tree differ.
- Tween
- A tween that interpolates between two values over time.
- TypeId
- Type identifier for widget types (used for diffing).
- Typography
- Typography scale.
- Virtual
Grid - Virtualized grid state
- Virtual
Grid Config - Configuration for virtualized grid
- Virtual
List - Virtualized list state
- Virtual
List Config - Configuration for virtualized list
- Visible
Grid Range - Visible grid range
- Visible
Range - Visible range information
- Widget
Id - Unique identifier for a widget instance.
Enums§
- Accessible
Role - Accessible role for screen readers.
- Animated
Value - An animated value with easing or spring physics.
- Animation
State - Animation state for tracking animation lifecycle.
- Brick
Assertion - Brick assertion that must be verified at runtime.
- Brick
Error - Yuan Gate: Zero-swallow error handling for bricks
- Brick
Phase - Rendering phase for budget tracking
- Cache
Event - Cache event for notifications
- Cache
State - Cache entry state
- Checked
State - Checked state for checkboxes and radio buttons.
- Clipboard
Format - Clipboard data format.
- Clipboard
Operation - Clipboard operation type.
- Clipboard
Result - Result of a clipboard operation.
- Color
Parse Error - Error type for color parsing.
- Command
- Commands for side effects.
- Command
Result - Result of executing or undoing a command
- Connection
State - Stream connection state.
- Counter
Message - Messages for the counter state.
- DiffOp
- Operation to apply during reconciliation.
- Drag
Data Type - Type of data being dragged.
- Drag
Phase - Current phase of a drag operation.
- Draw
Command - Drawing primitive - all rendering reduces to these.
- Drop
Effect - Effect/operation type for a drop.
- Easing
- Standard easing functions for animations.
- Easing
Function - Easing functions for smooth animations.
- Event
- Input event types.
- Execution
Result - Result of command execution.
- Fill
Rule - Fill rule for path filling.
- Focus
Direction - Focus direction for keyboard navigation.
- Font
Style - Font style.
- Font
Weight - Font weight.
- Gesture
State - State of a gesture.
- History
Event - State change notification
- Key
- Keyboard key identifiers.
- Lifecycle
Phase - Lifecycle phase for widgets.
- LineCap
- Line cap style.
- Line
Join - Line join style.
- Live
Region - Live region type for dynamic content updates.
- Mouse
Button - Mouse button identifiers.
- Pattern
Type - Type of pattern to match.
- Pointer
Type - Type of pointer device.
- Recognized
Gesture - State of a recognized gesture.
- Sampling
- Image sampling mode.
- Scroll
Align - Scroll alignment options
- Shortcut
Context - Context in which a shortcut is active.
- Shortcut
Priority - Priority for shortcut resolution when multiple match.
- Stream
Message - Stream message types for the protocol.
- Validate
On - When to run validation.
- Validation
Result - Validation result for a single field.
- Widget
Key - A key used to identify widgets across renders.
Traits§
- Brick
- Core Brick trait - the foundation of the Brick Architecture.
- Brick
Widget Ext - Extension trait for adding Brick verification to the render pipeline.
- Cache
Size - Trait for getting size of cached values
- Canvas
- Canvas trait for paint operations.
- History
Command - Trait for undoable commands
- Interpolate
- Trait for types that can be interpolated.
- Interpolator
- Interpolation trait for different curve types.
- Router
- Router trait for navigation commands.
- State
- Application state trait.
- Storage
- Storage trait for state persistence commands.
- Validator
- A validator that can validate a string value.
- Widget
- Core widget trait that all UI elements implement.
Functions§
- commands_
to_ instances - Convert DrawCommands to GPU instances for batched rendering.
- default_
executor - Create a default executor with memory-based backends.
- diff_
trees - Convenience function to diff two trees.
Type Aliases§
- Animation
Id - Unique identifier for an animation.
- Brick
Result - Result type for brick operations
- Cache
Callback - Callback for cache events
- History
Callback - Callback for history events
- PathRef
- Reference to a path in the path buffer.
- String
Cache - Simple string-keyed cache
- Tensor
Ref - Reference to a tensor in the tensor buffer.