An HTMl tree view that navigates the !DataObject | DataObjects in the given !Data | Data, while controlling the visibility of their corresponding ViewObjects in the given View.

See @xeokit/sdk/treeview for usage.

Hierarchy (View Summary)

Constructors

Properties

data: Data

The semantic !Data | Data model that determines the structure of this TreeView.

destroyed: boolean

True once this Component has been destroyed.

Don't use this Component if this is true.

dirty: boolean
id: string

Unique ID of this Component.

view: View

The View that contains the ViewObjects navigated by this TreeView.

AggregationHierarchy: number = 0

Hierarchy mode that arranges the TreeViewNodes as an aggregation hierarchy.

The mode creates a TreeViewNode hierarchy that mirrors that of the !DataObject | DataObjects and aggregation !Relationship | Relationships in the !Data | Data.

In this hierarchy, each TreeViewNode corresponds to a DataObject in the Data. The TreeViewNodes are connected into a hierarchy that reflects a depth-first traversal from the root DataObjects that follows each DataObject's outgoing Relationships of the type given in TreeView.linkType.

GroupsHierarchy: number = 2

Hierarchy mode that arranges the TreeViewNodes into an n-level grouped hierarchy.

This mode creates a multi-level grouped hierarchy, following the order given in TreeViewParams.groupTypes. The TreeViewNodes at level 0 are all the same type as TreeViewParams.groupTypes[0], TreeViewNodes at level 1 are all the same type as TreeViewParams.groupTypes[2], and so on. Once descended beyond the length of TreeViewParams.groupTypes, the TreeViewNodes are just grouped by type.

TypesHierarchy: number = 1

Hierarchy mode that groups the TreeViewNodes by type.

This mode creates a two-level hierarchy. At the root level, we get TreeViewNodes that represent each of the distinct types in our !Data | Data. Each of those gets one or more child TreeViewNodes that represent !DataObject | DataObjects of that type. When those DataObjects have ViewObjects of the same ID, then the TreeViewNodes will have checkboxes that we can use to show, hide, and X-ray their ViewObjects.

Accessors

Methods

  • Protected

    Logs an error for this component to the JavaScript console.

    The console message will have this format: [ERROR] [<component type> =<component id>: <message>

    Parameters

    • message: string

      The error message to log

    Returns void

  • Protected

    Logs a message for this component.

    The message will have this format: [LOG] [<component type> <component id>: <message>

    Parameters

    • message: string

      The message to log

    Returns void

  • Highlights the tree view node that represents the given object viewObject.

    This causes the tree view to collapse, then expand to reveal the node, then highlight the node.

    If a node is previously highlighted, de-highlights that node and collapses the tree first.

    Note that if the TreeView was configured with pruneEmptyNodes: true (default configuration), then the node won't exist in the tree if it has no viewObjects in the Scene. in that case, nothing will happen.

    Within the DOM, the node is represented by an <li> element. This method will add a .highlighted-node class to the element to make it appear highlighted, removing that class when de-highlighting it again. See the CSS rules in the TreeView ifcviewer for an example of that class.

    Parameters

    • objectId: string

      ID of the viewObject.

    Returns void

  • Protected

    Logs a warning for this component to the JavaScript console.

    The console message will have this format: [WARN] [<component type> =<component id>: <message>

    Parameters

    • message: string

      The warning message to log

    Returns void

Events

Emits an event each time we right-click on a tree node.

onDestroyed: EventEmitter<TreeView, null>

Emits an event when this TreeView has been destroyed.

Triggered by TreeView.destroy.

Emits an event each time the title of a node is clicked in the tree view.