Skip to content

Commit aeaba5c

Browse files
committed
Expose variables
1 parent 55f86ea commit aeaba5c

File tree

3 files changed

+25
-8
lines changed

3 files changed

+25
-8
lines changed

src/plots/cartesian/axes.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2541,6 +2541,7 @@ axes.drawOne = function(gd, ax, opts) {
25412541
var s = ax.side.charAt(0);
25422542
var sMirror = OPPOSITE_SIDE[ax.side].charAt(0);
25432543
var pos = axes.getPxPosition(gd, ax);
2544+
console.log(pos)
25442545
var outsideTickLen = outsideTicks ? ax.ticklen : 0;
25452546
var llbbox;
25462547

@@ -3766,9 +3767,13 @@ function drawDividers(gd, ax, opts) {
37663767
*/
37673768
axes.getPxPosition = function(gd, ax) {
37683769
var gs = gd._fullLayout._size;
3770+
console.log("PRINTING...")
3771+
//console.log(gd._fullLayout._size)
37693772
var axLetter = ax._id.charAt(0);
37703773
var side = ax.side;
37713774
var anchorAxis;
3775+
console.log(side)
3776+
console.log(axLetter)
37723777

37733778
if(ax.anchor !== 'free') {
37743779
anchorAxis = ax._anchorAxis;

src/plots/layout_attributes.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,20 @@ module.exports = {
228228
'between the plotting area and the axis lines'
229229
].join(' ')
230230
},
231+
minreducedwidth: {
232+
valType: 'number',
233+
min: 0,
234+
dflt: 64,
235+
editType: 'plot',
236+
description: 'TODO'
237+
},
238+
minreducedheight: {
239+
valType: 'number',
240+
min: 0,
241+
dflt: 64,
242+
editType: 'plot',
243+
description: 'TODO'
244+
},
231245
autoexpand: {
232246
valType: 'boolean',
233247
dflt: true,

src/plots/plots.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,6 +1512,8 @@ plots.supplyLayoutGlobalDefaults = function(layoutIn, layoutOut, formatObj) {
15121512
coerce('margin.b');
15131513
coerce('margin.pad');
15141514
coerce('margin.autoexpand');
1515+
coerce('margin.minreducedwidth');
1516+
coerce('margin.minreducedheight');
15151517

15161518
if(layoutIn.width && layoutIn.height) plots.sanitizeMargins(layoutOut);
15171519

@@ -1861,10 +1863,6 @@ function initMargins(fullLayout) {
18611863
var MIN_SPECIFIED_WIDTH = 2;
18621864
var MIN_SPECIFIED_HEIGHT = 2;
18631865

1864-
// could be exposed as an option - the smallest we will allow automargin to shrink a larger plot
1865-
var MIN_REDUCED_WIDTH = 64;
1866-
var MIN_REDUCED_HEIGHT = 64;
1867-
18681866
/**
18691867
* autoMargin: called by components that may need to expand the margins to
18701868
* be rendered on-plot.
@@ -1889,13 +1887,13 @@ plots.autoMargin = function(gd, id, o) {
18891887
var minFinalWidth = Lib.constrain(
18901888
width - margin.l - margin.r,
18911889
MIN_SPECIFIED_WIDTH,
1892-
MIN_REDUCED_WIDTH
1890+
margin.minreducedwidth
18931891
);
18941892

18951893
var minFinalHeight = Lib.constrain(
18961894
height - margin.t - margin.b,
18971895
MIN_SPECIFIED_HEIGHT,
1898-
MIN_REDUCED_HEIGHT
1896+
margin.minreducedheight
18991897
);
19001898

19011899
var maxSpaceW = Math.max(0, width - minFinalWidth);
@@ -2032,13 +2030,13 @@ plots.doAutoMargin = function(gd) {
20322030
var minFinalWidth = Lib.constrain(
20332031
width - margin.l - margin.r,
20342032
MIN_SPECIFIED_WIDTH,
2035-
MIN_REDUCED_WIDTH
2033+
margin.minreducedwidth
20362034
);
20372035

20382036
var minFinalHeight = Lib.constrain(
20392037
height - margin.t - margin.b,
20402038
MIN_SPECIFIED_HEIGHT,
2041-
MIN_REDUCED_HEIGHT
2039+
margin.minreducedheight
20422040
);
20432041

20442042
var maxSpaceW = Math.max(0, width - minFinalWidth);

0 commit comments

Comments
 (0)