Thanks for your tip. Works like a charm.
Best, Andrej
I think historically there was a bit of confusion regarding how to
interpret svg:title and svg:desc elements. In the past, I've found it
more reliable to use an anchor tag (svg:a) with an xlink:title
attribute, rather than using svg:title elements. But svg:title seems
to work on Chrome, Safari and Firefox these days, at least.
You can also use the CSS :hover class to toggle label visibility. For
example, to hide labels that aren't being hovered, say:
.node:not(:hover) .nodetext {
display: none;
}
If you don't want to use the :not psuedo-class, you could also say
something like:
.nodetext {
display: none;
}
.node:hover .nodetext {
display: inherit;
}
Live example:
Mike
I've been adding a 'title' attribute to my svg (or html) elements and then using the poshytip jQuery extension to spruce them up, and it's worked quite well for me. It's quite similar to tipsy, but it dealt with formatting inside the tips more easily in my case.
I came across this thread on google search and was wondering if
someone could throw some light on a problem related to svg titles :
I have a svg file of a scatter plot; each data-point in this plot has
a title. Is there a way to locate the data point by searching for
title ?
some thing like, press ctrl+F in firefox, type title-text and find the
data-point in scatter plot.
Example :
In this figure (http://bl.ocks.org/1212215), I would type "pontmercy"
in (ctrl+F) search bar and the title of corresponding smiley will get
automatically highlighted. Is it possible to do it ?
thanks in advance
Chakravarthy
---------- Forwarded message ----------
From: Justin Donaldson <donald...@bigml.com>
Date: Oct 7 2011, 1:54 am
Subject: Tooltips with "svg:title"
To: d3-js
Do you have a demo of this working? The author doesn't appear to be
using
bbox(), and I didn't think jquery handled svg element widths
appropriately.
Best,
-Justin
On Thu, Oct 6, 2011 at 6:31 AM, Kyle Foreman <kylefore...@gmail.com>
I don't think svg:title elements are searchable, but svg:text elements
are (at least in Chrome, though they don't light up yellow). You could
also use HTML elements with position:absolute on top of your
scatterplot, and search that way.
Or, you could implement this with a custom search box in JavaScript.
For example, see Bootstrap's typeahead component:
http://twitter.github.com/bootstrap/javascript.html#typeahead
Mike