Skip to content

Commit 9753780

Browse files
Release/0.2.1-3 (#96)
* 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
1 parent ba4ae48 commit 9753780

27 files changed

+3466
-914
lines changed

build/asset-manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"main.css": "/static/css/main.05fec320.css",
3-
"main.js": "/static/js/main.0000e798.js",
4-
"main.js.map": "/static/js/main.0000e798.js.map",
3+
"main.js": "/static/js/main.c684fef9.js",
4+
"main.js.map": "/static/js/main.c684fef9.js.map",
55
"static/media/config.xml": "/static/media/config.1890026d.xml",
66
"static/css/main.05fec320.css.map": "/static/css/main.05fec320.css.map",
77
"index.html": "/index.html",
8-
"precache-manifest.5a302afd57d1ff6af418a09b09864a14.js": "/precache-manifest.5a302afd57d1ff6af418a09b09864a14.js",
8+
"precache-manifest.917053f230e58e2ed5b7fcfb9a932a09.js": "/precache-manifest.917053f230e58e2ed5b7fcfb9a932a09.js",
99
"service-worker.js": "/service-worker.js"
1010
}

build/index.html

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,40 @@
11
<!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(() => {
22
var ls = new LabelStudio("label-studio", {
3-
config: `<View>
4-
<Labels name="ner" toName="text">
5-
<Label value="Person"></Label>
6-
<Label value="Organization"></Label>
7-
<Label value="Location"></Label>
8-
</Labels>
9-
<Text name="text" value="$text"></Text>
10-
</View>`,
3+
config: `
4+
<View>
5+
<Image name="img" value="$image"></Image>
6+
<RectangleLabels name="tag" toName="img">
7+
<Label value="Hello"></Label>
8+
<Label value="World"></Label>
9+
</RectangleLabels>
10+
</View>
11+
`,
1112

12-
expert: {},
13-
14-
project: { id: 1 },
13+
description: "Description",
1514

1615
interfaces: [
1716
"controls",
18-
"predictions",
1917
"completions",
2018
"completions:menu",
21-
"predictions:menu",
2219
"panel",
2320
"side-column",
2421
"update",
2522
"check-empty",
2623
],
2724

25+
expert: {
26+
pk: 1,
27+
firstName: "James",
28+
lastName: "Dean"
29+
},
30+
2831
task: {
2932
completions: [],
3033
predictions: [],
34+
id: 1,
3135
data: {
32-
text: "Showers continued throughou"
33-
},
36+
image: "https://htx-misc.s3.amazonaws.com/opensource/label-studio/examples/images/nick-owuor-astro-nic-visuals-wDifg5xc9Z4-unsplash.jpg"
37+
}
3438
}
3539
});
36-
}, 2000);</script><script src="/static/js/main.0000e798.js"></script></body></html>
40+
}, 2000);</script><script src="/static/js/main.c684fef9.js"></script></body></html>

build/precache-manifest.5a302afd57d1ff6af418a09b09864a14.js renamed to build/precache-manifest.917053f230e58e2ed5b7fcfb9a932a09.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ self.__precacheManifest = [
44
"url": "/static/media/config.be40f192.xml"
55
},
66
{
7-
"revision": "0000e79810a8235a820b",
7+
"revision": "c684fef92d363a33f67f",
88
"url": "/static/css/main.05fec320.css"
99
},
1010
{
@@ -28,8 +28,8 @@ self.__precacheManifest = [
2828
"url": "/static/media/config.2a6054fe.xml"
2929
},
3030
{
31-
"revision": "0000e79810a8235a820b",
32-
"url": "/static/js/main.0000e798.js"
31+
"revision": "c684fef92d363a33f67f",
32+
"url": "/static/js/main.c684fef9.js"
3333
},
3434
{
3535
"revision": "f4626f44ab6f63bfc683408a117236b7",
@@ -52,7 +52,7 @@ self.__precacheManifest = [
5252
"url": "/static/media/config.1890026d.xml"
5353
},
5454
{
55-
"revision": "b2dee54e21f41811993bc14ea7114173",
55+
"revision": "66ed7fd565bf84c4e932ccc8e7d880a3",
5656
"url": "/index.html"
5757
}
5858
];

build/service-worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js");
1515

1616
importScripts(
17-
"/precache-manifest.5a302afd57d1ff6af418a09b09864a14.js"
17+
"/precache-manifest.917053f230e58e2ed5b7fcfb9a932a09.js"
1818
);
1919

2020
workbox.clientsClaim();

build/static/js/main.0000e798.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

build/static/js/main.0000e798.js renamed to build/static/js/main.c684fef9.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/static/js/main.c684fef9.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ npm install
1111
### Starting Development server
1212

1313
```shell
14-
hexo serve
14+
npm run server
1515
```
1616

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

1919
### Deploying Documentation
2020

2121
```shell
22-
hexo generate && hexo clean && hexo deploy
22+
npm run publish
2323
```
2424

2525
## Hexo Official Documentation

docs/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,9 @@
2020
"hexo-renderer-marked": "^1.0.1",
2121
"hexo-renderer-stylus": "^0.3.3",
2222
"hexo-server": "^0.3.3"
23+
},
24+
"scripts": {
25+
"server": "hexo serve",
26+
"publish": "hexo generate && hexo clean && hexo deploy"
2327
}
2428
}

docs/source/guide/frontend.md

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ Instantiate a new Label Studio object with a selector for the div that should be
1010

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

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

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

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

79-
## The following keys are recognized
79+
## Options
80+
81+
The following keys are recognized
8082

8183
### config
8284

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

9597
Collection of modules to include and respective options.
9698

99+
### description
100+
101+
Default: `No description`
102+
103+
Type data: `string`
104+
105+
Description of the current task.
106+
107+
### apiCalls
108+
109+
Default: `true`
110+
111+
Type data: `boolean`
112+
113+
Whether to instantiate the Label Studio to API Calls mode.
114+
97115
### task
98116

99117
Task data
@@ -186,3 +204,48 @@ Type data: `boolean`
186204
Default: `false`
187205

188206
Flag fo labeling of tasks, if the flag is true then after submitting the next task will be called.
207+
208+
209+
## Callbacks
210+
211+
### submitCompletion
212+
213+
Type data: `function`
214+
215+
Called when a button `submit` is pressed. `result` is value of current completion.
216+
217+
#### Example
218+
219+
```javascript
220+
submitCompletion: function(result) {
221+
console.log(result)
222+
}
223+
```
224+
225+
### updateCompletion
226+
227+
Type data: `function`
228+
229+
Called when a button `update` is pressed. `result` is value of current completion.
230+
231+
#### Example
232+
233+
```javascript
234+
updateCompletion: function(result) {
235+
console.log(result)
236+
}
237+
```
238+
239+
### deleteCompletion
240+
241+
Type data: `function`
242+
243+
Callback will be called when a button `delete` is pressed. `completion` is value of current completion.
244+
245+
#### Example
246+
247+
```javascript
248+
updateCompletion: function(completion) {
249+
console.log(completion)
250+
}
251+
```

docs/themes/htx/layout/partials/sidebar.ejs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
<%- partial('partials/toc', { type: type }) %>
99
</div>
1010
</div>
11+
<img src="<%- url_for("/images/opossum/other/5.svg") %>" alt="label studio logo" height="120" />
1112
</div>
12-
<% } %>
13+
<% } %>

docs/themes/htx/layout/partials/toc.ejs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<% site.pages.find({ type: type }).sort('order').each(function (p) { %>
33
<% var fileName = p.path.replace(/^.+?\/([\w-]+)\.html/, '$1') %>
44
<% if (type === 'tags') { %>
5-
5+
66
<% if (fileName === 'audio') { %>
77
<!-- <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> -->
88
<li><h4>Objects</h4></li>
@@ -30,8 +30,4 @@
3030
<a href="<%- url_for(p.path) %>" class="sidebar-link<%- page.title === p.title ? ' current' : '' %><%- p.is_new ? ' new' : '' %>"><%- p.title %></a>
3131
</li>
3232
<% }) %>
33-
34-
<li style="position: absolute; bottom: 20px;">
35-
<img src="<%- url_for("/images/opossum/other/5.svg") %>" alt="label studio logo" height="120" />
36-
</li>
3733
</ul>

docs/themes/htx/source/css/_header.styl

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$header-height = 40px
1+
$header-height = 2em
22

33
red-dot-before(leftPos = -8px)
44
content: ""
@@ -13,27 +13,32 @@ red-dot-before(leftPos = -8px)
1313
#header
1414
background-color: #fff
1515
height: $header-height
16-
display: flex
17-
align-items: center
1816
padding: $heading-padding-vertical 20px $heading-padding-vertical 40px;
1917
position: relative
2018
z-index: 100
19+
display: flex
20+
align-items: center
21+
justify-content: space-between
2122

2223
body.docs
2324
#header
2425
position: fixed
2526
width: 100%
2627
top: 0
28+
display: flex
29+
align-items: center
30+
justify-content: space-between
2731
#nav
28-
position: fixed
32+
margin-right: 80px
2933

3034
#nav
3135
list-style-type: none
3236
margin: 0
3337
padding: 0
34-
position: absolute
35-
right: 30px
36-
line-height: $header-height
38+
39+
a, span
40+
line-height: 1.8em
41+
3742
.break
3843
display: none
3944
li
@@ -43,8 +48,10 @@ body.docs
4348
span
4449
font-weight: bold;
4550
a
51+
border-bottom: 2px solid #fff
4652
&:hover, &.current
4753
border-bottom: 2px solid $green
54+
transition: 200ms;
4855
.nav-dropdown
4956
.nav-link
5057
&:hover, &.current

docs/themes/htx/source/css/_settings.styl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ $content-padding-top = 30px
2222

2323
// header settings
2424
$header-inner-height = 41px
25-
$heading-padding-vertical = 10px
25+
$heading-padding-vertical = 20px
2626
$header-height = $header-inner-height + $heading-padding-vertical * 2
2727
$mobile-header-height = 40px
2828
// prevent headers from being covered by the top nav upon navigation

docs/themes/htx/source/css/_sidebar.styl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
overflow-y: auto
1111
-webkit-overflow-scrolling: touch
1212
-ms-overflow-style: none
13+
display: flex
14+
flex-flow: column
15+
align-items: center
16+
justify-content: space-between
1317
h2
1418
margin-top: .2em
1519
ul
@@ -83,8 +87,14 @@
8387
width: 200px
8488
margin-bottom: 10px
8589
.main-menu
86-
display: block
90+
display: flex
91+
flex-flow: column
92+
align-items: flex-start
93+
justify-content: flex-start
94+
a
95+
margin-bottom: 1em
8796
&.open
97+
z-index: 9999
8898
-webkit-transform: translate(0, 0)
8999
transform: translate(0, 0)
90100

docs/themes/htx/source/css/index.styl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ body
1313
#logo
1414
span
1515
font-size: 1.2em
16-
16+
1717
.sidebar
1818
display: none
1919

@@ -155,7 +155,7 @@ body
155155
-webkit-text-size-adjust: none
156156
font-size: 14px
157157
.sidebar
158-
display: block
158+
display: flex
159159
#header
160160
display: none
161161
#mobile-bar

0 commit comments

Comments
 (0)