List and count all related tags

I would like to create a tag cloud which contains all tags related with one tag.

For example,

  • Tiddler 1 has Tag1, Tag2
  • Tiddler 2 has Tag1, Tag2, Tag3
  • Tiddler 3 has Tag1, Tag2, Tag3, Tag4
  • Tiddler 4 has Tag2, Tag5

For Tag1, I would like to find all related tags with counting (i.e. Tag2 (3), Tag3 (2), and Tag4 (1)), and then create a tag cloud for Tag2, Tag3, and Tag4.

Is there already a solution for this problem? If not, how should I achieve it?

There are anuber of tag cloud implementations have a search on google “tag cloud tiddlywiki” eg https://groups.google.com/g/tiddlywiki/c/VQPaJC6yyWM/m/B2pS_FgXCgAJ

\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>
  • See how this does all tags, you could start with a single tag or for each tag on current tiddler.

Thanks. Actually I just tried this link before I come here to ask. It seems this code is filtering by tag, but not list tags by a tiddler.