Skip to content

Commit fbbcf91

Browse files
author
brian.kotek
committed
Relates to plotly#3735, switch to 'circle' option, but under the hood in theory the user could now specify any valid symbol name.
1 parent 9ff8ecf commit fbbcf91

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/components/legend/attributes.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ module.exports = {
7979
},
8080
itemsymbol: {
8181
valType: 'enumerated',
82-
values: ['trace', 'constant'],
82+
values: ['trace', 'circle'],
8383
dflt: 'trace',
8484
editType: 'legend',
8585
description: [
8686
'Determines if the legend items symbols use the symbol of the first point in each *trace*',
87-
'or use a *constant* circle symbol.'
87+
'or use a circle symbol.'
8888
].join(' ')
8989
},
9090
itemwidth: {

src/components/legend/style.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports = function style(s, gd, legend) {
2525
var fullLayout = gd._fullLayout;
2626
if(!legend) legend = fullLayout.legend;
2727
var constantItemSizing = legend.itemsizing === 'constant';
28-
var constantItemSymbol = legend.itemsymbol === 'constant';
28+
var customItemSymbol = legend.itemsymbol && legend.itemsymbol !== 'trace';
2929
var itemWidth = legend.itemwidth;
3030
var centerPos = (itemWidth + constants.itemGap * 2) / 2;
3131
var centerTransform = strTranslate(centerPos, 0);
@@ -205,8 +205,8 @@ module.exports = function style(s, gd, legend) {
205205
valToBound = cst;
206206
}
207207

208-
if(constantItemSymbol && attrIn === 'marker.symbol') {
209-
valToBound = 'circle';
208+
if(customItemSymbol && attrIn === 'marker.symbol') {
209+
valToBound = legend.itemsymbol;
210210
}
211211

212212
if(bounds) {

0 commit comments

Comments
 (0)