Flatten a tree into a list of visible nodes.
Only includes nodes whose ancestors are all expanded. Order is depth-first pre-order traversal.
Root node(s)
Function to get node key
Function to get node children
Function to check if node has children
Set of expanded node keys
Optional
Array of flattened nodes
Flatten a tree into a list of visible nodes.
Only includes nodes whose ancestors are all expanded. Order is depth-first pre-order traversal.