A HoverExpression question ($Tags)


(Rick) #1

I’ve been experimenting with HoverExpressions to use in Maps. In most cases, I’ve been using $Tags. It works fine in general, but there is an aesthetic issue that I’d like to address if possible:
A few notes have many tags. The tags are shown just as they are in the tags field, i.e. a tag followed by a semicolon, followed immediately by another tag with no space after the semicolon, and so on. The lack of spaces after the semicolons look ugly to me.
I’m wondering if there’s any way to show just one tag, or to show the tags with spaces between them. As I understand it, each tag is a separate item rather than the string of tags including semicolons being an entity as far as Tinderbox is concerned.
I’m assuming that inputting a space after each semicolon would lead to Tinderbox interpreting the spaces as being part of the tags; if I’ve got that wrong, I’d be grateful for a heads-up.

Thanks,
Rick


(Paul Walters) #2

Use something like this in your DisplayExpression:

$Tags.format(", ");

For more information see this.


(Mark Anderson) #3

Deleted (dupe post at same time)


(Rick) #4

Thank you both.

Hopefully, I’ll find that out soon.


(Rick) #5

Maybe there is an upper limit, but I haven’t found it yet. I added far more tags than is reasonable to one note to see what would happen, but they all displayed without a hitch.
I’m going to check the reference page you pointed me to and see if I can get them to display in alphabetical order, and maybe with a different font. Thanks to you guys, today has been a productive day in terms of my understanding of Tinderbox.


(Mark Anderson) #6

See here. For the font, try $HoverFont (see linked article).

To sort the list use .sort or isort if it needs to be case insensitive. Note that dot-operators like ,format and sort can chain onto one another: List.sort.format(“formatString”). Look at the main list of action codes for more detail: here.


(Rick) #7

That also worked great. And I found out why my long list of tags was nowhere near enough to be truncated:

The panel is drawn 350 pixels wide with height never exceeding half the Map view’s window height.

Thanks again for all the help.


(Paul Walters) #8

If you want to play around with limits, try this in your hover expression

$Tags.format("\n");

That will put each tag on a new line.


(Rick) #9

I tried that out just out of idle curiosity, but it’s actually quite cool to hover the mouse over each note in a map in turn and see a kind of “waterfall” of tags.