Skip to content

Add spin arrows - #346

Open
rozyczko wants to merge 4 commits into
developfrom
add-spin
Open

rozyczko wants to merge 4 commits into
developfrom
add-spin

Conversation

@rozyczko

Copy link
Copy Markdown
Member

Magnetic Moment Direction Visualization and Data Model:

  • The backend (layers.py, structure.py) now computes and exposes the physical moment direction (phi), a flag for editability, and a threshold for negligible moments. These are included in the data structures sent to the frontend. The moment direction is omitted for non-magnetic and gradient layers, and a flag (has_moment) distinguishes negligible moments.

  • The structure view (StructureView.qml) displays an arrow in each magnetic layer's box, with size constraints and visibility based on the moment's magnitude. A "H →" guide field reference is shown wherever arrows appear, clarifying the angle's reference direction.

  • New QML components provide reusable, consistent visuals:

    • MagnetizationArrow.qml draws the moment arrow or a hollow dot for negligible moments.
    • GuideFieldLegend.qml displays the "H →" reference with tooltip.
    • MagnetizationAngleSlider.qml offers a 0-360° slider for the selected layer's angle, showing both θM and the derived φ, and disables editing when constrained.

UI/UX Consistency and Live Updates:

  • Edits to magnetic parameters now trigger a full refresh of the structure view, ensuring arrows and tooltips always reflect the current state without stale angles.

@rozyczko rozyczko added [scope] enhancement Adds/improves features (major.MINOR.patch) magnetisation-support [priority] high Should be prioritized soon labels Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

magnetisation-support [priority] high Should be prioritized soon [scope] enhancement Adds/improves features (major.MINOR.patch)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant