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

Function getMainTitleY

src/plot_api/subroutines.js:573–594  ·  view source on GitHub ↗
(fullLayout, dy)

Source from the content-addressed store, hash-verified

571}
572
573function getMainTitleY(fullLayout, dy) {
574 var title = fullLayout.title;
575 var gs = fullLayout._size;
576 var vPadShift = 0;
577 if(dy === '0em' || !dy) {
578 vPadShift = -title.pad.b;
579 } else if(dy === alignmentConstants.CAP_SHIFT + 'em') {
580 vPadShift = title.pad.t;
581 }
582
583 if(title.y === 'auto') {
584 return gs.t / 2;
585 } else {
586 switch(title.yref) {
587 case 'paper':
588 return gs.t + gs.h - gs.h * title.y + vPadShift;
589 case 'container':
590 default:
591 return fullLayout.height - fullLayout.height * title.y + vPadShift;
592 }
593 }
594}
595
596function getMainTitleDyAdj(yanchor) {
597 if(yanchor === 'top') {

Callers 1

subroutines.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…