https://github.com/ubleipzig/mirador-ruler-plugin
https://github.com/ubleipzig/mirador-ruler-plugin
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ubleipzig/mirador-ruler-plugin
- Owner: ubleipzig
- License: mit
- Created: 2019-07-23T08:07:01.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-08-12T15:42:00.000Z (almost 7 years ago)
- Last Synced: 2025-06-18T08:49:15.890Z (12 months ago)
- Language: JavaScript
- Size: 38.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Mirador 3 Ruler Plugin
A plugin for Mirador 3 that adds a vertical and horizontal ruler, if a physical dimensions service is available for a given canvas. This plugin is an adaption of the [physical document ruler](https://github.com/dbmdz/mirador-plugins#physical-document-ruler) provided by morpheus87.
Continous Deployment: [](https://app.netlify.com/sites/agitated-turing-9ac6ed/deploys)
More information about Mirador's plugin system can be found here: [M3 Mirador 3 plugins](https://github.com/ProjectMirador/mirador/wiki/M3---Mirador-3-plugins, "M3 plugins")
## Usage
The plugin provides a create method, you can use to instantiate the plugin, as shown below. Please notice that you also habe to pass the OSDReference plugin as well.
```javascript
class Mirador extends React.Component {
constructor(props) {
super(props)
this.state = {}
}
render() {
const documentRuler = plugins.createPlugin({
color: '#ff0000'
});
return (
)
}
}
const el = document.createElement('div');
el.setAttribute('id', 'mirador')
document.body.appendChild(el);
ReactDOM.render(
,
document.getElementById('mirador')
);
```
You can use the following configuration attributes:
| Configuration Key | Type | Description |
| ----------------- | ---- | ----------- |
| color | string | color for rulers and labels |
| location | string | string | the ruler's origin |
| smallDashSize | number | size of the small dashes in pixels |
| largeDashSize | number | size of the large dashes in pixels |
| labelsEvery | number | draw ruler labels every n centimeters/inches |
| imperialUnits | boolean | Use imperial units instead of metric |