I'd think that your solution has a lot of potential to result in
eternal loops, as it doesn't exclude tiddlers that have already been
taken into account.

I guess you'd want some overarching array (passed down as a variable?)
to store all those tiddlers that have already been "TaggedTiddlers" to
any of the preceeding tiddlers, so that you wont check them over and
over ...and over.

Maybe Eric's RelatedTiddlersPlugin and the idea of a "Minimal Spanning
Tree" provide a good starting point to get that count right.

If I am not mistaken, then the number of items in a list returned by
RelatedTiddlersPlugin is exactly the number you're looking for.

Tobias.


On 11 Apr., 07:10, "Mark S." <throa...@yahoo.com> wrote:
> Assuming that you have a well-structured tree (nothing to cause
> eternal loops), then this script (using Inline javascript plugin)
> should do it. I think you can see where to plug in the tag name.
>
> Mark
>
> <script label="Count Tiddlers">
> var tagName = "Personal" ;
>
> function recurCount(tagName) {
>   var tiddlers=store.getTaggedTiddlers(tagName) ;
>   var tidCount = 1 ;
>   for(var i=0;i<tiddlers.length;i++) {
>     var title = tiddlers[i].title ;
>     tidCount += recurCount(title) ;
>
>   }
>   return tidCount ;
>
> } // recurCount()
>
> var cnt = recurCount(tagName) ;
> alert("Count was " + cnt + " for "+tagName) ;
>
> </script>
>
> On Apr 9, 3:53 am, twgrp <matiasg...@gmail.com> wrote:
>
> > Can't find this in archives or in e.g the many forEachTiddler examples
> > [1].
>
> > The idea is to get a list over tags ranked by "domain size".
> > I.e for a certain tag, how many tiddlers are tagged with it (let's say
> > it's 3) plus the number of tiddlers tagged with the names of *those* 3
> > tiddlers (let's say it's 15)... plus how many tiddlers are tagged with
> > those 15 tiddlers... plus... well you get it.
> > The end result for that particular tag is then 3+15+... = TagDomain
> > size
>
> > The purpose is to see what tags that "are important topics" in the TW.
>
> > I've found many variants[2] ranking by how many tiddlers that are
> > *directly* tagged with a certain tag, but this is a bit misleading
> > here, like the tip of an ice berg. I think what is needed is some kind
> > of tree traversing, counting leafs. I think the tag/tiddler-names must
> > be stored and continually compared, or it would probably turn
> > circular.
>
> > Any help appreciated! Thank you!
>
> > :-)
>
> > [1]http://tiddlywiki.abego-software.de/#ForEachTiddlerExamples
>
> > [2] for example:
> > * the built-in Tags listing, in the sidebar tabs
> > *http://tiddlywiki.abego-software.de/#[[List%20all%20Tiddlers%2C%20grouped%20by%20Tags]]
> > *http://www.tiddlytools.com/#RelatedTiddlersPlugin
> > *http://www.tiddlytools.com/#TagCloudPlugin
> > *http://www.tiddlytools.com/#TagGridPluginInfo

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to tiddlyw...@googlegroups.com.
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.

Reply via email to