kubernetes-ui / topology-graph

GNU Lesser General Public License v2.1
97 stars 38 forks source link

Ability to add angular/bootstrap tooltips to the nodes #14

Open abonas opened 8 years ago

abonas commented 8 years ago

It will be nice to have the ability to add styled tooltips to the nodes instead of the default browser ones. I tried to follow (in the custom render implementation) http://jsfiddle.net/9hCDs/1/ http://stackoverflow.com/questions/20399336/how-do-i-use-angularjs-directives-in-generated-d3-html

the attributes are added to the nodes on svg, but the tooltip won't show.

stefwalter commented 8 years ago

I think you would need to use d3 logic, rendered in the SVG rather than angularjs. Example: http://bl.ocks.org/Caged/6476579

abonas commented 8 years ago

I think you would need to use d3 logic, rendered in the SVG rather than angularjs. Example: http://bl.ocks.org/Caged/6476579

there are multiple other solutions, I was just looking to do something similar to what I added in the legend, to benefit from the same look and feel.

abonas commented 8 years ago

@stefwalter from what I read, there should be a $compile step in order to make angular-ui tooltip work with the angular directive and d3, just unsure where to place it, tried in the custom render function but no success so far. http://stackoverflow.com/questions/20399336/how-do-i-use-angularjs-directives-in-generated-d3-html