Examples
Murali's reference runnable examples live in the GitHub repository for Murali.
If you are new to Murali, read First Scene, Which API Should I Use?, and Animations first. Then come back here when you want concrete scenes to run and modify.
Running Examples​
Clone the repository and run any example locally:
cargo run --example hello_shapes
The full catalog lives in the repository at examples/README.md.
The published crate excludes examples/**, so these reference examples are available from the repository rather than from the crates.io package alone.
Some examples use experimental APIs. For example, the linear-algebra examples require the
experimental Cargo feature:
cargo run --features experimental --example linear_algebra_vectors
The repository helper scripts enable that feature automatically for examples tagged
linear-algebra.
Collection Category Coverage​
Every newly added collection category has at least one exported component and at least one runnable
example anchor:
| Category | Example anchor |
|---|---|
maths::notation | equation_and_matrix_animation, latex_and_typst |
maths::graph | graphs_2d |
maths::basic_math | equation_and_matrix_animation |
maths::linear_algebra | linear_algebra_vectors, linear_algebra_matrix_vector |
maths::calculus | graphs_2d, curves_3d, traced_paths |
maths::probability | next_token_distribution |
maths::statistics | normalization, graphs_2d |
maths::optimization | force_fields, traced_paths, surfaces_3d |
maths::information_theory | next_token_distribution, transformer_attention |
maths::data_geometry | graphs_2d, tensor_slicing, linear_algebra_basis_change |
ai::deep_learning | neural_networks, normalization, transformer_attention |
ai::ml_components | neural_networks, tensor_semantics, graphs_2d |
ai::transformers_llms | transformer_attention, context_window, kv_cache |
ai::systems_agentic_ai | context_window, self_attention_lesson, stepwise_storytelling |
Quick Start Picks​
If you only want a few examples to begin with:
hello_shapes- a first scene with a square, circle, rectangle, and polygonportrait_video- intentional 9:16 composition with frame-relative layoutmotion_basics- move, scale, rotate, and fade with clear pacingscene_view- independently animated child scene docked inside a parent compositionchat_input_box- beta chat-style input boxes with typewriter text and configurable bottom tipscontext_window- role-tagged model context with token budgets and explicit truncationnext_token_distribution- computed sampling filters and deterministic next-token selectionkv_cache- seekable key/value cache growth backed by semantic tensorsnormalization- computed LayerNorm before/after values and per-token statisticskavriq_opening- the betaOpeningcomposite customized as a textured 3D brand identopening_scene_view- a perspective opening view fading into an ongoing orthographic scenetext_animation- write, reveal, indicate, and simple draw semanticscode_blocks- syntax-highlighted code presented as a scene elementgraphs_2d- axes, function plots, labels, and sampled pointssurfaces_3d- a shaded form-first surface with camera movementmodel_inspector- automatic centering, framing, and inspection for local GLB/GLTF assetsmurali_logo- the brand mark as a polished visual/reference composition
By Intent​
Foundations​
hello_shapesWhat to notice: primitive tattvas and simple authored placementlayout_and_groupsWhat to notice:next_to,align_to,HStack,VStack, andGroup.move_toportrait_videoWhat to notice: portrait frame bounds,to_edge, preview sizing, and width-derived exportstyle_and_pathsWhat to notice: fill, stroke, dashes, arrows, and authored pathsmotion_basicsWhat to notice: the core motion verbs with calm timingscene_viewWhat to notice: an independent child timeline, offscreen composition, and whole-view transformsopening_scene_viewWhat to notice: projection isolation and a full-frame SceneView handoff into continuing contentchat_input_boxWhat to notice: beta composite IDs, configurable chat tips, and typewriter-ready label text
Text And Math​
text_animationWhat to notice:draw,undraw,typewrite_text,reveal_text, andindicatecode_blocksWhat to notice: syntax-highlighted code as a first-class tattva with layout and pacinglatex_and_typstWhat to notice: static LaTeX and Typst rendering plus a compact renderer-crossing morphequation_and_matrix_animationWhat to notice: equation continuity and matrix-step highlightingtablesWhat to notice: one table example that writes in, pauses, and unwrites cleanly
Experimental Linear Algebra​
These examples use murali::frontend::collection::maths::linear_algebra, which is currently gated
behind the experimental Cargo feature.
linear_algebra_vectorsWhat to notice: vectors as arrows, labels, coordinates, and feature-list readoutslinear_algebra_spanWhat to notice: linear combinations, span regions, and basis-vector intuitionlinear_algebra_dot_productWhat to notice: angle arcs, projection shadows, orthogonality, and dot/cosine readoutslinear_algebra_basis_changeWhat to notice: one vector shown against standard and custom basis coordinateslinear_algebra_matrix_transformWhat to notice: transformed grids, basis-column colors, and a linked matrix panellinear_algebra_matrix_vectorWhat to notice: compactA x = bflow beside input and output vectorslinear_algebra_column_combinationWhat to notice: columns ofAscaled by entries ofxand summed geometricallylinear_algebra_determinantWhat to notice: area scaling, orientation flip, and collapse to a linelinear_algebra_compositionWhat to notice: clean matrix-only comparison forAthenBversusBthenAlinear_algebra_transform_order_scene_viewWhat to notice: SceneView replay of each transform order before comparing the final outcomes
Run one directly with:
cargo run --features experimental --example linear_algebra_matrix_vector
Or run the tagged group through the repository scripts:
./preview_all.sh --tag linear-algebra --auto
./export_all.sh --tag linear-algebra --release
Graphs And Fields​
graphs_2dWhat to notice: axes, number plane, one function graph, and sampled pointscurves_3dWhat to notice: one parametric space curve with 3D framingstreamlinesWhat to notice: seeded flow trajectories without mixing in arrow fields
Dynamics And Systems​
force_fieldsWhat to notice: updater-driven electric fields responding to moving chargesparticlesWhat to notice: one orbital belt with cinematic motiontraced_pathsWhat to notice: a rolling wheel whose chosen point leaves behind a cycloidneural_networksWhat to notice: network structure and signal playbacktransformer_attentionWhat to notice: tokens, attention relationships, and transformer-style block compositioncontext_windowWhat to notice: ordered context blocks, semantic roles, retained-token accounting, and visible truncationnext_token_distributionWhat to notice: model versus sampling probability, filtered candidates, and the explicit unit samplekv_cacheWhat to notice: shared token identity, occupied versus future slots, and deterministic cache growthnormalizationWhat to notice: named-axis normalization, preserved identity, and statistics bound to displayed outputtensor_semanticsWhat to notice: computed self-attention with named axes, stable element identity, and semantic selectiontensor_operationsWhat to notice: named-axis reshape, split/merge, and semantic broadcastingtensor_slicingWhat to notice: explicit rank-4 slicing into an animated token-by-feature viewself_attention_lessonWhat to notice: a versioned JSON trace feeding computed attention, residual, logits, and sampling stagesstepwise_storytellingWhat to notice: staged reveal flow and routed narrative transitions
Three D​
model_inspectorWhat to notice: repository asset shorthand, automatic bounds-based fit, continuous centered rotation, and interactive orbit/zoom controlskavriq_openingWhat to notice: built-in marble texture selection, script-level opening constants, local-time clip authoring, and glyph particlesopening_scene_viewWhat to notice: a perspective opening and orthographic continuation running as separate scenessurfaces_3dWhat to notice: one translucent surface whose form is explained through color and camera framingwireframe_surfacesWhat to notice: wireframe-specific curvature readingtextured_surfaceWhat to notice: UV texture mapping on a parametric globe
Brand And Demos​
murali_logoWhat to notice: a reference brand composition built from authored guides and bezier curvesmurali_logo_transparentWhat to notice: export-oriented logo capture with transparent background and simple scene flagsfourier_formula_traceWhat to notice: Fourier coefficients reordered into epicycles that rebuild a Typst formula outlinemap_projection_morphWhat to notice: the Earth texture bending through multiple map projections
Choosing An Example​
Use this rough mapping when you are not sure where to start:
- learning scene structure: start with
hello_shapes,layout_and_groups, andscene_view - learning portrait video composition: start with
portrait_video - learning animation vocabulary: start with
motion_basicsandtext_animation - learning text, equations, or tables: start with
latex_and_typst,equation_and_matrix_animation, andtables - learning graphs and fields: start with
graphs_2dandstreamlines - learning updater-driven motion: start with
force_fields,particles, andtraced_paths - inspecting a downloaded 3D prop: start with
model_inspector - learning 3D camera and surface work: start with
curves_3d,surfaces_3d,textured_surface, andkavriq_opening - learning story-first scenes: start with
stepwise_storytellingandchat_input_box - learning AI diagrams: start with
neural_networksandtransformer_attention - learning semantic AI computation: start with
tensor_semantics,tensor_operations,tensor_slicing, andself_attention_lesson - learning branding study scenes: start with
murali_logo - learning branding export scenes: start with
murali_logo_transparent