sidshas03 commented on issue #21834:
URL: https://github.com/apache/echarts/issues/21834#issuecomment-6796594687

   Checked on master (34f4d927).
   
   Problem is there. nameGap is applied before the overlap move. AxisBuilder.ts 
L853 sets the position from nameGap (middle case is L869: pos.y = labelOffset + 
nameDirection * gap), then resolveAxisNameOverlap runs. moveIfOverlap (L406) 
shifts the name only when the rects still hit. So any nameGap inside the label 
box lands at the same spot. Only a gap bigger than the label extent actually 
moves it. nameTextStyle.textMargin only grows the collision box 
(labelLayoutHelper.ts L192). It is not a shift after the move, and it cannot 
pull the name back in.
   
   Before adding nameOffset, two things:
   
   1. axisCommonTypes.ts L63-L69 already documents nameGap as the offset from 
axis line + labels when nameMoveOverlap is true, and the pending line is: 
"should it named as nameOffset or support [offsetX, offsetY]?". Code does not 
match that comment. The procedure note right under it (L74-L76) says nameGap is 
applied first on purpose: "if nameGap is applied after the overlap handling, it 
may still cause overlap and confuse users." So this ask is already an open 
question in that file. A new option also called nameOffset will clash with that 
pending line. A negative offset that overlaps again goes against L75-L76.
   
   2. #21059 is the merged overlap work this issue points at. That PR does not 
mention #17902, and nothing there links to this issue. #17902 is still open. It 
is about the name sitting on the labels, plus this line: "Is there a way to get 
the size of the label space/boundaries?" The overlap part was fixed in #21059. 
The boundary read was never added. It is not a request for a post-overlap 
offset.
   
   If a pixel nudge after the auto move is still needed, settle the pending on 
nameGap first. Do not add a second option until that comment and the code say 
the same thing.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to