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
package/src/Annotation/Node.jsx
DELETED
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
import React, { Component } from "react";
|
|
2
|
-
import "./Annotation.scss";
|
|
3
|
-
import * as modes from "../types/modes";
|
|
4
|
-
import * as cursorstyles from "../types/cursorstyles";
|
|
5
|
-
|
|
6
|
-
class Node extends Component {
|
|
7
|
-
/*************
|
|
8
|
-
* LIFECYCLE *
|
|
9
|
-
**************/
|
|
10
|
-
constructor(props) {
|
|
11
|
-
super(props);
|
|
12
|
-
this.state = {
|
|
13
|
-
haloCss: "node-halo-off",
|
|
14
|
-
selAreaCss: "sel-area-off",
|
|
15
|
-
// anno: undefined,
|
|
16
|
-
nodeSelected: false,
|
|
17
|
-
style: {},
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
componentDidMount() {
|
|
22
|
-
this.setState({
|
|
23
|
-
// anno: this.props.anno,
|
|
24
|
-
style: {
|
|
25
|
-
...this.props.style,
|
|
26
|
-
cursor: this.getCursorStyle(this.props.mode),
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
// switch (this.props.mode){
|
|
30
|
-
// case modes.CREATE:
|
|
31
|
-
// if (this.props.idx !== 0){
|
|
32
|
-
// this.turnSelAreaOn()
|
|
33
|
-
// }
|
|
34
|
-
// default:
|
|
35
|
-
// break
|
|
36
|
-
// }
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
componentDidUpdate(prevProps) {
|
|
40
|
-
switch (this.props.mode) {
|
|
41
|
-
case modes.CREATE:
|
|
42
|
-
if (this.props.idx !== 0 || this.props.isPoint) {
|
|
43
|
-
this.turnSelAreaOn();
|
|
44
|
-
}
|
|
45
|
-
break;
|
|
46
|
-
case modes.EDIT:
|
|
47
|
-
this.turnSelAreaOn();
|
|
48
|
-
break;
|
|
49
|
-
default:
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
//on mode change
|
|
53
|
-
if (prevProps.mode !== this.props.mode) {
|
|
54
|
-
this.setState({
|
|
55
|
-
style: {
|
|
56
|
-
...this.state.style,
|
|
57
|
-
cursor: this.getCursorStyle(this.props.mode),
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
if (prevProps.style !== this.props.style) {
|
|
62
|
-
this.setState({
|
|
63
|
-
style: {
|
|
64
|
-
...this.state.style,
|
|
65
|
-
...this.props.style,
|
|
66
|
-
cursor: this.getCursorStyle(this.props.mode),
|
|
67
|
-
},
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/*************
|
|
73
|
-
* EVENTS *
|
|
74
|
-
**************/
|
|
75
|
-
|
|
76
|
-
onClick(e) {
|
|
77
|
-
this.turnHaloOn();
|
|
78
|
-
if (this.props.onClick) {
|
|
79
|
-
this.props.onClick(e, this.props.idx);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
onMouseMove(e) {
|
|
84
|
-
if (this.props.onMouseMove) {
|
|
85
|
-
this.props.onMouseMove(e, this.props.idx);
|
|
86
|
-
}
|
|
87
|
-
// switch (this.props.mode){
|
|
88
|
-
// case modes.CREATE:
|
|
89
|
-
// let newAnno = [...this.state.anno]
|
|
90
|
-
// const mousePos = mouse.getMousePosition(e, this.props.svg)
|
|
91
|
-
// newAnno[this.props.idx].x = mousePos.x
|
|
92
|
-
// newAnno[this.props.idx].y = mousePos.y
|
|
93
|
-
// this.setState({
|
|
94
|
-
// anno: newAnno
|
|
95
|
-
// })
|
|
96
|
-
// if (this.props.onAnnoUpdate){
|
|
97
|
-
// this.props.onAnnoUpdate(e, this.props.idx, newAnno)
|
|
98
|
-
// }
|
|
99
|
-
// default:
|
|
100
|
-
// break
|
|
101
|
-
// }
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
onContextMenu(e) {
|
|
105
|
-
e.preventDefault();
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
onMouseUp(e) {
|
|
109
|
-
switch (this.props.mode) {
|
|
110
|
-
case modes.EDIT:
|
|
111
|
-
switch (e.button) {
|
|
112
|
-
case 0:
|
|
113
|
-
this.turnSelAreaOff();
|
|
114
|
-
break;
|
|
115
|
-
default:
|
|
116
|
-
break;
|
|
117
|
-
}
|
|
118
|
-
break;
|
|
119
|
-
default:
|
|
120
|
-
break;
|
|
121
|
-
}
|
|
122
|
-
if (this.props.onMouseUp) {
|
|
123
|
-
this.props.onMouseUp(e, this.props.idx);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
onMouseDown(e) {
|
|
128
|
-
e.stopPropagation();
|
|
129
|
-
if (this.props.onMouseDown) {
|
|
130
|
-
this.props.onMouseDown(e, this.props.idx);
|
|
131
|
-
}
|
|
132
|
-
switch (this.props.mode) {
|
|
133
|
-
case modes.CREATE:
|
|
134
|
-
switch (e.button) {
|
|
135
|
-
case 0:
|
|
136
|
-
this.turnSelAreaOff();
|
|
137
|
-
break;
|
|
138
|
-
case 2:
|
|
139
|
-
this.turnSelAreaOff();
|
|
140
|
-
break;
|
|
141
|
-
default:
|
|
142
|
-
break;
|
|
143
|
-
}
|
|
144
|
-
// case modes.EDIT:
|
|
145
|
-
// switch (e.button){
|
|
146
|
-
// case 0:
|
|
147
|
-
// this.turnSelAreaOn()
|
|
148
|
-
// break
|
|
149
|
-
// default:
|
|
150
|
-
// break
|
|
151
|
-
// }
|
|
152
|
-
break;
|
|
153
|
-
default:
|
|
154
|
-
break;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
onMouseOver(e) {
|
|
159
|
-
if (this.props.isSelected) {
|
|
160
|
-
this.turnHaloOn();
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
onMouseLeave(e) {
|
|
165
|
-
if (this.props.isSelected) {
|
|
166
|
-
this.turnHaloOff();
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
onDoubleClick(e) {
|
|
171
|
-
if (this.props.onDoubleClick) {
|
|
172
|
-
this.props.onDoubleClick(e, this.props.idx);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
handleMouseLeave(e) {
|
|
177
|
-
if (this.props.onMouseLeave) {
|
|
178
|
-
this.props.onMouseLeave(e, this.props.idx);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/*************
|
|
183
|
-
* LOGIC *
|
|
184
|
-
**************/
|
|
185
|
-
getCursorStyle(mode) {
|
|
186
|
-
switch (mode) {
|
|
187
|
-
case modes.CREATE:
|
|
188
|
-
return cursorstyles.CREATE_NODE;
|
|
189
|
-
case modes.EDIT:
|
|
190
|
-
return cursorstyles.EDIT_NODE;
|
|
191
|
-
case modes.VIEW:
|
|
192
|
-
return cursorstyles.NORMAL_NODE;
|
|
193
|
-
default:
|
|
194
|
-
break;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
turnSelAreaOn() {
|
|
199
|
-
if (this.state.selAreaCss !== "sel-area-on") {
|
|
200
|
-
this.setState({
|
|
201
|
-
selAreaCss: "sel-area-on",
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
turnSelAreaOff() {
|
|
207
|
-
if (this.state.selAreaCss !== "sel-area-off") {
|
|
208
|
-
this.setState({
|
|
209
|
-
selAreaCss: "sel-area-off",
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
turnHaloOn() {
|
|
215
|
-
this.setState({
|
|
216
|
-
haloCss: "node-halo-on",
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
turnHaloOff() {
|
|
221
|
-
this.setState({
|
|
222
|
-
haloCss: "node-halo-off",
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
/*************
|
|
227
|
-
* RENDERING *
|
|
228
|
-
**************/
|
|
229
|
-
renderHalo() {
|
|
230
|
-
if (this.state.haloCss === "node-halo-off") return null;
|
|
231
|
-
const data = this.props.anno[this.props.idx];
|
|
232
|
-
|
|
233
|
-
return (
|
|
234
|
-
<circle
|
|
235
|
-
cx={data.x}
|
|
236
|
-
cy={data.y}
|
|
237
|
-
r={this.props.style.r * 3}
|
|
238
|
-
className={this.state.haloCss}
|
|
239
|
-
onMouseLeave={(e) => this.onMouseLeave(e)}
|
|
240
|
-
/>
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
renderNodes() {
|
|
244
|
-
const data = this.props.anno[this.props.idx];
|
|
245
|
-
if (data === undefined) {
|
|
246
|
-
return;
|
|
247
|
-
}
|
|
248
|
-
return (
|
|
249
|
-
<g
|
|
250
|
-
onClick={(e) => this.onClick(e)}
|
|
251
|
-
onMouseMove={(e) => this.onMouseMove(e)}
|
|
252
|
-
onContextMenu={(e) => this.onContextMenu(e)}
|
|
253
|
-
onMouseUp={(e) => this.onMouseUp(e)}
|
|
254
|
-
onMouseDown={(e) => this.onMouseDown(e)}
|
|
255
|
-
onDoubleClick={(e) => this.onDoubleClick(e)}
|
|
256
|
-
onMouseLeave={(e) => this.handleMouseLeave(e)}
|
|
257
|
-
>
|
|
258
|
-
<circle
|
|
259
|
-
cx={data.x}
|
|
260
|
-
cy={data.y}
|
|
261
|
-
r={"100%"}
|
|
262
|
-
className={this.state.selAreaCss}
|
|
263
|
-
/>
|
|
264
|
-
{this.renderHalo()}
|
|
265
|
-
<circle
|
|
266
|
-
cx={data.x}
|
|
267
|
-
cy={data.y}
|
|
268
|
-
r={3}
|
|
269
|
-
fill="red"
|
|
270
|
-
style={this.state.style}
|
|
271
|
-
className={this.props.className}
|
|
272
|
-
onMouseOver={(e) => this.onMouseOver(e)}
|
|
273
|
-
/>
|
|
274
|
-
</g>
|
|
275
|
-
);
|
|
276
|
-
}
|
|
277
|
-
render() {
|
|
278
|
-
return <g>{this.renderNodes()}</g>;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
export default Node;
|
package/src/Annotation/Point.jsx
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import React, { Component } from "react";
|
|
2
|
-
import InfSelectionArea from "./InfSelectionArea";
|
|
3
|
-
import Node from "./Node";
|
|
4
|
-
import * as modes from "../types/modes";
|
|
5
|
-
import * as transform from "../utils/transform";
|
|
6
|
-
import * as canvasActions from "../types/canvasActions";
|
|
7
|
-
|
|
8
|
-
class Point extends Component {
|
|
9
|
-
/*************
|
|
10
|
-
* LIFECYCLE *
|
|
11
|
-
**************/
|
|
12
|
-
constructor(props) {
|
|
13
|
-
super(props);
|
|
14
|
-
this.state = {
|
|
15
|
-
anno: undefined,
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
componentDidMount(prevProps) {
|
|
20
|
-
if (this.props.anno.mode === modes.CREATE) {
|
|
21
|
-
const data = this.props.anno.data[0];
|
|
22
|
-
const newAnno = {
|
|
23
|
-
...this.props.anno,
|
|
24
|
-
data: [{ x: data.x, y: data.y }],
|
|
25
|
-
selectedNode: 0,
|
|
26
|
-
};
|
|
27
|
-
this.setState({
|
|
28
|
-
anno: newAnno,
|
|
29
|
-
});
|
|
30
|
-
} else {
|
|
31
|
-
this.setState({ anno: { ...this.props.anno } });
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
componentDidUpdate(prevProps) {
|
|
36
|
-
if (prevProps.anno !== this.props.anno) {
|
|
37
|
-
this.setState({ anno: { ...this.props.anno } });
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**************
|
|
42
|
-
* ANNO EVENTS *
|
|
43
|
-
***************/
|
|
44
|
-
onMouseMove(e) {
|
|
45
|
-
switch (this.state.anno.mode) {
|
|
46
|
-
case modes.MOVE:
|
|
47
|
-
this.move(
|
|
48
|
-
e.movementX / this.props.svg.scale,
|
|
49
|
-
e.movementY / this.props.svg.scale,
|
|
50
|
-
);
|
|
51
|
-
break;
|
|
52
|
-
default:
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
onMouseUp(e) {
|
|
58
|
-
switch (this.state.anno.mode) {
|
|
59
|
-
case modes.MOVE:
|
|
60
|
-
if (e.button === 0) {
|
|
61
|
-
this.requestModeChange(this.state.anno, modes.VIEW);
|
|
62
|
-
this.performedAction(this.state.anno, canvasActions.ANNO_MOVED);
|
|
63
|
-
}
|
|
64
|
-
break;
|
|
65
|
-
case modes.CREATE:
|
|
66
|
-
this.requestModeChange(this.state.anno, modes.VIEW);
|
|
67
|
-
|
|
68
|
-
this.performedAction(this.state.anno, canvasActions.ANNO_CREATED);
|
|
69
|
-
break;
|
|
70
|
-
default:
|
|
71
|
-
break;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
onNodeMouseDown(e, idx) {
|
|
76
|
-
switch (this.state.anno.mode) {
|
|
77
|
-
case modes.VIEW:
|
|
78
|
-
if (e.button === 0) {
|
|
79
|
-
if (this.props.isSelected) {
|
|
80
|
-
this.requestModeChange(this.state.anno, modes.MOVE);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
break;
|
|
84
|
-
default:
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/*************
|
|
90
|
-
* LOGIC *
|
|
91
|
-
**************/
|
|
92
|
-
getResult() {
|
|
93
|
-
return this.state.anno;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
performedAction(anno, pAction) {
|
|
97
|
-
if (this.props.onAction) {
|
|
98
|
-
this.props.onAction(anno, pAction);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
requestModeChange(anno, mode) {
|
|
103
|
-
this.props.onModeChangeRequest(anno, mode);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
move(movementX, movementY) {
|
|
107
|
-
this.setState({
|
|
108
|
-
anno: {
|
|
109
|
-
...this.state.anno,
|
|
110
|
-
data: transform.move(this.state.anno.data, movementX, movementY),
|
|
111
|
-
},
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
renderInfSelectionArea() {
|
|
116
|
-
switch (this.state.anno.mode) {
|
|
117
|
-
case modes.MOVE:
|
|
118
|
-
return <InfSelectionArea enable={true} svg={this.props.svg} />;
|
|
119
|
-
default:
|
|
120
|
-
return null;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
renderNode() {
|
|
125
|
-
if (!this.props.isSelected) return null;
|
|
126
|
-
switch (this.state.anno.mode) {
|
|
127
|
-
case modes.EDIT_LABEL:
|
|
128
|
-
case modes.MOVE:
|
|
129
|
-
return null;
|
|
130
|
-
case modes.EDIT:
|
|
131
|
-
case modes.CREATE:
|
|
132
|
-
return (
|
|
133
|
-
<Node
|
|
134
|
-
anno={this.state.anno.data}
|
|
135
|
-
key={this.state.selectedNode}
|
|
136
|
-
idx={this.state.anno.selectedNode}
|
|
137
|
-
style={this.props.style}
|
|
138
|
-
className={this.props.className}
|
|
139
|
-
isSelected={this.props.isSelected}
|
|
140
|
-
mode={this.state.anno.mode}
|
|
141
|
-
svg={this.props.svg}
|
|
142
|
-
onMouseDown={(e, idx) => this.onNodeMouseDown(e, idx)}
|
|
143
|
-
isPoint={true}
|
|
144
|
-
/>
|
|
145
|
-
);
|
|
146
|
-
default:
|
|
147
|
-
return this.state.anno.data.map((e, idx) => {
|
|
148
|
-
return (
|
|
149
|
-
<Node
|
|
150
|
-
anno={this.state.anno.data}
|
|
151
|
-
idx={idx}
|
|
152
|
-
key={idx}
|
|
153
|
-
style={this.props.style}
|
|
154
|
-
className={this.props.className}
|
|
155
|
-
isSelected={this.props.isSelected}
|
|
156
|
-
mode={this.state.anno.mode}
|
|
157
|
-
svg={this.props.svg}
|
|
158
|
-
onMouseDown={(e, idx) => this.onNodeMouseDown(e, idx)}
|
|
159
|
-
isPoint={true}
|
|
160
|
-
/>
|
|
161
|
-
);
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
renderPoint() {
|
|
167
|
-
return this.state.anno.data.map((e, idx) => {
|
|
168
|
-
return (
|
|
169
|
-
<circle
|
|
170
|
-
key={idx}
|
|
171
|
-
cx={e.x}
|
|
172
|
-
cy={e.y}
|
|
173
|
-
r={10}
|
|
174
|
-
fill="red"
|
|
175
|
-
style={this.props.style}
|
|
176
|
-
className={this.props.className}
|
|
177
|
-
/>
|
|
178
|
-
);
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
render() {
|
|
183
|
-
if (this.state.anno) {
|
|
184
|
-
return (
|
|
185
|
-
<g
|
|
186
|
-
onMouseMove={(e) => this.onMouseMove(e)}
|
|
187
|
-
onMouseUp={(e) => this.onMouseUp(e)}
|
|
188
|
-
>
|
|
189
|
-
{this.renderPoint()}
|
|
190
|
-
{this.renderNode()}
|
|
191
|
-
{this.renderInfSelectionArea()}
|
|
192
|
-
</g>
|
|
193
|
-
);
|
|
194
|
-
} else {
|
|
195
|
-
return null;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
export default Point;
|