lost-sia 2.0.1-alpha9 → 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 -1
- package/dist/Annotation/ui/AnnotationComponent.d.ts +24 -0
- package/dist/Annotation/ui/AnnotationComponent.js +1 -1
- package/dist/Annotation/ui/atoms/AnnoBar.d.ts +15 -0
- package/dist/Annotation/ui/atoms/AnnoBar.js +1 -1
- package/dist/Annotation/ui/atoms/DaviIcon.d.ts +9 -0
- package/dist/Annotation/ui/atoms/Edge.d.ts +17 -0
- package/dist/Annotation/ui/atoms/Edge.js +1 -1
- package/dist/Annotation/ui/atoms/Node.d.ts +17 -0
- package/dist/Annotation/ui/atoms/Node.js +1 -1
- package/dist/Annotation/ui/atoms/PolygonArea.d.ts +16 -0
- package/dist/Annotation/ui/atoms/PolygonArea.js +1 -1
- package/dist/Annotation/ui/tools/BBox.d.ts +21 -0
- package/dist/Annotation/ui/tools/BBox.js +1 -1
- package/dist/Annotation/ui/tools/Line.d.ts +21 -0
- package/dist/Annotation/ui/tools/Line.js +1 -1
- package/dist/Annotation/ui/tools/Point.d.ts +16 -0
- package/dist/Annotation/ui/tools/Point.js +1 -1
- package/dist/Annotation/ui/tools/Polygon.d.ts +23 -0
- package/dist/Annotation/ui/tools/Polygon.js +1 -1
- package/dist/Canvas/Canvas.d.ts +31 -0
- package/dist/Canvas/Canvas.js +1 -1
- package/dist/Canvas/LabelInput.d.ts +11 -0
- package/dist/Canvas/LabelInput.js +1 -1
- 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 -1
- package/dist/Toolbar/Toolbar.d.ts +21 -0
- package/dist/Toolbar/Toolbar.js +1 -1
- package/dist/Toolbar/ToolbarItems/AccessibilityTools.d.ts +7 -0
- package/dist/Toolbar/ToolbarItems/AccessibilityTools.js +1 -1
- package/dist/Toolbar/ToolbarItems/AnnoToolSelector.d.ts +11 -0
- package/dist/Toolbar/ToolbarItems/AnnoToolSelector.js +1 -1
- 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 -1
- package/dist/Toolbar/ToolbarItems/ImageTools.d.ts +13 -0
- package/dist/Toolbar/ToolbarItems/ImageTools.js +1 -1
- package/dist/Toolbar/ToolbarItems/Instructions.d.ts +2 -0
- package/dist/Toolbar/ToolbarItems/InstructionsModal.d.ts +6 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +1 -1
- package/dist/models/AnnotationMode.d.ts +11 -0
- package/dist/models/AnnotationStatus.d.ts +8 -0
- package/dist/models/AnnotationTool.d.ts +7 -0
- package/dist/models/CanvasAction.d.ts +28 -0
- package/dist/models/Direction.d.ts +7 -0
- package/dist/models/EditorModes.d.ts +11 -0
- package/dist/models/KeyAction.d.ts +22 -0
- package/dist/models/KeyAction.js +1 -1
- 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 -1
- 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/utils/KeyMapper.d.ts +9 -0
- package/dist/utils/KeyMapper.js +1 -1
- 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/index.d.ts +2 -0
- package/dist/utils/index.js +1 -1
- package/dist/utils/mouse.d.ts +6 -0
- package/dist/utils/mouse.js +1 -1
- package/dist/utils/siaIcons.js +5 -5
- package/dist/utils/transform.d.ts +28 -0
- package/dist/utils/transform.js +1 -1
- package/dist/utils/windowViewport.d.ts +22 -0
- package/dist/utils/windowViewport.js +1 -1
- 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/dist/AnnoExampleViewer.cjs +0 -1
- package/dist/AnnoExampleViewer.js +0 -1
- package/dist/AnnoLabelInput.cjs +0 -1
- package/dist/AnnoLabelInput.js +0 -1
- package/dist/AnnoToolBar.cjs +0 -19
- package/dist/AnnoToolBar.js +0 -19
- package/dist/Annotation/AnnoBar.cjs +0 -1
- package/dist/Annotation/AnnoBar.js +0 -1
- package/dist/Annotation/Annotation.cjs +0 -1
- package/dist/Annotation/Annotation.js +0 -1
- package/dist/Annotation/BBox.cjs +0 -1
- package/dist/Annotation/BBox.js +0 -1
- package/dist/Annotation/Edge.cjs +0 -1
- package/dist/Annotation/Edge.js +0 -1
- package/dist/Annotation/InfSelectionArea.cjs +0 -1
- package/dist/Annotation/InfSelectionArea.js +0 -1
- package/dist/Annotation/Line.cjs +0 -1
- package/dist/Annotation/Line.js +0 -1
- package/dist/Annotation/Node.cjs +0 -1
- package/dist/Annotation/Node.js +0 -1
- package/dist/Annotation/Point.cjs +0 -1
- package/dist/Annotation/Point.js +0 -1
- package/dist/Annotation/Polygon.cjs +0 -1
- package/dist/Annotation/Polygon.js +0 -1
- package/dist/Annotation/logic/Annotation.cjs +0 -1
- package/dist/Annotation/logic/AnnotationUtils.cjs +0 -1
- package/dist/Annotation/logic/AnnotationUtils.js +0 -1
- package/dist/Annotation/ui/AnnotationComponent.cjs +0 -1
- package/dist/Annotation/ui/atoms/AnnoBar.cjs +0 -1
- package/dist/Annotation/ui/atoms/DaviIcon.cjs +0 -19
- package/dist/Annotation/ui/atoms/Edge.cjs +0 -1
- package/dist/Annotation/ui/atoms/Node.cjs +0 -1
- package/dist/Annotation/ui/atoms/PolygonArea.cjs +0 -1
- package/dist/Annotation/ui/tools/BBox.cjs +0 -1
- package/dist/Annotation/ui/tools/Line.cjs +0 -1
- package/dist/Annotation/ui/tools/Point.cjs +0 -1
- package/dist/Annotation/ui/tools/Polygon.cjs +0 -1
- package/dist/Canvas/Canvas.cjs +0 -1
- package/dist/Canvas/LabelInput.cjs +0 -1
- package/dist/Canvas.cjs +0 -1
- package/dist/Canvas.js +0 -1
- package/dist/ImgBar.cjs +0 -1
- package/dist/ImgBar.js +0 -1
- package/dist/InfoBoxes/AnnoDetails.cjs +0 -1
- package/dist/InfoBoxes/AnnoDetails.js +0 -1
- package/dist/InfoBoxes/AnnoStats.cjs +0 -1
- package/dist/InfoBoxes/AnnoStats.js +0 -1
- package/dist/InfoBoxes/InfoBox.cjs +0 -1
- package/dist/InfoBoxes/InfoBox.js +0 -1
- package/dist/InfoBoxes/InfoBoxArea.cjs +0 -1
- package/dist/InfoBoxes/InfoBoxArea.js +0 -1
- package/dist/InfoBoxes/LabelInfo.cjs +0 -1
- package/dist/InfoBoxes/LabelInfo.js +0 -1
- package/dist/LabelInput.cjs +0 -1
- package/dist/LabelInput.js +0 -1
- package/dist/Prompt.cjs +0 -1
- package/dist/Prompt.js +0 -1
- package/dist/SIAFilterButton.cjs +0 -1
- package/dist/SIAFilterButton.js +0 -1
- package/dist/SIASettingButton.cjs +0 -1
- package/dist/SIASettingButton.js +0 -1
- package/dist/Sia.cjs +0 -1
- package/dist/Sia2.cjs +0 -1
- package/dist/Sia2.js +0 -1
- package/dist/SiaPopup.cjs +0 -1
- package/dist/SiaPopup.js +0 -1
- package/dist/ToolBar.cjs +0 -1
- package/dist/ToolBar.js +0 -1
- package/dist/Toolbar/NavigationButtons.cjs +0 -1
- package/dist/Toolbar/NavigationButtons.js +0 -1
- package/dist/Toolbar/Toolbar.cjs +0 -1
- package/dist/Toolbar/ToolbarItems/AccessibilityTools.cjs +0 -1
- package/dist/Toolbar/ToolbarItems/AnnoToolSelector.cjs +0 -1
- package/dist/Toolbar/ToolbarItems/ImageToolItems/ImageLabel.cjs +0 -1
- package/dist/Toolbar/ToolbarItems/ImageToolItems/ImageLabel.js +0 -1
- package/dist/Toolbar/ToolbarItems/ImageToolItems/TagLabel.cjs +0 -1
- package/dist/Toolbar/ToolbarItems/ImageTools.cjs +0 -1
- package/dist/Toolbar/ToolbarItems/Instructions.cjs +0 -1
- package/dist/Toolbar/ToolbarItems/InstructionsModal.cjs +0 -1
- package/dist/ToolbarItem.cjs +0 -1
- package/dist/ToolbarItem.js +0 -1
- package/dist/_virtual/_commonjsHelpers.cjs +0 -1
- package/dist/_virtual/_commonjsHelpers.js +0 -1
- package/dist/_virtual/lodash.cjs +0 -1
- package/dist/_virtual/lodash.js +0 -1
- package/dist/assets/Annotation/Annotation-Cd5Ua5TG.css +0 -1
- package/dist/assets/Toolbar-Cp1xyYeH.css +0 -1
- package/dist/filterTools.cjs +0 -1
- package/dist/filterTools.js +0 -1
- package/dist/index.cjs +0 -1
- package/dist/models/AllowedTools.cjs +0 -1
- package/dist/models/AllowedTools.js +0 -1
- package/dist/models/AnnotationMode.cjs +0 -1
- package/dist/models/AnnotationSettings.cjs +0 -1
- package/dist/models/AnnotationSettings.js +0 -1
- package/dist/models/AnnotationStatus.cjs +0 -1
- package/dist/models/AnnotationTool.cjs +0 -1
- package/dist/models/CanvasAction.cjs +0 -1
- package/dist/models/Direction.cjs +0 -1
- package/dist/models/EditorModes.cjs +0 -1
- package/dist/models/ExternalAnnotation.cjs +0 -1
- package/dist/models/ExternalAnnotation.js +0 -1
- package/dist/models/KeyAction.cjs +0 -1
- package/dist/models/Label.cjs +0 -1
- package/dist/models/Label.js +0 -1
- package/dist/models/UiConfig.cjs +0 -1
- package/dist/models/UiConfig.js +0 -1
- package/dist/models/index.cjs +0 -1
- package/dist/siaDummyData.cjs +0 -7
- package/dist/siaDummyData.js +0 -7
- package/dist/stories/Canvas/CanvasOffset.cjs +0 -1
- package/dist/stories/Canvas/CanvasOffset.js +0 -1
- package/dist/stories/FilterDropdown.stories.cjs +0 -1
- package/dist/stories/FilterDropdown.stories.js +0 -1
- package/dist/stories/SIA2/DemoWrapper.cjs +0 -1
- package/dist/stories/SIA2/DemoWrapper.js +0 -1
- package/dist/stories/siaDummyData.cjs +0 -1
- package/dist/stories/siaDummyData.js +0 -1
- package/dist/stories/siaDummyData2.cjs +0 -7
- package/dist/stories/siaDummyData2.js +0 -7
- package/dist/types/annoStatus.cjs +0 -1
- package/dist/types/annoStatus.js +0 -1
- package/dist/types/canvasActions.cjs +0 -1
- package/dist/types/canvasActions.js +0 -1
- package/dist/types/cursorstyles.cjs +0 -1
- package/dist/types/cursorstyles.js +0 -1
- package/dist/types/modes.cjs +0 -1
- package/dist/types/modes.js +0 -1
- package/dist/types/notificationType.cjs +0 -1
- package/dist/types/notificationType.js +0 -1
- package/dist/types/toolbarEvents.cjs +0 -1
- package/dist/types/toolbarEvents.js +0 -1
- package/dist/types/tools.cjs +0 -1
- package/dist/types/tools.js +0 -1
- package/dist/types.cjs +0 -1
- package/dist/utils/KeyMapper.cjs +0 -1
- package/dist/utils/annoConversion.cjs +0 -1
- package/dist/utils/annoConversion.js +0 -1
- package/dist/utils/annoConversion2.cjs +0 -1
- package/dist/utils/annoConversion2.js +0 -1
- package/dist/utils/color.cjs +0 -1
- package/dist/utils/colorlut.cjs +0 -1
- package/dist/utils/colorlut.js +0 -1
- package/dist/utils/constraints.cjs +0 -1
- package/dist/utils/constraints.js +0 -1
- package/dist/utils/hist.cjs +0 -1
- package/dist/utils/hist.js +0 -1
- package/dist/utils/index.cjs +0 -1
- package/dist/utils/keyActions.cjs +0 -1
- package/dist/utils/keyActions.js +0 -1
- package/dist/utils/mouse.cjs +0 -1
- package/dist/utils/mouse2.cjs +0 -1
- package/dist/utils/mouse2.js +0 -1
- package/dist/utils/siaIcons.cjs +0 -12
- package/dist/utils/transform.cjs +0 -1
- package/dist/utils/transform2.cjs +0 -1
- package/dist/utils/transform2.js +0 -1
- package/dist/utils/uiConfig.cjs +0 -1
- package/dist/utils/windowViewport.cjs +0 -1
- package/dist/utils/windowViewport2.cjs +0 -1
- package/dist/utils/windowViewport2.js +0 -1
- 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,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
|
+
};
|
|
@@ -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;
|
package/dist/utils/KeyMapper.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../models/KeyAction.js";class
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const r=(t,o)=>{const n=((o-t)/1e3).toFixed(2);return Number.parseFloat(n)},d={getRoundedDuration:r};export{d as default};
|
package/dist/utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SIA_INITIAL_UI_CONFIG as
|
|
1
|
+
import{default as e}from"./TimeUtils.js";import{SIA_INITIAL_UI_CONFIG as i,uiConfig as r}from"./uiConfig.js";export{i as SIA_INITIAL_UI_CONFIG,e as TimeUtils,r as uiConfig};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
|
+
import { Point, Vector2 } from '../types';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
getAntiScaledMouseStagePosition: (e: MouseEvent, pageToStageOffset: Point, svgScale: number, svgTranslation: Vector2) => Point;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
package/dist/utils/mouse.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const d=(o,t,e,s)=>{const a={x:o.pageX,y:o.pageY},n={x:a.x-t.x,y:a.y-t.y},x={x:n.x/e,y:n.y/e};return{x:x.x-s.x,y:x.y-s.y}},y={getAntiScaledMouseStagePosition:d};export{y as default};
|
package/dist/utils/siaIcons.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{jsx as n}from"react/jsx-runtime";
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";function o(){return n("svg",{version:"1.1",id:"Linie",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1190.549 841.891",width:"17px",children:n("path",{fill:"currentColor",d:`M986.331,109.582c7.141-10.669,28.926-51.179-2.968-85.299S891.011,8.972,891.011,8.972L539.125,133.474
|
|
2
2
|
L63.239,302.022c-21.503,7.998-53.586,30.072-60.956,61.716s-2.116,58.538,22.414,96.79S211.33,752.213,228.564,777.28
|
|
3
3
|
c26.453,36.868,62.16,58.042,105.507,57.154s365.665-7.485,365.665-7.485l331.7-8.325l89.453-2.293c0,0,70.998-7.179,69.861-60.287
|
|
4
4
|
c-1.135-53.108-74.618-62.721-74.618-62.721s-733.215,15.553-749.148,15.576c-22.688,0.201-45.355-15.278-54.146-28.928
|
|
5
5
|
s-175.79-272.956-175.79-272.956l600.587-212.338c0,0-73.179,67.087-99.315,100.041s-30.56,74.565-5.053,95.237
|
|
6
|
-
c31.188,24.081,91.974-3.708,123.127-39.312C782.35,323.912,979.191,120.251,986.331,109.582z`})})}function
|
|
6
|
+
c31.188,24.081,91.974-3.708,123.127-39.312C782.35,323.912,979.191,120.251,986.331,109.582z`})})}function r(){return n("svg",{version:"1.1",id:"Linie",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1190.549 841.891",width:"17px",children:n("path",{fill:"none",stroke:"currentColor",strokeWidth:"120",strokeMiterlimit:"10",d:`M929.775,710.655
|
|
7
7
|
c0,23.386-19.134,42.52-42.52,42.52H278.991c-23.386,0-42.52-19.134-42.52-42.52V102.392c0-23.386,19.134-42.52,42.52-42.52
|
|
8
|
-
h608.264c23.386,0,42.52,19.134,42.52,42.52V710.655z`})})}function
|
|
8
|
+
h608.264c23.386,0,42.52,19.134,42.52,42.52V710.655z`})})}function t(){return n("svg",{version:"1.1",id:"Linie",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1190.549 841.891",width:"17px",children:n("path",{fill:"none",stroke:"currentColor",strokeWidth:"120",strokeMiterlimit:"10",d:`M342.327,769.938
|
|
9
9
|
c-23.379,0.548-52.922-15.056-65.65-34.674L65.479,409.738c-12.729-19.619-5.085-41.998,16.984-49.732L917.331,67.421
|
|
10
10
|
c22.07-7.734,26.86-0.275,10.645,16.576L691.761,329.475c-16.216,16.852-14.503,42.542,3.807,57.092l425.212,337.901
|
|
11
|
-
c18.31,14.549,14.16,26.901-9.219,27.449L342.327,769.938z`})})}function
|
|
12
|
-
c0-151.356,122.7-274.057,274.057-274.057C625.497,134.229,748.197,256.929,748.197,408.286z`})})}export{
|
|
11
|
+
c18.31,14.549,14.16,26.901-9.219,27.449L342.327,769.938z`})})}function c(){return n("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1190.549 841.891",width:"17px",children:n("path",{fill:"currentColor",d:`M748.197,408.286c0,151.355-122.699,274.058-274.059,274.058c-151.357,0-274.057-122.703-274.057-274.058
|
|
12
|
+
c0-151.356,122.7-274.057,274.057-274.057C625.497,134.229,748.197,256.929,748.197,408.286z`})})}export{r as bBoxIcon,o as lineIcon,c as pointIcon,t as polygonIcon};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Point, Vector2 } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Get point that is closest to the left browser side.
|
|
4
|
+
*
|
|
5
|
+
* @param points list of points {x,y}
|
|
6
|
+
* @returns {object} A list of point [{x,y}...]. Multiple points are
|
|
7
|
+
* returned when multiple points have the same distance to the left side.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getMostLeftPoints: (points: Point[]) => Point[];
|
|
10
|
+
/**
|
|
11
|
+
* Get point that is closest to the top of the browser.
|
|
12
|
+
*
|
|
13
|
+
* @param points list of points [x,y]
|
|
14
|
+
* @returns A list of point [[x,y]...]. Multiple points are
|
|
15
|
+
* returned when multiple points have the same distance to the top.
|
|
16
|
+
*/
|
|
17
|
+
export declare const getTopPoint: (points: Point[]) => Point[];
|
|
18
|
+
declare const _default: {
|
|
19
|
+
convertImageCoordinatesToStage: (imageCoordinates: Point[], imageSize: Vector2, stageSize: Vector2) => Point[];
|
|
20
|
+
convertPercentagedCoordinatesToImage: (percentagedCoordinates: Point[], imageSize: Vector2) => Point[];
|
|
21
|
+
convertPercentagedCoordinatesToStage: (percentagedCoordinates: Point[], imageSize: Vector2, stageSize: Vector2) => Point[];
|
|
22
|
+
convertStageCoordinatesToImage: (stageCoordinates: Point[], imageToStageFactor: number) => Point[];
|
|
23
|
+
convertStageCoordinatesToPercentaged: (scaledCoordinates: Point[], imageToStageFactor: number, imageSize: Vector2) => Point[];
|
|
24
|
+
convertStageToPage: (stageCoordinates: Point, pageToStageOffset: Point, svgScale: number, svgTranslation: Vector2) => Point;
|
|
25
|
+
getMostLeftPoints: (points: Point[]) => Point[];
|
|
26
|
+
getTopPoint: (points: Point[]) => Point[];
|
|
27
|
+
};
|
|
28
|
+
export default _default;
|
package/dist/utils/transform.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const c=(r,o,t)=>{const e=t.x/o.x;return r.map(s=>({x:s.x*e,y:s.y*e}))},d=(r,o)=>r.map(e=>({x:e.x*o.x,y:e.y*o.y})),y=(r,o,t)=>{const e=d(r,o);return c(e,o,t)},x=(r,o)=>r.map(e=>({x:e.x/o,y:e.y/o})),C=(r,o,t)=>x(r,o).map(n=>(n.x<0&&(n.x=0),n.y<0&&(n.y=0),n.x>t.x&&(n.x=t.x),n.y>t.y&&(n.y=t.y),n)).map(n=>({x:n.x/t.x,y:n.y/t.y})),g=(r,o,t,e)=>{const a={x:r.x+e.x,y:r.y+e.y},s={x:a.x*t,y:a.y*t};return{x:s.x+o.x,y:s.y+o.y}},u=r=>{let o=1/0,t=[];return r.forEach(e=>{e.x<o?(o=e.x,t=[],t.push(e)):e.x===o&&t.push(e)}),t},m=r=>{let o=1/0,t=[];return r.forEach(e=>{e.y<o?(o=e.y,t=[],t.push(e)):e.y===o&&t.push(e)}),t},f={convertImageCoordinatesToStage:c,convertPercentagedCoordinatesToImage:d,convertPercentagedCoordinatesToStage:y,convertStageCoordinatesToImage:x,convertStageCoordinatesToPercentaged:C,convertStageToPage:g,getMostLeftPoints:u,getTopPoint:m};export{f as default,u as getMostLeftPoints,m as getTopPoint};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Point, Vector2 } from '../types';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
getViewportCoordinates: (svgTranslation: Vector2, canvasSize: Vector2, svgScale: number, pointInViewport: Point) => {
|
|
4
|
+
window: {
|
|
5
|
+
xMin: number;
|
|
6
|
+
xMax: number;
|
|
7
|
+
yMin: number;
|
|
8
|
+
yMax: number;
|
|
9
|
+
};
|
|
10
|
+
viewport: {
|
|
11
|
+
xMin: number;
|
|
12
|
+
xMax: number;
|
|
13
|
+
yMin: number;
|
|
14
|
+
yMax: number;
|
|
15
|
+
};
|
|
16
|
+
vX: number;
|
|
17
|
+
vY: number;
|
|
18
|
+
scaleX: number;
|
|
19
|
+
scaleY: number;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const d=(y,n,o,t)=>{const x={xMin:-1*y.x,xMax:-1*y.x+n.x/o,yMin:-1*y.y,yMax:-1*y.y+n.y/o},M={xMin:0,xMax:n.x,yMin:0,yMax:n.y},i=(M.xMax-M.xMin)/(x.xMax-x.xMin),c=(M.yMax-M.yMin)/(x.yMax-x.yMin),w=M.xMin+(t.x-x.xMin)*i,e=M.yMin+(t.y-x.yMin)*c;return{window:x,viewport:M,vX:w,vY:e,scaleX:i,scaleY:c}},r={getViewportCoordinates:d};export{r as default};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lost-sia",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Single Image Annotation Tool",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "l3p-cv/lost-sia",
|
|
7
|
-
"main": "
|
|
8
|
-
"module": "
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
9
|
"type": "module",
|
|
10
|
-
"types": "
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
11
|
"keywords": [
|
|
12
12
|
"lost",
|
|
13
13
|
"annotation",
|
|
@@ -20,22 +20,17 @@
|
|
|
20
20
|
},
|
|
21
21
|
"exports": {
|
|
22
22
|
".": {
|
|
23
|
-
"development": {
|
|
24
|
-
"types": "./src/types.ts",
|
|
25
|
-
"import": "./src/index.ts"
|
|
26
|
-
},
|
|
27
23
|
"types": "./dist/index.d.ts",
|
|
28
24
|
"import": "./dist/index.js",
|
|
29
25
|
"require": "./dist/index.js"
|
|
30
26
|
},
|
|
31
27
|
"./utils": {
|
|
32
|
-
"development": "./src/utils/index.js",
|
|
33
28
|
"types": "./dist/utils/index.d.ts",
|
|
34
29
|
"import": "./dist/utils/index.js",
|
|
35
30
|
"require": "./dist/utils/index.js"
|
|
36
31
|
},
|
|
37
32
|
"./models": {
|
|
38
|
-
"
|
|
33
|
+
"bun": "./src/models/index.js",
|
|
39
34
|
"types": "./dist/models/index.d.ts",
|
|
40
35
|
"import": "./dist/models/index.js",
|
|
41
36
|
"require": "./dist/models/index.js"
|
|
@@ -58,7 +53,8 @@
|
|
|
58
53
|
"start": "storybook dev -p 6006",
|
|
59
54
|
"storybook": "storybook dev -p 6006",
|
|
60
55
|
"build-storybook": "storybook build",
|
|
61
|
-
"format": "prettier --write src/"
|
|
56
|
+
"format": "prettier --write src/",
|
|
57
|
+
"pretty": "prettier --write \"./**/*.{js,jsx,mjs,cjs,ts,tsx,json}\""
|
|
62
58
|
},
|
|
63
59
|
"dependencies": {
|
|
64
60
|
"@fortawesome/free-regular-svg-icons": "^6.7.2",
|
|
@@ -72,28 +68,35 @@
|
|
|
72
68
|
"semantic-ui-react": "^2.0.3"
|
|
73
69
|
},
|
|
74
70
|
"peerDependencies": {
|
|
75
|
-
"@coreui/react": "^5.
|
|
71
|
+
"@coreui/react": "^5.9.1",
|
|
76
72
|
"prop-types": "^15.5.4",
|
|
77
73
|
"react": "^18.0.0",
|
|
78
74
|
"react-dom": "^18.0.0"
|
|
79
75
|
},
|
|
80
76
|
"devDependencies": {
|
|
77
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
78
|
+
"@eslint/js": "^9.39.1",
|
|
81
79
|
"@microsoft/api-extractor": "^7.52.13",
|
|
80
|
+
"@storybook/addon-docs": "^9.1.10",
|
|
82
81
|
"@storybook/addon-links": "^9.0.12",
|
|
83
82
|
"@storybook/react": "^9.0.12",
|
|
84
83
|
"@storybook/react-vite": "^9.0.12",
|
|
85
84
|
"@storybook/test": "9.0.0-alpha.2",
|
|
85
|
+
"@types/react": "^19.1.16",
|
|
86
|
+
"@typescript-eslint/eslint-plugin": "^8.46.1",
|
|
87
|
+
"@typescript-eslint/parser": "^8.46.1",
|
|
86
88
|
"@vitejs/plugin-react": "^4.3.0",
|
|
87
89
|
"cross-env": "^7.0.3",
|
|
88
|
-
"eslint": "^
|
|
90
|
+
"eslint": "^9.39.1",
|
|
89
91
|
"eslint-config-standard": "^17.1.0",
|
|
90
92
|
"eslint-config-standard-react": "^13.0.0",
|
|
91
93
|
"eslint-plugin-import": "^2.29.1",
|
|
92
94
|
"eslint-plugin-node": "^11.1.0",
|
|
93
|
-
"eslint-plugin-promise": "^
|
|
94
|
-
"eslint-plugin-react": "^7.
|
|
95
|
+
"eslint-plugin-promise": "^7.2.1",
|
|
96
|
+
"eslint-plugin-react": "^7.37.5",
|
|
95
97
|
"eslint-plugin-standard": "^5.0.0",
|
|
96
|
-
"
|
|
98
|
+
"eslint-plugin-storybook": "^10.0.7",
|
|
99
|
+
"glob": "^11.0.3",
|
|
97
100
|
"lodash-es": "^4.17.21",
|
|
98
101
|
"prettier": "^3.3.3",
|
|
99
102
|
"react-redux": "^9.1.2",
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import Prompt from
|
|
2
|
-
import React from
|
|
3
|
-
import { Card, Image } from
|
|
1
|
+
import Prompt from './Prompt'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { Card, Image } from 'semantic-ui-react'
|
|
4
4
|
|
|
5
5
|
const LabelExampleViewer = (props) => {
|
|
6
6
|
const requestExample = (e) => {
|
|
7
|
-
e.stopPropagation()
|
|
7
|
+
e.stopPropagation()
|
|
8
8
|
if (props.onRequestExample) {
|
|
9
|
-
props.onRequestExample()
|
|
9
|
+
props.onRequestExample()
|
|
10
10
|
}
|
|
11
|
-
}
|
|
11
|
+
}
|
|
12
12
|
const renderContent = () => {
|
|
13
|
-
if (!props.lbl) return null
|
|
14
|
-
if (!props.exampleImg) return null
|
|
13
|
+
if (!props.lbl) return null
|
|
14
|
+
if (!props.exampleImg) return null
|
|
15
15
|
const description = (
|
|
16
16
|
<div>
|
|
17
17
|
{props.lbl.description}
|
|
18
18
|
<h4>Comment:</h4>
|
|
19
|
-
{props.exampleImg.anno ? props.exampleImg.anno.comment :
|
|
19
|
+
{props.exampleImg.anno ? props.exampleImg.anno.comment : 'no comment'}
|
|
20
20
|
</div>
|
|
21
|
-
)
|
|
21
|
+
)
|
|
22
22
|
return (
|
|
23
23
|
<div>
|
|
24
24
|
<Card
|
|
@@ -46,24 +46,24 @@ const LabelExampleViewer = (props) => {
|
|
|
46
46
|
{props.lbl.description}
|
|
47
47
|
<Image src={props.exampleImg.img} centered size='medium'></Image> */}
|
|
48
48
|
</div>
|
|
49
|
-
)
|
|
50
|
-
}
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
51
|
|
|
52
52
|
const handlePromptClick = () => {
|
|
53
53
|
if (props.onClose) {
|
|
54
|
-
props.onClose()
|
|
54
|
+
props.onClose()
|
|
55
55
|
}
|
|
56
|
-
}
|
|
56
|
+
}
|
|
57
57
|
|
|
58
58
|
return (
|
|
59
59
|
<Prompt
|
|
60
60
|
onClick={() => {
|
|
61
|
-
handlePromptClick()
|
|
61
|
+
handlePromptClick()
|
|
62
62
|
}}
|
|
63
63
|
active={props.active}
|
|
64
64
|
content={renderContent()}
|
|
65
65
|
/>
|
|
66
|
-
)
|
|
67
|
-
}
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
68
|
|
|
69
|
-
export default LabelExampleViewer
|
|
69
|
+
export default LabelExampleViewer
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import AnnotationMode from
|
|
2
|
-
import AnnotationStatus from
|
|
3
|
-
import AnnotationTool from
|
|
4
|
-
import { Point } from
|
|
1
|
+
import { AnnotationMode } from '../../models'
|
|
2
|
+
import AnnotationStatus from '../../models/AnnotationStatus'
|
|
3
|
+
import AnnotationTool from '../../models/AnnotationTool'
|
|
4
|
+
import { Point } from '../../types'
|
|
5
5
|
|
|
6
6
|
class Annotation {
|
|
7
|
-
internalId: number
|
|
8
|
-
externalId?: string
|
|
9
|
-
annoTime
|
|
10
|
-
coordinates: Point[]
|
|
11
|
-
labelIds?: number[]
|
|
12
|
-
mode: AnnotationMode
|
|
13
|
-
selectedNode: number
|
|
14
|
-
status
|
|
15
|
-
type: AnnotationTool
|
|
16
|
-
timestamp?: DOMHighResTimeStamp;
|
|
7
|
+
internalId: number
|
|
8
|
+
externalId?: string
|
|
9
|
+
annoTime: number
|
|
10
|
+
coordinates: Point[]
|
|
11
|
+
labelIds?: number[]
|
|
12
|
+
mode: AnnotationMode // do we even need this globally? - only really used inside AnnotationComponent
|
|
13
|
+
selectedNode: number
|
|
14
|
+
status: AnnotationStatus
|
|
15
|
+
type: AnnotationTool
|
|
17
16
|
|
|
18
17
|
constructor(
|
|
19
18
|
internalId: number,
|
|
@@ -21,19 +20,18 @@ class Annotation {
|
|
|
21
20
|
coordinates: Point[],
|
|
22
21
|
mode: AnnotationMode = AnnotationMode.CREATE,
|
|
23
22
|
status: AnnotationStatus = AnnotationStatus.CREATING,
|
|
24
|
-
externalId: string =
|
|
23
|
+
externalId: string = '',
|
|
25
24
|
) {
|
|
26
|
-
this.internalId = internalId
|
|
27
|
-
this.externalId = externalId
|
|
28
|
-
this.labelIds = []
|
|
29
|
-
this.type = type
|
|
30
|
-
this.mode = mode
|
|
31
|
-
this.status = status
|
|
32
|
-
this.coordinates = coordinates
|
|
33
|
-
this.selectedNode = 1
|
|
34
|
-
this.
|
|
35
|
-
this.annoTime = 0.0;
|
|
25
|
+
this.internalId = internalId
|
|
26
|
+
this.externalId = externalId
|
|
27
|
+
this.labelIds = []
|
|
28
|
+
this.type = type
|
|
29
|
+
this.mode = mode
|
|
30
|
+
this.status = status
|
|
31
|
+
this.coordinates = coordinates
|
|
32
|
+
this.selectedNode = 1
|
|
33
|
+
this.annoTime = 0
|
|
36
34
|
}
|
|
37
35
|
}
|
|
38
36
|
|
|
39
|
-
export default Annotation
|
|
37
|
+
export default Annotation
|