susiwen8 commented on code in PR #21597:
URL: https://github.com/apache/echarts/pull/21597#discussion_r3206119031


##########
src/chart/chord/ChordPiece.ts:
##########
@@ -26,9 +26,18 @@ import type Model from '../../model/Model';
 import type { GraphNode } from '../../data/Graph';
 import { getLabelStatesModels, setLabelStyle } from '../../label/labelStyle';
 import type { BuiltinTextPosition } from 'zrender/src/core/types';
-import { setStatesStylesFromModel, toggleHoverEmphasis } from 
'../../util/states';
+import { setStatesStylesFromModel, SPECIAL_STATES, toggleHoverEmphasis } from 
'../../util/states';
 import { getECData } from '../../util/innerStore';
 
+const RADIAN = Math.PI / 180;
+
+function getLabelRotation(rotate: number | 'radial', midAngle: number, dx: 
number): number {
+    if (rotate === 'radial') {
+        return dx < 0 ? -midAngle + Math.PI : -midAngle;

Review Comment:
   `series.startAngle` is already included in the node layout: `chordLayout` 
derives each nodes `layout.startAngle` / `layout.endAngle` from the normalized 
series start angle, and the label rotation uses that resulting `midAngle`.
   
   The boundary consideration is valid, though. The current `dx < 0` flip check 
can be sensitive around the 90 / 270 degree boundaries, especially with 
non-default `startAngle`, while sunburst uses normalized radians plus an 
epsilon boundary check. I will align this with the sunburst approach and add 
coverage for a non-default `startAngle` boundary case.



-- 
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