-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Introducing splom traces #2505
Introducing splom traces #2505
Changes from 98 commits
44dc3d8
c56e35e
29ca0ed
8b5af93
3be9569
76c64e5
59588cc
66494c7
20f01cc
c5cda6b
89fb6bb
9cac919
fda1b34
cf485b7
fc6c895
7be161b
80dd61e
0fb65dd
d50746b
a3c87da
c4c1514
469e4cd
c0c5a6e
d02f572
60df466
e7b02c0
658c529
2b6c58e
eab3768
b6359ef
a37abfb
4470447
aaa42c6
a077c3f
f442f59
4f68cba
07d59d5
2a048a9
697a127
32118b0
bb11313
1bc95d5
419458c
9162265
e14013b
22e8c7e
d072121
02ed2eb
3ad1eaa
bb02281
d07ae70
468119e
0979272
ebb35ce
37b585e
92a37c8
ce379a1
f9090b7
b28052b
f2569c3
b283919
571950e
76d8ace
2d39ea7
7f916b0
0c901b5
1193e6c
99712dd
129e1f2
b2ee736
a6f2664
5f0c828
0d5a638
a0b2574
7ae7159
d4a2a53
f07ff4b
fa8adee
d3fe40d
cc1b3de
45266ed
a0caefd
2e6b610
980855c
f7d637d
da81a0e
74abb7f
062d4a3
978a70e
b868959
e38a0a6
651901d
9aea0ba
71a0395
24dad16
9d0bcfd
6fd6919
31e34fa
a79f5dc
31836f2
6cc634a
c7b81ec
8e9eaff
ad5abb6
c98071f
2d93469
6c5a1e7
a7b08b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* Copyright 2012-2018, Plotly, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
module.exports = require('../src/traces/splom'); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -215,7 +215,7 @@ function _hover(gd, evt, subplot, noHoverEvent) { | |
var hoverdistance = fullLayout.hoverdistance === -1 ? Infinity : fullLayout.hoverdistance; | ||
var spikedistance = fullLayout.spikedistance === -1 ? Infinity : fullLayout.spikedistance; | ||
|
||
// hoverData: the set of candidate points we've found to highlight | ||
// hoverData: the set of candidate points we've found to highlight | ||
var hoverData = [], | ||
|
||
// searchData: the data to search in. Mostly this is just a copy of | ||
|
@@ -265,7 +265,7 @@ function _hover(gd, evt, subplot, noHoverEvent) { | |
for(curvenum = 0; curvenum < gd.calcdata.length; curvenum++) { | ||
cd = gd.calcdata[curvenum]; | ||
trace = cd[0].trace; | ||
if(trace.hoverinfo !== 'skip' && subplots.indexOf(helpers.getSubplot(trace)) !== -1) { | ||
if(trace.hoverinfo !== 'skip' && helpers.isTraceInSubplots(trace, subplots)) { | ||
searchData.push(cd); | ||
} | ||
} | ||
|
@@ -338,8 +338,15 @@ function _hover(gd, evt, subplot, noHoverEvent) { | |
// the rest of this function from running and failing | ||
if(['carpet', 'contourcarpet'].indexOf(trace._module.name) !== -1) continue; | ||
|
||
subplotId = helpers.getSubplot(trace); | ||
subploti = subplots.indexOf(subplotId); | ||
if(trace.type === 'splom') { | ||
// splom traces do not generate overlay subplots, | ||
// it is safe to assume here splom traces correspond to the 0th subplot | ||
subploti = 0; | ||
subplotId = subplots[subploti]; | ||
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. OK for now, but we should remove this restriction at some point - it would be weird to overlay a splom on something else, but you never know what weird use cases users will come up with. 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. If ok, I'd leave out splom trace on overlaid axes from this PR. |
||
} else { | ||
subplotId = helpers.getSubplot(trace); | ||
subploti = subplots.indexOf(subplotId); | ||
} | ||
|
||
// within one trace mode can sometimes be overridden | ||
mode = hovermode; | ||
|
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.
🙏
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.
Not sure how this will work with
show(upper|lower)half
- actually, it's probably better to let it pass here - in fact in case there's ever another trace type that spans multiple subplots, we could doif(trace.xaxes && trace.yaxes)
instead ofif(trace.type === 'splom')
- and then bail out duringhoverPoints
for the trace if that subplot is blank.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.
Turns out this works fine for splom traces with
show(upper|lower)half
anddiagonal.visible: false
as hovering over their omitted subplots never triggersFx.hover
as we don't draw those subplots and more precisely we don't draw their corresponding<g .draglayer>
.If we choose at some point to draw only one drag layer for all interaction types for all subplots, we'll of course have to change this logic here. But if ok, I'll leave this out of this PR and list it in an upcoming splom open items issue.