Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1 2 
Send Topic Print
Dashboards (Read 36100 times)
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Dashboards
Mar 18th, 2009, 4:10pm
 
I've been discussing Tinderbox dashboards on my blog

 http://www.markbernstein.org/Mar09/DashboardProgressBar.html

Happy to answer questions!  More usefully: how do you summarize Tinderbox information so you can see critical items at a glance?


Back to top
 
 
WWW   IP Logged
Amafortas
Full Member
*
Offline



Posts: 90

Re: Dashboards
Reply #1 - Mar 19th, 2009, 9:35pm
 
Mark,

I've been trying to make the example you posted on your blog for making a running word count work, and I've run into a problem.

I've pasted the following text into the Rule area on a new note:
"Rule: Text=sum_if(descendant(/BOOK),1,$WordCount);)

I copied the text directly from your blog, includeing the opening quotation mark.

I have also created a container called "BOOK" and put some notes in it with text.

Could you please provide me with some advice for how to proceed?

Thanks,

~A
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Dashboards
Reply #2 - Mar 20th, 2009, 5:15am
 
[post-edited for correction]
It looks like you've confused the sum_if parameters. It should be sum_if(which notes, condition to test, increment to add). You're not providing a test, just a value 1 - oops, not strictly true, see Mark B's next post. You actually want to test WordCount is > 0. So you need (checked in v4.6.1):

$Text=sum_if(descendant(/BOOK),$WordCount>0,$WordCount)

Actually, this more concise syntax also works and is simpler:

$Text=sum_if(descendant(/BOOK),$WordCount,$WordCount)

OK, in the latter version the test is effectively "does WordCount have a value?" as a count of zero equates to no value, so a test of '$WordCount' is always true for any other value than 0; as we can't have a negative word count the test will be true - and cause that note to be counted - wherever a note in the searched group has 1 or more words. There's no harm in using the first form - it's only two more characters - and sometimes writing things out more explicitly helps when you come to trouble shoot days or weeks later.

See more on sum_if().
Back to top
 
« Last Edit: Mar 20th, 2009, 11:56am by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Amafortas
Full Member
*
Offline



Posts: 90

Re: Dashboards
Reply #3 - Mar 20th, 2009, 10:57am
 
Mark,

Thanks for the help. You may want to change rule in the blog posting. (Follow the link in the first post.) Unless I'm missing something the rule posted there is not working.

Have a good one,

~A
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Dashboards
Reply #4 - Mar 20th, 2009, 11:24am
 
Actually, I believe the rule *does* work.  Mark Anderson's rule

  $Text=sum_if(descendant(/BOOK),$WordCount>0,$WordCount)

is fine; it sums up all the word counts that are greater than zero.  But it does no harm to add in all the zero word counts too!

    $Text=sum_if(descendant(/BOOK),1,$WordCount)

Since "1" is always true, this will add up everything.

(
Back to top
 
 
WWW   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Dashboards
Reply #5 - Mar 20th, 2009, 12:03pm
 
Mea culpa, I've rechecked. If I set both the condition and increment parameters to 1 I get a count of matching notes and - as Mark B says - I get a count of all notes in scope regardless of whether they have a WordCount or not. If I set the condition to back to '$'WordCount' and leave the increment as 1 I get a count of only those items with a count >0.

My mistake was not to start my test with the OP's 'bad' code.  Now I see that this Text=sum_if(descendant(/BOOK),1,$WordCount);) rule does work - at least in v4.6.1.  I can only assume the OP's problem lay elsewhere or was an undetected typo (i.e. the rule wasn't exactly as posted).
Back to top
 
« Last Edit: Mar 21st, 2009, 5:29am by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
peter lindsay
Full Member
*
Offline



Posts: 20
st andrews
Re: Dashboards
Reply #6 - Mar 20th, 2009, 12:54pm
 
Mark
how do you get the coloured font in the labels in map view ?
Peter
Back to top
 
 
plindsay.000   IP Logged
Amafortas
Full Member
*
Offline



Posts: 90

Re: Dashboards
Reply #7 - Mar 20th, 2009, 1:19pm
 
Marks,

I've tried recopying and pasting your code and I'm now getting a word count.

~A
Back to top
 
« Last Edit: Mar 20th, 2009, 1:28pm by Amafortas »  
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Dashboards
Reply #8 - Mar 20th, 2009, 1:54pm
 
Peter Lindsay --

The color of the body text is set by MapBodyTextColor, and its size is MapBodyTextSize.  (I'm using "green", which I redefined as "#c2d841".  36pt Futura Condensed.  But I encourage you to experiment!)
Back to top
 
 
WWW   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Dashboards
Reply #9 - Mar 21st, 2009, 5:29am
 
Was MapBodyTextColor added in v4.6 or v4.6.1?

Also, if one is doing a word count of all notes in group regardless of whether they have any words, it might be easier to just us a non-conditional sum:

$Text=sum(descendant(/BOOK),$WordCount)

instead of

Text=sum_if(descendant(/BOOK),1,$WordCount)
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Hugh Akston
Full Member
*
Offline



Posts: 7

Re: Dashboards
Reply #10 - Mar 21st, 2009, 9:09pm
 
Mark,

Love the dashboard idea in your blog.  I'm playing with one of my own.  I was successful using your word count example.   Can you describe how you did the progress bar?  I'm also intrigued by your idea to use the hue function to change color based on progress toward a goal.  

Many thanks!!
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Dashboards
Reply #11 - Mar 22nd, 2009, 9:08am
 
A progress bar is set using the horizontal bar() pattern, or the vertical vbar() pattern. note that in v4.6+ the pattern must be written as a string, i.e. $Pattern="bar(20)" or $Pattern="bar($MyProgress)" not as Pattern=bar(50) as previously.

In the above the 'progress' color is drawn in Color2. The hue of a colour can be controlled via the hue operator.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Hugh Akston
Full Member
*
Offline



Posts: 7

Re: Dashboards
Reply #12 - Mar 22nd, 2009, 10:13am
 
Many thanks, Mark!   I'll give it a try.

Edit:   It worked perfectly.   Thanks again!  Next I'll try messing around with the hue.  Maybe light green to dark green as I make progress toward the goal.
Back to top
 
« Last Edit: Mar 22nd, 2009, 4:06pm by Hugh Akston »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Dashboards
Reply #13 - Mar 22nd, 2009, 10:58am
 
Here's a stab at the hue issue, you'll need a custom colour attribute and this rule:

$MyColor=rgb(201,102,102);if($MyProgress<33){$Color2=$MyColor};if(($MyProgress>3
3)&($MyProgress<67)){$Color2=hue($MyColor,200)};if($MyProgress>67){$Color2=hue($
MyColor,150)};$Pattern="bar($MyProgress)";


Breaking out the individual terms out a bit onto separate lines we get:

$MyColor=rgb(201,102,102);
if($MyProgress<33){$Color2=$MyColor};
if(($MyProgress>33)&($MyProgress<67)){$Color2=hue($MyColor,200)};
if($MyProgress>67){$Color2=hue($MyColor,150)};
$Pattern="bar($MyProgress)";


So, how does it work? First, we define a colour,$MyColor, that we won't modify further but rather use it as a reference to make hue-shifted colours from that we apply to $Color2 which draws the progress bar. Depending on the value of $ProgressBar, $Color2 is changed  In the above example, below 33% complete the fill colour is red, 33%-67% it is blue and above 67% it is green. Play with the base colour and hue offsets to get different colour combos. Clearly, if you want more variation in colour, you'll need more 'if' clauses.

One thing I do note is that despite setting $Pattern last in the Rule, when I change $MyProgress the bar updates immediately but $Color2 does not - it appears to wait until the next agent/action/rule update cycle. That strikes me as unexpected but it's probably flaky syntax on my part rather than an error in TB's rule resolution.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Dashboards
Reply #14 - Mar 22nd, 2009, 12:42pm
 
Mark Anderson's approach is great.  Here's another one.

Let's suppose we have a numeric variable we want to reflect as a dashboard color.  We'll call it $MyNumber assume it's in the range from 0 to 100.

Using a Rule, we say

     $Color=saturation(green,$MyNumber);

where we've been using a custom green of #c2d841 in all our examples.  Here's what we get:



Or, perhaps we leave the Color of the note unchanged by vary the brightness of the label:

      $NameColor=$NameColor=brightness(green,$MyNumber);

Now, low values are dark, and high values are bright:



Another trick: play with the drop shadow. Setting ShadowBlur to 30 and ShadowDistance to 0, our rule becomes

$ShadowColor=brightness(white,$Name);

and now high-value notes glow:


Back to top
 
« Last Edit: Mar 22nd, 2009, 1:35pm by Mark Bernstein »  
WWW   IP Logged
Pages: 1 2 
Send Topic Print