You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ULabel is also published on [npm](https://www.npmjs.com/package/ulabel). You can use npm to install it and serve the `dist/ulabel.js` file from `node_modules` locally.
21
+
ULabel is also published on [npm](https://www.npmjs.com/package/ulabel). You can use npm to install it and serve the files from `node_modules` locally.
18
22
19
23
```bash
20
24
npm install ulabel
21
25
```
22
26
23
27
```html
28
+
<!-- Use minified version (recommended for production) -->
Or you can import it directly in your JavaScript code:
28
36
29
37
```javascript
38
+
// Use minified version (default, recommended for production)
30
39
importULabelfrom'ulabel';
40
+
41
+
// Or use unminified version for debugging
42
+
importULabelfrom'ulabel/debug';
31
43
```
32
44
33
45
An API spec can be found [here](https://github.com/SenteraLLC/ulabel/blob/main/api_spec.md), but as a brief overview: Once the script is included in your HTML doc, you can create a ULabel annotation session as follows.
This toolbox item provides CSS filter controls that apply only to the image, not to the UI elements. Users can adjust brightness, contrast, hue rotation, inversion, and saturation using sliders. The filters are hardware-accelerated by modern browsers for optimal performance.
415
+
393
416
### `change_zoom_keybind`
394
417
Keybind to change the zoom level. Must be a letter, and the lowercase version of the letter will set the zoom level to the `initial_crop`, while the capitalized version will show the full image. Default is `r`.
395
418
@@ -429,6 +452,15 @@ Keybind to increase the brush size. Default is `]`. Requires the active subtask
429
452
### `decrease_brush_size_keybind`
430
453
Keybind to decrease the brush size. Default is `[`. Requires the active subtask to have a `polygon` mode.
431
454
455
+
### `fly_to_next_annotation_keybind`
456
+
Keybind to set the zoom to focus on the next annotation. Default is `Tab`, which also will disable any default browser behavior for `Tab`.
457
+
458
+
### `fly_to_previous_annotation_keybind`
459
+
Keybind to set the zoom to focus on the previous annotation. Default is `<null>`, which will default to `Shift+<fly_to_next_annotation_keybind>`.
460
+
461
+
### `fly_to_max_zoom`
462
+
Maximum zoom factor used when flying-to an annotation. Default is `10`, value must be > `0`.
463
+
432
464
### `n_annos_per_canvas`
433
465
The number of annotations to render on a single canvas. Default is `100`. Increasing this number may improve performance for jobs with a large number of annotations.
434
466
@@ -476,6 +508,15 @@ Display utilities are provided for a constructed `ULabel` object.
476
508
*() => void* -- Removes persistent event listeners from the document and window. Listeners attached directly to html elements are not explicitly removed.
477
509
Note that ULabel will not function properly after this method is called. Designed for use in single-page applications before navigating away from the annotation page.
478
510
511
+
### `fly_to_next_annotation(increment)`
512
+
Sets the zoom to focus on a non-deprecated, spatial annotation in the active subtask's ordering that is an `<increment>` number away from the previously focused annotation, if any. Returns `true` on success and `false` on failure (eg, no valid annotations exist, or an annotation is currently actively being edited).
Sets the zoom to focus on the provided annotation id, and switches to its subtask. Returns `true` on success and `false` on failure (eg, annotation doesn't exist in subtask, is not a spatial annotation, or is deprecated).
Sets the zoom to focus on the provided annotation, and switches to its subtask if provided. Returns `true` on success and `false` on failure (eg, annotation doesn't exist in subtask, is not a spatial annotation, or is deprecated).
519
+
479
520
## Generic Callbacks
480
521
481
522
Callbacks can be provided by calling `.on(fn, callback)` on a `ULabel` object.
0 commit comments