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 1919 "react-hotkeys" : " ^2.0.0" ,
2020 "react-json-view" : " ^1.19.1" ,
2121 "react-markdown" : " ^4.0.6" ,
22- "react-material-workspace-layout" : " ^1.0.6 " ,
22+ "react-material-workspace-layout" : " ^1.0.8 " ,
2323 "react-monaco-editor" : " ^0.25.1" ,
2424 "react-remove-scroll" : " ^2.0.4" ,
2525 "react-select" : " ^3.0.8" ,
Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ type Props = {
4848 autoSegmentationOptions ?:
4949 | { | type : "simple" | }
5050 | { | type : "autoseg" , maxClusters ?: number , slicWeightFactor ?: number | } ,
51+ hideHeader ?: boolean ,
52+ hideHeaderText ?: boolean ,
53+ hideNext ?: boolean ,
54+ hidePrev ?: boolean ,
5155}
5256
5357export const Annotator = ( {
@@ -82,6 +86,10 @@ export const Annotator = ({
8286 onPrevImage,
8387 keypointDefinitions,
8488 autoSegmentationOptions = { type : "autoseg" } ,
89+ hideHeader,
90+ hideHeaderText,
91+ hideNext,
92+ hidePrev,
8593} : Props ) => {
8694 if ( typeof selectedImage === "string" ) {
8795 selectedImage = ( images || [ ] ) . findIndex ( ( img ) => img . src === selectedImage )
@@ -172,6 +180,10 @@ export const Annotator = ({
172180 state = { state }
173181 dispatch = { dispatch }
174182 onRegionClassAdded = { onRegionClassAdded }
183+ hideHeader = { hideHeader }
184+ hideHeaderText = { hideHeaderText }
185+ hideNext = { hideNext }
186+ hidePrev = { hidePrev }
175187 />
176188 </ SettingsProvider >
177189 )
Original file line number Diff line number Diff line change @@ -666,3 +666,36 @@ storiesOf("Annotator", module)
666666 ] }
667667 />
668668 ) )
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 = {
5454 alwaysShowNextButton ?: boolean ,
5555 alwaysShowPrevButton ?: boolean ,
5656 onRegionClassAdded : ( ) => { } ,
57+ hideHeader ?: boolean ,
58+ hideHeaderText ?: boolean ,
5759}
5860
5961export const MainLayout = ( {
@@ -63,6 +65,10 @@ export const MainLayout = ({
6365 alwaysShowPrevButton = false ,
6466 RegionEditLabel,
6567 onRegionClassAdded,
68+ hideHeader,
69+ hideHeaderText,
70+ hideNext = false ,
71+ hidePrev = false ,
6672} : Props ) => {
6773 const classes = useStyles ( )
6874 const settings = useSettings ( )
@@ -226,6 +232,8 @@ export const MainLayout = ({
226232 < Workspace
227233 allowFullscreen
228234 iconDictionary = { iconDictionary }
235+ hideHeader = { hideHeader }
236+ hideHeaderText = { hideHeaderText }
229237 headerLeftSide = { [
230238 state . annotationType === "video" ? (
231239 < KeyframeTimeline
@@ -239,8 +247,8 @@ export const MainLayout = ({
239247 ) : null ,
240248 ] . filter ( Boolean ) }
241249 headerItems = { [
242- { name : "Prev" } ,
243- { name : "Next" } ,
250+ ! hidePrev && { name : "Prev" } ,
251+ ! hideNext && { name : "Next" } ,
244252 state . annotationType !== "video"
245253 ? null
246254 : ! state . videoPlaying
Original file line number Diff line number Diff line change @@ -14566,10 +14566,10 @@ react-markdown@^4.0.6:
1456614566 unist-util-visit "^1.3.0"
1456714567 xtend "^4.0.1"
1456814568
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 ==
1457314573 dependencies:
1457414574 "@material-ui/core" "^4.10.0"
1457514575 "@material-ui/icons" "^4.9.1"
You can’t perform that action at this time.
0 commit comments