MCPcopy Index your code
hub / github.com/plotly/plotly.js / considerCrossing

Function considerCrossing

src/traces/pie/plot.js:711–728  ·  view source on GitHub ↗
(angle, key)

Source from the content-addressed store, hash-verified

709 // max size if text is placed (horizontally) at the top or bottom of the arc
710
711 var considerCrossing = function (angle, key) {
712 if (isCrossing(pt, angle)) {
713 var dStart = Math.abs(angle - pt.startangle);
714 var dStop = Math.abs(angle - pt.stopangle);
715
716 var closestEdge = dStart < dStop ? dStart : dStop;
717
718 if (key === 'tan') {
719 newT = calcTanTransform(textBB, r, ring, closestEdge, 0);
720 } else {
721 // case of 'rad'
722 newT = calcRadTransform(textBB, r, ring, closestEdge, Math.PI / 2);
723 }
724 newT.textPosAngle = angle;
725
726 allTransforms.push(newT);
727 }
728 };
729
730 // to cover all cases with trace.rotation added
731 var i;

Callers 1

transformInsideTextFunction · 0.85

Calls 3

isCrossingFunction · 0.85
calcTanTransformFunction · 0.85
calcRadTransformFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…