Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2k
Introducing splom traces#2505
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
Uh oh!
There was an error while loading. Please reload this page.
Introducing splom traces #2505
Changes from all commits
44dc3d8c56e35e29ca0ed8b5af933be956976c64e559588cc66494c720f01ccc5cda6b89fb6bb9cac919fda1b34cf485b7fc6c8957be161b80dd61e0fb65ddd50746ba3c87dac4c1514469e4cdc0c5a6ed02f57260df466e7b02c0658c5292b6c58eeab3768b6359efa37abfb4470447aaa42c6a077c3ff442f594f68cba07d59d52a048a9697a12732118b0bb113131bc95d5419458c9162265e14013b22e8c7ed07212102ed2eb3ad1eaabb02281d07ae70468119e0979272ebb35ce37b585e92a37c8ce379a1f9090b7b28052bf2569c3b283919571950e76d8ace2d39ea77f916b00c901b51193e6c99712dd129e1f2b2ee736a6f26645f0c8280d5a638a0b25747ae7159d4a2a53f07ff4bfa8adeed3fe40dcc1b3de45266eda0caefd2e6b610980855cf7d637dda81a0e74abb7f062d4a3978a70eb868959e38a0a6651901d9aea0ba71a039524dad169d0bcfd6fd691931e34faa79f5dc31836f26cc634ac7b81ec8e9eaffad5abb6c98071f2d934696c5a1e7a7b08b3File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
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.
Uh oh!
There was an error while loading. Please reload this page.
| 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]; | ||
Collaborator 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. ContributorAuthor 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; | ||
Uh oh!
There was an error while loading. Please reload this page.
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 duringhoverPointsfor 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)halfanddiagonal.visible: falseas hovering over their omitted subplots never triggersFx.hoveras 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.