Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/legend/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ module.exports = function style(s, gd) {

function boundVal(attrIn, arrayToValFn, bounds) {
var valIn = Lib.nestedProperty(trace, attrIn).get();
var valToBound = (Array.isArray(valIn) && arrayToValFn) ?
var valToBound = (Lib.isArrayOrTypedArray(valIn) && arrayToValFn) ?
arrayToValFn(valIn) :
valIn;

Expand Down
13 changes: 13 additions & 0 deletions test/jasmine/tests/scatter_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,19 @@ describe('end-to-end scatter tests', function() {
['rgb(0, 255, 0)', 'rgb(0, 0, 255)', 'rgb(255, 0, 0)'],
[40, 30, 20]
);

return Plotly.relayout(gd, 'showlegend', true);
})
.then(function() {
_assert(
['rgb(0, 255, 0)', 'rgb(0, 0, 255)', 'rgb(255, 0, 0)'],
[40, 30, 20]
);

var legendPts = d3.select('.legend').selectAll('.scatterpts');
expect(legendPts.size()).toBe(1, '# legend items');
expect(getColor(legendPts.node())).toBe('rgb(0, 0, 0)', 'legend pt color');
expect(getMarkerSize(legendPts.node())).toBe(16, 'legend pt size');
})
.catch(failTest)
.then(done);
Expand Down