Skip to content
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

Cartesian dropline support #1461

Merged
merged 30 commits into from
Apr 18, 2017
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d9fab15
Cartesian dropline support
rpaskowitz Mar 10, 2017
5d39b53
Removed chart config for showDroplines
rpaskowitz Mar 11, 2017
be47533
Add spikecolor, spikethickness, spikedash and spikemode
rpaskowitz Apr 7, 2017
17d815c
Add cartesian spikeline modebar support
rpaskowitz Apr 7, 2017
162068e
Merge branch 'master' into dropline
rpaskowitz Apr 7, 2017
762b54a
Move dashStyle to Drawing
rpaskowitz Apr 7, 2017
d680bd4
Name back to showspikes
rpaskowitz Apr 7, 2017
2433d4c
Lint, test and implementation fixes
rpaskowitz Apr 7, 2017
75da2fe
add spikeline icon
etpinard Apr 7, 2017
7953488
Fix cartesian check and fine-tune marker placement
rpaskowitz Apr 7, 2017
55b17b2
Merge branch 'master' into dropline
etpinard Apr 10, 2017
b9f6ab1
Refactor dropline to spikeline
rpaskowitz Apr 10, 2017
7fe4363
Merge branch 'dropline' of github.com:rpaskowitz/plotly.js into dropline
rpaskowitz Apr 10, 2017
34a1562
Switch from getBoundingClientRect to offsetLeft and offsetTop.
rpaskowitz Apr 10, 2017
8c7ac76
Move spike setup from axis to layout.
rpaskowitz Apr 10, 2017
6e243de
Fix marker positioning and across rendering for top-side x-axes.
rpaskowitz Apr 11, 2017
c036bf7
Merge branch 'master' into dropline
alexcjohnson Apr 13, 2017
08371c2
short-circuit redraw for spike attribute relayouts
alexcjohnson Apr 14, 2017
69dc781
fix manual-hover logic for event emitting
alexcjohnson Apr 14, 2017
37b77fe
don't make spike markers crisp
alexcjohnson Apr 14, 2017
710d2d6
alter logic for where spikes start and end
alexcjohnson Apr 14, 2017
e509fa7
lint
alexcjohnson Apr 14, 2017
75121d2
:hocho: spikemode: 'none'
alexcjohnson Apr 17, 2017
bd11567
make drawing/attributes.dash - and clean up some dashes that don't fi…
alexcjohnson Apr 17, 2017
3a9aa58
short-circuit spike properties when spikes are off
alexcjohnson Apr 17, 2017
052417b
test hover event response to manual and "real" events
alexcjohnson Apr 17, 2017
a3a0a4f
:hocho: fit
alexcjohnson Apr 17, 2017
f7b467e
fix scattermapbox defaults for omitted options
alexcjohnson Apr 18, 2017
7aa4359
lint
alexcjohnson Apr 18, 2017
5925049
:hocho: :hocho:
alexcjohnson Apr 18, 2017
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
39 changes: 39 additions & 0 deletions test/jasmine/tests/hover_label_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var createGraphDiv = require('../assets/create_graph_div');
var destroyGraphDiv = require('../assets/destroy_graph_div');
var mouseEvent = require('../assets/mouse_event');
var click = require('../assets/click');
var delay = require('../assets/delay');
var doubleClick = require('../assets/double_click');
var fail = require('../assets/fail_test');

Expand Down Expand Up @@ -532,6 +533,44 @@ describe('hover info', function() {
expect(hovers.size()).toEqual(0);
});
});

describe('hover events', function() {
var data = [{x: [1, 2, 3], y: [1, 3, 2], type: 'bar'}];
var layout = {width: 600, height: 400};
var gd;

beforeEach(function(done) {
gd = createGraphDiv();
Plotly.plot(gd, data, layout).then(done);
});

fit('should emit events only if the event looks user-driven', function(done) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🆘 fit 🆘

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, linter caught it...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice test 🎉

var hoverHandler = jasmine.createSpy();
gd.on('plotly_hover', hoverHandler);

var gdBB = gd.getBoundingClientRect();
var event = {clientX: gdBB.left + 300, clientY: gdBB.top + 200};

Promise.resolve().then(function() {
Fx.hover(gd, event, 'xy');
})
.then(delay(constants.HOVERMINTIME * 1.1))
.then(function() {
Fx.unhover(gd);
})
.then(function() {
expect(hoverHandler).not.toHaveBeenCalled();
var dragger = gd.querySelector('.nsewdrag');

Fx.hover(gd, Lib.extendFlat({target: dragger}, event), 'xy');
})
.then(function() {
expect(hoverHandler).toHaveBeenCalledTimes(1);
})
.catch(fail)
.then(done);
});
});
});

describe('hover info on stacked subplots', function() {
Expand Down