Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2e38d9d
Refactor naming in history, improve annotation highlighting, fix obje…
simonasarvasova May 22, 2025
ab7d5cf
fixed jsdoc and deleted property
simonasarvasova May 22, 2025
2843e6b
fix: ruler description in history, highlight on zoom, constraint for …
simonasarvasova Jul 8, 2025
782c334
generalized history
simonasarvasova Oct 15, 2025
ef82264
expanded Layer class, fixed small bugs in object factories
simonasarvasova Oct 15, 2025
9044e77
add Sortable for annotation board functionality
simonasarvasova Oct 15, 2025
19b07fb
new history manager for board UI, added interaction with generalized …
simonasarvasova Oct 15, 2025
ebd872f
fix: forgotten activeObject usage
simonasarvasova Oct 28, 2025
2447004
added selection style to factories, removed rotation in edit mode, ad…
simonasarvasova Oct 28, 2025
cff7092
export support for selection of annotations
simonasarvasova Oct 28, 2025
9bd3274
fixed visibility handling in layers
simonasarvasova Oct 28, 2025
306f9c3
fix: multiselection, deletion of selected items, import for selection…
simonasarvasova Oct 28, 2025
36d8cb5
drag&drop with history, refactored annotations arrow movement, fixed …
simonasarvasova Oct 28, 2025
cf96cec
fix: removed unused function
simonasarvasova Oct 28, 2025
6728b87
Merge branch 'master' of github.com:RationAI/xopat into feat-multipol…
Aiosa Oct 30, 2025
8aec22a
Fix: duplicated property, revert crlf
Aiosa Oct 30, 2025
ffc364a
feat: almost working object selection after merge
Aiosa Nov 3, 2025
140073a
chore: remove unused code
Aiosa Nov 3, 2025
35ef3f3
feat: separate annotations + canvas from global annotation scope (pre…
Aiosa Nov 8, 2025
42d6067
feat: remove annotation dependency on VIEWER object, fix selection an…
Aiosa Nov 12, 2025
b7f77bd
chore: resolve conflict
Aiosa Nov 12, 2025
8b100cf
chore: resolve conflict, add todos on issues
Aiosa Nov 13, 2025
2ccc2e1
fixed some merge bugs, export issues, and board visuals, changed logi…
simonasarvasova Nov 27, 2025
c88c8d3
added constraints during edit mode, resolved editing of text annotati…
simonasarvasova Nov 27, 2025
8efdcb4
fix: selection uses objects instead of ids, bug in preset update, pol…
simonasarvasova Dec 9, 2025
ddb0e30
added text annotation edit, fix: selection, dashed highlight, bug fix
simonasarvasova Dec 15, 2025
93f3718
bug fix edit mode, selection, disabled polygon drag, icons render
simonasarvasova Dec 17, 2025
c854cce
Merge branch 'master' of https://github.com/RationAI/xopat into feat-…
simonasarvasova Dec 17, 2025
9b52b0b
bug fix
simonasarvasova Dec 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ module.exports = function(grunt) {

grunt.registerTask('default', []);
grunt.registerTask('all', ["uglify", "css"]);

// todo enable build-only step
grunt.registerTask('build', 'Build Necessary Parts of the Viewer', function () {
// todo only on a single place:
exec("npx esbuild --bundle --sourcemap --format=esm --outfile=ui/index.js ui/index.mjs");
});
grunt.registerTask('plugins', ["uglify:plugins"]);
grunt.registerTask('modules', ["uglify:modules"]);
grunt.registerTask('buildUI', function (){
Expand Down
5 changes: 1 addition & 4 deletions modules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,7 @@ Return data exported with the viewer if available. Exporting the data is done th

### Events
Modules (and plugins) can have their own event system - in that case, the `EVENTS.md` description
should be provided. These events require OpenSeadragon.EventSource implementation (which it is based on) and it
should be invoked on the ``XOpatModule`` or `XOpatModuleSingleton` instance.

> Events are available only after `this.registerAsEventSource()` has been called.
should be provided. These events require OpenSeadragon.EventSource implementation (which it is based on).

### Localization
Can be done using ``this.loadLocale(locale, data)`` which behaves like plugin's `loadLocale` function
Expand Down
95 changes: 89 additions & 6 deletions modules/annotations/EVENTS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# Events in OSD Annotations

##### factory-registered | e: `{factory: OSDAnnotations.AnnotationObjectFactory}`
Some events are fired on the global instance of OSD Annotations. Some events are
fired on particular annotation context - depends on the particular viewer the annotations are on.

##### visual-property-changed | ``{[name]: any}``
Common visual property changed.
For global events, it is enough to say ``OSDAnnotations.addHandler(...)``. For contextual events,
TODO api not finished.

## Global Events

##### factory-registered | e: `{factory: OSDAnnotations.AnnotationObjectFactory}`

##### osd-interactivity-toggle

Expand Down Expand Up @@ -112,11 +117,11 @@ This event is fired prior to changing annotation preset. Same usage as `annotati

##### history-select | ``{incrementId: number, originalEvent: MouseEvent}``

##### import | ``{options: object, clear: boolean, data: object}``
##### import | ``{options: object, clear: boolean, data: object, owner: FabricWrapper}``

##### export-partial | ``{options: object, data: object}``
##### export-partial | ``{options: object, data: object, owner: FabricWrapper}``

##### export | ``{data: string}``
##### export | ``{data: string, owner: FabricWrapper}``

#### mode-changed | ``{mode: OSDAnnotatinos.AnnotationState}``

Expand All @@ -136,4 +141,82 @@ Called when the annotation modes did not handle mouse release action.
##### canvas-release-not-handled
Called when the annotation modes did not handle mouse release action.

#### canvas-release | ``{originalEvent: Event, pressTime: number}``
TODO do we want to keep this?

Fires ``warn-user``, ``error-user`` and `warn-system` on the viewer instance.

## Viewer Contextual Events - ``FabricProxy``

#### active-layer-changed | ``{id: string}``

#### layer-selection-changed | ``{ids: string[], isSelected: boolean}``

##### layer-added | ``{layer: OSDAnnotations.AnnotationLayer}``

##### layer-removed | ``{layer: OSDAnnotations.AnnotationLayer}``

##### annotation-selection-changed | ``{ids: string[], isSelected: boolean, fromCanvas: boolean}``

##### annotation-create | ``{object: fabric.Object}``
Fires when annotation object is created. This does not apply when
``annotation-replace`` is called - in that case, the replacement is
considered as the creation.

##### annotation-before-create | ``{object: fabric.Object, isCancelled: () => boolean, setCancelled: (cancelled: boolean) => void}``
This event is fired prior to inserting any annotation, including promotion (simple helper annotation creation is not affected).
`isCancelled` can be called to check if the deletion was already requested to be cancelled (by another plugin/module for example)
`setCancelled` can be used to request to cancel the deletion

##### annotation-delete | ``{object: fabric.Object}``

##### annotation-before-delete | ``{object: fabric.Object, isCancelled: () => boolean, setCancelled: (cancelled: boolean) => void}``
This event is fired prior to deleting any annotation.
`isCancelled` can be called to check if the deletion was already requested to be cancelled (by another plugin/module for example)
`setCancelled` can be used to request to cancel the deletion

##### annotation-replace | ``{previous: fabric.Object, next: fabric.Object}``
This event is fired when annotation is replaced, e.g. free-form-tool edit. Such edits
in fact replace annotation with a new one, although the annotation identity as perceived
by the user remains the same. This event is called only once per update,
at the end.

##### annotation-before-replace | ``{object: fabric.Object, isCancelled: () => boolean, setCancelled: (cancelled: boolean) => void}``
This event is fired prior to replacing annotation. Same usage as `annotation-before-delete`

##### annotation-replace-doppelganger | ``{previous: fabric.Object, next: fabric.Object}``
This event is fired when annotations are replaced, but only temporarily (e.g. via free form tool).
It can be called several times during one edit action.

##### annotation-before-replace-doppelganger | ``{object: fabric.Object, isCancelled: () => boolean, setCancelled: (cancelled: boolean) => void}``
This event is fired prior to replacing doppelganger annotation. Same usage as `annotation-before-delete`

##### annotation-edit | ``{object: fabric.Object}``
This event is fired when user performs direct annotation editing.

##### annotation-before-edit | ``{object: fabric.Object, isCancelled: () => boolean, setCancelled: (cancelled: boolean) => void}``
This event is fired prior to editing annotation. Same usage as `annotation-before-delete`

##### annotation-set-private | ``{object: fabric.Object}``
This event is fired when the `private` property of an annotation changes.

##### annotation-add-comment | ``{object: fabric.Object, comment: AnnotationComment}``
This event is fired when a comment is added, one by one.
```ts
type AnnotationComment = {
id: string;
author: {
id: string;
name: string;
};
content: string;
createdAt: Date;
removed?: boolean;
}
```

##### annotation-delete-comment | ``{object: fabric.Object, commentId: string}``
This event is fired when a comment is deleted, one by one.

##### visual-property-changed | ``{[name]: any}``
Common visual property changed.
Loading