Skip to content

ubleipzig/mirador-ruler-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 provided by morpheus87.

Continous Deployment: Netlify Status

More information about Mirador's plugin system can be found here: M3 Mirador 3 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.

class Mirador extends React.Component {
  constructor(props) {
    super(props)
    this.state = {}
  }

  render() {

    const documentRuler = plugins.createPlugin({
      color: '#ff0000'
    });

    return (
      <Provider store={this.state.store}>
        <PluginProvider
          plugins={[documentRuler, plugins.OsdReference]}
          createRootReducer={createRootReducer}
        >
          <MiradorApp />
        </PluginProvider>
      </Provider>
    )
  }
}

const el = document.createElement('div');
el.setAttribute('id', 'mirador')
document.body.appendChild(el);

ReactDOM.render(
  <Mirador />,
  document.getElementById('mirador')
);

You can use the following configuration attributes:

Configuration Key Type Description
color string color for rulers and labels
location string string
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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published