Display attributes of notes from attributes of Children

I am just getting my feets wet in Tinderbox.
So Sorry. A basic question, But could not find a solution.

I am creating a Tinderbox file for different medicinal herbs.
The main note has the Name and basic attributes.
Inside of this note I place notes of descriptions of this herb from different scources.

  • Is it possible to change the display attributes of the main note according to attributes of one of the “children notes”? (How to adress a chld?)
  • When using agents to select notes, it creates an alias. How to select notes, so that the original notes with the subnotes are displayed?

Urs

What is shown in any note’s Displayed Attributes table (including for agents and aliases) is a list of attributes which is stored discretely per note (aliases use their original note’s Displayed Attributes). That list is itself an attribute value, held in system attribute $DisplayedAttributes.

Displayed Attributes can be set in a number of ways. The most common way is probably using the Add Displayed Attributes pop-over but the $DisplayedAttributes can also be set via the UI using a Quickstamp, or Get Info/attributes. Finally, in more advanced use, action code can be used edit $DisplayedAttributes directly via code.

However, and I may be misunderstanding your questions phrasing, whilst a note can show the same attributes in its Displayed Attributes table as its child, it cannot show the child’s values. To do the latter you would need to use code to copy the child values into a user attribute and make the latter part of the parent’s Displayed Attributes table.

That is correct and as expected. Moreover, an agent only makes one aliases per note even if a note and some of its aliases all match the query

Given the above, an agent cannot display original notes within the agent container. If you wish to see the original note, in context, then:

Does that help? :slight_smile:

It might help to show an actual — perhaps imagined — example.

For example, let’s imagine a note for ginger (Zingiber officinale)

  • what are its Displayed Attributes?
  • what are its children?

It might also be useful to know the purpose or goal!

Thank you. Yes helped me to dig into the attributes. To clarify my problem, see my answer below.
Urs

1 Like

@eastgate
I have a note “medicinals”. Inside this note would be “Ginger” as one of the hundreds of herb notes. The “Ginger” note has the basic attributes of every herb: Name German, Name English, Pharmaceutical name, Chinese name. Inside this ginger note are notes about ginger from different texts: an example of an attribute is the taste of the herb. eg acrid. the taste was not always the same with different scholars. Depending on how it grew, was harvested, processed… (compare taste of different apples) or because the chinese language is referering to processes not things acrid could also mean dispersing, like wood in spring… So sometimes perhaps the reference is not the taste in the mouth but a physiological process.

I made different prototypes to color code the taste of the herb. So when I open the Ginger note, its easy to see where the scholars agree. But it would be easier to dig into the concept of taste, if eg the taste of one scholar codes the outline of the note “Ginger” and the taste of another the color of the Title of “Ginger”. So you see in the overview of all notes where there is a disagreement.
Thats what I meant with displaying an attribute of a child in the parent. I should reference to an attribute of a specific child.

By changing the prototype, other attributes could be displayed, helping to understand the view of different scholars and times. And how they used different attributes.

The second step would be to look into formulas, meanss combination of different herbs. I started to make this with agents that search for multiple herbs. Not sure if this is the best method. It would be great, if the herbs appearing in the “formula agent” would have the same color coding as the “parent” herb note. In our example “Ginger”. So the combination of selected attributes could be visualized. Without having to open the original note.

Hope made it clear…

Urs

OK, so you have a note for ‘Ginger’ that—amongst other things—lists its name in various languages. Then—here the description is far less clear, you have a note per source/reference (?) about that parent note. A little sample doc or a screen grab might help here. So something like this:

I’m unclear of the exact meaning of ‘codes’ here. My best guess is that by selecting (how?) a given source person, the colour of per herb/space spice notes in the Outline view will change based on what change in the document?

In case it helps, the colour as set in $Color is used in different parts of different views—the same colour but a different visual use of that colour:

  • Map, Hyperbolic views: the fill colour of the note icon
  • Outline, Chart, Timeline, Attribute Browser views: the colour of the note title
  • Treemap view; the border colour of the item
  • Crosstabs view: not used except possibly as a colour stripe in the per-cell data.

If you want to apply a particular source’s (book/author/tradition/etc.) taste profile across numerous herbs/spaces, them it might be better to have a single note per source and have a Dictionary attribute hold per-source tastes for each herb/spice. If you use a fixed taste vocabulary, a separate dictionary can hold taste-to-Tinderbox-colour mappings, e.g. acid:red;sweet:yellow;... etc.

That way you could tell Tinderbox to colour the $Color of all herb/spice notes according to a particular source’s tastes. The rough code logic being

  • get a list of all herb and/or spice notes (e.g. “Ginger”) you wish to colour.
  • store the source whose taste profile we want to colour-display.
  • test each item from step #1 in turn (a .each() iteration of the list)
    • look up the item in the nominated sources taste dictionary
    • if found, take the taste value, loo-up the associated colour and use that value to set the item’s $Color
    • if no match set a dull, null, value so un-tasted items don’t create visual noise (e.g. a light grey colour)

To reset, step through the list again and reset $Color ($Color=;) so the note resume the doc default or prototype inherited colour.

I hope that helps you with some ideas to help get going. :slight_smile:

Thank you Mark!
Think working with a Dictionary could be the way to go.
Have added screnshots of Ginger notes. And of the agent as an example of how I did the color code till now.
Will ask again, if I do not find a solution. Thanks again.





1 Like

Are you aware of the TBX videos?

You may find these helpful.

yes great resource!