Searching for a nice dashboard

I’ve been reading that series of posts, trying to follow some of the advices it contains in order to have a nice dashboard with a textlenght count and a progress bar which could help me see my progression while working with much effort on a research article. Then, I began to test them with a copy of a certain file and apply the code above, but I must admit that I can’t manage to understand what I have to do. So, is there a rule to know I should apply? Thanks so much for your help!

1 Like

The excellent “Actions and Dashboard” document available from Help is a good read for the important aspects of dashboarding. Chapter 7 “Progress Bars” is where you would want to look for help on the OP. Here is a toy example:

If I have a container of notes with the text for an article I am working on. The container’s $Rule is

$Text=sum_if(children,$WordCount>0,$WordCount)

then I can open the Plot inspector for that container and set parameters for a ** bar** pattern such as

and then tweak to get the desired dashboard counts for that container.

1 Like

A. Your rule

$Text=sum_if(children,$WordCount>0,$WordCount)

is more complicated than it needs to be. What you want to do is, simple, add up the word count for all of the children. You don’t need a conditional to do that!

$Text=sum(children,$WordCount)

B. Suppose you want the word count of all the children of some other container – perhaps /Chapter One. Then your rule would be

$Text=sum(children(/Chapter One),$WordCount)

C. If you’re using the built-in prototype Dashboard note, it draws its $Name as a label and draws its $Subtitle as a big green display. So, your dashboard might look nicer with

$Subtitle=sum(children(/Chapter One),$WordCount)

D. I like to separate data collection actions from display actions, primarily in order to be able to see intermediate results. That way, if I don’t immediately see what I expect, I can look at those intermediate results to discover whether I’m doing the calculation wrong, or whether I’ve got the display wrong. Easy enough:

$MyNumber=sum(children(/Chapter One),$WordCount); $Subtitle=$MyNumber;

E. Finally, word counts tend to be big numbers, and if we’re going to gild the lilly, it might be nice to format them. In English, it’s more legible to write “19,671” for the word count than to leave it as “19671”. As I recall, in France people prefer “19 671”. Fortunately, Tinderbox knows all this, and it’s easy to format!

$MyNumber=sum(children(/Chapter One),$WordCount); $Subtitle=$MyNumber.format(“l”);

1 Like

@dominiquerenauld I haven’t tried this, and perhaps desendant() is legacy action code that still works, but you may want to check out descendedFrom()

descendants is a group designator, like children, ancestors, and all. It can be used like this:

$Color(descendants)=“red”

descendedFrom(thatNote) is a function; it returns true if this is descended from the designated note.

@PaulWalters @eastgate @pat Thank you for your answers!!! They helped me so much to do my work. For the moment, I’ve passed my first exam and shaped one of my files as follows:


I have now a file, my research notebook, that indicates me the number of words my articles contain.
I was wondering:
First, if I wanted my dashboard to show the number of words for each section of my articles, how could I do? Is the following rule correct?

$Text=sum(children(/Chapter One, Chapter Two, Chapter Three),$WordCount)

Second, is there any way to show the number of characters for each container ? It’s not absolutely important, but I have to compromise with a determined sum of characters, not words.

Yes, in France, we write “19 671” with that separator.

1 Like

Number of characters: $TextLength.

Word count for entire article: You want to construct a list, so each item should be separated by semicolons:

 sum(children("/Chapter One;/Chapter 2;/Chapter Three"),$Word Count)

Note also the quotation marks, which ensure that the parser doesn’t confuse itself with the semicolons and commas within the list.

A better approach might be to simply add up the values already computed within your dashboard!

 $Text=$MyNumber(/Dash/Chapter 1)+$MyNumber(/Dash/Chapter 2) .... 

This saves a little work.

Finally, if you put /Chapter One and /Chapter Two inside a container called /Book, then you could use

 $Text=sum(descendants(/Book), $WordCount)

Or, if all the components of your book share a common prototype, then

 sum(find("Prototype=BookPage"),$WordCount)

Thank you profusely for answering, merci vivement. It works. I am developing my research notebook with new features: a research journal including, besides that nice dashboard, a very useful timeline.

1 Like

Thanks for this thread. @dominiquerenauld, please, make sure to keep us updated on how your interesting sounding project of a “research notebook” is progressing and eventually turning out.

1 Like

I won’t fail to do that.

I’ve just posted a short article on my blog about the way I use now Tinderbox as a BIG notebook for my notes and projects.

I eventually choose to gather all my notes into one big file rather than several notebooks. The reason is that I found that I needed to know how, where and when I had written such and such note especially for my thesis research: when did you find that nice association? Do you remember if it was before you read that particular book? Or if it was after we talked about that theoretical issue? As you can see on the screenshot, my dashboard is like a paperboard: I pin on it some reminders and set all my files within easy reach.

3 Likes

@dominiquerenauld, very helpful and straightforward. Thank you for writing and posting your thoughts.

I have adapted the very good info in this page to have a dashboard for an agent.
I’ve managed to display the number of notes found by the agent and their total number of words. I am lost at how to get the latter result to be divided by 250 in order to have the approximate number of pages. This is as far as I got:

$MyList=sum(children,$WordCount);$Subtitle=$ChildCount+"\n"+$MyList

For example:

$Subtitle="Pages: " + sum(children,$WordCount) / 250;

You’ll want to apply formatting to the division result so as to round page count to 10ths or whole numbers.

(BTW, $MyList is a list attribute, not numeric, so I would suggest using either $MyNumber or a variable in your construction.)

Thanks. I am afraid I didn’t phrase well my question. What I would like to include in the same subtitle is all the following, and if possible only for prototypes P1 & P2:

  • $ChildCount+" P1 & P2"
  • sum(children,$WordCount)+" W"
  • sum(children,$WordCount)/250+" P"

See sum_if

So you would want something like

sum_if(children,$Prototype="P1",$WordCount) + sum_if(children,$Prototype="P2",$WordCount)

(BTW – it’s easy to browse aTbRef, as I did, and quickly find the answers, then do a little experiment to confirm – that’s all I did before replying.)

I finally decided to get Tinderbox half a year ago, but my first attempt at customizing it proved daunting. This time I’m nearly finishing a setup I’ll be more than happy to start using, thanks to the responsive and patient participants in this forum. Trying to customize Tinderbox is well beyond the Getting Started Guide, so I have followed a number of good tutorials that I can adapt, such as Eclectic Light’s, I have a local copy of aTbRef both in tbx and html, and at times also check the Cookbook. Yet, I can’t say I’m finding it straight forward. I realise I would benefit from improving my knowledge of formal languages, which one would you advise in order to better comprehend problems like the one I’m trying to solve now?

I have managed to get number of notes, words and pages both in total and for Annotations and Notes. To finish the prototype, I don’t know how to merge the two Rules below into one. I think the problem I cannot solve is how to use these two $MyNumber in just one rule.

$MyNumber=sum(descendants,$WordCount); $Subtitle=$DescendantCount+ " " +$MyNumber+" W " +($MyNumber/250).precision(1)+" P"

$MyNumber=sum_if(descendants,$Prototype="pNote",$WordCount)+sum_if(descendants,$Prototype="pAnnotation",$WordCount); $Subtitle=sum_if(descendants,$Prototype="pNote",1)+sum_if(descendants,$Prototype="pAnnotation",1)+ " " +$MyNumber+" W " +($MyNumber/250).precision(1)+" P"

You’re storying a number in $MyNumber, using it, and then storing a new number there. That’s fine. You might be slightly happier adding a second numerical attribute in order to keep both numbers.

But note that you’re setting the Subtitle of this note. So, these are probably two rules for two different notes. If they’re different notes, each note has its own value of $MyNumber.

1 Like

Maybe the latest version of A Tinderbox Way – just out – would aid your understanding of why Tinderbox works the way it works?

The best way to learn Tinderbox is working on your own project ideas – like what you are doing right now. Over time you’ll build up the muscle memory to know “ah, this fits with that – I’ve seen that before – now if I tweak this other knob let me see what I get”. We all find ourselves jumping into aTbRef for a refresher on a topic or to find examples.

1 Like

Thanks also for the encouragement.
aTbRef is a great resource, but I find that unless one knows exactly the appropriate term to look for, it is not easy for the newbie to locate the info in the .tbx version with TB search. This time I couldn’t find if DescendantCount(original) is possible.

I have been unable to create the following agent. But it does count as an edict for a Dashboard prototype. I am leaving it here until I know TB enough to automate it further.

The reason to prefer an agent over a prototype is that in my first attempt at TB I used edict and rules in prototypes, instead of agents. I am under the impression that it was less efficient and more difficult to manage. But I might be wrong.

if($AgentQuery!="" | $Prototype=="pNote" | $Prototype=="pAnnotation") {$MyNumber=sum(descendants(original),$WordCount);$MyNumber_1=sum_if(descendants(original),$Prototype="pNote",$WordCount)+sum_if(descendants(original),$Prototype="pAnnotation",$WordCount);$Subtitle=sum_if(descendants(original),$Prototype="pNote",1)+sum_if(descendants(original),$Prototype="pAnnotation",1) + " " +$MyNumber_1 +" W " + ($MyNumber_1/250).precision(1) + " P\n"+$DescendantCount(original) + " " +$MyNumber+" W " + ($MyNumber/250).precision(1) + " P"}