Skip to content

Commit 66ca5f9

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

File tree

12 files changed

+19
-53
lines changed

12 files changed

+19
-53
lines changed

draftlogs/6351_add.md

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 0 additions & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 0 additions & 33 deletions
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() {

0 commit comments

Comments
 (0)