MaxDisplayedChildren

MaxDisplayedChildren

is an option for Tree and related functions that specifies the maximum number of children that should be displayed for each subtree.

Details

  • MaxDisplayedChildren allows the children of the root node of a tree to be elided, as well as those of any subtrees at positions matching a pattern.
  • The following option settings can be used:
  • Automaticdisplay the default number of children
    mdisplay m children at the root node
    Allmdisplay m children at all nodes
    TreeCases[pattern]mdisplay m children at nodes with data matching pattern
    {pos1m1,pos2m2,}display mi children at relative position posi
    {patt1m1,patt2m2,}display mi children at positions matching patti
  • The global variable $MaxDisplayedChildren gives the default number of children for all nodes.

Examples

open allclose all

Basic Examples  (3)

Display all children of the root node:

Display five children:

Display two children for all nodes:

Specify a list of max child numbers:

Scope  (1)

Position Specification  (1)

Specify positions using position patterns:

Specify positions using data patterns:

Properties & Relations  (6)

Ten children are displayed by default:

Setting $MaxDisplayedChildren=m specifies the default number of children to display for the option setting MaxDisplayedChildrenAutomatic:

Maximum children for nodes can be specified by position:

Specify the maximum number of children for a tree:

Maximum children specified by a subtree take precedence over those specified by its ancestors:

A position {i,j,} in a subtree refers to its subtree at relative position {i,j,}:

A relative position {2} at position {1} refers to the global position {1,2}:

In general, a pattern patt applies to subtrees at global positions {i,j,} that match patt:

A list of patterns {patt1,patt2,} applies to relative positions {i,j,} that match the patti:

Wolfram Research (2022), MaxDisplayedChildren, Wolfram Language function, https://reference.wolfram.com/language/ref/MaxDisplayedChildren.html.

Text

Wolfram Research (2022), MaxDisplayedChildren, Wolfram Language function, https://reference.wolfram.com/language/ref/MaxDisplayedChildren.html.

CMS

Wolfram Language. 2022. "MaxDisplayedChildren." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MaxDisplayedChildren.html.

APA

Wolfram Language. (2022). MaxDisplayedChildren. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MaxDisplayedChildren.html

BibTeX

@misc{reference.wolfram_2024_maxdisplayedchildren, author="Wolfram Research", title="{MaxDisplayedChildren}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/MaxDisplayedChildren.html}", note=[Accessed: 30-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_maxdisplayedchildren, organization={Wolfram Research}, title={MaxDisplayedChildren}, year={2022}, url={https://reference.wolfram.com/language/ref/MaxDisplayedChildren.html}, note=[Accessed: 30-December-2024 ]}