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

Function needsMarginPush

src/plot_api/subroutines.js:506–529  ·  view source on GitHub ↗
(gd, title, titleHeight)

Source from the content-addressed store, hash-verified

504}
505
506function needsMarginPush(gd, title, titleHeight) {
507 var titleY = title.y;
508 var titleYanchor = title.yanchor;
509 var position = titleY > 0.5 ? 't' : 'b';
510 var curMargin = gd._fullLayout.margin[position];
511 var pushMargin = 0;
512 if(title.yref === 'paper') {
513 pushMargin = (
514 titleHeight +
515 title.pad.t +
516 title.pad.b
517 );
518 } else if(title.yref === 'container') {
519 pushMargin = (
520 containerPushVal(position, titleY, titleYanchor, gd._fullLayout.height, titleHeight) +
521 title.pad.t +
522 title.pad.b
523 );
524 }
525 if(pushMargin > curMargin) {
526 return pushMargin;
527 }
528 return 0;
529}
530
531function applyTitleAutoMargin(gd, y, pushMargin, titleHeight) {
532 var titleID = 'title.automargin';

Callers 1

subroutines.jsFile · 0.85

Calls 1

containerPushValFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…