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

Function getRotatedTextSize

src/traces/bar/plot.js:748–757  ·  view source on GitHub ↗
(textBB, rotate)

Source from the content-addressed store, hash-verified

746}
747
748function getRotatedTextSize(textBB, rotate) {
749 var a = (Math.PI / 180) * rotate;
750 var absSin = Math.abs(Math.sin(a));
751 var absCos = Math.abs(Math.cos(a));
752
753 return {
754 x: textBB.width * absCos + textBB.height * absSin,
755 y: textBB.width * absSin + textBB.height * absCos
756 };
757}
758
759function toMoveInsideBar(x0, x1, y0, y1, textBB, opts) {
760 var isHorizontal = !!opts.isHorizontal;

Callers 2

toMoveInsideBarFunction · 0.85
toMoveOutsideBarFunction · 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…