@@ -14,16 +14,18 @@ import Annotator from "./"
14
14
15
15
import { testRegions } from "../ImageCanvas/index.story"
16
16
17
+ const middlewares = [
18
+ ( store ) => ( next ) => ( action ) => {
19
+ actionAddon ( action . type ) ( action )
20
+ return next ( action )
21
+ } ,
22
+ ]
23
+
17
24
storiesOf ( "Annotator" , module )
18
25
. add ( "Basic" , ( ) => (
19
26
< Annotator
20
27
onExit = { actionAddon ( "onExit" ) }
21
- middlewares = { [
22
- ( store ) => ( next ) => ( action ) => {
23
- actionAddon ( action . type ) ( action )
24
- return next ( action )
25
- } ,
26
- ] }
28
+ middlewares = { middlewares }
27
29
labelImages
28
30
regionClsList = { [ "Alpha" , "Beta" , "Charlie" , "Delta" ] }
29
31
regionTagList = { [ "tag1" , "tag2" , "tag3" ] }
@@ -112,12 +114,7 @@ storiesOf("Annotator", module)
112
114
. add ( "Annotator w/o No Region Labels or Image Labels" , ( ) => (
113
115
< Annotator
114
116
onExit = { actionAddon ( "onExit" ) }
115
- middlewares = { [
116
- ( store ) => ( next ) => ( action ) => {
117
- actionAddon ( action . type ) ( action )
118
- return next ( action )
119
- } ,
120
- ] }
117
+ middlewares = { middlewares }
121
118
images = { [
122
119
{
123
120
src : exampleImage ,
@@ -132,12 +129,7 @@ storiesOf("Annotator", module)
132
129
onExit = { actionAddon ( "onExit" ) }
133
130
enabledTools = { [ ] }
134
131
showTags = { false }
135
- middlewares = { [
136
- ( store ) => ( next ) => ( action ) => {
137
- actionAddon ( action . type ) ( action )
138
- return next ( action )
139
- } ,
140
- ] }
132
+ middlewares = { middlewares }
141
133
images = { [
142
134
{
143
135
src : exampleImage ,
@@ -195,12 +187,7 @@ storiesOf("Annotator", module)
195
187
. add ( "Car Annotation" , ( ) => (
196
188
< Annotator
197
189
onExit = { actionAddon ( "onExit" ) }
198
- middlewares = { [
199
- ( store ) => ( next ) => ( action ) => {
200
- actionAddon ( action . type ) ( action )
201
- return next ( action )
202
- } ,
203
- ] }
190
+ middlewares = { middlewares }
204
191
labelImages
205
192
regionClsList = { [ "Car" , "Sign" , "Construction Barrier" ] }
206
193
regionTagList = { [ "Moving" , "Stopped" , "Obstacle" ] }
@@ -650,18 +637,30 @@ storiesOf("Annotator", module)
650
637
. add ( "CORs Error (Pixel Segmentation)" , ( ) => (
651
638
< Annotator
652
639
onExit = { actionAddon ( "onExit" ) }
653
- middlewares = { [
654
- ( store ) => ( next ) => ( action ) => {
655
- actionAddon ( action . type ) ( action )
656
- return next ( action )
640
+ middlewares = { middlewares }
641
+ labelImages
642
+ fullImageSegmentationMode
643
+ regionClsList = { [ "Alpha" , "Beta" , "Charlie" , "Delta" ] }
644
+ images = { [
645
+ {
646
+ src : "https://placebear.com/200/300" ,
647
+ name : "Frame 0036" ,
657
648
} ,
658
649
] }
650
+ />
651
+ ) )
652
+ . add ( "Modify Allowed Area" , ( ) => (
653
+ < Annotator
654
+ onExit = { actionAddon ( "onExit" ) }
655
+ middlewares = { middlewares }
659
656
labelImages
660
657
fullImageSegmentationMode
658
+ allowedArea = { { x : 0 , y : 0.6 , w : 0.3 , h : 0.3 } }
659
+ enabledTools = { [ "modify-allowed-area" ] }
661
660
regionClsList = { [ "Alpha" , "Beta" , "Charlie" , "Delta" ] }
662
661
images = { [
663
662
{
664
- src : "https://placebear.com/200/300" ,
663
+ src : exampleImage ,
665
664
name : "Frame 0036" ,
666
665
} ,
667
666
] }
0 commit comments