Documents Hierarchy
Type: Class
How to get documentsHierarchy?
JavaScript
import documentsHierarchy from 'fontoxml-documents/src/documentsHierarchy.js'
The DocumentsHierarchy represents the relationships between the documents loaded in the DocumentsManager. It is a tree of DocumentsHierarchyNodes, each of which optionally references a document which can be loaded. The DocumentsHierarchy itself is the root of the tree and can not reference a document.
Properties
children
Type: Array<DocumentsHierarchyNode>
The top-level hierarchy nodes referencing the documents directly loaded in the editor
hierarchy Changed Notifier
Type: DebouncedNotifier
Notifier to use for signalling hierarchy changes. Note that this is not called by the hierarchy itself, but should be used by components that mutate the hierarchy. This way, mutations can be batched.
This notifier is debounced internally.
Methods
add Child
Type: Function
Append a child to this hierarchy node
Arguments
clear
Type: Function
Remove all children of the hierarchy
find
Type: Function
Traverses the documents hierarchy in depth-first order looking for a hierarchy node for which the given callback returns true.
Arguments
Returns
find All
Type: Function
Find all hierarchy nodes (in hierarchy order) for which the given callback returns true.
Arguments
Returns
find All Visible Hierarchy Nodes
Type: Function
Find all visible hierarchy nodes, in hierarchy order.
Returns
find Next Visible Hierarchy Node
Type: Function
Find the visible hierarchy node following (or preceding) the given hierarchy node in hierarchy order.
Arguments
Returns
get
Type: Function
Get the current DocumentsHierarchyNode with the given ID, or null if there is no node with that ID in the current hierarchy.
Arguments
Returns
get First Visible Hierarchy Node
Type: Function
Find the first visible hierarchy node.
Returns
get Last Visible Hierarchy Node
Type: Function
Find the last visible hierarchy node.
Returns
remove Child
Type: Function
Remove a child from this hierarchy node
Arguments