Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Interactively construct a tree
ResourceFunction["NestTreeInteractive"][f,expr0] gives an interactive tree with initial data expr0, where clicking a leaf with data expr adds new children defined by f[expr]. | |
ResourceFunction["NestTreeInteractive"][f,expr0,h] additionally applies h to the data of the clicked node. |
Interactively build a tree from an expression:
In[1]:= |
Out[1]= |
Clicking the leaf adds children:
In[2]:= |
Out[2]= |
Children can be continually added by clicking the leaves:
In[3]:= |
Out[3]= |
Give a function to apply to each new node:
In[4]:= |
Out[4]= |
Interactively create a Calkin-Wilf tree:
In[5]:= |
Out[5]= |
Interactively create a Stern-Brocot tree:
In[6]:= |
Out[6]= |
Wolfram Language 13.0 (December 2021) or above
This work is licensed under a Creative Commons Attribution 4.0 International License