Skip to content

Commit 8c270e0

Browse files
committed
Add draftlog for PR#7656
1 parent 9de5b3d commit 8c270e0

File tree

6 files changed

+5
-70
lines changed

6 files changed

+5
-70
lines changed

draftlogs/7656_add.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Add `colorlegend`, `sizelegend`, and `symbollegend` components for attribute-based legends [[#7656](https://github.com/plotly/plotly.js/pull/7656)]
17.9 KB
Loading
19.3 KB
Loading
18.3 KB
Loading

test/jasmine/bundle_tests/plotschema_test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,10 @@ describe('plot schema', function() {
130130
// ... counters, so list it here
131131
'xaxis.rangeslider.yaxis',
132132
'legend',
133-
'coloraxis'
133+
'coloraxis',
134+
'colorlegend',
135+
'sizelegend',
136+
'symbollegend'
134137
];
135138

136139
// check if the subplot objects have '_isSubplotObj'

test/jasmine/tests/colorlegend_test.js

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -293,73 +293,4 @@ describe('Color legend', function() {
293293
});
294294
});
295295

296-
describe('binning', function() {
297-
var gd;
298-
299-
beforeEach(function() {
300-
gd = createGraphDiv();
301-
});
302-
303-
afterEach(destroyGraphDiv);
304-
305-
// Skip: numeric colorscale binning requires additional setup
306-
xit('should bin numeric values when exceeding nbins', function(done) {
307-
var numericColors = [];
308-
for(var i = 0; i < 20; i++) {
309-
numericColors.push(i);
310-
}
311-
312-
Plotly.newPlot(gd, [{
313-
type: 'scatter',
314-
mode: 'markers',
315-
x: numericColors,
316-
y: numericColors,
317-
marker: {
318-
color: numericColors,
319-
colorlegend: 'colorlegend',
320-
colorscale: 'Viridis',
321-
showscale: false
322-
}
323-
}], {
324-
colorlegend: {
325-
visible: true,
326-
binning: 'auto',
327-
nbins: 5
328-
}
329-
})
330-
.then(function() {
331-
var items = d3SelectAll('.colorlegend-item');
332-
expect(items.size()).toBe(5); // binned into 5 groups
333-
})
334-
.then(done, done.fail);
335-
});
336-
337-
// Skip: numeric colorscale binning requires additional setup
338-
xit('should show discrete values when binning is discrete', function(done) {
339-
var numericColors = [1, 2, 3, 1, 2, 3];
340-
341-
Plotly.newPlot(gd, [{
342-
type: 'scatter',
343-
mode: 'markers',
344-
x: [1, 2, 3, 4, 5, 6],
345-
y: [1, 2, 3, 4, 5, 6],
346-
marker: {
347-
color: numericColors,
348-
colorlegend: 'colorlegend',
349-
colorscale: 'Viridis',
350-
showscale: false
351-
}
352-
}], {
353-
colorlegend: {
354-
visible: true,
355-
binning: 'discrete'
356-
}
357-
})
358-
.then(function() {
359-
var items = d3SelectAll('.colorlegend-item');
360-
expect(items.size()).toBe(3); // 1, 2, 3
361-
})
362-
.then(done, done.fail);
363-
});
364-
});
365296
});

0 commit comments

Comments
 (0)