Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Add draftlog for PR#7656
  • Loading branch information
Rhoahndur committed Nov 27, 2025
commit 8c270e03706f91a82f9136fbc62ffa726ca74e1b
1 change: 1 addition & 0 deletions draftlogs/7656_add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Add `colorlegend`, `sizelegend`, and `symbollegend` components for attribute-based legends [[#7656](https://github.com/plotly/plotly.js/pull/7656)]
Binary file added test/image/baselines/colorlegend_basic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/image/baselines/sizelegend_basic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/image/baselines/symbollegend_basic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion test/jasmine/bundle_tests/plotschema_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ describe('plot schema', function() {
// ... counters, so list it here
'xaxis.rangeslider.yaxis',
'legend',
'coloraxis'
'coloraxis',
'colorlegend',
'sizelegend',
'symbollegend'
];

// check if the subplot objects have '_isSubplotObj'
Expand Down
69 changes: 0 additions & 69 deletions test/jasmine/tests/colorlegend_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,73 +293,4 @@ describe('Color legend', function() {
});
});

describe('binning', function() {
var gd;

beforeEach(function() {
gd = createGraphDiv();
});

afterEach(destroyGraphDiv);

// Skip: numeric colorscale binning requires additional setup
xit('should bin numeric values when exceeding nbins', function(done) {
var numericColors = [];
for(var i = 0; i < 20; i++) {
numericColors.push(i);
}

Plotly.newPlot(gd, [{
type: 'scatter',
mode: 'markers',
x: numericColors,
y: numericColors,
marker: {
color: numericColors,
colorlegend: 'colorlegend',
colorscale: 'Viridis',
showscale: false
}
}], {
colorlegend: {
visible: true,
binning: 'auto',
nbins: 5
}
})
.then(function() {
var items = d3SelectAll('.colorlegend-item');
expect(items.size()).toBe(5); // binned into 5 groups
})
.then(done, done.fail);
});

// Skip: numeric colorscale binning requires additional setup
xit('should show discrete values when binning is discrete', function(done) {
var numericColors = [1, 2, 3, 1, 2, 3];

Plotly.newPlot(gd, [{
type: 'scatter',
mode: 'markers',
x: [1, 2, 3, 4, 5, 6],
y: [1, 2, 3, 4, 5, 6],
marker: {
color: numericColors,
colorlegend: 'colorlegend',
colorscale: 'Viridis',
showscale: false
}
}], {
colorlegend: {
visible: true,
binning: 'discrete'
}
})
.then(function() {
var items = d3SelectAll('.colorlegend-item');
expect(items.size()).toBe(3); // 1, 2, 3
})
.then(done, done.fail);
});
});
});