Skip to content

Commit d7b06a1

Browse files
committed
change divider to edgeshape
1 parent a54ca9c commit d7b06a1

File tree

6 files changed

+25
-25
lines changed

6 files changed

+25
-25
lines changed

src/traces/treemap/attributes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ module.exports = {
189189
].join(' ')
190190
},
191191

192-
divider: {
192+
edgeshape: {
193193
valType: 'enumerated',
194194
values: [
195195
'>',
@@ -202,7 +202,7 @@ module.exports = {
202202
role: 'style',
203203
editType: 'plot',
204204
description: [
205-
'Determines which divider is used between labels.'
205+
'Determines which shape is used for edges between `barpath` labels.'
206206
].join(' ')
207207
},
208208

src/traces/treemap/defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
105105
coerce('pathbar.thickness', traceOut.pathbar.textfont.size + 2 * TEXTPAD);
106106

107107
coerce('pathbar.side');
108-
coerce('pathbar.divider');
108+
coerce('pathbar.edgeshape');
109109
}
110110

111111
handleDomainDefaults(traceOut, layout, coerce);

src/traces/treemap/plot.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ function plotOne(gd, cd, element, transitionOpts) {
173173
p.x = Math.max(xStart, p.x);
174174
};
175175

176-
var divider = trace.pathbar.divider;
177-
var hasExtraPoint = (divider !== '|');
176+
var edgeshape = trace.pathbar.edgeshape;
177+
var hasExtraPoint = (edgeshape !== '|');
178178

179179
// pathbar(directory) path generation fn
180180
var pathAncestor = function(d) {
@@ -192,8 +192,8 @@ function plotOne(gd, cd, element, transitionOpts) {
192192
pM.x = _x0;
193193

194194
pM.y = (
195-
divider === '>' ||
196-
divider === '<'
195+
edgeshape === '>' ||
196+
edgeshape === '<'
197197
) ? _y0 + halfH : _y0;
198198
}
199199

@@ -202,14 +202,14 @@ function plotOne(gd, cd, element, transitionOpts) {
202202
var pC = {x: _x1, y: _y1};
203203
var pD = {x: _x0, y: _y1};
204204

205-
if(divider === '>') {
205+
if(edgeshape === '>') {
206206
pA.x -= halfH;
207207
pD.x -= halfH;
208-
} else if(divider === '/') {
208+
} else if(edgeshape === '/') {
209209
pD.x -= halfH;
210-
} else if(divider === '\\') {
210+
} else if(edgeshape === '\\') {
211211
pM.x -= halfH;
212-
} else if(divider === '<') {
212+
} else if(edgeshape === '<') {
213213
pM.x -= halfH;
214214
}
215215

1.18 KB
Loading

test/image/mocks/treemap_packings.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"packing": "binary"
99
},
1010
"pathbar": {
11-
"divider": "/",
11+
"edgeshape": "/",
1212
"textfont": {
1313
"size": 12,
1414
"family": "Times New Roman"
@@ -95,7 +95,7 @@
9595
"packing": "dice-slice"
9696
},
9797
"pathbar": {
98-
"divider": "|",
98+
"edgeshape": "|",
9999
"textfont": {
100100
"size": 12,
101101
"family": "Times New Roman"
@@ -182,7 +182,7 @@
182182
"packing": "squarify"
183183
},
184184
"pathbar": {
185-
"divider": "<",
185+
"edgeshape": "<",
186186
"textfont": {
187187
"size": 12,
188188
"family": "Times New Roman"
@@ -269,7 +269,7 @@
269269
"packing": "slice"
270270
},
271271
"pathbar": {
272-
"divider": ">",
272+
"edgeshape": ">",
273273
"textfont": {
274274
"size": 12,
275275
"family": "Times New Roman"
@@ -356,7 +356,7 @@
356356
"packing": "slice-dice"
357357
},
358358
"pathbar": {
359-
"divider": "|",
359+
"edgeshape": "|",
360360
"textfont": {
361361
"size": 12,
362362
"family": "Times New Roman"
@@ -443,7 +443,7 @@
443443
"packing": "dice"
444444
},
445445
"pathbar": {
446-
"divider": "\\",
446+
"edgeshape": "\\",
447447
"textfont": {
448448
"size": 12,
449449
"family": "Times New Roman"
@@ -529,47 +529,47 @@
529529
"annotations": [
530530
{
531531
"showarrow": false,
532-
"text": "<b>binary</b> treemap<br>with / divider",
532+
"text": "<b>binary</b> treemap<br>with / edgeshape",
533533
"x": 0.15,
534534
"xanchor": "center",
535535
"y": 0,
536536
"yanchor": "top"
537537
},
538538
{
539539
"showarrow": false,
540-
"text": "<b>dice-slice</b> treemap<br>with | divider",
540+
"text": "<b>dice-slice</b> treemap<br>with | edgeshape",
541541
"x": 0.5,
542542
"xanchor": "center",
543543
"y": 0,
544544
"yanchor": "top"
545545
},
546546
{
547547
"showarrow": false,
548-
"text": "<b>squarify</b> treemap<br>with < divider",
548+
"text": "<b>squarify</b> treemap<br>with < edgeshape",
549549
"x": 0.85,
550550
"xanchor": "center",
551551
"y": 0,
552552
"yanchor": "top"
553553
},
554554
{
555555
"showarrow": false,
556-
"text": "<b>slice</b> treemap<br>with > divider",
556+
"text": "<b>slice</b> treemap<br>with > edgeshape",
557557
"x": 0.15,
558558
"xanchor": "center",
559559
"y": 1,
560560
"yanchor": "bottom"
561561
},
562562
{
563563
"showarrow": false,
564-
"text": "<b>slice-dice</b> treemap<br>with | divider",
564+
"text": "<b>slice-dice</b> treemap<br>with | edgeshape",
565565
"x": 0.5,
566566
"xanchor": "center",
567567
"y": 1,
568568
"yanchor": "bottom"
569569
},
570570
{
571571
"showarrow": false,
572-
"text": "<b>dice</b> treemap<br>with \\ divider",
572+
"text": "<b>dice</b> treemap<br>with \\ edgeshape",
573573
"x": 0.85,
574574
"xanchor": "center",
575575
"y": 1,

test/jasmine/tests/treemap_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ describe('Test treemap defaults:', function() {
222222
expect(fullData[0].pathbar.textfont).toBe(undefined);
223223
expect(fullData[0].pathbar.thickness).toBe(undefined);
224224
expect(fullData[0].pathbar.side).toBe(undefined);
225-
expect(fullData[0].pathbar.divider).toBe(undefined);
225+
expect(fullData[0].pathbar.edgeshape).toBe(undefined);
226226
});
227227

228228
it('should set *pathbar.visible* to true by default', function() {
@@ -243,7 +243,7 @@ describe('Test treemap defaults:', function() {
243243
expect(fullData[0].pathbar.textfont.size).toBe(12);
244244
expect(fullData[0].pathbar.thickness).toBe(18);
245245
expect(fullData[0].pathbar.side).toBe('top');
246-
expect(fullData[0].pathbar.divider).toBe('>');
246+
expect(fullData[0].pathbar.edgeshape).toBe('>');
247247
});
248248

249249
it('should default *pathbar* sizes and styles to layout', function() {

0 commit comments

Comments
 (0)