Skip to content

Commit c9eaff2

Browse files
committed
remove comments regarding push options and simplify logic for now
1 parent 71e24eb commit c9eaff2

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

src/plots/cartesian/axes.js

+5-13
Original file line numberDiff line numberDiff line change
@@ -3065,7 +3065,6 @@ axes.drawLabels = function(gd, ax, opts) {
30653065
if(!ticklabeloverflow || ticklabeloverflow === 'allow') return;
30663066

30673067
var hideOverflow = ticklabeloverflow.indexOf('hide') !== -1;
3068-
// var pushOverflow = ticklabeloverflow.indexOf('push') !== -1;
30693068

30703069
var isX = ax._id.charAt(0) === 'x';
30713070
// div positions
@@ -3095,25 +3094,18 @@ axes.drawLabels = function(gd, ax, opts) {
30953094

30963095
if(mathjaxGroup.empty()) {
30973096
var bb = Drawing.bBox(thisLabel.node());
3098-
var adjust = '';
3097+
var adjust = 0;
30993098
if(isX) {
3100-
if(bb.right > max) adjust += 'right';
3101-
else if(bb.left < min) adjust += 'left';
3099+
if(bb.right > max) adjust = 1;
3100+
else if(bb.left < min) adjust = 1;
31023101
} else {
3103-
if(bb.bottom > max) adjust += 'top';
3104-
else if(bb.top + (ax.tickangle ? 0 : d.fontSize / 4) < min) adjust += 'bottom';
3102+
if(bb.bottom > max) adjust = 1;
3103+
else if(bb.top + (ax.tickangle ? 0 : d.fontSize / 4) < min) adjust = 1;
31053104
}
31063105

31073106
var t = thisLabel.select('text');
31083107
if(adjust) {
31093108
if(hideOverflow) t.style('opacity', 0); // hidden
3110-
/*
3111-
else if(pushOverflow) {
3112-
if(adjust.indexOf('left') !== -1) t.attr('text-anchor', 'start');
3113-
if(adjust.indexOf('right') !== -1) t.attr('text-anchor', 'end');
3114-
// more TODO: https://github.com/plotly/plotly.js/issues/3292
3115-
}
3116-
*/
31173109
} else {
31183110
t.style('opacity', 1); // visible
31193111

src/plots/cartesian/layout_attributes.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -500,9 +500,7 @@ module.exports = {
500500
values: [
501501
'allow',
502502
'hide past div',
503-
'hide past domain',
504-
// 'push to div',
505-
// 'push to domain'
503+
'hide past domain'
506504
],
507505
editType: 'calc',
508506
description: [

0 commit comments

Comments
 (0)