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

Function getMainTitleX

src/plot_api/subroutines.js:553–571  ·  view source on GitHub ↗
(fullLayout, textAnchor)

Source from the content-addressed store, hash-verified

551}
552
553function getMainTitleX(fullLayout, textAnchor) {
554 var title = fullLayout.title;
555 var gs = fullLayout._size;
556 var hPadShift = 0;
557
558 if(textAnchor === SVG_TEXT_ANCHOR_START) {
559 hPadShift = title.pad.l;
560 } else if(textAnchor === SVG_TEXT_ANCHOR_END) {
561 hPadShift = -title.pad.r;
562 }
563
564 switch(title.xref) {
565 case 'paper':
566 return gs.l + gs.w * title.x + hPadShift;
567 case 'container':
568 default:
569 return fullLayout.width * title.x + hPadShift;
570 }
571}
572
573function getMainTitleY(fullLayout, dy) {
574 var title = fullLayout.title;

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…