lost-sia 2.0.1-alpha8 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/Annotation/logic/Annotation.d.ts +17 -0
- package/dist/Annotation/logic/Annotation.js +1 -0
- package/dist/Annotation/ui/AnnotationComponent.d.ts +24 -0
- package/dist/Annotation/ui/AnnotationComponent.js +1 -0
- package/dist/Annotation/ui/atoms/AnnoBar.d.ts +15 -0
- package/dist/Annotation/ui/atoms/AnnoBar.js +1 -0
- package/dist/Annotation/ui/atoms/DaviIcon.d.ts +9 -0
- package/dist/Annotation/ui/atoms/DaviIcon.js +19 -0
- package/dist/Annotation/ui/atoms/Edge.d.ts +17 -0
- package/dist/Annotation/ui/atoms/Edge.js +1 -0
- package/dist/Annotation/ui/atoms/Node.d.ts +17 -0
- package/dist/Annotation/ui/atoms/Node.js +1 -0
- package/dist/Annotation/ui/atoms/PolygonArea.d.ts +16 -0
- package/dist/Annotation/ui/atoms/PolygonArea.js +1 -0
- package/dist/Annotation/ui/tools/BBox.d.ts +21 -0
- package/dist/Annotation/ui/tools/BBox.js +1 -0
- package/dist/Annotation/ui/tools/Line.d.ts +21 -0
- package/dist/Annotation/ui/tools/Line.js +1 -0
- package/dist/Annotation/ui/tools/Point.d.ts +16 -0
- package/dist/Annotation/ui/tools/Point.js +1 -0
- package/dist/Annotation/ui/tools/Polygon.d.ts +23 -0
- package/dist/Annotation/ui/tools/Polygon.js +1 -0
- package/dist/Canvas/Canvas.d.ts +31 -0
- package/dist/Canvas/Canvas.js +1 -0
- package/dist/Canvas/LabelInput.d.ts +11 -0
- package/dist/Canvas/LabelInput.js +1 -0
- package/dist/IconButton.d.ts +25 -0
- package/dist/IconButton.js +1 -0
- package/dist/Sia.d.ts +33 -0
- package/dist/Sia.js +1 -0
- package/dist/Toolbar/Toolbar.d.ts +21 -0
- package/dist/Toolbar/Toolbar.js +1 -0
- package/dist/Toolbar/ToolbarItems/AccessibilityTools.d.ts +7 -0
- package/dist/Toolbar/ToolbarItems/AccessibilityTools.js +1 -0
- package/dist/Toolbar/ToolbarItems/AnnoToolSelector.d.ts +11 -0
- package/dist/Toolbar/ToolbarItems/AnnoToolSelector.js +1 -0
- package/dist/Toolbar/ToolbarItems/ImageToolItems/ImageLabelInput.d.ts +11 -0
- package/dist/Toolbar/ToolbarItems/ImageToolItems/ImageLabelInput.js +1 -0
- package/dist/Toolbar/ToolbarItems/ImageToolItems/TagLabel.d.ts +11 -0
- package/dist/Toolbar/ToolbarItems/ImageToolItems/TagLabel.js +1 -0
- package/dist/Toolbar/ToolbarItems/ImageTools.d.ts +13 -0
- package/dist/Toolbar/ToolbarItems/ImageTools.js +1 -0
- package/dist/Toolbar/ToolbarItems/Instructions.d.ts +2 -0
- package/dist/Toolbar/ToolbarItems/Instructions.js +1 -0
- package/dist/Toolbar/ToolbarItems/InstructionsModal.d.ts +6 -0
- package/dist/Toolbar/ToolbarItems/InstructionsModal.js +1 -0
- package/dist/assets/SIA-BV1tYu3P.css +1 -0
- package/dist/assets/brand-icons-Cu_C0hZ4.svg +1008 -0
- package/dist/assets/brand-icons-F3SPCeH1.woff +0 -0
- package/dist/assets/brand-icons-XL9sxUpA.woff2 +0 -0
- package/dist/assets/brand-icons-sqJ2Pg7a.eot +0 -0
- package/dist/assets/brand-icons-ubhWoxly.ttf +0 -0
- package/dist/assets/flags-DOLqOU7Y.png +0 -0
- package/dist/assets/icons-BOCtAERH.woff +0 -0
- package/dist/assets/icons-CHzK1VD9.eot +0 -0
- package/dist/assets/icons-D29ZQHHw.ttf +0 -0
- package/dist/assets/icons-Du6TOHnR.woff2 +0 -0
- package/dist/assets/icons-RwhydX30.svg +1518 -0
- package/dist/assets/node_modules/semantic-ui-css/semantic.min-Bvulf91l.css +346 -0
- package/dist/assets/outline-icons-BfdLr8tr.svg +366 -0
- package/dist/assets/outline-icons-DD8jm0uy.ttf +0 -0
- package/dist/assets/outline-icons-DInHoiqI.woff2 +0 -0
- package/dist/assets/outline-icons-LX8adJ4n.eot +0 -0
- package/dist/assets/outline-icons-aQ88nltS.woff +0 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +1 -0
- package/dist/models/AnnotationMode.d.ts +11 -0
- package/dist/models/AnnotationMode.js +1 -0
- package/dist/models/AnnotationStatus.d.ts +8 -0
- package/dist/models/AnnotationStatus.js +1 -0
- package/dist/models/AnnotationTool.d.ts +7 -0
- package/dist/models/AnnotationTool.js +1 -0
- package/dist/models/CanvasAction.d.ts +28 -0
- package/dist/models/CanvasAction.js +1 -0
- package/dist/models/Direction.d.ts +7 -0
- package/dist/models/Direction.js +1 -0
- package/dist/models/EditorModes.d.ts +11 -0
- package/dist/models/EditorModes.js +1 -0
- package/dist/models/KeyAction.d.ts +22 -0
- package/dist/models/KeyAction.js +1 -0
- package/dist/models/NotificationType.d.ts +7 -0
- package/dist/models/NotificationType.js +1 -0
- package/dist/models/index.d.ts +6 -0
- package/dist/models/index.js +1 -0
- package/dist/stories/AnnotationTools.stories.d.ts +40 -0
- package/dist/stories/Canvas/Canvas.stories.d.ts +50 -0
- package/dist/stories/Canvas/CanvasOffset.d.ts +13 -0
- package/dist/stories/Canvas/CanvasWithOffset.stories.d.ts +36 -0
- package/dist/stories/FilterDropdown.stories.d.ts +19 -0
- package/dist/stories/MinimalSia.stories.d.ts +66 -0
- package/dist/stories/SIA/DemoWrapper.d.ts +8 -0
- package/dist/stories/SIA/DemoWrapper.stories.d.ts +27 -0
- package/dist/stories/SIA/SIA.stories.d.ts +72 -0
- package/dist/stories/Toolbar/ImageTools/TagLabel.stories.d.ts +21 -0
- package/dist/stories/Toolbar/Instructions.stories.d.ts +11 -0
- package/dist/stories/Toolbar/Toolbar.stories.d.ts +37 -0
- package/dist/stories/exampleData/exampleAnnotations.d.ts +8 -0
- package/dist/stories/exampleData/exampleExternalAnnotations.d.ts +8 -0
- package/dist/stories/exampleData/exampleImage.d.ts +2 -0
- package/dist/stories/exampleData/exampleLabels.d.ts +6 -0
- package/dist/types.d.ts +57 -0
- package/dist/types.js +1 -0
- package/dist/utils/KeyMapper.d.ts +9 -0
- package/dist/utils/KeyMapper.js +1 -0
- package/dist/utils/TimeUtils.d.ts +4 -0
- package/dist/utils/TimeUtils.js +1 -0
- package/dist/utils/color.d.ts +2 -0
- package/dist/utils/color.js +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/mouse.d.ts +6 -0
- package/dist/utils/mouse.js +1 -0
- package/dist/utils/siaIcons.js +12 -0
- package/dist/utils/transform.d.ts +28 -0
- package/dist/utils/transform.js +1 -0
- package/dist/utils/uiConfig.js +1 -0
- package/dist/utils/windowViewport.d.ts +22 -0
- package/dist/utils/windowViewport.js +1 -0
- package/package.json +19 -16
- package/src/AnnoExampleViewer.jsx +18 -18
- package/src/Annotation/logic/Annotation.ts +24 -26
- package/src/Annotation/ui/AnnotationComponent.tsx +115 -86
- package/src/Annotation/ui/atoms/AnnoBar.tsx +51 -53
- package/src/Annotation/ui/atoms/DaviIcon.tsx +12 -22
- package/src/Annotation/ui/atoms/Edge.tsx +25 -22
- package/src/Annotation/ui/atoms/Node.tsx +56 -50
- package/src/Annotation/ui/atoms/PolygonArea.tsx +30 -35
- package/src/Annotation/ui/tools/BBox.tsx +136 -150
- package/src/Annotation/ui/tools/Line.tsx +94 -91
- package/src/Annotation/ui/tools/Point.tsx +19 -17
- package/src/Annotation/ui/tools/Polygon.tsx +126 -95
- package/src/Canvas/Canvas.tsx +748 -594
- package/src/Canvas/LabelInput.tsx +68 -45
- package/src/IconButton.tsx +119 -0
- package/src/InfoBoxes/AnnoDetails.jsx +53 -53
- package/src/InfoBoxes/AnnoStats.jsx +41 -41
- package/src/InfoBoxes/InfoBox.jsx +16 -16
- package/src/InfoBoxes/InfoBoxArea.jsx +32 -34
- package/src/InfoBoxes/LabelInfo.jsx +30 -30
- package/src/SIASettingButton.jsx +25 -25
- package/src/Sia.tsx +484 -0
- package/src/Toolbar/Toolbar.tsx +38 -31
- package/src/Toolbar/ToolbarItems/AccessibilityTools.tsx +26 -46
- package/src/Toolbar/ToolbarItems/AnnoToolSelector.tsx +53 -46
- package/src/Toolbar/ToolbarItems/ImageToolItems/ImageLabelInput.tsx +127 -0
- package/src/Toolbar/ToolbarItems/ImageToolItems/TagLabel.tsx +29 -28
- package/src/Toolbar/ToolbarItems/ImageTools.tsx +43 -40
- package/src/Toolbar/ToolbarItems/Instructions.tsx +47 -50
- package/src/Toolbar/ToolbarItems/InstructionsModal.tsx +8 -8
- package/src/index.ts +9 -13
- package/src/models/{AnnotationMode.tsx → AnnotationMode.ts} +1 -1
- package/src/models/{AnnotationStatus.tsx → AnnotationStatus.ts} +1 -1
- package/src/models/{AnnotationTool.tsx → AnnotationTool.ts} +1 -1
- package/src/models/{CanvasAction.tsx → CanvasAction.ts} +1 -1
- package/src/models/{Direction.tsx → Direction.ts} +1 -1
- package/src/models/{EditorModes.tsx → EditorModes.ts} +1 -1
- package/src/models/{KeyAction.tsx → KeyAction.ts} +3 -1
- package/src/models/NotificationType.ts +8 -0
- package/src/models/index.ts +6 -7
- package/src/siaDummyData.js +71 -71
- package/src/stories/AnnotationTools.mdx +27 -0
- package/src/stories/AnnotationTools.stories.tsx +104 -0
- package/src/stories/Canvas/Canvas.stories.tsx +59 -113
- package/src/stories/Canvas/CanvasOffset.tsx +54 -38
- package/src/stories/Canvas/CanvasWithOffset.stories.tsx +42 -113
- package/src/stories/FilterDropdown.stories.ts +13 -11
- package/src/stories/MinimalSIA.mdx +20 -0
- package/src/stories/MinimalSia.stories.tsx +90 -0
- package/src/stories/SIA/DemoWrapper.stories.tsx +71 -0
- package/src/stories/SIA/DemoWrapper.tsx +55 -0
- package/src/stories/SIA/SIA.stories.tsx +79 -45
- package/src/stories/Toolbar/ImageTools/TagLabel.stories.tsx +11 -12
- package/src/stories/Toolbar/Instructions.stories.tsx +11 -11
- package/src/stories/Toolbar/Toolbar.stories.tsx +32 -47
- package/src/stories/Welcome.mdx +5 -0
- package/src/stories/development/CoordinateSystems.mdx +25 -0
- package/src/stories/exampleData/exampleAnnotations.ts +65 -0
- package/src/stories/exampleData/exampleExternalAnnotations.ts +115 -0
- package/src/stories/{siaDummyData2.ts → exampleData/exampleImage.ts} +3 -264
- package/src/stories/exampleData/exampleLabels.ts +146 -0
- package/src/stories/main.scss +6 -0
- package/src/styles/style.scss +1 -26
- package/src/types.ts +67 -0
- package/src/utils/KeyMapper.ts +76 -74
- package/src/utils/TimeUtils.ts +11 -0
- package/src/utils/color.ts +25 -25
- package/src/utils/hist.js +22 -22
- package/src/utils/index.ts +2 -3
- package/src/utils/mouse.ts +45 -0
- package/src/utils/siaIcons.jsx +5 -7
- package/src/utils/transform.ts +186 -0
- package/src/utils/uiConfig.js +19 -22
- package/src/utils/windowViewport.ts +34 -0
- package/src/AnnoLabelInput.jsx +0 -109
- package/src/AnnoToolBar.jsx +0 -153
- package/src/Annotation/AnnoBar.jsx +0 -154
- package/src/Annotation/Annotation.jsx +0 -395
- package/src/Annotation/Annotation.scss +0 -47
- package/src/Annotation/BBox.jsx +0 -299
- package/src/Annotation/Edge.jsx +0 -92
- package/src/Annotation/InfSelectionArea.jsx +0 -72
- package/src/Annotation/Line.jsx +0 -68
- package/src/Annotation/Node.jsx +0 -282
- package/src/Annotation/Point.jsx +0 -200
- package/src/Annotation/Polygon.jsx +0 -404
- package/src/Annotation/logic/AnnotationUtils.ts +0 -30
- package/src/Canvas.jsx +0 -2194
- package/src/ImgBar.jsx +0 -131
- package/src/LabelInput.jsx +0 -238
- package/src/Prompt.jsx +0 -45
- package/src/SIAFilterButton.jsx +0 -186
- package/src/Sia.jsx +0 -478
- package/src/Sia2.tsx +0 -392
- package/src/SiaPopup.jsx +0 -15
- package/src/ToolBar.jsx +0 -463
- package/src/Toolbar/NavigationButtons.tsx +0 -21
- package/src/Toolbar/ToolbarItem.jsx +0 -30
- package/src/Toolbar/ToolbarItems/ImageToolItems/ImageLabel.tsx +0 -62
- package/src/Toolbar.css +0 -13
- package/src/ToolbarItem.jsx +0 -31
- package/src/filterTools.js +0 -5
- package/src/models/AllowedTools.tsx +0 -9
- package/src/models/AnnotationSettings.tsx +0 -9
- package/src/models/ExternalAnnotation.ts +0 -15
- package/src/models/Label.tsx +0 -8
- package/src/models/UiConfig.tsx +0 -6
- package/src/stories/Button.jsx +0 -54
- package/src/stories/Button.stories.js +0 -48
- package/src/stories/Header.jsx +0 -69
- package/src/stories/Header.stories.js +0 -28
- package/src/stories/Page.jsx +0 -87
- package/src/stories/Page.stories.js +0 -28
- package/src/stories/SIA2/DemoWrapper.stories.tsx +0 -167
- package/src/stories/SIA2/DemoWrapper.tsx +0 -54
- package/src/stories/SIA2/Sia2.stories.tsx +0 -62
- package/src/stories/Toolbar/ImageTools/ImageLabel.stories.tsx +0 -32
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +0 -5
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +0 -15
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +0 -3
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +0 -12
- package/src/stories/assets/youtube.svg +0 -4
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/src/stories/lost.js +0 -54
- package/src/stories/page.css +0 -69
- package/src/stories/siaDummyData.js +0 -263
- package/src/stories/store.js +0 -18
- package/src/test.js +0 -7
- package/src/types/annoStatus.js +0 -4
- package/src/types/canvasActions.js +0 -58
- package/src/types/cursorstyles.js +0 -3
- package/src/types/modes.js +0 -9
- package/src/types/notificationType.js +0 -11
- package/src/types/toolbarEvents.js +0 -35
- package/src/types/tools.js +0 -17
- package/src/types.tsx +0 -11
- package/src/utils/annoConversion.js +0 -145
- package/src/utils/annoConversion2.ts +0 -145
- package/src/utils/colorlut.js +0 -68
- package/src/utils/constraints.js +0 -81
- package/src/utils/index.js +0 -1
- package/src/utils/keyActions.js +0 -113
- package/src/utils/mouse.js +0 -14
- package/src/utils/mouse2.ts +0 -35
- package/src/utils/transform.js +0 -336
- package/src/utils/transform2.ts +0 -343
- package/src/utils/windowViewport.js +0 -34
- package/src/utils/windowViewport2.ts +0 -50
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare enum CanvasAction {
|
|
2
|
+
ANNO_DELETED = 0,
|
|
3
|
+
ANNO_SELECTED = 1,
|
|
4
|
+
ANNO_CREATED = 2,
|
|
5
|
+
ANNO_MOVED = 3,
|
|
6
|
+
ANNO_ENTER_MOVE_MODE = 4,
|
|
7
|
+
ANNO_EDITED = 5,
|
|
8
|
+
ANNO_ENTER_EDIT_MODE = 6,
|
|
9
|
+
ANNO_ADDED_NODE = 7,
|
|
10
|
+
ANNO_REMOVED_NODE = 8,
|
|
11
|
+
ANNO_LABEL_UPDATE = 9,
|
|
12
|
+
ANNO_CREATED_NODE = 10,
|
|
13
|
+
ANNO_CREATED_FINAL_NODE = 11,
|
|
14
|
+
ANNO_START_CREATING = 12,
|
|
15
|
+
ANNO_COMMENT_UPDATE = 13,
|
|
16
|
+
ANNO_MARK_EXAMPLE = 14,
|
|
17
|
+
ANNO_ENTER_CREATE_MODE = 15,
|
|
18
|
+
CANVAS_SVG_UPDATE = 16,
|
|
19
|
+
CANVAS_UI_CONFIG_UPDATE = 17,
|
|
20
|
+
CANVAS_AUTO_SAVE = 18,
|
|
21
|
+
CANVAS_LABEL_INPUT_CLOSE = 19,
|
|
22
|
+
CANVAS_IMG_LOADED = 20,
|
|
23
|
+
CANVAS_IMGBAR_CLOSE = 21,
|
|
24
|
+
IMG_LABEL_UPDATE = 22,
|
|
25
|
+
IMG_JUNK_UPDATE = 23,
|
|
26
|
+
IMG_ANNO_TIME_UPDATE = 24
|
|
27
|
+
}
|
|
28
|
+
export default CanvasAction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var N=(E=>(E[E.ANNO_DELETED=0]="ANNO_DELETED",E[E.ANNO_SELECTED=1]="ANNO_SELECTED",E[E.ANNO_CREATED=2]="ANNO_CREATED",E[E.ANNO_MOVED=3]="ANNO_MOVED",E[E.ANNO_ENTER_MOVE_MODE=4]="ANNO_ENTER_MOVE_MODE",E[E.ANNO_EDITED=5]="ANNO_EDITED",E[E.ANNO_ENTER_EDIT_MODE=6]="ANNO_ENTER_EDIT_MODE",E[E.ANNO_ADDED_NODE=7]="ANNO_ADDED_NODE",E[E.ANNO_REMOVED_NODE=8]="ANNO_REMOVED_NODE",E[E.ANNO_LABEL_UPDATE=9]="ANNO_LABEL_UPDATE",E[E.ANNO_CREATED_NODE=10]="ANNO_CREATED_NODE",E[E.ANNO_CREATED_FINAL_NODE=11]="ANNO_CREATED_FINAL_NODE",E[E.ANNO_START_CREATING=12]="ANNO_START_CREATING",E[E.ANNO_COMMENT_UPDATE=13]="ANNO_COMMENT_UPDATE",E[E.ANNO_MARK_EXAMPLE=14]="ANNO_MARK_EXAMPLE",E[E.ANNO_ENTER_CREATE_MODE=15]="ANNO_ENTER_CREATE_MODE",E[E.CANVAS_SVG_UPDATE=16]="CANVAS_SVG_UPDATE",E[E.CANVAS_UI_CONFIG_UPDATE=17]="CANVAS_UI_CONFIG_UPDATE",E[E.CANVAS_AUTO_SAVE=18]="CANVAS_AUTO_SAVE",E[E.CANVAS_LABEL_INPUT_CLOSE=19]="CANVAS_LABEL_INPUT_CLOSE",E[E.CANVAS_IMG_LOADED=20]="CANVAS_IMG_LOADED",E[E.CANVAS_IMGBAR_CLOSE=21]="CANVAS_IMGBAR_CLOSE",E[E.IMG_LABEL_UPDATE=22]="IMG_LABEL_UPDATE",E[E.IMG_JUNK_UPDATE=23]="IMG_JUNK_UPDATE",E[E.IMG_ANNO_TIME_UPDATE=24]="IMG_ANNO_TIME_UPDATE",E))(N||{});export{N as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=(T=>(T[T.UP=0]="UP",T[T.DOWN=1]="DOWN",T[T.LEFT=2]="LEFT",T[T.RIGHT=3]="RIGHT",T))(a||{});export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var A=(D=>(D[D.VIEW=0]="VIEW",D[D.EDIT=1]="EDIT",D[D.CREATE=2]="CREATE",D[D.MOVE=3]="MOVE",D[D.ADD=4]="ADD",D[D.CAMERA_MOVE=5]="CAMERA_MOVE",D[D.EDIT_LABEL=6]="EDIT_LABEL",D[D.DELETED=7]="DELETED",D))(A||{});export{A as default};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare enum KeyAction {
|
|
2
|
+
EDIT_LABEL = 0,
|
|
3
|
+
DELETE_ANNO = 1,
|
|
4
|
+
ENTER_ANNO_ADD_MODE = 2,
|
|
5
|
+
LEAVE_ANNO_ADD_MODE = 3,
|
|
6
|
+
UNDO = 4,
|
|
7
|
+
REDO = 5,
|
|
8
|
+
TRAVERSE_ANNOS = 6,
|
|
9
|
+
TRAVERSE_ANNOS_BACKWARDS = 7,
|
|
10
|
+
CAM_MOVE_UP = 8,
|
|
11
|
+
CAM_MOVE_DOWN = 9,
|
|
12
|
+
CAM_MOVE_LEFT = 10,
|
|
13
|
+
CAM_MOVE_RIGHT = 11,
|
|
14
|
+
CAM_MOVE_STOP = 12,
|
|
15
|
+
COPY_ANNOTATION = 13,
|
|
16
|
+
PASTE_ANNOTATION = 14,
|
|
17
|
+
RECREATE_ANNO = 15,
|
|
18
|
+
DELETE_ANNO_IN_CREATION = 16,
|
|
19
|
+
TOGGLE_ANNO_COMMENT_INPUT = 17,
|
|
20
|
+
TOGGLE_IMAGE_JUNK = 18
|
|
21
|
+
}
|
|
22
|
+
export default KeyAction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var _=(E=>(E[E.EDIT_LABEL=0]="EDIT_LABEL",E[E.DELETE_ANNO=1]="DELETE_ANNO",E[E.ENTER_ANNO_ADD_MODE=2]="ENTER_ANNO_ADD_MODE",E[E.LEAVE_ANNO_ADD_MODE=3]="LEAVE_ANNO_ADD_MODE",E[E.UNDO=4]="UNDO",E[E.REDO=5]="REDO",E[E.TRAVERSE_ANNOS=6]="TRAVERSE_ANNOS",E[E.TRAVERSE_ANNOS_BACKWARDS=7]="TRAVERSE_ANNOS_BACKWARDS",E[E.CAM_MOVE_UP=8]="CAM_MOVE_UP",E[E.CAM_MOVE_DOWN=9]="CAM_MOVE_DOWN",E[E.CAM_MOVE_LEFT=10]="CAM_MOVE_LEFT",E[E.CAM_MOVE_RIGHT=11]="CAM_MOVE_RIGHT",E[E.CAM_MOVE_STOP=12]="CAM_MOVE_STOP",E[E.COPY_ANNOTATION=13]="COPY_ANNOTATION",E[E.PASTE_ANNOTATION=14]="PASTE_ANNOTATION",E[E.RECREATE_ANNO=15]="RECREATE_ANNO",E[E.DELETE_ANNO_IN_CREATION=16]="DELETE_ANNO_IN_CREATION",E[E.TOGGLE_ANNO_COMMENT_INPUT=17]="TOGGLE_ANNO_COMMENT_INPUT",E[E.TOGGLE_IMAGE_JUNK=18]="TOGGLE_IMAGE_JUNK",E))(_||{});export{_ as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var S=(R=>(R[R.INFO=0]="INFO",R[R.SUCCESS=1]="SUCCESS",R[R.WARNING=2]="WARNING",R[R.ERROR=3]="ERROR",R))(S||{});export{S as default};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as Annotation } from '../Annotation/logic/Annotation';
|
|
2
|
+
import { default as AnnotationMode } from './AnnotationMode';
|
|
3
|
+
import { default as AnnotationStatus } from './AnnotationStatus';
|
|
4
|
+
import { default as AnnotationTool } from './AnnotationTool';
|
|
5
|
+
import { default as NotificationType } from './NotificationType';
|
|
6
|
+
export { Annotation, AnnotationMode, AnnotationStatus, AnnotationTool, NotificationType };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{default as a}from"../Annotation/logic/Annotation.js";import{default as e}from"./AnnotationMode.js";import{default as r}from"./AnnotationStatus.js";import{default as d}from"./AnnotationTool.js";import{default as p}from"./NotificationType.js";export{a as Annotation,e as AnnotationMode,r as AnnotationStatus,d as AnnotationTool,p as NotificationType};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { AllowedTools } from '../types';
|
|
3
|
+
export declare const ActionsData: {};
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: ({ additionalButtons, allowedTools: propAllowedTools, polygonOperationResult, annotationSettings: propAnnotationSettings, uiConfig: propUiConfig, defaultAnnotationTool, defaultLabelId, image, isLoading, isPolygonSelectionMode, initialAnnotations, initialImageLabelIds, initialIsImageJunk, possibleLabels, onAnnoCreated, onAnnoCreationFinished, onAnnoChanged, onAnnoDeleted, onImageLabelsChanged, onIsImageJunk, onNotification, onSelectAnnotation, }: {
|
|
7
|
+
additionalButtons?: import('react').ReactElement;
|
|
8
|
+
allowedTools?: AllowedTools;
|
|
9
|
+
polygonOperationResult?: import('..').PolygonOperationResult;
|
|
10
|
+
annotationSettings?: import('..').AnnotationSettings;
|
|
11
|
+
defaultAnnotationTool?: import('../models').AnnotationTool;
|
|
12
|
+
defaultLabelId?: number;
|
|
13
|
+
image?: string;
|
|
14
|
+
isLoading?: boolean;
|
|
15
|
+
isPolygonSelectionMode?: boolean;
|
|
16
|
+
initialAnnotations?: import('..').ExternalAnnotation[];
|
|
17
|
+
initialImageLabelIds?: number[];
|
|
18
|
+
initialIsImageJunk?: boolean;
|
|
19
|
+
possibleLabels: import('..').Label[];
|
|
20
|
+
uiConfig?: import('..').UiConfig;
|
|
21
|
+
onAnnoCreated?: (createdAnno: import('../models').Annotation, allAnnos: import('../models').Annotation[]) => void;
|
|
22
|
+
onAnnoCreationFinished?: (createdAnno: import('../models').Annotation, allAnnos: import('../models').Annotation[]) => void;
|
|
23
|
+
onAnnoChanged?: (changedAnno: import('../models').Annotation, allAnnos: import('../models').Annotation[]) => void;
|
|
24
|
+
onAnnoDeleted?: (deletedAnno: import('../models').Annotation, allAnnos: import('../models').Annotation[]) => void;
|
|
25
|
+
onImageLabelsChanged?: (selectedImageIds: number[]) => void;
|
|
26
|
+
onIsImageJunk?: (isJunk: boolean) => void;
|
|
27
|
+
onNotification?: (notification: import('..').SIANotification) => void;
|
|
28
|
+
onSelectAnnotation?: (annotation: import('../models').Annotation) => void;
|
|
29
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
parameters: {
|
|
31
|
+
layout: string;
|
|
32
|
+
};
|
|
33
|
+
tags: string[];
|
|
34
|
+
excludeStories: RegExp;
|
|
35
|
+
args: {};
|
|
36
|
+
};
|
|
37
|
+
export default meta;
|
|
38
|
+
type Story = StoryObj<typeof meta>;
|
|
39
|
+
export declare const BBoxOnly: Story;
|
|
40
|
+
export declare const NoJunk: Story;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as AnnotationTool } from '../../models/AnnotationTool';
|
|
3
|
+
import { AnnotationSettings, UiConfig } from '../../types';
|
|
4
|
+
export declare const ActionsData: {
|
|
5
|
+
onAnnoEvent: import('@vitest/spy').Mock<(...args: any[]) => any>;
|
|
6
|
+
onKeyDown: import('@vitest/spy').Mock<(...args: any[]) => any>;
|
|
7
|
+
onKeyUp: import('@vitest/spy').Mock<(...args: any[]) => any>;
|
|
8
|
+
};
|
|
9
|
+
declare const meta: {
|
|
10
|
+
title: string;
|
|
11
|
+
component: ({ annotations, annotationSettings, defaultLabelId, image, isFullscreen, isImageJunk, isPolygonSelectionMode, polygonOperationResult, possibleLabels, preventScrolling, selectedAnnotation, selectedAnnoTool, toolbarHeight, uiConfig, onAnnoCreated, onAnnoCreationFinished, onAnnoChanged, onAnnoEditing, onNotification, onRequestNewAnnoId, onSelectAnnotation, onSetIsImageJunk, onSetSelectedTool, onShouldDeleteAnno, }: {
|
|
12
|
+
annotations?: import('../../models').Annotation[];
|
|
13
|
+
annotationSettings: AnnotationSettings;
|
|
14
|
+
defaultLabelId?: number;
|
|
15
|
+
image: string;
|
|
16
|
+
isFullscreen?: boolean;
|
|
17
|
+
isImageJunk?: boolean;
|
|
18
|
+
isPolygonSelectionMode?: boolean;
|
|
19
|
+
selectedAnnotation: import('../../models').Annotation | undefined;
|
|
20
|
+
selectedAnnoTool: AnnotationTool;
|
|
21
|
+
toolbarHeight?: number;
|
|
22
|
+
polygonOperationResult?: import('../..').PolygonOperationResult;
|
|
23
|
+
possibleLabels: import('../..').Label[];
|
|
24
|
+
preventScrolling?: boolean;
|
|
25
|
+
uiConfig: UiConfig;
|
|
26
|
+
onAnnoCreated: (createdAnno: import('../../models').Annotation) => void;
|
|
27
|
+
onAnnoCreationFinished: (createdAnno: import('../../models').Annotation, hasAnnotationExisted: boolean) => void;
|
|
28
|
+
onAnnoChanged: (changedAnno: import('../../models').Annotation) => void;
|
|
29
|
+
onAnnoEditing: (annoToEdit: import('../../models').Annotation) => void;
|
|
30
|
+
onNotification?: (notification: import('../..').SIANotification) => void;
|
|
31
|
+
onRequestNewAnnoId: () => number;
|
|
32
|
+
onSelectAnnotation: (annotation?: import('../../models').Annotation) => void;
|
|
33
|
+
onSetIsImageJunk: (newJunkState: boolean) => void;
|
|
34
|
+
onSetSelectedTool: (tool: AnnotationTool) => void;
|
|
35
|
+
onShouldDeleteAnno: (internalAnnoId: number) => void;
|
|
36
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
parameters: {
|
|
38
|
+
layout: string;
|
|
39
|
+
};
|
|
40
|
+
tags: string[];
|
|
41
|
+
excludeStories: RegExp;
|
|
42
|
+
args: {};
|
|
43
|
+
};
|
|
44
|
+
export default meta;
|
|
45
|
+
type Story = StoryObj<typeof meta>;
|
|
46
|
+
export declare const Default: Story;
|
|
47
|
+
export declare const WithPoints: Story;
|
|
48
|
+
export declare const WithLines: Story;
|
|
49
|
+
export declare const WithBBoxes: Story;
|
|
50
|
+
export declare const WithPolygonAnnotations: Story;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as Annotation } from '../../Annotation/logic/Annotation';
|
|
2
|
+
import { default as AnnotationTool } from '../../models/AnnotationTool';
|
|
3
|
+
import { Label, UiConfig } from '../../types';
|
|
4
|
+
type CanvasProps = {
|
|
5
|
+
annotations?: Annotation[];
|
|
6
|
+
image: string;
|
|
7
|
+
selectedAnnoTool: AnnotationTool;
|
|
8
|
+
possibleLabels: Label[];
|
|
9
|
+
preventScrolling: boolean;
|
|
10
|
+
uiConfig: UiConfig;
|
|
11
|
+
};
|
|
12
|
+
declare const CanvasWithOffset: ({ annotations, image, selectedAnnoTool, possibleLabels, preventScrolling, uiConfig, }: CanvasProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default CanvasWithOffset;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as AnnotationTool } from '../../models/AnnotationTool';
|
|
3
|
+
import { UiConfig } from '../../types';
|
|
4
|
+
export declare const ActionsData: {
|
|
5
|
+
onAnnoEvent: import('@vitest/spy').Mock<(...args: any[]) => any>;
|
|
6
|
+
onKeyDown: import('@vitest/spy').Mock<(...args: any[]) => any>;
|
|
7
|
+
onKeyUp: import('@vitest/spy').Mock<(...args: any[]) => any>;
|
|
8
|
+
};
|
|
9
|
+
declare const meta: {
|
|
10
|
+
title: string;
|
|
11
|
+
component: ({ annotations, image, selectedAnnoTool, possibleLabels, preventScrolling, uiConfig, }: {
|
|
12
|
+
annotations?: import('../../models').Annotation[];
|
|
13
|
+
image: string;
|
|
14
|
+
selectedAnnoTool: AnnotationTool;
|
|
15
|
+
possibleLabels: import('../..').Label[];
|
|
16
|
+
preventScrolling: boolean;
|
|
17
|
+
uiConfig: UiConfig;
|
|
18
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: string;
|
|
21
|
+
};
|
|
22
|
+
tags: string[];
|
|
23
|
+
excludeStories: RegExp;
|
|
24
|
+
args: {
|
|
25
|
+
onAnnoEvent: import('@vitest/spy').Mock<(...args: any[]) => any>;
|
|
26
|
+
onKeyDown: import('@vitest/spy').Mock<(...args: any[]) => any>;
|
|
27
|
+
onKeyUp: import('@vitest/spy').Mock<(...args: any[]) => any>;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export default meta;
|
|
31
|
+
type Story = StoryObj<typeof meta>;
|
|
32
|
+
export declare const Default: Story;
|
|
33
|
+
export declare const WithPoints: Story;
|
|
34
|
+
export declare const WithLines: Story;
|
|
35
|
+
export declare const WithBBoxes: Story;
|
|
36
|
+
export declare const WithPolygonAnnotations: Story;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ defaultLabelId, isVisible, selectedLabelsIds, possibleLabels, isMultilabel, onLabelSelect, }: {
|
|
5
|
+
defaultLabelId?: number;
|
|
6
|
+
isVisible: boolean;
|
|
7
|
+
selectedLabelsIds: number[];
|
|
8
|
+
possibleLabels: import('..').Label[];
|
|
9
|
+
isMultilabel?: boolean;
|
|
10
|
+
onLabelSelect: (selectedLabelIds: number[]) => void;
|
|
11
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
argTypes: {};
|
|
13
|
+
parameters: {
|
|
14
|
+
layout: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { Label } from '../types';
|
|
3
|
+
export declare const ActionsData: {};
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: ({ additionalButtons, allowedTools: propAllowedTools, polygonOperationResult, annotationSettings: propAnnotationSettings, uiConfig: propUiConfig, defaultAnnotationTool, defaultLabelId, image, isLoading, isPolygonSelectionMode, initialAnnotations, initialImageLabelIds, initialIsImageJunk, possibleLabels, onAnnoCreated, onAnnoCreationFinished, onAnnoChanged, onAnnoDeleted, onImageLabelsChanged, onIsImageJunk, onNotification, onSelectAnnotation, }: {
|
|
7
|
+
additionalButtons?: import('react').ReactElement;
|
|
8
|
+
allowedTools?: import('..').AllowedTools;
|
|
9
|
+
polygonOperationResult?: import('..').PolygonOperationResult;
|
|
10
|
+
annotationSettings?: import('..').AnnotationSettings;
|
|
11
|
+
defaultAnnotationTool?: import('../models').AnnotationTool;
|
|
12
|
+
defaultLabelId?: number;
|
|
13
|
+
image?: string;
|
|
14
|
+
isLoading?: boolean;
|
|
15
|
+
isPolygonSelectionMode?: boolean;
|
|
16
|
+
initialAnnotations?: import('..').ExternalAnnotation[];
|
|
17
|
+
initialImageLabelIds?: number[];
|
|
18
|
+
initialIsImageJunk?: boolean;
|
|
19
|
+
possibleLabels: Label[];
|
|
20
|
+
uiConfig?: import('..').UiConfig;
|
|
21
|
+
onAnnoCreated?: (createdAnno: import('../models').Annotation, allAnnos: import('../models').Annotation[]) => void;
|
|
22
|
+
onAnnoCreationFinished?: (createdAnno: import('../models').Annotation, allAnnos: import('../models').Annotation[]) => void;
|
|
23
|
+
onAnnoChanged?: (changedAnno: import('../models').Annotation, allAnnos: import('../models').Annotation[]) => void;
|
|
24
|
+
onAnnoDeleted?: (deletedAnno: import('../models').Annotation, allAnnos: import('../models').Annotation[]) => void;
|
|
25
|
+
onImageLabelsChanged?: (selectedImageIds: number[]) => void;
|
|
26
|
+
onIsImageJunk?: (isJunk: boolean) => void;
|
|
27
|
+
onNotification?: (notification: import('..').SIANotification) => void;
|
|
28
|
+
onSelectAnnotation?: (annotation: import('../models').Annotation) => void;
|
|
29
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
parameters: {
|
|
31
|
+
layout: string;
|
|
32
|
+
};
|
|
33
|
+
tags: string[];
|
|
34
|
+
excludeStories: RegExp;
|
|
35
|
+
args: {};
|
|
36
|
+
decorators: ((Story: import('storybook/internal/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
|
|
37
|
+
additionalButtons?: import('react').ReactElement;
|
|
38
|
+
allowedTools?: import('..').AllowedTools;
|
|
39
|
+
polygonOperationResult?: import('..').PolygonOperationResult;
|
|
40
|
+
annotationSettings?: import('..').AnnotationSettings;
|
|
41
|
+
defaultAnnotationTool?: import('../models').AnnotationTool;
|
|
42
|
+
defaultLabelId?: number;
|
|
43
|
+
image?: string;
|
|
44
|
+
isLoading?: boolean;
|
|
45
|
+
isPolygonSelectionMode?: boolean;
|
|
46
|
+
initialAnnotations?: import('..').ExternalAnnotation[];
|
|
47
|
+
initialImageLabelIds?: number[];
|
|
48
|
+
initialIsImageJunk?: boolean;
|
|
49
|
+
possibleLabels: Label[];
|
|
50
|
+
uiConfig?: import('..').UiConfig;
|
|
51
|
+
onAnnoCreated?: (createdAnno: import('../models').Annotation, allAnnos: import('../models').Annotation[]) => void;
|
|
52
|
+
onAnnoCreationFinished?: (createdAnno: import('../models').Annotation, allAnnos: import('../models').Annotation[]) => void;
|
|
53
|
+
onAnnoChanged?: (changedAnno: import('../models').Annotation, allAnnos: import('../models').Annotation[]) => void;
|
|
54
|
+
onAnnoDeleted?: (deletedAnno: import('../models').Annotation, allAnnos: import('../models').Annotation[]) => void;
|
|
55
|
+
onImageLabelsChanged?: (selectedImageIds: number[]) => void;
|
|
56
|
+
onIsImageJunk?: (isJunk: boolean) => void;
|
|
57
|
+
onNotification?: (notification: import('..').SIANotification) => void;
|
|
58
|
+
onSelectAnnotation?: (annotation: import('../models').Annotation) => void;
|
|
59
|
+
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
60
|
+
};
|
|
61
|
+
export default meta;
|
|
62
|
+
type Story = StoryObj<typeof meta>;
|
|
63
|
+
/**
|
|
64
|
+
* Minimal SIA example
|
|
65
|
+
*/
|
|
66
|
+
export declare const Minimal: Story;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AnnotationSettings, ExternalAnnotation } from '../../types';
|
|
2
|
+
type DemoWrapperProps = {
|
|
3
|
+
annotations?: ExternalAnnotation[];
|
|
4
|
+
annotationSettings?: AnnotationSettings;
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const DemoWrapper: ({ annotations, annotationSettings, isLoading, }: DemoWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default DemoWrapper;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { AnnotationSettings } from '../../types';
|
|
3
|
+
export declare const ActionsData: {};
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: ({ annotations, annotationSettings, isLoading, }: {
|
|
7
|
+
annotations?: import('../..').ExternalAnnotation[];
|
|
8
|
+
annotationSettings?: AnnotationSettings;
|
|
9
|
+
isLoading?: boolean;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: string;
|
|
13
|
+
};
|
|
14
|
+
tags: string[];
|
|
15
|
+
excludeStories: RegExp;
|
|
16
|
+
args: {};
|
|
17
|
+
};
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
/**
|
|
21
|
+
* SIA with dummy data
|
|
22
|
+
*/
|
|
23
|
+
export declare const Default: Story;
|
|
24
|
+
export declare const WithPolygonAnnotations: Story;
|
|
25
|
+
export declare const WithBBoxAnnotations: Story;
|
|
26
|
+
export declare const WithLineAnnotations: Story;
|
|
27
|
+
export declare const WithPointAnnotations: Story;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { UiConfig } from '../../types';
|
|
3
|
+
export declare const ActionsData: {};
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: ({ additionalButtons, allowedTools: propAllowedTools, polygonOperationResult, annotationSettings: propAnnotationSettings, uiConfig: propUiConfig, defaultAnnotationTool, defaultLabelId, image, isLoading, isPolygonSelectionMode, initialAnnotations, initialImageLabelIds, initialIsImageJunk, possibleLabels, onAnnoCreated, onAnnoCreationFinished, onAnnoChanged, onAnnoDeleted, onImageLabelsChanged, onIsImageJunk, onNotification, onSelectAnnotation, }: {
|
|
7
|
+
additionalButtons?: import('react').ReactElement;
|
|
8
|
+
allowedTools?: import('../..').AllowedTools;
|
|
9
|
+
polygonOperationResult?: import('../..').PolygonOperationResult;
|
|
10
|
+
annotationSettings?: import('../..').AnnotationSettings;
|
|
11
|
+
defaultAnnotationTool?: import('../../models').AnnotationTool;
|
|
12
|
+
defaultLabelId?: number;
|
|
13
|
+
image?: string;
|
|
14
|
+
isLoading?: boolean;
|
|
15
|
+
isPolygonSelectionMode?: boolean;
|
|
16
|
+
initialAnnotations?: import('../..').ExternalAnnotation[];
|
|
17
|
+
initialImageLabelIds?: number[];
|
|
18
|
+
initialIsImageJunk?: boolean;
|
|
19
|
+
possibleLabels: import('../..').Label[];
|
|
20
|
+
uiConfig?: UiConfig;
|
|
21
|
+
onAnnoCreated?: (createdAnno: import('../../models').Annotation, allAnnos: import('../../models').Annotation[]) => void;
|
|
22
|
+
onAnnoCreationFinished?: (createdAnno: import('../../models').Annotation, allAnnos: import('../../models').Annotation[]) => void;
|
|
23
|
+
onAnnoChanged?: (changedAnno: import('../../models').Annotation, allAnnos: import('../../models').Annotation[]) => void;
|
|
24
|
+
onAnnoDeleted?: (deletedAnno: import('../../models').Annotation, allAnnos: import('../../models').Annotation[]) => void;
|
|
25
|
+
onImageLabelsChanged?: (selectedImageIds: number[]) => void;
|
|
26
|
+
onIsImageJunk?: (isJunk: boolean) => void;
|
|
27
|
+
onNotification?: (notification: import('../..').SIANotification) => void;
|
|
28
|
+
onSelectAnnotation?: (annotation: import('../../models').Annotation) => void;
|
|
29
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
parameters: {
|
|
31
|
+
layout: string;
|
|
32
|
+
};
|
|
33
|
+
tags: string[];
|
|
34
|
+
excludeStories: RegExp;
|
|
35
|
+
args: {};
|
|
36
|
+
decorators: ((Story: import('storybook/internal/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
|
|
37
|
+
additionalButtons?: import('react').ReactElement;
|
|
38
|
+
allowedTools?: import('../..').AllowedTools;
|
|
39
|
+
polygonOperationResult?: import('../..').PolygonOperationResult;
|
|
40
|
+
annotationSettings?: import('../..').AnnotationSettings;
|
|
41
|
+
defaultAnnotationTool?: import('../../models').AnnotationTool;
|
|
42
|
+
defaultLabelId?: number;
|
|
43
|
+
image?: string;
|
|
44
|
+
isLoading?: boolean;
|
|
45
|
+
isPolygonSelectionMode?: boolean;
|
|
46
|
+
initialAnnotations?: import('../..').ExternalAnnotation[];
|
|
47
|
+
initialImageLabelIds?: number[];
|
|
48
|
+
initialIsImageJunk?: boolean;
|
|
49
|
+
possibleLabels: import('../..').Label[];
|
|
50
|
+
uiConfig?: UiConfig;
|
|
51
|
+
onAnnoCreated?: (createdAnno: import('../../models').Annotation, allAnnos: import('../../models').Annotation[]) => void;
|
|
52
|
+
onAnnoCreationFinished?: (createdAnno: import('../../models').Annotation, allAnnos: import('../../models').Annotation[]) => void;
|
|
53
|
+
onAnnoChanged?: (changedAnno: import('../../models').Annotation, allAnnos: import('../../models').Annotation[]) => void;
|
|
54
|
+
onAnnoDeleted?: (deletedAnno: import('../../models').Annotation, allAnnos: import('../../models').Annotation[]) => void;
|
|
55
|
+
onImageLabelsChanged?: (selectedImageIds: number[]) => void;
|
|
56
|
+
onIsImageJunk?: (isJunk: boolean) => void;
|
|
57
|
+
onNotification?: (notification: import('../..').SIANotification) => void;
|
|
58
|
+
onSelectAnnotation?: (annotation: import('../../models').Annotation) => void;
|
|
59
|
+
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
60
|
+
};
|
|
61
|
+
export default meta;
|
|
62
|
+
type Story = StoryObj<typeof meta>;
|
|
63
|
+
/**
|
|
64
|
+
* SIA with dummy data
|
|
65
|
+
*/
|
|
66
|
+
export declare const Default: Story;
|
|
67
|
+
/**
|
|
68
|
+
* Minimal SIA example
|
|
69
|
+
*/
|
|
70
|
+
export declare const Minimal: Story;
|
|
71
|
+
export declare const Loading: Story;
|
|
72
|
+
export declare const Junk: Story;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ name, color, size: bodySize, style, triangleSize, onClick, }: {
|
|
5
|
+
name: string;
|
|
6
|
+
color?: string;
|
|
7
|
+
size?: number;
|
|
8
|
+
style?: import('react').CSSProperties;
|
|
9
|
+
triangleSize?: number;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
argTypes: {};
|
|
13
|
+
parameters: {
|
|
14
|
+
layout: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
export declare const Default: Story;
|
|
20
|
+
export declare const DifferentColor: Story;
|
|
21
|
+
export declare const DifferentSize: Story;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: () => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
type Story = StoryObj<typeof meta>;
|
|
11
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as AnnotationTool } from '../../models/AnnotationTool';
|
|
3
|
+
import { AllowedTools, AnnotationSettings } from '../../types';
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: ({ annotationSettings, allowedTools, additionalButtons, isImageJunk, imageLabelIds, isDisabled, isFullscreen, possibleLabels, selectedTool, onImageLabelsChanged, onSetIsFullscreen, onSetIsImageJunk, onSetSelectedTool, onShouldDeleteSelectedAnnotation, }: {
|
|
7
|
+
annotationSettings: AnnotationSettings;
|
|
8
|
+
allowedTools: AllowedTools;
|
|
9
|
+
additionalButtons?: import('react').ReactElement;
|
|
10
|
+
isImageJunk?: boolean;
|
|
11
|
+
imageLabelIds?: number[];
|
|
12
|
+
isDisabled?: boolean;
|
|
13
|
+
isFullscreen?: boolean;
|
|
14
|
+
possibleLabels: import('../..').Label[];
|
|
15
|
+
selectedTool: AnnotationTool;
|
|
16
|
+
onImageLabelsChanged?: (selectedImageIds: number[]) => void;
|
|
17
|
+
onSetIsFullscreen?: (isFullscreen: boolean) => void;
|
|
18
|
+
onSetIsImageJunk?: (isImageJunk: boolean) => void;
|
|
19
|
+
onSetSelectedTool?: (selectedTool: AnnotationTool) => void;
|
|
20
|
+
onShouldDeleteSelectedAnnotation?: () => void;
|
|
21
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
argTypes: {
|
|
23
|
+
selectedTool: {
|
|
24
|
+
control: "select";
|
|
25
|
+
options: AnnotationTool[];
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
parameters: {
|
|
29
|
+
layout: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export default meta;
|
|
33
|
+
type Story = StoryObj<typeof meta>;
|
|
34
|
+
export declare const Default: Story;
|
|
35
|
+
export declare const DifferentDefaultTool: Story;
|
|
36
|
+
export declare const LimitedAllowedTools: Story;
|
|
37
|
+
export declare const WithImageLabels: Story;
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { default as Annotation } from './Annotation/logic/Annotation';
|
|
2
|
+
import { AnnotationStatus, AnnotationTool } from './models';
|
|
3
|
+
import { default as NotificationType } from './models/NotificationType';
|
|
4
|
+
export type AllowedTools = {
|
|
5
|
+
bbox: boolean;
|
|
6
|
+
junk: boolean;
|
|
7
|
+
line: boolean;
|
|
8
|
+
point: boolean;
|
|
9
|
+
polygon: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type AnnotationSettings = {
|
|
12
|
+
minimalArea?: number;
|
|
13
|
+
canHaveMultipleLabels: boolean;
|
|
14
|
+
canEdit?: boolean;
|
|
15
|
+
canCreate: boolean;
|
|
16
|
+
canLabel: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type ExternalAnnotation = {
|
|
19
|
+
externalId?: string;
|
|
20
|
+
annoTime?: number;
|
|
21
|
+
coordinates: Point[];
|
|
22
|
+
status: AnnotationStatus;
|
|
23
|
+
labelIds: number[];
|
|
24
|
+
type: AnnotationTool;
|
|
25
|
+
};
|
|
26
|
+
export type Label = {
|
|
27
|
+
id: number;
|
|
28
|
+
name: string;
|
|
29
|
+
description: string;
|
|
30
|
+
color?: string;
|
|
31
|
+
};
|
|
32
|
+
export type Point = {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
};
|
|
36
|
+
export type PolygonOperationResult = {
|
|
37
|
+
polygonsToCreate: ToolCoordinates[];
|
|
38
|
+
annotationsToDelete: Annotation[];
|
|
39
|
+
};
|
|
40
|
+
export type SIANotification = {
|
|
41
|
+
title: string;
|
|
42
|
+
message: string;
|
|
43
|
+
type: NotificationType;
|
|
44
|
+
};
|
|
45
|
+
export type ToolCoordinates = {
|
|
46
|
+
coordinates: Point[];
|
|
47
|
+
type: AnnotationTool;
|
|
48
|
+
};
|
|
49
|
+
export type UiConfig = {
|
|
50
|
+
strokeWidth: number;
|
|
51
|
+
nodeRadius: number;
|
|
52
|
+
imageCentered: boolean;
|
|
53
|
+
};
|
|
54
|
+
export type Vector2 = {
|
|
55
|
+
x: number;
|
|
56
|
+
y: number;
|
|
57
|
+
};
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as KeyAction } from '../models/KeyAction';
|
|
2
|
+
declare class KeyMapper {
|
|
3
|
+
isControlDown: boolean;
|
|
4
|
+
keyActionHandler: ((keyAction: any) => void) | undefined;
|
|
5
|
+
constructor(keyActionHandler?: ((keyAction: any) => void) | undefined);
|
|
6
|
+
keyDown(key: string, isShiftKeyPressed?: boolean, isCtrlKeyPressed?: boolean): boolean;
|
|
7
|
+
triggerKeyAction(keyAction: KeyAction): void;
|
|
8
|
+
}
|
|
9
|
+
export default KeyMapper;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c=Object.defineProperty;var s=(i,t,r)=>t in i?c(i,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[t]=r;var A=(i,t,r)=>s(i,typeof t!="symbol"?t+"":t,r);import e from"../models/KeyAction.js";class o{constructor(t=void 0){A(this,"isControlDown",!1);A(this,"keyActionHandler");this.keyActionHandler=t}keyDown(t,r=!1,a=!1){switch(t){case"Enter":this.triggerKeyAction(e.EDIT_LABEL);break;case"Delete":this.triggerKeyAction(e.DELETE_ANNO);break;case"Backspace":this.triggerKeyAction(e.DELETE_ANNO);break;case"z":a&&this.triggerKeyAction(e.UNDO);break;case"y":a&&this.triggerKeyAction(e.REDO);break;case"Tab":r?this.triggerKeyAction(e.TRAVERSE_ANNOS_BACKWARDS):this.triggerKeyAction(e.TRAVERSE_ANNOS);break;case"w":this.triggerKeyAction(e.CAM_MOVE_UP);break;case"s":this.triggerKeyAction(e.CAM_MOVE_DOWN);break;case"a":this.triggerKeyAction(e.CAM_MOVE_LEFT);break;case"d":this.triggerKeyAction(e.CAM_MOVE_RIGHT);break;case"e":this.triggerKeyAction(e.RECREATE_ANNO);break;case"j":this.triggerKeyAction(e.TOGGLE_IMAGE_JUNK);break;case"c":a?this.triggerKeyAction(e.COPY_ANNOTATION):this.triggerKeyAction(e.TOGGLE_ANNO_COMMENT_INPUT);break;case"v":a&&this.triggerKeyAction(e.PASTE_ANNOTATION);break;case"Escape":this.triggerKeyAction(e.DELETE_ANNO_IN_CREATION);break;default:return!1}return!0}triggerKeyAction(t){this.keyActionHandler&&this.keyActionHandler(t)}}export{o as default};
|