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

sankey: compare links in a flow on hover #3730

Merged
merged 5 commits into from
Apr 8, 2019
Merged

Conversation

antoinerg
Copy link
Contributor

@antoinerg antoinerg commented Apr 4, 2019

Closes #3322

Screenshot_2019-04-04_17-30-43

  • Add jasmine tests

Sorry, something went wrong.

@antoinerg
Copy link
Contributor Author

Right now, only the top link within a flow has its hover label exactly above it. All the ones below will be shifted. Should I change this behavior such that the hovered link always has its hover label above it? I think this would be ideal but I'm not sure how easy/hard it would be to implement. 🤔

// For each related links, create a hoverItem
for(var i = 0; i < d.flow.links.length; i++) {
var link = d.flow.links[i];
if(gd._fullLayout.hovermode === 'closest' && d.link.pointNumber !== link.pointNumber) continue;
Copy link
Contributor

@etpinard etpinard Apr 4, 2019

Choose a reason for hiding this comment

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

So, hovermode: 'x' or 'y' enables the "compare" mode? That's a little unfortunate because sankey don't have x nor y axes, but I guess it's not worth adding a hovermode: 'compare' just for sankey.

Copy link
Contributor

Choose a reason for hiding this comment

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

... so I'm ok with this 👌

@etpinard
Copy link
Contributor

etpinard commented Apr 4, 2019

l but I'm not sure how easy/hard it would be to implement

give it a shot! If you think it's the ideal behavior, it's definitely worth spending at least one more day on this feature.

@antoinerg
Copy link
Contributor Author

antoinerg commented Apr 4, 2019

give it a shot! If you think it's the ideal behavior, it's definitely worth spending at least one more day on this feature.

I agree that the current behavior is not good enough. It should be possible to display any hover label via the mouse. For this to work, we need to center it or at least making sure it's not overflowing. Right now it just overflows and thus it becomes invisible:
Screenshot_2019-04-04_18-32-47

@antoinerg
Copy link
Contributor Author

With commit f00b542 we can reach all hoverlabels and fix #3730 (comment):
Screenshot_2019-04-05_15-11-28

@etpinard
Copy link
Contributor

etpinard commented Apr 5, 2019

With commit f00b542 we can reach all hoverlabels and fix #3730 (comment):

🎉 🍾 🥇

@etpinard etpinard added this to the v1.47.0 milestone Apr 8, 2019
@etpinard
Copy link
Contributor

etpinard commented Apr 8, 2019

Brilliant work. 💃

@antoinerg antoinerg merged commit 5baa139 into master Apr 8, 2019
@antoinerg antoinerg deleted the sankey-multiple-hover branch April 8, 2019 15:47
@etpinard
Copy link
Contributor

etpinard commented Apr 8, 2019

@antoinerg one sankey @noCI test is failing on master is my machine:

image

Is it passing on your setup?

@archmoj
Copy link
Contributor

archmoj commented Apr 8, 2019

@etpinard That one also fails on my machine.

@antoinerg
Copy link
Contributor Author

antoinerg commented Apr 8, 2019

It fails sometimes but it does pass more often than not. I guess this one should be a @flaky.

Screenshot_2019-04-08_12-26-23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants