Skip to content
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.

showing tooltip with node:mouseover event #1

Open
agaurav opened this issue Apr 6, 2016 · 3 comments
Open

showing tooltip with node:mouseover event #1

agaurav opened this issue Apr 6, 2016 · 3 comments

Comments

@agaurav
Copy link

agaurav commented Apr 6, 2016

Is there way to use d3.tip with the chart.on if not then best way to add a chart.tip method simmilar to the one implemented here line 102 and 156

Also, great plugin (the only decent of sankey) and really liked the hierarchical highlighting of edges in product demo.

@wvengen
Copy link
Member

wvengen commented Jun 9, 2016

Sorry for not responding earlier, somehow I've missed these notifications.
In theory this would be no problem, and I'd love d3.chart.sankey to support this. I'd say that you could subclass one of the d3.chart.sankey classes and setup d3.tip. Some untested rough idea:

var MySankeyTip = Sankey.extend("Sankey.Tip", {
  initialize: function() {
    var chart = this;
    chart.tip = // make the tip stuff work
  }
}); 

@agaurav
Copy link
Author

agaurav commented Jun 10, 2016

Yeah sounds good, will submit a PR after trying it out. For now I am using the mouseover callbacks for showing the node or link details.

@wvengen
Copy link
Member

wvengen commented Jun 10, 2016

Cool! I wonder if this should be a separate Sankey class, since there is no clear chain of derivation. It might be better to just create the chart, and then attach d3.tip() to it - so I'm curious where you'll end up. In any case, this would be useful to add to the documentation and/or as an example.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants