lost-sia 2.0.1-alpha12 → 2.0.1-alpha13

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.
Files changed (146) hide show
  1. package/dist/Annotation/ui/atoms/AnnoBar.js +1 -1
  2. package/dist/Annotation/ui/atoms/Edge.js +1 -1
  3. package/dist/Annotation/ui/atoms/Node.js +1 -1
  4. package/dist/Annotation/ui/tools/BBox.js +1 -1
  5. package/dist/Annotation/ui/tools/Line.js +1 -1
  6. package/dist/Annotation/ui/tools/Polygon.js +1 -1
  7. package/dist/Canvas/Canvas.d.ts +2 -1
  8. package/dist/Canvas/Canvas.js +1 -1
  9. package/dist/Sia.js +1 -1
  10. package/dist/index.d.ts +0 -9
  11. package/dist/index.js +1 -1
  12. package/dist/models/KeyAction.d.ts +2 -1
  13. package/dist/models/KeyAction.js +1 -1
  14. package/dist/stories/Canvas/Canvas.stories.d.ts +2 -1
  15. package/dist/utils/KeyMapper.js +1 -1
  16. package/dist/utils/mouse.js +1 -1
  17. package/dist/utils/siaIcons.js +5 -5
  18. package/dist/utils/transform.js +1 -1
  19. package/dist/utils/windowViewport.d.ts +22 -0
  20. package/dist/utils/windowViewport.js +1 -1
  21. package/package.json +9 -8
  22. package/src/Annotation/ui/atoms/AnnoBar.tsx +46 -46
  23. package/src/Annotation/ui/atoms/Edge.tsx +23 -23
  24. package/src/Annotation/ui/atoms/Node.tsx +51 -51
  25. package/src/Annotation/ui/tools/BBox.tsx +129 -145
  26. package/src/Annotation/ui/tools/Line.tsx +81 -87
  27. package/src/Annotation/ui/tools/Polygon.tsx +92 -95
  28. package/src/Canvas/Canvas.tsx +369 -397
  29. package/src/InfoBoxes/AnnoStats.jsx +1 -1
  30. package/src/InfoBoxes/InfoBoxArea.jsx +32 -34
  31. package/src/{Sia2.tsx → Sia.tsx} +156 -175
  32. package/src/index.ts +6 -17
  33. package/src/models/KeyAction.ts +1 -0
  34. package/src/stories/AnnotationTools.stories.tsx +21 -21
  35. package/src/stories/Canvas/Canvas.stories.tsx +31 -26
  36. package/src/stories/Canvas/CanvasOffset.tsx +23 -25
  37. package/src/stories/MinimalSia.stories.tsx +22 -22
  38. package/src/stories/SIA2/DemoWrapper.tsx +20 -24
  39. package/src/stories/SIA2/Sia2.stories.tsx +24 -24
  40. package/src/utils/KeyMapper.ts +3 -0
  41. package/src/utils/siaIcons.jsx +5 -7
  42. package/src/utils/windowViewport.ts +34 -0
  43. package/dist/AnnoExampleViewer.js +0 -1
  44. package/dist/AnnoLabelInput.js +0 -1
  45. package/dist/AnnoToolBar.js +0 -19
  46. package/dist/Annotation/AnnoBar.js +0 -1
  47. package/dist/Annotation/Annotation.js +0 -1
  48. package/dist/Annotation/BBox.js +0 -1
  49. package/dist/Annotation/Edge.js +0 -1
  50. package/dist/Annotation/InfSelectionArea.js +0 -1
  51. package/dist/Annotation/Line.js +0 -1
  52. package/dist/Annotation/Node.js +0 -1
  53. package/dist/Annotation/Point.js +0 -1
  54. package/dist/Annotation/Polygon.js +0 -1
  55. package/dist/Canvas.js +0 -1
  56. package/dist/ImgBar.js +0 -1
  57. package/dist/InfoBoxes/AnnoDetails.js +0 -1
  58. package/dist/InfoBoxes/AnnoStats.js +0 -1
  59. package/dist/InfoBoxes/InfoBox.js +0 -1
  60. package/dist/InfoBoxes/InfoBoxArea.js +0 -1
  61. package/dist/InfoBoxes/LabelInfo.js +0 -1
  62. package/dist/LabelInput.js +0 -1
  63. package/dist/Prompt.js +0 -1
  64. package/dist/SIAFilterButton.js +0 -1
  65. package/dist/SIASettingButton.js +0 -1
  66. package/dist/Sia2.js +0 -1
  67. package/dist/SiaPopup.js +0 -1
  68. package/dist/ToolBar.js +0 -1
  69. package/dist/ToolbarItem.js +0 -1
  70. package/dist/_virtual/_commonjsHelpers.js +0 -1
  71. package/dist/_virtual/lodash.js +0 -1
  72. package/dist/assets/Annotation/Annotation-Cd5Ua5TG.css +0 -1
  73. package/dist/assets/Toolbar-Cp1xyYeH.css +0 -1
  74. package/dist/filterTools.js +0 -1
  75. package/dist/siaDummyData.js +0 -7
  76. package/dist/stories/Canvas/CanvasOffset.js +0 -1
  77. package/dist/stories/FilterDropdown.stories.js +0 -1
  78. package/dist/stories/SIA/SIA.stories.d.ts +0 -36
  79. package/dist/stories/SIA2/DemoWrapper.js +0 -1
  80. package/dist/stories/Toolbar/ImageTools/ImageLabel.stories.d.ts +0 -13
  81. package/dist/stories/siaDummyData.js +0 -1
  82. package/dist/stories/siaDummyData2.js +0 -7
  83. package/dist/types/annoStatus.js +0 -1
  84. package/dist/types/canvasActions.js +0 -1
  85. package/dist/types/cursorstyles.js +0 -1
  86. package/dist/types/modes.js +0 -1
  87. package/dist/types/notificationType.js +0 -1
  88. package/dist/types/toolbarEvents.js +0 -1
  89. package/dist/types/tools.js +0 -1
  90. package/dist/utils/annoConversion.js +0 -1
  91. package/dist/utils/annoConversion2.d.ts +0 -27
  92. package/dist/utils/annoConversion2.js +0 -1
  93. package/dist/utils/colorlut.js +0 -1
  94. package/dist/utils/constraints.js +0 -1
  95. package/dist/utils/hist.js +0 -1
  96. package/dist/utils/keyActions.js +0 -1
  97. package/dist/utils/mouse2.js +0 -1
  98. package/dist/utils/transform2.js +0 -1
  99. package/src/AnnoLabelInput.jsx +0 -109
  100. package/src/AnnoToolBar.jsx +0 -153
  101. package/src/Annotation/AnnoBar.jsx +0 -154
  102. package/src/Annotation/Annotation.jsx +0 -395
  103. package/src/Annotation/Annotation.scss +0 -47
  104. package/src/Annotation/BBox.jsx +0 -299
  105. package/src/Annotation/Edge.jsx +0 -92
  106. package/src/Annotation/InfSelectionArea.jsx +0 -72
  107. package/src/Annotation/Line.jsx +0 -68
  108. package/src/Annotation/Node.jsx +0 -282
  109. package/src/Annotation/Point.jsx +0 -200
  110. package/src/Annotation/Polygon.jsx +0 -404
  111. package/src/Canvas.jsx +0 -2194
  112. package/src/ImgBar.jsx +0 -131
  113. package/src/LabelInput.jsx +0 -238
  114. package/src/Prompt.jsx +0 -45
  115. package/src/SIAFilterButton.jsx +0 -186
  116. package/src/Sia.jsx +0 -478
  117. package/src/SiaPopup.jsx +0 -15
  118. package/src/ToolBar.jsx +0 -463
  119. package/src/Toolbar/ToolbarItem.jsx +0 -30
  120. package/src/Toolbar.css +0 -13
  121. package/src/ToolbarItem.jsx +0 -31
  122. package/src/filterTools.js +0 -5
  123. package/src/stories/SIA/SIA.stories.tsx +0 -64
  124. package/src/stories/Toolbar/ImageTools/ImageLabel.stories.tsx +0 -31
  125. package/src/stories/lost.js +0 -54
  126. package/src/stories/store.js +0 -18
  127. package/src/test.js +0 -7
  128. package/src/types/annoStatus.js +0 -4
  129. package/src/types/canvasActions.js +0 -58
  130. package/src/types/cursorstyles.js +0 -3
  131. package/src/types/modes.js +0 -9
  132. package/src/types/notificationType.js +0 -11
  133. package/src/types/toolbarEvents.js +0 -35
  134. package/src/types/tools.js +0 -17
  135. package/src/utils/annoConversion.js +0 -145
  136. package/src/utils/annoConversion2.ts +0 -145
  137. package/src/utils/colorlut.js +0 -68
  138. package/src/utils/constraints.js +0 -81
  139. package/src/utils/mouse.js +0 -14
  140. package/src/utils/transform.js +0 -336
  141. package/src/utils/windowViewport.js +0 -34
  142. /package/dist/{Sia2.d.ts → Sia.d.ts} +0 -0
  143. /package/dist/utils/{mouse2.d.ts → mouse.d.ts} +0 -0
  144. /package/dist/utils/{transform2.d.ts → transform.d.ts} +0 -0
  145. /package/src/utils/{mouse2.ts → mouse.ts} +0 -0
  146. /package/src/utils/{transform2.ts → transform.ts} +0 -0
@@ -1,19 +1,19 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
2
 
3
- import Sia2 from "../Sia2";
4
- import { imgBlob } from "./siaDummyData";
5
- import { AllowedTools } from "../types";
3
+ import Sia from '../Sia'
4
+ import { imgBlob } from './siaDummyData'
5
+ import { AllowedTools } from '../types'
6
6
 
7
- export const ActionsData = {};
7
+ export const ActionsData = {}
8
8
 
9
9
  const meta = {
10
- title: "Annotation Tools",
11
- component: Sia2,
10
+ title: 'Annotation Tools',
11
+ component: Sia,
12
12
  parameters: {
13
13
  // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
14
- layout: "padding",
14
+ layout: 'padding',
15
15
  },
16
- tags: ["!autodocs"],
16
+ tags: ['!autodocs'],
17
17
  excludeStories: /.*Data$/,
18
18
  args: {
19
19
  ...ActionsData,
@@ -22,20 +22,20 @@ const meta = {
22
22
  (Story) => (
23
23
  <div
24
24
  style={{
25
- width: "50vw",
26
- height: "65vh",
25
+ width: '50vw',
26
+ height: '65vh',
27
27
  padding: 10,
28
- overflow: "hidden",
28
+ overflow: 'hidden',
29
29
  }}
30
30
  >
31
31
  <Story />
32
32
  </div>
33
33
  ),
34
34
  ],
35
- } satisfies Meta<typeof Sia2>;
35
+ } satisfies Meta<typeof Sia>
36
36
 
37
- export default meta;
38
- type Story = StoryObj<typeof meta>;
37
+ export default meta
38
+ type Story = StoryObj<typeof meta>
39
39
 
40
40
  const allowedTools: AllowedTools = {
41
41
  bbox: true,
@@ -43,7 +43,7 @@ const allowedTools: AllowedTools = {
43
43
  point: false,
44
44
  polygon: false,
45
45
  junk: true,
46
- };
46
+ }
47
47
 
48
48
  export const BBoxOnly: Story = {
49
49
  args: {
@@ -67,7 +67,7 @@ export const BBoxOnly: Story = {
67
67
 
68
68
  ...
69
69
 
70
- <Sia2
70
+ <Sia
71
71
  allowedTools={allowedTools}
72
72
  image={imageBlob}
73
73
  possibleLabels={[]}
@@ -75,7 +75,7 @@ export const BBoxOnly: Story = {
75
75
  },
76
76
  },
77
77
  },
78
- };
78
+ }
79
79
 
80
80
  const noJunkTools = {
81
81
  bbox: true,
@@ -83,7 +83,7 @@ const noJunkTools = {
83
83
  point: true,
84
84
  polygon: true,
85
85
  junk: false,
86
- };
86
+ }
87
87
 
88
88
  export const NoJunk: Story = {
89
89
  args: {
@@ -107,7 +107,7 @@ export const NoJunk: Story = {
107
107
 
108
108
  ...
109
109
 
110
- <Sia2
110
+ <Sia
111
111
  allowedTools={allowedTools}
112
112
  image={imageBlob}
113
113
  possibleLabels={[]}
@@ -115,4 +115,4 @@ export const NoJunk: Story = {
115
115
  },
116
116
  },
117
117
  },
118
- };
118
+ }
@@ -1,48 +1,48 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { fn } from "@storybook/test";
3
- import { imgBlob } from "../siaDummyData";
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { fn } from '@storybook/test'
3
+ import { imgBlob } from '../siaDummyData'
4
4
 
5
- import Canvas from "../../Canvas/Canvas";
6
- import AnnotationTool from "../../models/AnnotationTool";
7
- import Annotation from "../../Annotation/logic/Annotation";
5
+ import Canvas from '../../Canvas/Canvas'
6
+ import AnnotationTool from '../../models/AnnotationTool'
7
+ import Annotation from '../../Annotation/logic/Annotation'
8
8
 
9
- import { possibleLabels } from "../siaDummyData2";
10
- import { AnnotationSettings, UiConfig } from "../../types";
9
+ import { possibleLabels } from '../siaDummyData2'
10
+ import { AnnotationSettings, UiConfig } from '../../types'
11
11
 
12
12
  export const ActionsData = {
13
13
  onAnnoEvent: fn(),
14
14
  onKeyDown: fn(),
15
15
  onKeyUp: fn(),
16
- };
16
+ }
17
17
 
18
18
  const meta = {
19
- title: "Components/Canvas",
19
+ title: 'Components/Canvas',
20
20
  component: Canvas,
21
21
  parameters: {
22
22
  // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
23
- layout: "fullscreen",
23
+ layout: 'fullscreen',
24
24
  },
25
- tags: ["!autodocs"],
25
+ tags: ['!autodocs'],
26
26
  excludeStories: /.*Data$/,
27
27
  args: {
28
28
  // ...ActionsData,
29
29
  },
30
- } satisfies Meta<typeof Canvas>;
30
+ } satisfies Meta<typeof Canvas>
31
31
 
32
- export default meta;
33
- type Story = StoryObj<typeof meta>;
32
+ export default meta
33
+ type Story = StoryObj<typeof meta>
34
34
 
35
35
  const uiConfig: UiConfig = {
36
36
  nodeRadius: 4,
37
37
  strokeWidth: 4,
38
38
  imageCentered: false,
39
- };
39
+ }
40
40
 
41
41
  const annotationSettings: AnnotationSettings = {
42
42
  canHaveMultipleLabels: true,
43
43
  canCreate: true,
44
44
  canLabel: true,
45
- };
45
+ }
46
46
 
47
47
  export const Default: Story = {
48
48
  args: {
@@ -61,10 +61,11 @@ export const Default: Story = {
61
61
  onAnnoEditing: () => {},
62
62
  onRequestNewAnnoId: () => 1,
63
63
  onSelectAnnotation: () => {},
64
+ onSetIsImageJunk: () => {},
64
65
  onSetSelectedTool: () => {},
65
66
  onShouldDeleteAnno: () => {},
66
67
  },
67
- };
68
+ }
68
69
 
69
70
  const samplePointAnnotations: Annotation[] = [
70
71
  new Annotation(0, AnnotationTool.Point, [{ x: 10, y: 10 }]),
@@ -75,7 +76,7 @@ const samplePointAnnotations: Annotation[] = [
75
76
  new Annotation(5, AnnotationTool.Point, [{ x: 250, y: 250 }]),
76
77
  new Annotation(6, AnnotationTool.Point, [{ x: 300, y: 300 }]),
77
78
  new Annotation(7, AnnotationTool.Point, [{ x: 350, y: 350 }]),
78
- ];
79
+ ]
79
80
 
80
81
  export const WithPoints: Story = {
81
82
  args: {
@@ -94,10 +95,11 @@ export const WithPoints: Story = {
94
95
  onAnnoEditing: () => {},
95
96
  onRequestNewAnnoId: () => 1,
96
97
  onSelectAnnotation: () => {},
98
+ onSetIsImageJunk: () => {},
97
99
  onSetSelectedTool: () => {},
98
100
  onShouldDeleteAnno: () => {},
99
101
  },
100
- };
102
+ }
101
103
 
102
104
  const sampleLineAnnotations: Annotation[] = [
103
105
  new Annotation(0, AnnotationTool.Line, [
@@ -114,7 +116,7 @@ const sampleLineAnnotations: Annotation[] = [
114
116
  ]),
115
117
  new Annotation(2, AnnotationTool.Line, [{ x: 150, y: 150 }]),
116
118
  new Annotation(3, AnnotationTool.Line, [{ x: 200, y: 200 }]),
117
- ];
119
+ ]
118
120
 
119
121
  export const WithLines: Story = {
120
122
  args: {
@@ -133,10 +135,11 @@ export const WithLines: Story = {
133
135
  onAnnoEditing: () => {},
134
136
  onRequestNewAnnoId: () => 1,
135
137
  onSelectAnnotation: () => {},
138
+ onSetIsImageJunk: () => {},
136
139
  onSetSelectedTool: () => {},
137
140
  onShouldDeleteAnno: () => {},
138
141
  },
139
- };
142
+ }
140
143
 
141
144
  const sampleBBoxAnnotations: Annotation[] = [
142
145
  new Annotation(0, AnnotationTool.BBox, [
@@ -151,7 +154,7 @@ const sampleBBoxAnnotations: Annotation[] = [
151
154
  { x: 400, y: 325 },
152
155
  { x: 500, y: 375 },
153
156
  ]),
154
- ];
157
+ ]
155
158
 
156
159
  export const WithBBoxes: Story = {
157
160
  args: {
@@ -170,10 +173,11 @@ export const WithBBoxes: Story = {
170
173
  onAnnoEditing: () => {},
171
174
  onRequestNewAnnoId: () => 1,
172
175
  onSelectAnnotation: () => {},
176
+ onSetIsImageJunk: () => {},
173
177
  onSetSelectedTool: () => {},
174
178
  onShouldDeleteAnno: () => {},
175
179
  },
176
- };
180
+ }
177
181
 
178
182
  const samplePolygonAnnotations: Annotation[] = [
179
183
  new Annotation(0, AnnotationTool.Polygon, [
@@ -189,7 +193,7 @@ const samplePolygonAnnotations: Annotation[] = [
189
193
  { x: 600, y: 350 },
190
194
  { x: 550, y: 450 },
191
195
  ]),
192
- ];
196
+ ]
193
197
 
194
198
  export const WithPolygonAnnotations: Story = {
195
199
  args: {
@@ -208,7 +212,8 @@ export const WithPolygonAnnotations: Story = {
208
212
  onAnnoEditing: () => {},
209
213
  onRequestNewAnnoId: () => 1,
210
214
  onSelectAnnotation: () => {},
215
+ onSetIsImageJunk: () => {},
211
216
  onSetSelectedTool: () => {},
212
217
  onShouldDeleteAnno: () => {},
213
218
  },
214
- };
219
+ }
@@ -1,29 +1,26 @@
1
- import Annotation from "../../Annotation/logic/Annotation";
2
- import Canvas from "../../Canvas/Canvas";
3
- import AnnotationTool from "../../models/AnnotationTool";
4
- import CanvasAction from "../../models/CanvasAction";
5
- import type { AnnotationSettings, Label, UiConfig } from "../../types";
1
+ import Annotation from '../../Annotation/logic/Annotation'
2
+ import Canvas from '../../Canvas/Canvas'
3
+ import AnnotationTool from '../../models/AnnotationTool'
4
+ import CanvasAction from '../../models/CanvasAction'
5
+ import type { AnnotationSettings, Label, UiConfig } from '../../types'
6
6
 
7
7
  type CanvasProps = {
8
- annotations?: Annotation[];
9
- image: string;
10
- selectedAnnoTool: AnnotationTool;
11
- possibleLabels: Label[];
12
- preventScrolling: boolean;
13
- uiConfig: UiConfig;
14
- onAnnoEvent?: (
15
- annotation: Annotation,
16
- canvasAction: CanvasAction,
17
- ) => void | undefined;
18
- onKeyDown?: (e) => void | undefined;
19
- onKeyUp?: (e) => void | undefined;
20
- };
8
+ annotations?: Annotation[]
9
+ image: string
10
+ selectedAnnoTool: AnnotationTool
11
+ possibleLabels: Label[]
12
+ preventScrolling: boolean
13
+ uiConfig: UiConfig
14
+ onAnnoEvent?: (annotation: Annotation, canvasAction: CanvasAction) => void | undefined
15
+ onKeyDown?: (e) => void | undefined
16
+ onKeyUp?: (e) => void | undefined
17
+ }
21
18
 
22
19
  const annotationSettings: AnnotationSettings = {
23
20
  canHaveMultipleLabels: true,
24
21
  canCreate: true,
25
22
  canLabel: true,
26
- };
23
+ }
27
24
 
28
25
  const CanvasWithOffset = ({
29
26
  annotations = [],
@@ -38,10 +35,10 @@ const CanvasWithOffset = ({
38
35
  <h1>A line to generate offset</h1>
39
36
  <div
40
37
  style={{
41
- width: "100%",
42
- height: "100%",
38
+ width: '100%',
39
+ height: '100%',
43
40
  padding: 200,
44
- background: "green",
41
+ background: 'green',
45
42
  }}
46
43
  >
47
44
  <Canvas
@@ -59,12 +56,13 @@ const CanvasWithOffset = ({
59
56
  onAnnoEditing={() => {}}
60
57
  onRequestNewAnnoId={() => 1}
61
58
  onSelectAnnotation={() => {}}
59
+ onSetIsImageJunk={() => {}}
62
60
  onSetSelectedTool={() => {}}
63
61
  onShouldDeleteAnno={() => {}}
64
62
  />
65
63
  </div>
66
64
  </>
67
- );
68
- };
65
+ )
66
+ }
69
67
 
70
- export default CanvasWithOffset;
68
+ export default CanvasWithOffset
@@ -1,19 +1,19 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
2
 
3
- import Sia2 from "../Sia2";
4
- import type { Label } from "../types";
5
- import { imgBlob } from "./siaDummyData";
3
+ import Sia from '../Sia'
4
+ import type { Label } from '../types'
5
+ import { imgBlob } from './siaDummyData'
6
6
 
7
- export const ActionsData = {};
7
+ export const ActionsData = {}
8
8
 
9
9
  const meta = {
10
- title: "Minimal SIA",
11
- component: Sia2,
10
+ title: 'Minimal SIA',
11
+ component: Sia,
12
12
  parameters: {
13
13
  // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
14
- layout: "padding",
14
+ layout: 'padding',
15
15
  },
16
- tags: ["!autodocs"],
16
+ tags: ['!autodocs'],
17
17
  excludeStories: /.*Data$/,
18
18
  args: {
19
19
  ...ActionsData,
@@ -22,33 +22,33 @@ const meta = {
22
22
  (Story) => (
23
23
  <div
24
24
  style={{
25
- width: "50vw",
26
- height: "65vh",
25
+ width: '50vw',
26
+ height: '65vh',
27
27
  padding: 10,
28
- overflow: "hidden",
28
+ overflow: 'hidden',
29
29
  }}
30
30
  >
31
31
  <Story />
32
32
  </div>
33
33
  ),
34
34
  ],
35
- } satisfies Meta<typeof Sia2>;
35
+ } satisfies Meta<typeof Sia>
36
36
 
37
- export default meta;
38
- type Story = StoryObj<typeof meta>;
37
+ export default meta
38
+ type Story = StoryObj<typeof meta>
39
39
 
40
40
  const minimalExampleLabels: Label[] = [
41
41
  {
42
42
  id: 1,
43
- name: "Cat",
44
- description: "Includes all cats",
43
+ name: 'Cat',
44
+ description: 'Includes all cats',
45
45
  },
46
46
  {
47
47
  id: 2,
48
- name: "Dog",
49
- description: "Includes all dogs",
48
+ name: 'Dog',
49
+ description: 'Includes all dogs',
50
50
  },
51
- ];
51
+ ]
52
52
 
53
53
  /**
54
54
  * Minimal SIA example
@@ -79,11 +79,11 @@ export const Minimal: Story = {
79
79
 
80
80
  ...
81
81
 
82
- <Sia2
82
+ <Sia
83
83
  image={imageBlob}
84
84
  possibleLabels={possibleLabels}
85
85
  />`,
86
86
  },
87
87
  },
88
88
  },
89
- };
89
+ }
@@ -1,22 +1,18 @@
1
- import Annotation from "../../Annotation/logic/Annotation";
2
- import AnnotationTool from "../../models/AnnotationTool";
1
+ import Annotation from '../../Annotation/logic/Annotation'
2
+ import AnnotationTool from '../../models/AnnotationTool'
3
3
 
4
- import Sia2 from "../../Sia2";
4
+ import Sia from '../../Sia'
5
5
 
6
- import type {
7
- AnnotationSettings,
8
- ExternalAnnotation,
9
- UiConfig,
10
- } from "../../types";
6
+ import type { AnnotationSettings, ExternalAnnotation, UiConfig } from '../../types'
11
7
 
12
- import { imgBlob } from "../siaDummyData";
13
- import { possibleLabels } from "../siaDummyData2";
8
+ import { imgBlob } from '../siaDummyData'
9
+ import { possibleLabels } from '../siaDummyData2'
14
10
 
15
11
  type DemoWrapperProps = {
16
- annotations?: ExternalAnnotation[];
17
- annotationSettings?: AnnotationSettings;
18
- isLoading?: boolean;
19
- };
12
+ annotations?: ExternalAnnotation[]
13
+ annotationSettings?: AnnotationSettings
14
+ isLoading?: boolean
15
+ }
20
16
 
21
17
  const DemoWrapper = ({
22
18
  annotations = [],
@@ -27,10 +23,10 @@ const DemoWrapper = ({
27
23
  nodeRadius: 4,
28
24
  strokeWidth: 4,
29
25
  imageCentered: false,
30
- };
26
+ }
31
27
 
32
28
  return (
33
- <Sia2
29
+ <Sia
34
30
  annotationSettings={annotationSettings}
35
31
  initialAnnotations={annotations}
36
32
  isLoading={isLoading}
@@ -39,22 +35,22 @@ const DemoWrapper = ({
39
35
  image={imgBlob}
40
36
  defaultAnnotationTool={AnnotationTool.Polygon}
41
37
  onAnnoCreated={(anno: Annotation, _: Annotation[]) => {
42
- console.log("CREATED", anno);
38
+ console.log('CREATED', anno)
43
39
  }}
44
40
  onAnnoCreationFinished={(anno: Annotation, _: Annotation[]) => {
45
- console.log("FINISHED CREATION", anno);
41
+ console.log('FINISHED CREATION', anno)
46
42
  }}
47
43
  onAnnoChanged={(anno: Annotation, _: Annotation[]) => {
48
- console.log("CHANGED", anno);
44
+ console.log('CHANGED', anno)
49
45
  }}
50
46
  onAnnoDeleted={(anno: Annotation, annos: Annotation[]) => {
51
- console.log("DELETED", anno, annos);
47
+ console.log('DELETED', anno, annos)
52
48
  }}
53
49
  onImageLabelsChanged={(imageLabelIds: number[]) => {
54
- console.log("IMAGE LABEL IDS CHANGED", imageLabelIds);
50
+ console.log('IMAGE LABEL IDS CHANGED', imageLabelIds)
55
51
  }}
56
52
  />
57
- );
58
- };
53
+ )
54
+ }
59
55
 
60
- export default DemoWrapper;
56
+ export default DemoWrapper
@@ -1,42 +1,42 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
2
 
3
- import Sia2 from "../../Sia2";
3
+ import Sia from '../../Sia'
4
4
 
5
- import { Label, UiConfig } from "../../types";
5
+ import { Label, UiConfig } from '../../types'
6
6
 
7
- import { imgBlob, possibleLabels } from "../siaDummyData";
7
+ import { imgBlob, possibleLabels } from '../siaDummyData'
8
8
 
9
- export const ActionsData = {};
9
+ export const ActionsData = {}
10
10
 
11
11
  const meta = {
12
- title: "Components/Sia2",
13
- component: Sia2,
12
+ title: 'Components/Sia2',
13
+ component: Sia,
14
14
  parameters: {
15
15
  // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
16
- layout: "padding",
16
+ layout: 'padding',
17
17
  },
18
- tags: ["!autodocs"],
18
+ tags: ['!autodocs'],
19
19
  excludeStories: /.*Data$/,
20
20
  args: {
21
21
  ...ActionsData,
22
22
  },
23
23
  decorators: [
24
24
  (Story) => (
25
- <div style={{ width: "50vw", height: "65vh" }}>
25
+ <div style={{ width: '50vw', height: '65vh' }}>
26
26
  <Story />
27
27
  </div>
28
28
  ),
29
29
  ],
30
- } satisfies Meta<typeof Sia2>;
30
+ } satisfies Meta<typeof Sia>
31
31
 
32
- export default meta;
33
- type Story = StoryObj<typeof meta>;
32
+ export default meta
33
+ type Story = StoryObj<typeof meta>
34
34
 
35
35
  const uiConfig: UiConfig = {
36
36
  nodeRadius: 4,
37
37
  strokeWidth: 4,
38
38
  imageCentered: false,
39
- };
39
+ }
40
40
 
41
41
  /**
42
42
  * SIA with dummy data
@@ -48,20 +48,20 @@ export const Default: Story = {
48
48
  image: imgBlob,
49
49
  possibleLabels,
50
50
  },
51
- };
51
+ }
52
52
 
53
53
  const minimalExampleLabels: Label[] = [
54
54
  {
55
55
  id: 1,
56
- name: "Cat",
57
- description: "Includes all cats",
56
+ name: 'Cat',
57
+ description: 'Includes all cats',
58
58
  },
59
59
  {
60
60
  id: 2,
61
- name: "Dog",
62
- description: "Includes all dogs",
61
+ name: 'Dog',
62
+ description: 'Includes all dogs',
63
63
  },
64
- ];
64
+ ]
65
65
 
66
66
  /**
67
67
  * Minimal SIA example
@@ -92,14 +92,14 @@ export const Minimal: Story = {
92
92
 
93
93
  ...
94
94
 
95
- <Sia2
95
+ <Sia
96
96
  image={imageBlob}
97
97
  possibleLabels={possibleLabels}
98
98
  />`,
99
99
  },
100
100
  },
101
101
  },
102
- };
102
+ }
103
103
 
104
104
  export const Loading: Story = {
105
105
  args: {
@@ -109,7 +109,7 @@ export const Loading: Story = {
109
109
  image: imgBlob,
110
110
  possibleLabels: [],
111
111
  },
112
- };
112
+ }
113
113
 
114
114
  export const Junk: Story = {
115
115
  args: {
@@ -119,4 +119,4 @@ export const Junk: Story = {
119
119
  image: imgBlob,
120
120
  possibleLabels: [],
121
121
  },
122
- };
122
+ }
@@ -52,6 +52,9 @@ class KeyMapper {
52
52
  case "e":
53
53
  this.triggerKeyAction(KeyAction.RECREATE_ANNO);
54
54
  break;
55
+ case "j":
56
+ this.triggerKeyAction(KeyAction.TOGGLE_IMAGE_JUNK);
57
+ break;
55
58
  case "c":
56
59
  if (isCtrlKeyPressed) this.triggerKeyAction(KeyAction.COPY_ANNOTATION);
57
60
  else this.triggerKeyAction(KeyAction.TOGGLE_ANNO_COMMENT_INPUT);
@@ -1,5 +1,3 @@
1
- import React from "react";
2
-
3
1
  export function textIcon() {
4
2
  return (
5
3
  <svg
@@ -32,7 +30,7 @@ export function textIcon() {
32
30
  C948.049,214.236,926.687,199.643,925.876,172.939z"
33
31
  />
34
32
  </svg>
35
- );
33
+ )
36
34
  }
37
35
 
38
36
  export function lineIcon() {
@@ -58,7 +56,7 @@ export function lineIcon() {
58
56
  c31.188,24.081,91.974-3.708,123.127-39.312C782.35,323.912,979.191,120.251,986.331,109.582z"
59
57
  />
60
58
  </svg>
61
- );
59
+ )
62
60
  }
63
61
 
64
62
  export function bBoxIcon() {
@@ -84,7 +82,7 @@ export function bBoxIcon() {
84
82
  h608.264c23.386,0,42.52,19.134,42.52,42.52V710.655z"
85
83
  />
86
84
  </svg>
87
- );
85
+ )
88
86
  }
89
87
 
90
88
  export function polygonIcon() {
@@ -111,7 +109,7 @@ export function polygonIcon() {
111
109
  c18.31,14.549,14.16,26.901-9.219,27.449L342.327,769.938z"
112
110
  />
113
111
  </svg>
114
- );
112
+ )
115
113
  }
116
114
 
117
115
  export function pointIcon() {
@@ -130,5 +128,5 @@ export function pointIcon() {
130
128
  c0-151.356,122.7-274.057,274.057-274.057C625.497,134.229,748.197,256.929,748.197,408.286z"
131
129
  />
132
130
  </svg>
133
- );
131
+ )
134
132
  }