-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Cartesian dropline support #1461
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
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
d9fab15
Cartesian dropline support
rpaskowitz 5d39b53
Removed chart config for showDroplines
rpaskowitz be47533
Add spikecolor, spikethickness, spikedash and spikemode
rpaskowitz 17d815c
Add cartesian spikeline modebar support
rpaskowitz 162068e
Merge branch 'master' into dropline
rpaskowitz 762b54a
Move dashStyle to Drawing
rpaskowitz d680bd4
Name back to showspikes
rpaskowitz 2433d4c
Lint, test and implementation fixes
rpaskowitz 75da2fe
add spikeline icon
etpinard 7953488
Fix cartesian check and fine-tune marker placement
rpaskowitz 55b17b2
Merge branch 'master' into dropline
etpinard b9f6ab1
Refactor dropline to spikeline
rpaskowitz 7fe4363
Merge branch 'dropline' of github.com:rpaskowitz/plotly.js into dropline
rpaskowitz 34a1562
Switch from getBoundingClientRect to offsetLeft and offsetTop.
rpaskowitz 8c7ac76
Move spike setup from axis to layout.
rpaskowitz 6e243de
Fix marker positioning and across rendering for top-side x-axes.
rpaskowitz c036bf7
Merge branch 'master' into dropline
alexcjohnson 08371c2
short-circuit redraw for spike attribute relayouts
alexcjohnson 69dc781
fix manual-hover logic for event emitting
alexcjohnson 37b77fe
don't make spike markers crisp
alexcjohnson 710d2d6
alter logic for where spikes start and end
alexcjohnson e509fa7
lint
alexcjohnson 75121d2
:hocho: spikemode: 'none'
alexcjohnson bd11567
make drawing/attributes.dash - and clean up some dashes that don't fi…
alexcjohnson 3a9aa58
short-circuit spike properties when spikes are off
alexcjohnson 052417b
test hover event response to manual and "real" events
alexcjohnson a3a0a4f
:hocho: fit
alexcjohnson f7b467e
fix scattermapbox defaults for omitted options
alexcjohnson 7aa4359
lint
alexcjohnson 5925049
:hocho: :hocho:
alexcjohnson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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'); | ||
|
||
|
@@ -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) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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() { | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🆘
fit
🆘There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, linter caught it...