File tree Expand file tree Collapse file tree 5 files changed +60
-7
lines changed Expand file tree Collapse file tree 5 files changed +60
-7
lines changed Original file line number Diff line number Diff line change 19
19
"react-hotkeys" : " ^2.0.0" ,
20
20
"react-json-view" : " ^1.19.1" ,
21
21
"react-markdown" : " ^4.0.6" ,
22
- "react-material-workspace-layout" : " ^1.0.6 " ,
22
+ "react-material-workspace-layout" : " ^1.0.8 " ,
23
23
"react-monaco-editor" : " ^0.25.1" ,
24
24
"react-remove-scroll" : " ^2.0.4" ,
25
25
"react-select" : " ^3.0.8" ,
Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ type Props = {
48
48
autoSegmentationOptions ?:
49
49
| { | type : "simple" | }
50
50
| { | type : "autoseg" , maxClusters ?: number , slicWeightFactor ?: number | } ,
51
+ hideHeader ?: boolean ,
52
+ hideHeaderText ?: boolean ,
53
+ hideNext ?: boolean ,
54
+ hidePrev ?: boolean ,
51
55
}
52
56
53
57
export const Annotator = ( {
@@ -82,6 +86,10 @@ export const Annotator = ({
82
86
onPrevImage,
83
87
keypointDefinitions,
84
88
autoSegmentationOptions = { type : "autoseg" } ,
89
+ hideHeader,
90
+ hideHeaderText,
91
+ hideNext,
92
+ hidePrev,
85
93
} : Props ) => {
86
94
if ( typeof selectedImage === "string" ) {
87
95
selectedImage = ( images || [ ] ) . findIndex ( ( img ) => img . src === selectedImage )
@@ -172,6 +180,10 @@ export const Annotator = ({
172
180
state = { state }
173
181
dispatch = { dispatch }
174
182
onRegionClassAdded = { onRegionClassAdded }
183
+ hideHeader = { hideHeader }
184
+ hideHeaderText = { hideHeaderText }
185
+ hideNext = { hideNext }
186
+ hidePrev = { hidePrev }
175
187
/>
176
188
</ SettingsProvider >
177
189
)
Original file line number Diff line number Diff line change @@ -666,3 +666,36 @@ storiesOf("Annotator", module)
666
666
] }
667
667
/>
668
668
) )
669
+ . add ( "Hide Next, Hide Header Text" , ( ) => (
670
+ < Annotator
671
+ onExit = { actionAddon ( "onExit" ) }
672
+ labelImages
673
+ hideNext
674
+ hideHeaderText
675
+ fullImageSegmentationMode
676
+ enabledTools = { [ "modify-allowed-area" ] }
677
+ regionClsList = { [ "Alpha" , "Beta" , "Charlie" , "Delta" ] }
678
+ images = { [
679
+ {
680
+ src : exampleImage ,
681
+ name : "Frame 0036" ,
682
+ } ,
683
+ ] }
684
+ />
685
+ ) )
686
+ . add ( "Hide Header" , ( ) => (
687
+ < Annotator
688
+ onExit = { actionAddon ( "onExit" ) }
689
+ labelImages
690
+ hideHeader
691
+ fullImageSegmentationMode
692
+ enabledTools = { [ "modify-allowed-area" ] }
693
+ regionClsList = { [ "Alpha" , "Beta" , "Charlie" , "Delta" ] }
694
+ images = { [
695
+ {
696
+ src : exampleImage ,
697
+ name : "Frame 0036" ,
698
+ } ,
699
+ ] }
700
+ />
701
+ ) )
Original file line number Diff line number Diff line change @@ -54,6 +54,8 @@ type Props = {
54
54
alwaysShowNextButton ?: boolean ,
55
55
alwaysShowPrevButton ?: boolean ,
56
56
onRegionClassAdded : ( ) => { } ,
57
+ hideHeader ?: boolean ,
58
+ hideHeaderText ?: boolean ,
57
59
}
58
60
59
61
export const MainLayout = ( {
@@ -63,6 +65,10 @@ export const MainLayout = ({
63
65
alwaysShowPrevButton = false ,
64
66
RegionEditLabel,
65
67
onRegionClassAdded,
68
+ hideHeader,
69
+ hideHeaderText,
70
+ hideNext = false ,
71
+ hidePrev = false ,
66
72
} : Props ) => {
67
73
const classes = useStyles ( )
68
74
const settings = useSettings ( )
@@ -226,6 +232,8 @@ export const MainLayout = ({
226
232
< Workspace
227
233
allowFullscreen
228
234
iconDictionary = { iconDictionary }
235
+ hideHeader = { hideHeader }
236
+ hideHeaderText = { hideHeaderText }
229
237
headerLeftSide = { [
230
238
state . annotationType === "video" ? (
231
239
< KeyframeTimeline
@@ -239,8 +247,8 @@ export const MainLayout = ({
239
247
) : null ,
240
248
] . filter ( Boolean ) }
241
249
headerItems = { [
242
- { name : "Prev" } ,
243
- { name : "Next" } ,
250
+ ! hidePrev && { name : "Prev" } ,
251
+ ! hideNext && { name : "Next" } ,
244
252
state . annotationType !== "video"
245
253
? null
246
254
: ! state . videoPlaying
Original file line number Diff line number Diff line change @@ -14566,10 +14566,10 @@ react-markdown@^4.0.6:
14566
14566
unist-util-visit "^1.3.0"
14567
14567
xtend "^4.0.1"
14568
14568
14569
- react-material-workspace-layout@^1.0.6 :
14570
- version "1.0.6 "
14571
- resolved "https://registry.yarnpkg.com/react-material-workspace-layout/-/react-material-workspace-layout-1.0.6 .tgz#d4495bb62bdc764ee3ccc77cdd1f7c33e4022c92 "
14572
- integrity sha512-CiqdpivEC9ZEELDpJFrrzwfnZgtz2Ijl465bf1ehU7tflJ3Z9Dhm2cYXzGPzeNrqJ0pdmKQoCn27Ht943oHefQ ==
14569
+ react-material-workspace-layout@^1.0.8 :
14570
+ version "1.0.8 "
14571
+ resolved "https://registry.yarnpkg.com/react-material-workspace-layout/-/react-material-workspace-layout-1.0.8 .tgz#3825b7ee2f5d2b219adac98afce4670fd3935bbb "
14572
+ integrity sha512-UT4qIVXJA2MhHiv4D/18jxo5vFnn+q/xWk0x+b01V/niKzIRE6jx/MNSJdmzgAyhzTxU2XixMCMhGVQu19JyOw ==
14573
14573
dependencies:
14574
14574
"@material-ui/core" "^4.10.0"
14575
14575
"@material-ui/icons" "^4.9.1"
You can’t perform that action at this time.
0 commit comments