Skip to content

Commit 56e92af

Browse files
committed
feat: Use dashed markers in legend for shape traces
1 parent 5777afe commit 56e92af

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

src/components/legend/style.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,7 @@ module.exports = function style(s, gd, legend) {
216216
dEdit.mo = boundVal('marker.opacity', Lib.mean, [0.2, 1]);
217217
dEdit.mlc = boundVal('marker.line.color', pickFirst);
218218
dEdit.mlw = boundVal('marker.line.width', Lib.mean, [0, 5], CST_MARKER_LINE_WIDTH);
219-
// TODO: Remove this check in next major version
220-
// Use 'solid' for shapes to match existing behavior
221-
dEdit.mld = trace._isShape ? 'solid' : boundVal('marker.line.dash', pickFirst);
219+
dEdit.mld = boundVal('marker.line.dash', pickFirst);
222220
tEdit.marker = {
223221
sizeref: 1,
224222
sizemin: 1,

test/jasmine/tests/legend_test.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3200,8 +3200,7 @@ describe('legend with custom legendwidth', function () {
32003200
.then(done, done.fail);
32013201
});
32023202

3203-
// TODO: Update this test when releasing next major version which will remove the exception for shape traces
3204-
it('should apply marker.line.dash to scatter traces but use solid for shape traces', (done) => {
3203+
it('should apply marker.line.dash to scatter traces and shape traces', (done) => {
32053204
const data = [
32063205
{
32073206
type: 'scatter',
@@ -3247,7 +3246,7 @@ describe('legend with custom legendwidth', function () {
32473246

32483247
expect(legendItems.length).toBe(2);
32493248
expect(legendItems[0].style.strokeDasharray).not.toBe('');
3250-
expect(legendItems[1].style.strokeDasharray).toBe('');
3249+
expect(legendItems[1].style.strokeDasharray).not.toBe('');
32513250
})
32523251
.then(done, done.fail);
32533252
});
@@ -3498,4 +3497,4 @@ describe('legend title click', function() {
34983497
}
34993498
}).then(done, done.fail);
35003499
});
3501-
});
3500+
});

0 commit comments

Comments
 (0)