npm.io
1.0.0-rc.11 • Published 8 years ago

digirati-annotation-plugin-core

Licence
MIT
Version
1.0.0-rc.11
Deps
2
Size
28 kB
Vulns
0
Weekly
0

Annotation Studio - Core plugin

This is the state behind the other components.

Usage

To use the plugin you need to add it as a dependency:

$ npm i digirati-annotation-plugin-core --save-dev

Then in your code (ES6 in this example)

import CorePlugin from 'digirati-annotation-plugin-core';

const core = CorePlugin(
  document.getElementById('myContainer'),
  {
    resourceTemplates: '...',
    manifest: '...',
    canvas: '...',
    elucidateServer: '...',
  }
);

core.then(store => {
  // this is called whenever the store changes
  store.subscribe(() => {
    // This is how to get the state
    const state = store.getState();
    // You can now render things, dispatch actions etc.
  })
})

Resource templates:

[todo add link to resource template model]