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

Function calcTanTransform

src/traces/pie/plot.js:815–826  ·  view source on GitHub ↗
(textBB, r, ring, halfAngle, midAngle)

Source from the content-addressed store, hash-verified

813}
814
815function calcTanTransform(textBB, r, ring, halfAngle, midAngle) {
816 r = Math.max(0, r - 2 * TEXTPAD);
817
818 // max size if text is rotated tangentially
819 var a = textBB.height / textBB.width;
820 var s = calcMaxHalfSize(a, halfAngle, r, ring);
821 return {
822 scale: (s * 2) / textBB.width,
823 rCenter: calcRCenter(a, s / r),
824 rotate: calcRotate(midAngle + Math.PI / 2)
825 };
826}
827
828function calcRCenter(a, b) {
829 return Math.cos(b) - a * b;

Callers 2

considerCrossingFunction · 0.85
transformInsideTextFunction · 0.85

Calls 3

calcMaxHalfSizeFunction · 0.85
calcRCenterFunction · 0.85
calcRotateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…