Eric!

As usual - WOW !!!

I used this on www.tiddlywiki.com and it's perfect!

\define calcFontSize() font-size:calc(0.8em + (0.07em * ($(count)$ / 5) ) );

<$list filter="[tags[]!is[system]sort[]]" variable="thistag">
   <$vars count={{{ [<thistag>tagging[]count[]] }}}>
      <span style=<<calcFontSize>>>
         <$link to=<<thistag>> tooltip=<<count>>>
            <$text text=<<thistag>> />
         </$link>
      </span>
   </$vars>
</$list>

Thanks as well for the explanation. It never occurred to me to use CSS's 
*calc*

Cheers

On Sunday, April 14, 2019 at 9:13:30 AM UTC+7, Eric Shulman wrote:
>
> On Saturday, April 13, 2019 at 5:35:14 PM UTC-7, S. S. wrote:
>>
>> Is this TW CLassic plugin available for TW5 ?
>> http://www.tiddlytools.com/#TagCloudPlugin
>> Here is an big example: 
>> https://karlarao.github.io/karlaraowiki/index.html#TagCloud
>>
>
> In TiddlyWiki5, you can actually generate a tag cloud without using any 
> plugins!
>
> Try this:
>
> \define calcFontSize() font-size:calc(0.5em + (0.2em * ($(count)$ / 5) ) 
> );
>
> <$list filter="[tags[]]" variable="thistag">
>    <$vars count={{{ [<thistag>tagging[]count[]] }}}>
>       <span style=<<calcFontSize>>>
>          <$link to=<<thistag>> tooltip=<<count>>>
>             <$text text=<<thistag>> />
>          </$link>
>       </span>
>    </$vars>
> </$list>
>
> What it does:
> 1) The <$list> widget gets the names of all the tags in the document, 
> assigning each name, in turn, to the "thistag" variable
> 2) The <$vars> widget gets the number of items for the current tag
> 3) The <span> uses the "calcFontSize" macro to generate a style attribute 
> that sets the font-size of the tag text to be displayed, based on the 
> number of items with that tag
> 4) The <$link> widget creates a link to the tag tiddler itself, with the 
> mouse-over tooltip text showing the number of items with that tag
> 5) The <$text> widget displays the tag text
>
> The calcFontSize macro uses a base size of 0.5em, and then adds an 
> increment of 0.2em for every 5 tagged items.  Thus, the resulting font 
> sizes are:
> 1-5 items    = 0.5em
> 6-10 items  = 0.7em
> 11-15 items = 0.9em
> 16-20 items = 1.1em
> 21-25 items = 1.3em
> etc.
>
> Of course, you can adjust all the numbers in the calculation to suit your 
> own tastes.
>
> Let me know how it goes...
>
> enjoy,
> -e
> Eric Shulman
> TiddlyTools.com: "Small Tools for Big Ideas!" (tm)
> InsideTiddlyWiki: The Missing Manuals
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/82b8899f-42fc-416a-b75b-8e522c743911%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to