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

Function applyTitleAutoMargin

src/plot_api/subroutines.js:531–551  ·  view source on GitHub ↗
(gd, y, pushMargin, titleHeight)

Source from the content-addressed store, hash-verified

529}
530
531function applyTitleAutoMargin(gd, y, pushMargin, titleHeight) {
532 var titleID = 'title.automargin';
533 var title = gd._fullLayout.title;
534 var position = title.y > 0.5 ? 't' : 'b';
535 var push = {
536 x: title.x,
537 y: title.y,
538 t: 0,
539 b: 0
540 };
541 var reservedPush = {};
542
543 if(title.yref === 'paper' && isOutsideContainer(gd, title, position, y, titleHeight)) {
544 push[position] = pushMargin;
545 } else if(title.yref === 'container') {
546 reservedPush[position] = pushMargin;
547 gd._fullLayout._reservedMargin[titleID] = reservedPush;
548 }
549 Plots.allowAutoMargin(gd, titleID);
550 Plots.autoMargin(gd, titleID, push);
551}
552
553function getMainTitleX(fullLayout, textAnchor) {
554 var title = fullLayout.title;

Callers 1

subroutines.jsFile · 0.85

Calls 1

isOutsideContainerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…