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

Function initMargins

src/plots/plots.js:1739–1756  ·  view source on GitHub ↗
(fullLayout)

Source from the content-addressed store, hash-verified

1737};
1738
1739function initMargins(fullLayout) {
1740 var margin = fullLayout.margin;
1741
1742 if(!fullLayout._size) {
1743 var gs = fullLayout._size = {
1744 l: Math.round(margin.l),
1745 r: Math.round(margin.r),
1746 t: Math.round(margin.t),
1747 b: Math.round(margin.b),
1748 p: Math.round(margin.pad)
1749 };
1750 gs.w = Math.round(fullLayout.width) - gs.l - gs.r;
1751 gs.h = Math.round(fullLayout.height) - gs.t - gs.b;
1752 }
1753 if(!fullLayout._pushmargin) fullLayout._pushmargin = {};
1754 if(!fullLayout._pushmarginIds) fullLayout._pushmarginIds = {};
1755 if(!fullLayout._reservedMargin) fullLayout._reservedMargin = {};
1756}
1757
1758// non-negotiable - this is the smallest height we will allow users to specify via explicit margins
1759var MIN_SPECIFIED_WIDTH = 2;

Callers 1

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