Annotation Viewer
yarn add @committed/annotation-viewerimport React from 'react'
import { AnnotationViewer } from '@committed/annotation-viewer'
class Example extends React.Component {
render() {
return (
<AnnotationViewer
text="The British people are represented by members of Parliament"
marks={[
{
offset: 4,
length: 7,
type: 'NORP',
},
{
offset: 49,
length: 10,
type: 'ORG',
},
]}
inlines={[
{
offset: 4,
length: 55,
type: 'Link',
},
]}
/>
)
}
}NB The committed component
ThemeProvidermust be in the react component stack. (Future versions may remove these pees dependencies.)
Further examples of use and configuration options can be seen in the storybook.
The main build is currently performed using Rollup and yarn build.
We use storybook to develop and document the components, this is run in development using
yarn storybookand to create a production version
yarn build-storybookTo run the example:
yarn
yarn build
cd example
yarn
yarn startMIT - © Committed Software 2021 https://committed.io
