I am trying to add tooltips to my map with d3 -- on advice from this post Show data on mouseover of circle
I am looking at this example from Bostock's tutorials.
My SVG looks like this:
<svg width="503" height="629">
<g class="precincts">
<path class="O precinct" title="52-47" id="1-1" d="8895922,383.750108730128L128.22787341161165,383....403.91773820327217L135.3001918293303,404.0915875970313Z">
</path>
...
<path>
</path>
</g>
</svg>
I have this jquery in my document load function, which is called after my call to load the SVG:
$('.button').tipsy({
gravity: 'w',
title: function() {
return 'Hi there!';
}
});
$('.precinct').tipsy({
gravity: 'w',
title: function() {
alert("here");
return 'Hi there!';
}
});
The .button selector fires the tooltips -- so tipsy is loading properly (also no console errors). Also my ".precinct" selector is correct because I can write a css rule .precinct{style} and it will style the precinct svgs. So what am I missing? It should be selecting everything of class precinct and adding a tool tip on the same way that it selects everything of class button and adding a tool tip. Right?
I get the same problem with the simpletip tooltip library.