Skip to content

Commit

Permalink
remove comments regarding push options and simplify logic for now
Browse files Browse the repository at this point in the history
  • Loading branch information
archmoj committed Apr 13, 2021
1 parent 71e24eb commit c9eaff2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
18 changes: 5 additions & 13 deletions src/plots/cartesian/axes.js
Original file line number Diff line number Diff line change
Expand Up @@ -3065,7 +3065,6 @@ axes.drawLabels = function(gd, ax, opts) {
if(!ticklabeloverflow || ticklabeloverflow === 'allow') return;

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

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

if(mathjaxGroup.empty()) {
var bb = Drawing.bBox(thisLabel.node());
var adjust = '';
var adjust = 0;
if(isX) {
if(bb.right > max) adjust += 'right';
else if(bb.left < min) adjust += 'left';
if(bb.right > max) adjust = 1;
else if(bb.left < min) adjust = 1;
} else {
if(bb.bottom > max) adjust += 'top';
else if(bb.top + (ax.tickangle ? 0 : d.fontSize / 4) < min) adjust += 'bottom';
if(bb.bottom > max) adjust = 1;
else if(bb.top + (ax.tickangle ? 0 : d.fontSize / 4) < min) adjust = 1;
}

var t = thisLabel.select('text');
if(adjust) {
if(hideOverflow) t.style('opacity', 0); // hidden
/*
else if(pushOverflow) {
if(adjust.indexOf('left') !== -1) t.attr('text-anchor', 'start');
if(adjust.indexOf('right') !== -1) t.attr('text-anchor', 'end');
// more TODO: https://github.com/plotly/plotly.js/issues/3292
}
*/
} else {
t.style('opacity', 1); // visible

Expand Down
4 changes: 1 addition & 3 deletions src/plots/cartesian/layout_attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -500,9 +500,7 @@ module.exports = {
values: [
'allow',
'hide past div',
'hide past domain',
// 'push to div',
// 'push to domain'
'hide past domain'
],
editType: 'calc',
description: [
Expand Down

0 comments on commit c9eaff2

Please sign in to comment.