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

Function ensureLength

src/components/legend/draw.js:625–631  ·  view source on GitHub ↗
(str, maxLength)

Source from the content-addressed store, hash-verified

623 * no wider than the real labels.
624 */
625function ensureLength(str, maxLength) {
626 var targetLength = Math.max(4, maxLength);
627 if(str && str.trim().length >= targetLength / 2) return str;
628 str = str || '';
629 for(var i = targetLength - str.length; i > 0; i--) str += ' ';
630 return str;
631}
632
633function setupTraceToggle(g, gd, legendId) {
634 var doubleClickDelay = gd._context.doubleClickDelay;

Callers 1

drawTextsFunction · 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…