Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Malyuk authored Jan 10, 2020
1 parent 527b781 commit 96cd0de
Showing 1 changed file with 32 additions and 21 deletions.
53 changes: 32 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ npm install label-studio

## Usage

```html

<link href="https://unpkg.com/browse/[email protected]/build/static/css/main.14acfaa5.css" rel="stylesheet">
```xhtml
<!-- Include Label Studio stylesheet -->
<link href="https://unpkg.com/[email protected]/build/static/css/main.14acfaa5.css" rel="stylesheet">

<!-- Create the Label Studio container -->
<div id="editor"></div>
<div id="label-studio"></div>

<!-- Include the Label Studio library -->
<script src="https://unpkg.com/browse/[email protected]/build/static/js/main.0249ea16.js"></script>
<script src="https://unpkg.com/[email protected]/build/static/js/main.0249ea16.js"></script>

<!-- Initialize Label Studio -->
<script>
var LS = new LabelStudio("label-studio", {
<script>
var labelStudio = new LabelStudio('editor', {
config: `
<View>
<Image name="img" value="$image"></Image>
Expand All @@ -41,26 +41,37 @@ npm install label-studio
</View>
`,
interfaces: [
"panel",
"update",
"controls",
"side-column",
"completions:menu",
"completions:add-new",
"completions:delete",
"predictions:menu",
],
user: {
pk: 1,
firstName: "Awesome",
lastName: "User"
pk: 1,
firstName: "James",
lastName: "Dean"
},
task: {
completions: [],
predictions: [],
id: 1,
data: {
image: "https://ls-pub.s3.amazonaws.com/earth.jpeg"
}
completions: [],
predictions: [],
id: 1,
data: {
image: "https://htx-misc.s3.amazonaws.com/opensource/label-studio/examples/images/nick-owuor-astro-nic-visuals-wDifg5xc9Z4-unsplash.jpg"
}
},
onLabelStudioLoad: function(LS) {
var c = LS.completionStore.addCompletion({
userGenerate: true
});
LS.completionStore.selectCompletion(c.id);
var c = LS.completionStore.addCompletion({
userGenerate: true
});
LS.completionStore.selectCompletion(c.id);
}
});
</script>
Expand Down

0 comments on commit 96cd0de

Please sign in to comment.