output::tree -- display of
trees
Introductionoutput::tree formats internally represented trees to
display graphically.
Call(s)output::tree(Tree <, indentdepth <, charlist> <,
options>>)
ParametersTree |
- | the tree, given as a special list |
indentdepth |
- | indent depth for each subtree |
charlist |
- | the chars that illustrate the tree structure |
options |
- | option Small |
OptionsSmall |
- | suppresses the display of a space line between every tree entry |
Returnsan string object to display
Related
Functions
Detailsoutput::tree displays trees given as specially
MuPAD lists.print and fprint and the option
Unquoted the tree can be displayed.charlist is a list with five characters.
The default value is [", "+", ", ``", " "]. The characters
have the following meaning (described in the order of the list).
Option: Small
Example
1output::tree displayes special nested lists
as trees:
>> TREE := ["a1", "a2", ["b1", "b2", ["c1", "c2"], "b3"],
["d1", "d2", "d3"]]:
print(Unquoted, output::tree(TREE))
a1
|
+-- a2
|
+-- b1
| |
| +-- b2
| |
| +-- c1
| | |
| | `-- c2
| |
| `-- b3
|
`-- d1
|
+-- d2
|
`-- d3
>> print(Unquoted, output::tree(TREE, 3, Small)):
a1
+- a2
+- b1
| +- b2
| +- c1
| | `- c2
| `- b3
`- d1
+- d2
`- d3
The chars can be defined by the user:
>> print(Unquoted, output::tree(TREE, 6, ["|", "|", ".", "\\", " "])):
a1
|
|.... a2
|
|.... b1
| |
| |.... b2
| |
| |.... c1
| | |
| | \.... c2
| |
| \.... b3
|
\.... d1
|
|.... d2
|
\.... d3