8000 Add `layout.subplots` to enable (x|y) hover effects across multiple cartesian and splom suplots sharing one axis by archmoj · Pull Request #6947 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

Add layout.subplots to enable (x|y) hover effects across multiple cartesian and splom suplots sharing one axis #6947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Apr 9, 2024
Merged
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
Next Next commit
splom test
  • Loading branch information
archmoj committed Apr 5, 2024
commit 08917b5f4a7456ce15f0ad6d9a37d93d66df9efc
41 changes: 41 additions & 0 deletions test/jasmine/tests/hover_label_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ var assertElemInside = customAssertions.assertElemInside;

var groupTitlesMock = require('../../image/mocks/legendgroup-titles');

var splomLogMock = require('../../image/mocks/splom_log');

function touch(path, options) {
var len = path.length;
Lib.clearThrottle();
Expand Down Expand Up @@ -2554,6 +2556,45 @@ describe('hover on subplots when hoversameaxis is set to true and y hovermodes',
});
});

describe('splom hover on subplots when hoversameaxis is set to true and (x|y) hovermodes', function() {
'use strict';

var mock = Lib.extendDeep({}, splomLogMock);
mock.layout.hovermode = 'x';
mock.layout.hoversameaxis = true;

var gd;

beforeEach(function(done) {
gd = createGraphDiv();
Plotly.newPlot(gd, mock).then(done);
});

afterEach(destroyGraphDiv);

it('splom hoversameaxis: true', function() {
Lib.clearThrottle();
Plotly.Fx.hover(gd, {x: 200, y: 200}, 'xy');
expect(gd._hoverdata.length).toBe(3);
assertHoverLabelContent({
nums: ['100', '100k'],
name: ['', ''],
axis: '100'
});

Plotly.relayout(gd, 'hovermode', 'x unified');

Lib.clearThrottle();
Plotly.Fx.hover(gd, {x: 200, y: 200}, 'xy');
expect(gd._hoverdata.length).toBe(3);

Plotly.relayout(gd, 'hovermode', 'y unified');
Lib.clearThrottle();
Plotly.Fx.hover(gd, {x: 200, y: 200}, 'xy');
expect(gd._hoverdata.length).toBe(3);
});
});

describe('hover on many lines+bars', function() {
'use strict';

Expand Down
0