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

Function fitTextInsideBox

src/traces/indicator/plot.js:841–845  ·  view source on GitHub ↗
(textBB, width, height)

Source from the content-addressed store, hash-verified

839}
840
841function fitTextInsideBox(textBB, width, height) {
842 // compute scaling ratio to have text fit within specified width and height
843 var ratio = Math.min(width / textBB.width, height / textBB.height);
844 return [ratio, textBB, width + 'x' + height];
845}
846
847function fitTextInsideCircle(textBB, radius) {
848 // compute scaling ratio to have text fit within specified radius

Callers 1

plot.jsFile · 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…