@@ -740,38 +740,40 @@ class JSRootMenu {
740740 faxis . fNdivisions = val ; painter . interactiveRedraw ( 'pad' , `exec:SetNdivisions(${ val } )` , kind ) ;
741741 } ) ) ;
742742
743- this . sub ( 'Labels' ) ;
744- this . addchk ( faxis . TestBit ( EAxisBits . kCenterLabels ) , 'Center' ,
745- arg => { faxis . SetBit ( EAxisBits . kCenterLabels , arg ) ; painter . interactiveRedraw ( 'pad' , `exec:CenterLabels(${ arg } )` , kind ) ; } ) ;
746- this . addchk ( faxis . TestBit ( EAxisBits . kLabelsVert ) , 'Rotate' ,
747- arg => { faxis . SetBit ( EAxisBits . kLabelsVert , arg ) ; painter . interactiveRedraw ( 'pad' , `exec:SetBit(TAxis::kLabelsVert,${ arg } )` , kind ) ; } ) ;
748- this . addColorMenu ( 'Color' , faxis . fLabelColor ,
749- arg => { faxis . fLabelColor = arg ; painter . interactiveRedraw ( 'pad' , getColorExec ( arg , 'SetLabelColor' ) , kind ) ; } ) ;
750- this . addSizeMenu ( 'Offset' , - 0.02 , 0.1 , 0.01 , faxis . fLabelOffset ,
751- arg => { faxis . fLabelOffset = arg ; painter . interactiveRedraw ( 'pad' , `exec:SetLabelOffset(${ arg } )` , kind ) ; } ) ;
752- let a = faxis . fLabelSize >= 1 ;
753- this . addSizeMenu ( 'Size' , a ? 2 : 0.02 , a ? 30 : 0.11 , a ? 2 : 0.01 , faxis . fLabelSize ,
754- arg => { faxis . fLabelSize = arg ; painter . interactiveRedraw ( 'pad' , `exec:SetLabelSize(${ arg } )` , kind ) ; } ) ;
755-
756- if ( frame_painter && ( axis_painter ?. kind === kAxisLabels ) && ( faxis . fNbins > 20 ) ) {
757- this . add ( 'Find label' , ( ) => this . input ( 'Label id' ) . then ( id => {
758- if ( ! id )
759- return ;
760- for ( let bin = 0 ; bin < faxis . fNbins ; ++ bin ) {
761- const lbl = axis_painter . formatLabels ( bin ) ;
762- if ( lbl === id )
763- return frame_painter . zoomSingle ( kind , Math . max ( 0 , bin - 4 ) , Math . min ( faxis . fNbins , bin + 5 ) ) ;
764- }
765- } ) , 'Zoom into region around specific label' ) ;
766- }
767- if ( frame_painter && faxis . fLabels ) {
768- const ignore = `${ kind } _ignore_labels` ;
769- this . addchk ( ! frame_painter [ ignore ] , 'Custom' , flag => {
770- frame_painter [ ignore ] = ! flag ;
771- painter . interactiveRedraw ( 'pad' ) ;
772- } , `Use of custom labels in axis ${ kind } ` ) ;
743+ if ( kind !== 'v' ) {
744+ this . sub ( 'Labels' ) ;
745+ this . addchk ( faxis . TestBit ( EAxisBits . kCenterLabels ) , 'Center' ,
746+ arg => { faxis . SetBit ( EAxisBits . kCenterLabels , arg ) ; painter . interactiveRedraw ( 'pad' , `exec:CenterLabels(${ arg } )` , kind ) ; } ) ;
747+ this . addchk ( faxis . TestBit ( EAxisBits . kLabelsVert ) , 'Rotate' ,
748+ arg => { faxis . SetBit ( EAxisBits . kLabelsVert , arg ) ; painter . interactiveRedraw ( 'pad' , `exec:SetBit(TAxis::kLabelsVert,${ arg } )` , kind ) ; } ) ;
749+ this . addColorMenu ( 'Color' , faxis . fLabelColor ,
750+ arg => { faxis . fLabelColor = arg ; painter . interactiveRedraw ( 'pad' , getColorExec ( arg , 'SetLabelColor' ) , kind ) ; } ) ;
751+ this . addSizeMenu ( 'Offset' , - 0.02 , 0.1 , 0.01 , faxis . fLabelOffset ,
752+ arg => { faxis . fLabelOffset = arg ; painter . interactiveRedraw ( 'pad' , `exec:SetLabelOffset(${ arg } )` , kind ) ; } ) ;
753+ const a = faxis . fLabelSize >= 1 ;
754+ this . addSizeMenu ( 'Size' , a ? 2 : 0.02 , a ? 30 : 0.11 , a ? 2 : 0.01 , faxis . fLabelSize ,
755+ arg => { faxis . fLabelSize = arg ; painter . interactiveRedraw ( 'pad' , `exec:SetLabelSize(${ arg } )` , kind ) ; } ) ;
756+
757+ if ( frame_painter && ( axis_painter ?. kind === kAxisLabels ) && ( faxis . fNbins > 20 ) ) {
758+ this . add ( 'Find label' , ( ) => this . input ( 'Label id' ) . then ( id => {
759+ if ( ! id )
760+ return ;
761+ for ( let bin = 0 ; bin < faxis . fNbins ; ++ bin ) {
762+ const lbl = axis_painter . formatLabels ( bin ) ;
763+ if ( lbl === id )
764+ return frame_painter . zoomSingle ( kind , Math . max ( 0 , bin - 4 ) , Math . min ( faxis . fNbins , bin + 5 ) ) ;
765+ }
766+ } ) , 'Zoom into region around specific label' ) ;
767+ }
768+ if ( frame_painter && faxis . fLabels ) {
769+ const ignore = `${ kind } _ignore_labels` ;
770+ this . addchk ( ! frame_painter [ ignore ] , 'Custom' , flag => {
771+ frame_painter [ ignore ] = ! flag ;
772+ painter . interactiveRedraw ( 'pad' ) ;
773+ } , `Use of custom labels in axis ${ kind } ` ) ;
774+ }
775+ this . endsub ( ) ;
773776 }
774- this . endsub ( ) ;
775777
776778 this . sub ( 'Title' ) ;
777779 this . add ( 'SetTitle' , ( ) => {
@@ -798,8 +800,8 @@ class JSRootMenu {
798800 } ) ;
799801 this . addSizeMenu ( 'Offset' , 0 , 3 , 0.2 , faxis . fTitleOffset ,
800802 arg => { faxis . fTitleOffset = arg ; painter . interactiveRedraw ( 'pad' , `exec:SetTitleOffset(${ arg } )` , kind ) ; } ) ;
801- a = faxis . fTitleSize >= 1 ;
802- this . addSizeMenu ( 'Size' , a ? 2 : 0.02 , a ? 30 : 0.11 , a ? 2 : 0.01 , faxis . fTitleSize ,
803+ const p = faxis . fTitleSize >= 1 ;
804+ this . addSizeMenu ( 'Size' , p ? 2 : 0.02 , p ? 30 : 0.11 , p ? 2 : 0.01 , faxis . fTitleSize ,
803805 arg => { faxis . fTitleSize = arg ; painter . interactiveRedraw ( 'pad' , `exec:SetTitleSize(${ arg } )` , kind ) ; } ) ;
804806 this . endsub ( ) ;
805807
0 commit comments