Skip to content

Commit 66ca5f9

Browse files
committed
revise attribute name and do not add it to icicle
1 parent 7b6e278 commit 66ca5f9

12 files changed

+19
-53
lines changed

draftlogs/6351_add.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
- Expose `marker.fillet` attribute for rounded corners in treemap and icicle plots [[#6351](https://github.com/plotly/plotly.js/pull/6351)]
1+
- Add `marker.cornerradius` attribute to `treemap` trace [[#6351](https://github.com/plotly/plotly.js/pull/6351)]

src/traces/icicle/attributes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ module.exports = {
6161

6262
line: sunburstAttrs.marker.line,
6363

64-
fillet: treemapAttrs.marker.fillet,
64+
cornerradius: treemapAttrs.marker.cornerradius,
6565

6666
editType: 'calc'
6767
},

src/traces/icicle/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
6262
var lineWidth = coerce('marker.line.width');
6363
if(lineWidth) coerce('marker.line.color', layout.paper_bgcolor);
6464

65-
coerce('marker.fillet');
65+
coerce('marker.cornerradius');
6666

6767
coerce('marker.colors');
6868
var withColorscale = traceOut._hasColorscale = (

src/traces/treemap/attributes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ module.exports = {
141141

142142
line: sunburstAttrs.marker.line,
143143

144-
fillet: {
144+
cornerradius: {
145145
valType: 'number',
146146
min: 0,
147147
// max: 10, // TODO: Do we need a max?

src/traces/treemap/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
8585
coerce('marker.pad.r', headerSize / 4);
8686
coerce('marker.pad.b', bottomText ? headerSize : headerSize / 4);
8787

88-
coerce('marker.fillet');
88+
coerce('marker.cornerradius');
8989

9090
traceOut._hovered = {
9191
marker: {

src/traces/treemap/plot_one.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ module.exports = function plotOne(gd, cd, element, transitionOpts, drawDescendan
217217
var dy = _y1 - _y0;
218218
if(!dx || !dy) return '';
219219

220-
var FILLET = trace.marker.fillet;
220+
var FILLET = trace.marker.cornerradius;
221221
var r = dx > 2 * FILLET && dy > 2 * FILLET ? FILLET : Math.min(dx, dy) / 2;
222222

223223
var arc = function(rx, ry) { return r ? 'a' + pos(r, r) + ' 0 0 1 ' + pos(rx, ry) : ''; };
Loading

test/image/mocks/icicle_packages_colorscale_novalue.json

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"line": {
99
"color": "#777"
1010
},
11-
"fillet": 10,
1211
"colorscale": [[0, "#FFF"], [0.01, "#FF0"], [0.1, "#F00"], [1, "#000"]],
1312
"showscale": true
1413
},

test/image/mocks/treemap_packages_colorscale_novalue.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"line": {
1010
"color": "#777"
1111
},
12-
"fillet": 4,
12+
"cornerradius": 4,
1313
"colorscale": [[0, "#FFF"], [0.01, "#FF0"], [0.1, "#F00"], [1, "#000"]],
1414
"showscale": true
1515
},

test/jasmine/tests/icicle_test.js

-33
Original file line numberDiff line numberDiff line change
@@ -793,39 +793,6 @@ describe('Test icicle restyle:', function() {
793793
.then(_assert('back to dflt', ['', '0.7', '', '0.7']))
794794
.then(done, done.fail);
795795
});
796-
797-
it('should be able to restyle *marker.fillet*', function(done) {
798-
var mock = {
799-
data: [{
800-
type: 'icicle',
801-
labels: ['Root', 'A', 'B', 'b'],
802-
parents: ['', 'Root', 'Root', 'B']
803-
}]
804-
};
805-
806-
function _assert(msg, exp) {
807-
return function() {
808-
var layer = d3Select(gd).select('.iciclelayer');
809-
layer.selectAll('.surface').each(function() {
810-
var surfaces = d3Select(this);
811-
var path = surfaces[0][0].getAttribute('d');
812-
expect(path.indexOf('a') !== -1).toEqual(exp);
813-
});
814-
};
815-
}
816-
817-
Plotly.newPlot(gd, mock)
818-
.then(_assert('no arcs', false))
819-
.then(function() {
820-
return Plotly.restyle(gd, 'marker.fillet', 10);
821-
})
822-
.then(_assert('has arcs', true))
823-
.then(function() {
824-
return Plotly.restyle(gd, 'marker.fillet', 0);
825-
})
826-
.then(_assert('no arcs', false))
827-
.then(done, done.fail);
828-
});
829796
});
830797

831798
describe('Test icicle texttemplate without `values` should work at root level:', function() {

test/jasmine/tests/treemap_test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,7 @@ describe('Test treemap restyle:', function() {
12951295
.then(done, done.fail);
12961296
});
12971297

1298-
it('should be able to restyle *marker.fillet*', function(done) {
1298+
it('should be able to restyle *marker.cornerradius*', function(done) {
12991299
var mock = {
13001300
data: [{
13011301
type: 'treemap',
@@ -1321,11 +1321,11 @@ describe('Test treemap restyle:', function() {
13211321
Plotly.newPlot(gd, mock)
13221322
.then(_assert('no arcs', false))
13231323
.then(function() {
1324-
return Plotly.restyle(gd, 'marker.fillet', 10);
1324+
return Plotly.restyle(gd, 'marker.cornerradius', 10);
13251325
})
13261326
.then(_assert('has arcs', true))
13271327
.then(function() {
1328-
return Plotly.restyle(gd, 'marker.fillet', 0);
1328+
return Plotly.restyle(gd, 'marker.cornerradius', 0);
13291329
})
13301330
.then(_assert('no arcs', false))
13311331
.then(done, done.fail);

test/plot-schema.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -34112,14 +34112,14 @@
3411234112
"editType": "none",
3411334113
"valType": "string"
3411434114
},
34115-
"editType": "calc",
34116-
"fillet": {
34115+
"cornerradius": {
3411734116
"description": "Sets the rounding of corners (in px).",
3411834117
"dflt": 0,
3411934118
"editType": "plot",
3412034119
"min": 0,
3412134120
"valType": "number"
3412234121
},
34122+
"editType": "calc",
3412334123
"line": {
3412434124
"color": {
3412534125
"arrayOk": true,
@@ -69178,6 +69178,13 @@
6917869178
"editType": "none",
6917969179
"valType": "string"
6918069180
},
69181+
"cornerradius": {
69182+
"description": "Sets the rounding of corners (in px).",
69183+
"dflt": 0,
69184+
"editType": "plot",
69185+
"min": 0,
69186+
"valType": "number"
69187+
},
6918169188
"depthfade": {
6918269189
"description": "Determines if the sector colors are faded towards the background from the leaves up to the headers. This option is unavailable when a `colorscale` is present, defaults to false when `marker.colors` is set, but otherwise defaults to true. When set to *reversed*, the fading direction is inverted, that is the top elements within hierarchy are drawn with fully saturated colors while the leaves are faded towards the background color.",
6918369190
"editType": "style",
@@ -69189,13 +69196,6 @@
6918969196
]
6919069197
},
6919169198
"editType": "calc",
69192-
"fillet": {
69193-
"description": "Sets the rounding of corners (in px).",
69194-
"dflt": 0,
69195-
"editType": "plot",
69196-
"min": 0,
69197-
"valType": "number"
69198-
},
6919969199
"line": {
6920069200
"color": {
6920169201
"arrayOk": true,

0 commit comments

Comments
 (0)