Skip to content

Commit

Permalink
Release/0.2.1-3 (#96)
Browse files Browse the repository at this point in the history
* To dev dependencies and keywords

* Fix sidebar in docs

* Docs & entry point

* Build 0.2.1-3

* Added new docs

* Added external callbacks and fix rectangle bugs
  • Loading branch information
shevchenkonik authored Oct 17, 2019
1 parent ba4ae48 commit 9753780
Show file tree
Hide file tree
Showing 27 changed files with 3,466 additions and 914 deletions.
6 changes: 3 additions & 3 deletions build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"main.css": "/static/css/main.05fec320.css",
"main.js": "/static/js/main.0000e798.js",
"main.js.map": "/static/js/main.0000e798.js.map",
"main.js": "/static/js/main.c684fef9.js",
"main.js.map": "/static/js/main.c684fef9.js.map",
"static/media/config.xml": "/static/media/config.1890026d.xml",
"static/css/main.05fec320.css.map": "/static/css/main.05fec320.css.map",
"index.html": "/index.html",
"precache-manifest.5a302afd57d1ff6af418a09b09864a14.js": "/precache-manifest.5a302afd57d1ff6af418a09b09864a14.js",
"precache-manifest.917053f230e58e2ed5b7fcfb9a932a09.js": "/precache-manifest.917053f230e58e2ed5b7fcfb9a932a09.js",
"service-worker.js": "/service-worker.js"
}
36 changes: 20 additions & 16 deletions build/index.html
Original file line number Diff line number Diff line change
@@ -1,36 +1,40 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.ico"/><link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600|Roboto Mono" rel="stylesheet"/><link href="//fonts.googleapis.com/css?family=Dosis:500&text=LabelStudio" rel="stylesheet"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="/manifest.json"><link rel="stylesheet" href="/styles/main.css"><title>Label Studio</title><link href="/static/css/main.05fec320.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="header"><a id="logo" href="/"><img src="./images/ls_logo.png" alt="label studio logo"> <span style="font-size:1.2em">Label Studio</span></a><ul id="nav" style="display:flex;align-items:center"><a style="margin-right:1em;text-decoration:underline" href="https://labelstud.io/guide">Guide</a> <a class="github-button" href="https://github.com/heartexlabs/label-studio" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star heartexlabs/label-studio on GitHub"><img src="./images/GitHub-Mark-64px.png" height="25"/></a></ul></div><div id="label-studio"></div><footer class="footer">Made by <a target="_blank" href="https://heartex.net">Heartex</a> in San Francisco<br/><br/><img src="./images/3nowhite.svg" height="80"/></footer><script>setTimeout(() => {
var ls = new LabelStudio("label-studio", {
config: `<View>
<Labels name="ner" toName="text">
<Label value="Person"></Label>
<Label value="Organization"></Label>
<Label value="Location"></Label>
</Labels>
<Text name="text" value="$text"></Text>
</View>`,
config: `
<View>
<Image name="img" value="$image"></Image>
<RectangleLabels name="tag" toName="img">
<Label value="Hello"></Label>
<Label value="World"></Label>
</RectangleLabels>
</View>
`,

expert: {},

project: { id: 1 },
description: "Description",

interfaces: [
"controls",
"predictions",
"completions",
"completions:menu",
"predictions:menu",
"panel",
"side-column",
"update",
"check-empty",
],

expert: {
pk: 1,
firstName: "James",
lastName: "Dean"
},

task: {
completions: [],
predictions: [],
id: 1,
data: {
text: "Showers continued throughou"
},
image: "https://htx-misc.s3.amazonaws.com/opensource/label-studio/examples/images/nick-owuor-astro-nic-visuals-wDifg5xc9Z4-unsplash.jpg"
}
}
});
}, 2000);</script><script src="/static/js/main.0000e798.js"></script></body></html>
}, 2000);</script><script src="/static/js/main.c684fef9.js"></script></body></html>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ self.__precacheManifest = [
"url": "/static/media/config.be40f192.xml"
},
{
"revision": "0000e79810a8235a820b",
"revision": "c684fef92d363a33f67f",
"url": "/static/css/main.05fec320.css"
},
{
Expand All @@ -28,8 +28,8 @@ self.__precacheManifest = [
"url": "/static/media/config.2a6054fe.xml"
},
{
"revision": "0000e79810a8235a820b",
"url": "/static/js/main.0000e798.js"
"revision": "c684fef92d363a33f67f",
"url": "/static/js/main.c684fef9.js"
},
{
"revision": "f4626f44ab6f63bfc683408a117236b7",
Expand All @@ -52,7 +52,7 @@ self.__precacheManifest = [
"url": "/static/media/config.1890026d.xml"
},
{
"revision": "b2dee54e21f41811993bc14ea7114173",
"revision": "66ed7fd565bf84c4e932ccc8e7d880a3",
"url": "/index.html"
}
];
2 changes: 1 addition & 1 deletion build/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js");

importScripts(
"/precache-manifest.5a302afd57d1ff6af418a09b09864a14.js"
"/precache-manifest.917053f230e58e2ed5b7fcfb9a932a09.js"
);

workbox.clientsClaim();
Expand Down
1 change: 0 additions & 1 deletion build/static/js/main.0000e798.js.map

This file was deleted.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions build/static/js/main.c684fef9.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ npm install
### Starting Development server

```shell
hexo serve
npm run server
```

Starts a local server. By default, this is at http://localhost:4000/.

### Deploying Documentation

```shell
hexo generate && hexo clean && hexo deploy
npm run publish
```

## Hexo Official Documentation
Expand Down
4 changes: 4 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@
"hexo-renderer-marked": "^1.0.1",
"hexo-renderer-stylus": "^0.3.3",
"hexo-server": "^0.3.3"
},
"scripts": {
"server": "hexo serve",
"publish": "hexo generate && hexo clean && hexo deploy"
}
}
69 changes: 66 additions & 3 deletions docs/source/guide/frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ Instantiate a new Label Studio object with a selector for the div that should be

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

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

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

<!-- Initialize Label Studio -->
<script>
Expand Down Expand Up @@ -76,7 +76,9 @@ Take a look at the [Label Studio]("https://labelstud.io") website for more docum
<link href="https://unpkg.com/[email protected]/build/static/css/main.05fec320.css" rel="stylesheet">
```

## The following keys are recognized
## Options

The following keys are recognized

### config

Expand All @@ -94,6 +96,22 @@ Type data: `array`

Collection of modules to include and respective options.

### description

Default: `No description`

Type data: `string`

Description of the current task.

### apiCalls

Default: `true`

Type data: `boolean`

Whether to instantiate the Label Studio to API Calls mode.

### task

Task data
Expand Down Expand Up @@ -186,3 +204,48 @@ Type data: `boolean`
Default: `false`

Flag fo labeling of tasks, if the flag is true then after submitting the next task will be called.


## Callbacks

### submitCompletion

Type data: `function`

Called when a button `submit` is pressed. `result` is value of current completion.

#### Example

```javascript
submitCompletion: function(result) {
console.log(result)
}
```

### updateCompletion

Type data: `function`

Called when a button `update` is pressed. `result` is value of current completion.

#### Example

```javascript
updateCompletion: function(result) {
console.log(result)
}
```

### deleteCompletion

Type data: `function`

Callback will be called when a button `delete` is pressed. `completion` is value of current completion.

#### Example

```javascript
updateCompletion: function(completion) {
console.log(completion)
}
```
3 changes: 2 additions & 1 deletion docs/themes/htx/layout/partials/sidebar.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
<%- partial('partials/toc', { type: type }) %>
</div>
</div>
<img src="<%- url_for("/images/opossum/other/5.svg") %>" alt="label studio logo" height="120" />
</div>
<% } %>
<% } %>
6 changes: 1 addition & 5 deletions docs/themes/htx/layout/partials/toc.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<% site.pages.find({ type: type }).sort('order').each(function (p) { %>
<% var fileName = p.path.replace(/^.+?\/([\w-]+)\.html/, '$1') %>
<% if (type === 'tags') { %>
<% if (fileName === 'audio') { %>
<!-- <div style="margin-top: 20px; margin-right: 40px; background: url(<%- url_for("/images/wave.png") %>) repeat-x; opacity: 0.4; background-size: 20px; height: 20px;"></div> -->
<li><h4>Objects</h4></li>
Expand Down Expand Up @@ -30,8 +30,4 @@
<a href="<%- url_for(p.path) %>" class="sidebar-link<%- page.title === p.title ? ' current' : '' %><%- p.is_new ? ' new' : '' %>"><%- p.title %></a>
</li>
<% }) %>

<li style="position: absolute; bottom: 20px;">
<img src="<%- url_for("/images/opossum/other/5.svg") %>" alt="label studio logo" height="120" />
</li>
</ul>
21 changes: 14 additions & 7 deletions docs/themes/htx/source/css/_header.styl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$header-height = 40px
$header-height = 2em

red-dot-before(leftPos = -8px)
content: ""
Expand All @@ -13,27 +13,32 @@ red-dot-before(leftPos = -8px)
#header
background-color: #fff
height: $header-height
display: flex
align-items: center
padding: $heading-padding-vertical 20px $heading-padding-vertical 40px;
position: relative
z-index: 100
display: flex
align-items: center
justify-content: space-between

body.docs
#header
position: fixed
width: 100%
top: 0
display: flex
align-items: center
justify-content: space-between
#nav
position: fixed
margin-right: 80px

#nav
list-style-type: none
margin: 0
padding: 0
position: absolute
right: 30px
line-height: $header-height

a, span
line-height: 1.8em

.break
display: none
li
Expand All @@ -43,8 +48,10 @@ body.docs
span
font-weight: bold;
a
border-bottom: 2px solid #fff
&:hover, &.current
border-bottom: 2px solid $green
transition: 200ms;
.nav-dropdown
.nav-link
&:hover, &.current
Expand Down
2 changes: 1 addition & 1 deletion docs/themes/htx/source/css/_settings.styl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $content-padding-top = 30px

// header settings
$header-inner-height = 41px
$heading-padding-vertical = 10px
$heading-padding-vertical = 20px
$header-height = $header-inner-height + $heading-padding-vertical * 2
$mobile-header-height = 40px
// prevent headers from being covered by the top nav upon navigation
Expand Down
12 changes: 11 additions & 1 deletion docs/themes/htx/source/css/_sidebar.styl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
overflow-y: auto
-webkit-overflow-scrolling: touch
-ms-overflow-style: none
display: flex
flex-flow: column
align-items: center
justify-content: space-between
h2
margin-top: .2em
ul
Expand Down Expand Up @@ -83,8 +87,14 @@
width: 200px
margin-bottom: 10px
.main-menu
display: block
display: flex
flex-flow: column
align-items: flex-start
justify-content: flex-start
a
margin-bottom: 1em
&.open
z-index: 9999
-webkit-transform: translate(0, 0)
transform: translate(0, 0)

Expand Down
4 changes: 2 additions & 2 deletions docs/themes/htx/source/css/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ body
#logo
span
font-size: 1.2em

.sidebar
display: none

Expand Down Expand Up @@ -155,7 +155,7 @@ body
-webkit-text-size-adjust: none
font-size: 14px
.sidebar
display: block
display: flex
#header
display: none
#mobile-bar
Expand Down
Loading

0 comments on commit 9753780

Please sign in to comment.