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

Function computeTransform

src/traces/pie/plot.js:1285–1297  ·  view source on GitHub ↗
(
    transform, // inout
    textBB // in
)

Source from the content-addressed store, hash-verified

1283}
1284
1285function computeTransform(
1286 transform, // inout
1287 textBB // in
1288) {
1289 var a = (transform.rotate * Math.PI) / 180;
1290 var cosA = Math.cos(a);
1291 var sinA = Math.sin(a);
1292 var midX = (textBB.left + textBB.right) / 2;
1293 var midY = (textBB.top + textBB.bottom) / 2;
1294 transform.textX = midX * cosA - midY * sinA;
1295 transform.textY = midX * sinA + midY * cosA;
1296 transform.noCenter = true;
1297}
1298
1299module.exports = {
1300 plot: plot,

Callers 2

strTransformFunction · 0.85
plotFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…