Overview
The following features have been added to mirador-rotation-plugin:
- 90-degree rotation buttons
- Manifest and rotation angle specification via URL parameters
- UI improvements (reset button icon change)
- Help feature (dialog explaining how to use)
New Feature Details
1. 90-Degree Rotation Buttons
Previously only a 1-degree increment slider was available, but buttons for quick 90-degree rotation have been added.
Implementation Details
The following changes were made to src/plugins/MiradorRotation.js:
Two buttons were added to the UI:
- Left rotation button: Rotate 90 degrees counter-clockwise
- Right rotation button: Rotate 90 degrees clockwise
Translation Support
English and Japanese translations were added to src/translations.js:
2. URL Parameter Support
The demo page now supports specifying manifests and rotation angles via URL parameters.
Supported Parameters
| Parameter | Description | Separator |
|---|---|---|
manifest | IIIF manifest URL | ; (semicolon) |
rotation | Initial rotation angle (degrees) | ; (semicolon) |
Demo Page URL
Usage Examples
Implementation Details
Key changes in demo/src/index.js:
3. Reset Button Icon Change
To distinguish it from the rotation buttons, the reset button icon was changed.
| Before | After |
|---|---|
ReplaySharpIcon | RestartAltIcon |
ReplaySharpIcon had a design that evoked rotation, so it was changed to RestartAltIcon, which more clearly indicates “reset.”
4. Help Feature
A “?” button was added within the plugin, which displays a dialog explaining how to use it when clicked.
Implementation Details
MUI’s Dialog component is used to display descriptions of each control in a table format.
Dialog Content
| Icon | Description |
|---|---|
| RotateLeftIcon | Rotate 90 degrees counter-clockwise |
| RotateRightIcon | Rotate 90 degrees clockwise |
| LinearScaleIcon | Fine-tune rotation angle (-180 to 180 degrees) |
| RestartAltIcon | Reset rotation to 0 degrees |
Translation Support
Controls List
The current plugin provides the following controls:
| Control | Icon | Function |
|---|---|---|
| Rotate 90 degrees left | RotateLeftIcon | Rotate 90 degrees counter-clockwise |
| Rotate 90 degrees right | RotateRightIcon | Rotate 90 degrees clockwise |
| Angle slider | LinearScaleIcon | Adjustment in 1-degree increments from -180 to 180 degrees |
| Reset | RestartAltIcon | Reset rotation to 0 degrees |
| Help | HelpOutlineIcon | Display usage dialog |
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
rotationEnabled | boolean | false | Enable plugin display |
rotationOpen | boolean | false | Open rotation controls by default |
initialViewerConfig.rotation | number | 0 | Initial rotation angle |
Summary
These feature enhancements have improved the usability of mirador-rotation-plugin:
- 90-degree rotation buttons: Quickly correct the orientation of books and documents
- URL parameters: Easy external invocation and sharing
- UI improvements: Changed to more intuitive icons
- Help feature: First-time users can immediately understand how to use it
These features enable more efficient rotation operations on IIIF images.