TagCanvas 2.6
Published
TagCanvas 2.6 really only adds one new feature, with a few options to go with it. The example cloud below shows the new mixed text and image tags in action.
The first new option is imageMode
and determines how TagCanvas
deals with text and images found in the links it uses to create the tags. The
default behaviour is to act the way it always used to do, displaying an image
if there is one, or the link text otherwise. The imageMode
option
allows you to choose
to only display images (imageMode = 'image'
), only display text
(imageMode = 'text'
), or display text and images on a single tag
(imageMode = 'both'
). The default fallback option is used when
imageMode
is null
.
The imagePosition
option specifies where the image goes in
relation to the text, and imagePadding
is the amount of space
between the image and the text. For positioning the text and image within the
bounding box of the tag, there are imageAlign
,
imageVAlign
, textAlign
and textVAlign
options. Apart from textAlign
, these options are only useful when
mixed image and text tags are in use.
To aid in setting up and debugging your canvas, TagCanvas will now display
a message saying “No tags” when it cannot find any tags to draw.
This should make it a bit easier to tell what is going wrong when your canvas
doesn't show anything. To hide the message, you can set the noTagsMessage
option to false
.
In previous versions, setting a title attribute for the canvas element did not produce a useful result. This version supports displaying the canvas title as a tooltip along with the tooltips from the tags. This works in both native and div-based modes without any extra configuration required. The example canvas above is using div-based tooltips for the canvas and some of the tags.
This version is also the first to clear any existing event handlers before starting a new instance of TagCanvas on a canvas where it has already been running. This is so that you can switch between using drag control and cursor position control without the canvas appearing to have frozen up.
The new version is available from the TagCanvas page.