Skip to content

Commit a54ca9c

Browse files
committed
better description regarding the position of pathbar also move the gap to constants
1 parent e4bc91e commit a54ca9c

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/traces/treemap/attributes.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ module.exports = {
168168
role: 'info',
169169
editType: 'plot',
170170
description: [
171-
'Determines if the path bar is drawn.'
171+
'Determines if the path bar is drawn',
172+
'i.e. outside the trace `domain` and',
173+
'with one pixel gap.'
172174
].join(' ')
173175
},
174176

src/traces/treemap/constants.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ module.exports = {
1919
'root',
2020
'visible',
2121
'parent'
22-
]
22+
],
23+
gapWithPathbar: 1 // i.e. one pixel
2324
};

src/traces/treemap/plot.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ var Lib = require('../../lib');
1717
var TEXTPAD = require('../bar/constants').TEXTPAD;
1818
var toMoveInsideBar = require('../bar/plot').toMoveInsideBar;
1919

20+
var constants = require('./constants');
2021
var drawDescendants = require('./draw_descendants');
2122
var drawAncestors = require('./draw_ancestors');
2223

@@ -90,7 +91,7 @@ function plotOne(gd, cd, element, transitionOpts) {
9091
var vph = gs.h * (domain.y[1] - domain.y[0]);
9192
var barW = vpw;
9293
var barH = trace.pathbar.thickness;
93-
var barPad = trace.marker.line.width + 1; // TODO: may expose this constant in future
94+
var barPad = trace.marker.line.width + constants.gapWithPathbar;
9495
var barDifY = !trace.pathbar.visible ? 0 :
9596
trace.pathbar.side.indexOf('bottom') > -1 ? vph + barPad : -(barH + barPad);
9697

0 commit comments

Comments
 (0)