Skip to content

Negate axis offset and then turn it into a string #2339

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 7 commits into from
Feb 9, 2018
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
10 changes: 7 additions & 3 deletions src/components/fx/hover.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,18 @@ function _hover(gd, evt, subplot, noHoverEvent) {
subplots = subplots.concat(overlayedSubplots);
}

var len = subplots.length,
xaArray = new Array(len),
yaArray = new Array(len);
var len = subplots.length;
var xaArray = new Array(len);
var yaArray = new Array(len);
var supportsCompare = false;

for(var i = 0; i < len; i++) {
var spId = subplots[i];

// 'cartesian' case
var plotObj = plots[spId];
if(plotObj) {
supportsCompare = true;

// TODO make sure that fullLayout_plots axis refs
// get updated properly so that we don't have
Expand All @@ -203,6 +205,8 @@ function _hover(gd, evt, subplot, noHoverEvent) {

var hovermode = evt.hovermode || fullLayout.hovermode;

if(hovermode && !supportsCompare) hovermode = 'closest';
Copy link
Collaborator

Choose a reason for hiding this comment

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

The second part of #2338 - fixes hover labels for geo and ternary on the plot_types mock

Copy link
Contributor Author

@etpinard etpinard Feb 9, 2018

Choose a reason for hiding this comment

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

Looks good. Not sure what's the best to 🔒 this down?

Maybe just checking that hovermode: 'x' behaves the same as hovermode: 'closest' in a cartesian + geo (or ternary or polar) graph would suffice.

Copy link
Collaborator

Choose a reason for hiding this comment

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

good call -> 16b01f0


if(['x', 'y', 'closest'].indexOf(hovermode) === -1 || !gd.calcdata ||
gd.querySelector('.zoombox') || gd._dragging) {
return dragElement.unhoverRaw(gd, evt);
Expand Down