Skip to content

Commit 6f94816

Browse files
authored
Merge pull request #2840 from plotly/bound-scalar-markersize-in-legenditem
Bound scalar marker size in legend item
2 parents 0a62fbd + e50e6f5 commit 6f94816

8 files changed

+5
-2
lines changed

src/components/legend/style.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ module.exports = function style(s, gd) {
9090
var showLines = subTypes.hasLines(trace);
9191
var dMod, tMod;
9292

93-
// 'scatter3d' and 'scattergeo' don't use gd.calcdata yet;
93+
// 'scatter3d' don't use gd.calcdata,
9494
// use d0.trace to infer arrayOk attributes
9595

9696
function boundVal(attrIn, arrayToValFn, bounds) {
@@ -117,14 +117,17 @@ module.exports = function style(s, gd) {
117117
dEdit.mc = boundVal('marker.color', pickFirst);
118118
dEdit.mx = boundVal('marker.symbol', pickFirst);
119119
dEdit.mo = boundVal('marker.opacity', Lib.mean, [0.2, 1]);
120-
dEdit.ms = boundVal('marker.size', Lib.mean, [2, 16]);
121120
dEdit.mlc = boundVal('marker.line.color', pickFirst);
122121
dEdit.mlw = boundVal('marker.line.width', Lib.mean, [0, 5]);
123122
tEdit.marker = {
124123
sizeref: 1,
125124
sizemin: 1,
126125
sizemode: 'diameter'
127126
};
127+
128+
var ms = boundVal('marker.size', Lib.mean, [2, 16]);
129+
dEdit.ms = ms;
130+
tEdit.marker.size = ms;
128131
}
129132

130133
if(showLines) {
-327 Bytes
Loading
-89 Bytes
Loading

test/image/baselines/geo_bg-color.png

-311 Bytes
Loading
-126 Bytes
Loading
30 Bytes
Loading

test/image/baselines/line_scatter.png

-131 Bytes
Loading

test/image/baselines/transforms.png

-191 Bytes
Loading

0 commit comments

Comments
 (0)