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
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { Component } from
|
|
2
|
-
import AnnoDetails from
|
|
3
|
-
import AnnoStats from
|
|
4
|
-
import LabelInfo from
|
|
1
|
+
import { Component } from 'react'
|
|
2
|
+
import AnnoDetails from './AnnoDetails'
|
|
3
|
+
import AnnoStats from './AnnoStats'
|
|
4
|
+
import LabelInfo from './LabelInfo'
|
|
5
5
|
|
|
6
6
|
class InfoBoxes extends Component {
|
|
7
7
|
constructor(props) {
|
|
8
|
-
super(props)
|
|
8
|
+
super(props)
|
|
9
9
|
this.state = {
|
|
10
10
|
position: {
|
|
11
11
|
top: 0,
|
|
12
12
|
left: 0,
|
|
13
13
|
},
|
|
14
|
-
}
|
|
14
|
+
}
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
componentDidMount() {
|
|
18
|
-
this.updateLayout()
|
|
18
|
+
this.updateLayout()
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
componentDidUpdate(prevProps) {
|
|
22
22
|
if (this.props.layoutUpdate !== prevProps.layoutUpdate) {
|
|
23
|
-
this.updateLayout()
|
|
23
|
+
this.updateLayout()
|
|
24
24
|
}
|
|
25
25
|
if (this.props.commentInputTrigger !== prevProps.commentInputTrigger) {
|
|
26
26
|
if (!this.props.uiConfig.annoDetails.visible) {
|
|
27
|
-
this.showAnnoDetails(true)
|
|
27
|
+
this.showAnnoDetails(true)
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
updateLayout() {
|
|
33
33
|
if (this.props.container.current) {
|
|
34
|
-
const container = this.props.container.current.getBoundingClientRect()
|
|
34
|
+
const container = this.props.container.current.getBoundingClientRect()
|
|
35
35
|
this.setState({
|
|
36
36
|
position: {
|
|
37
37
|
...this.state.position,
|
|
38
38
|
left: container.right - 250,
|
|
39
39
|
top: container.top,
|
|
40
40
|
},
|
|
41
|
-
})
|
|
41
|
+
})
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -49,59 +49,59 @@ class InfoBoxes extends Component {
|
|
|
49
49
|
...this.props.uiConfig.annoDetails,
|
|
50
50
|
visible: show,
|
|
51
51
|
},
|
|
52
|
-
})
|
|
52
|
+
})
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
onDismiss(type) {
|
|
56
56
|
if (this.props.onUiConfigUpdate) {
|
|
57
57
|
switch (type) {
|
|
58
|
-
case
|
|
59
|
-
this.showAnnoDetails(false)
|
|
60
|
-
break
|
|
61
|
-
case
|
|
58
|
+
case 'AnnoDetails':
|
|
59
|
+
this.showAnnoDetails(false)
|
|
60
|
+
break
|
|
61
|
+
case 'LabelInfo':
|
|
62
62
|
this.props.onUiConfigUpdate({
|
|
63
63
|
...this.props.uiConfig,
|
|
64
64
|
labelInfo: {
|
|
65
65
|
...this.props.uiConfig.labelInfo,
|
|
66
66
|
visible: false,
|
|
67
67
|
},
|
|
68
|
-
})
|
|
69
|
-
break
|
|
70
|
-
case
|
|
68
|
+
})
|
|
69
|
+
break
|
|
70
|
+
case 'AnnoStats':
|
|
71
71
|
this.props.onUiConfigUpdate({
|
|
72
72
|
...this.props.uiConfig,
|
|
73
73
|
annoStats: {
|
|
74
74
|
...this.props.uiConfig.annoStats,
|
|
75
75
|
visible: false,
|
|
76
76
|
},
|
|
77
|
-
})
|
|
78
|
-
break
|
|
77
|
+
})
|
|
78
|
+
break
|
|
79
79
|
default:
|
|
80
|
-
break
|
|
80
|
+
break
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
onCommentUpdate(comment) {
|
|
86
86
|
if (this.props.onCommentUpdate) {
|
|
87
|
-
this.props.onCommentUpdate(comment)
|
|
87
|
+
this.props.onCommentUpdate(comment)
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
onMarkExample(anno) {
|
|
92
92
|
if (this.props.onMarkExample) {
|
|
93
|
-
this.props.onMarkExample(anno)
|
|
93
|
+
this.props.onMarkExample(anno)
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
onHideLbl(lbl, hide) {
|
|
98
98
|
if (this.props.onHideLbl) {
|
|
99
|
-
this.props.onHideLbl(lbl, hide)
|
|
99
|
+
this.props.onHideLbl(lbl, hide)
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
render() {
|
|
104
|
-
if (!this.props.annos) return null
|
|
104
|
+
if (!this.props.annos) return null
|
|
105
105
|
// if (!this.props.selectedAnno) return null
|
|
106
106
|
return (
|
|
107
107
|
<div>
|
|
@@ -109,12 +109,10 @@ class InfoBoxes extends Component {
|
|
|
109
109
|
selectedAnno={this.props.selectedAnno}
|
|
110
110
|
possibleLabels={this.props.possibleLabels}
|
|
111
111
|
defaultPos={this.state.position}
|
|
112
|
-
onDismiss={() => this.onDismiss(
|
|
112
|
+
onDismiss={() => this.onDismiss('LabelInfo')}
|
|
113
113
|
visible={this.props.uiConfig.labelInfo.visible}
|
|
114
114
|
onGetAnnoExample={(exampleArgs) =>
|
|
115
|
-
this.props.onGetAnnoExample
|
|
116
|
-
? this.props.onGetAnnoExample(exampleArgs)
|
|
117
|
-
: {}
|
|
115
|
+
this.props.onGetAnnoExample ? this.props.onGetAnnoExample(exampleArgs) : {}
|
|
118
116
|
}
|
|
119
117
|
exampleImg={this.props.exampleImg}
|
|
120
118
|
/>
|
|
@@ -125,7 +123,7 @@ class InfoBoxes extends Component {
|
|
|
125
123
|
left: this.state.position.left - 300,
|
|
126
124
|
top: this.state.position.top,
|
|
127
125
|
}}
|
|
128
|
-
onDismiss={() => this.onDismiss(
|
|
126
|
+
onDismiss={() => this.onDismiss('AnnoDetails')}
|
|
129
127
|
onCommentUpdate={(comment) => this.onCommentUpdate(comment)}
|
|
130
128
|
onMarkExample={(anno) => this.onMarkExample(anno)}
|
|
131
129
|
allowedToMarkExample={this.props.allowedToMarkExample}
|
|
@@ -141,14 +139,14 @@ class InfoBoxes extends Component {
|
|
|
141
139
|
top: this.state.position.top + 400,
|
|
142
140
|
}}
|
|
143
141
|
// defaultPos={this.state.position}
|
|
144
|
-
onDismiss={() => this.onDismiss(
|
|
142
|
+
onDismiss={() => this.onDismiss('AnnoStats')}
|
|
145
143
|
onHideLbl={(lbl, hide) => this.onHideLbl(lbl, hide)}
|
|
146
144
|
visible={this.props.uiConfig.annoStats.visible}
|
|
147
145
|
imgLoadCount={this.props.imgLoadCount}
|
|
148
146
|
/>
|
|
149
147
|
</div>
|
|
150
|
-
)
|
|
148
|
+
)
|
|
151
149
|
}
|
|
152
150
|
}
|
|
153
151
|
|
|
154
|
-
export default InfoBoxes
|
|
152
|
+
export default InfoBoxes
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import React, { useEffect, useState } from
|
|
2
|
-
import InfoBox from
|
|
3
|
-
import SiaPopup from
|
|
4
|
-
import AnnoExampleViewer from
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import InfoBox from './InfoBox'
|
|
3
|
+
import SiaPopup from '../SiaPopup'
|
|
4
|
+
import AnnoExampleViewer from '../AnnoExampleViewer'
|
|
5
5
|
const LabelInfo = (props) => {
|
|
6
|
-
const [showExampleViewer, setShowExampleViewer] = useState(false)
|
|
7
|
-
const [myLbl, setMyLbl] = useState(undefined)
|
|
6
|
+
const [showExampleViewer, setShowExampleViewer] = useState(false)
|
|
7
|
+
const [myLbl, setMyLbl] = useState(undefined)
|
|
8
8
|
// const { data: exampleImg, mutate: getAnnoExample } = exampleApi.useGetAnnoExampleImg({})
|
|
9
9
|
useEffect(() => {
|
|
10
10
|
if (props.selectedAnno) {
|
|
11
|
-
const selectedLabelIds = props.selectedAnno.labelIds
|
|
11
|
+
const selectedLabelIds = props.selectedAnno.labelIds
|
|
12
12
|
if (selectedLabelIds) {
|
|
13
13
|
const lbl = props.possibleLabels.find((e) => {
|
|
14
|
-
return selectedLabelIds[0] === e.id
|
|
15
|
-
})
|
|
14
|
+
return selectedLabelIds[0] === e.id
|
|
15
|
+
})
|
|
16
16
|
if (lbl) {
|
|
17
17
|
if (lbl !== myLbl) {
|
|
18
|
-
setMyLbl(lbl)
|
|
18
|
+
setMyLbl(lbl)
|
|
19
19
|
if (props.visible)
|
|
20
20
|
// getAnnoExample({llId:lbl.id, type:'annoBased', drawAnno: true, addContext:0.05})
|
|
21
|
-
requestImg(lbl, props.selectedAnno)
|
|
21
|
+
requestImg(lbl, props.selectedAnno)
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
}, [props.selectedAnno])
|
|
26
|
+
}, [props.selectedAnno])
|
|
27
27
|
const onDismiss = () => {
|
|
28
28
|
if (props.onDismiss) {
|
|
29
|
-
props.onDismiss()
|
|
29
|
+
props.onDismiss()
|
|
30
30
|
}
|
|
31
|
-
}
|
|
31
|
+
}
|
|
32
32
|
|
|
33
33
|
const requestImg = (lbl, anno) => {
|
|
34
34
|
if (props.onGetAnnoExample) {
|
|
35
|
-
props.onGetAnnoExample({ lbl: lbl, anno: anno })
|
|
35
|
+
props.onGetAnnoExample({ lbl: lbl, anno: anno })
|
|
36
36
|
}
|
|
37
|
-
}
|
|
37
|
+
}
|
|
38
38
|
|
|
39
39
|
const handleImgClick = () => {
|
|
40
40
|
// setShowExampleViewer(true)
|
|
41
41
|
// requestImg(myLbl, props.selectedAnno)
|
|
42
42
|
|
|
43
|
-
setShowExampleViewer(true)
|
|
43
|
+
setShowExampleViewer(true)
|
|
44
44
|
// getAnnoExample({llId:myLbl.id, type:'annoBased', drawAnno: true, addContext:0.05})
|
|
45
|
-
}
|
|
45
|
+
}
|
|
46
46
|
|
|
47
47
|
const renderExampleImg = () => {
|
|
48
|
-
if (!props.exampleImg) return null
|
|
48
|
+
if (!props.exampleImg) return null
|
|
49
49
|
return (
|
|
50
50
|
<div>
|
|
51
51
|
<h4 onClick={() => handleImgClick()}>Example:</h4>
|
|
@@ -54,14 +54,14 @@ const LabelInfo = (props) => {
|
|
|
54
54
|
<img
|
|
55
55
|
src={props.exampleImg.img}
|
|
56
56
|
onClick={() => handleImgClick()}
|
|
57
|
-
style={{ borderRadius: 25, width:
|
|
57
|
+
style={{ borderRadius: 25, width: '100%' }}
|
|
58
58
|
/>
|
|
59
59
|
}
|
|
60
|
-
content={
|
|
60
|
+
content={'Click on image to view more examples'}
|
|
61
61
|
/>
|
|
62
62
|
</div>
|
|
63
|
-
)
|
|
64
|
-
}
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
65
|
|
|
66
66
|
const renderDescription = () => {
|
|
67
67
|
// if (props.selectedAnno){
|
|
@@ -71,7 +71,7 @@ const LabelInfo = (props) => {
|
|
|
71
71
|
// const lbl = props.possibleLabels.find( e => {
|
|
72
72
|
// return selectedLabelIds[0] === e.id
|
|
73
73
|
// })
|
|
74
|
-
if (!myLbl) return
|
|
74
|
+
if (!myLbl) return 'No Label'
|
|
75
75
|
return (
|
|
76
76
|
<div>
|
|
77
77
|
<h4>{myLbl.label}</h4>
|
|
@@ -80,18 +80,18 @@ const LabelInfo = (props) => {
|
|
|
80
80
|
<AnnoExampleViewer
|
|
81
81
|
onRequestExample={() => requestImg(myLbl, props.selectedAnno)}
|
|
82
82
|
onClose={() => {
|
|
83
|
-
setShowExampleViewer(false)
|
|
83
|
+
setShowExampleViewer(false)
|
|
84
84
|
}}
|
|
85
85
|
active={showExampleViewer}
|
|
86
86
|
lbl={myLbl}
|
|
87
87
|
exampleImg={props.exampleImg}
|
|
88
88
|
/>
|
|
89
89
|
</div>
|
|
90
|
-
)
|
|
90
|
+
)
|
|
91
91
|
// } else {
|
|
92
92
|
// return 'No Label'
|
|
93
93
|
// }
|
|
94
|
-
}
|
|
94
|
+
}
|
|
95
95
|
|
|
96
96
|
return (
|
|
97
97
|
<InfoBox
|
|
@@ -101,7 +101,7 @@ const LabelInfo = (props) => {
|
|
|
101
101
|
defaultPos={props.defaultPos}
|
|
102
102
|
onDismiss={() => onDismiss()}
|
|
103
103
|
/>
|
|
104
|
-
)
|
|
105
|
-
}
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
106
|
|
|
107
|
-
export default LabelInfo
|
|
107
|
+
export default LabelInfo
|
package/src/SIASettingButton.jsx
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import React, { Component } from
|
|
1
|
+
import React, { Component } from 'react'
|
|
2
2
|
|
|
3
|
-
import * as tbe from
|
|
4
|
-
import { faCog } from
|
|
5
|
-
import { CFormSwitch, CPopover } from
|
|
6
|
-
import ToolbarItem from
|
|
3
|
+
import * as tbe from './types/toolbarEvents'
|
|
4
|
+
import { faCog } from '@fortawesome/free-solid-svg-icons'
|
|
5
|
+
import { CFormSwitch, CPopover } from '@coreui/react'
|
|
6
|
+
import ToolbarItem from './ToolbarItem'
|
|
7
7
|
class SIASettingButton extends Component {
|
|
8
8
|
constructor(props) {
|
|
9
|
-
super(props)
|
|
10
|
-
this.state = {}
|
|
9
|
+
super(props)
|
|
10
|
+
this.state = {}
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
triggerEvent(e, data) {
|
|
14
14
|
if (this.props.onSettingEvent) {
|
|
15
|
-
this.props.onSettingEvent(e, data)
|
|
15
|
+
this.props.onSettingEvent(e, data)
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
toggleAnnoDetails() {
|
|
19
|
-
this.triggerEvent(tbe.SHOW_ANNO_DETAILS)
|
|
19
|
+
this.triggerEvent(tbe.SHOW_ANNO_DETAILS)
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
toggleLabelInfo() {
|
|
23
|
-
this.triggerEvent(tbe.SHOW_LABEL_INFO)
|
|
23
|
+
this.triggerEvent(tbe.SHOW_LABEL_INFO)
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
toggleAnnoStats() {
|
|
27
|
-
this.triggerEvent(tbe.SHOW_ANNO_STATS)
|
|
27
|
+
this.triggerEvent(tbe.SHOW_ANNO_STATS)
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
handleStrokeWidthChange(e) {
|
|
31
|
-
this.triggerEvent(tbe.EDIT_STROKE_WIDTH, parseInt(e.target.value))
|
|
31
|
+
this.triggerEvent(tbe.EDIT_STROKE_WIDTH, parseInt(e.target.value))
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
handleNodeRadiusChange(e) {
|
|
35
|
-
this.triggerEvent(tbe.EDIT_NODE_RADIUS, parseInt(e.target.value))
|
|
35
|
+
this.triggerEvent(tbe.EDIT_NODE_RADIUS, parseInt(e.target.value))
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
renderInfoBoxContent() {
|
|
@@ -58,26 +58,26 @@ class SIASettingButton extends Component {
|
|
|
58
58
|
onClick={() => this.toggleAnnoStats()}
|
|
59
59
|
/>
|
|
60
60
|
</div>
|
|
61
|
-
)
|
|
61
|
+
)
|
|
62
62
|
}
|
|
63
63
|
renderInfoBoxes() {
|
|
64
|
-
if (!this.props.enabled) return null
|
|
64
|
+
if (!this.props.enabled) return null
|
|
65
65
|
if (this.props.enabled === true) {
|
|
66
|
-
return this.renderInfoBoxContent()
|
|
66
|
+
return this.renderInfoBoxContent()
|
|
67
67
|
} else {
|
|
68
68
|
if (this.props.enabled.infoBoxes) {
|
|
69
|
-
return this.renderInfoBoxContent()
|
|
69
|
+
return this.renderInfoBoxContent()
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
renderAnnoStyle() {
|
|
75
|
-
if (!this.props.enabled) return null
|
|
75
|
+
if (!this.props.enabled) return null
|
|
76
76
|
if (this.props.enabled === true) {
|
|
77
|
-
return this.renderAnnoStyleContent()
|
|
77
|
+
return this.renderAnnoStyleContent()
|
|
78
78
|
} else {
|
|
79
79
|
if (this.props.enabled.annoStyle) {
|
|
80
|
-
return this.renderAnnoStyleContent()
|
|
80
|
+
return this.renderAnnoStyleContent()
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -102,25 +102,25 @@ class SIASettingButton extends Component {
|
|
|
102
102
|
onChange={(e) => this.handleNodeRadiusChange(e)}
|
|
103
103
|
/>
|
|
104
104
|
</div>
|
|
105
|
-
)
|
|
105
|
+
)
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
render() {
|
|
109
|
-
if (!this.props.uiConfig) return null
|
|
109
|
+
if (!this.props.uiConfig) return null
|
|
110
110
|
const popupContent = (
|
|
111
111
|
<div>
|
|
112
112
|
{this.renderInfoBoxes()}
|
|
113
113
|
{this.renderAnnoStyle()}
|
|
114
114
|
</div>
|
|
115
|
-
)
|
|
115
|
+
)
|
|
116
116
|
return (
|
|
117
117
|
<CPopover content={popupContent} placement="right">
|
|
118
118
|
<span>
|
|
119
119
|
<ToolbarItem faIcon={faCog} />
|
|
120
120
|
</span>
|
|
121
121
|
</CPopover>
|
|
122
|
-
)
|
|
122
|
+
)
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
export default SIASettingButton
|
|
126
|
+
export default SIASettingButton
|