Namespace treeview


xeokit Tree View UI

  • TreeView - A fast and interactive HTML-based tree view.
  • Enables seamless navigation of federated models in a Viewer.
  • Designed to work with a View and a semantic Data model.
  • Supports Industry Foundation Classes (IFC).
  • Compatible with any schema structured as an ER graph with aggregation relationships.
npm install @xeokit/sdk
import { Viewer } from "@xeokit/sdk/viewer";
import { WebGLRenderer } from "@xeokit/sdk/webglrenderer";
import { Data } from "@xeokit/sdk/data";
import * as ifcTypes from "@xeokit/sdk/ifctypes";
import { TreeView } from "@xeokit/sdk/treeview";
import { loadXGF } from "@xeokit/sdk/xgf";
const myViewer = new Viewer({
id: "myViewer",
renderer: new WebGLRenderer({})
});
const view1 = myViewer.createView({
id: "myView",
canvasId: "myView1"
});

view1.camera.eye = [-3.933, 2.855, 27.018];
view1.camera.look = [4.400, 3.724, 8.899];
view1.camera.up = [-0.018, 0.999, 0.039];

const data = new Data();
const treeView = new TreeView({
view: myView,
data: myData,
containerElement: document.getElementById("myTreeViewContainer"),
hierarchy: TreeView.GroupsHierarchy,
linkType: ifcTypes.IfcRelAggregates,
groupTypes: [ifcTypes.IfcBuilding, ifcTypes.IfcBuildingStorey]
});
const sceneModel = new SceneModel();
const dataModel = data.createModel({ id: "myModel" });

fetch("myModel.xgf").then(response => {
response.arrayBuffer().then(data => {
loadXGF({ data, sceneModel, dataModel });
sceneModel.build();
dataModel.build();
myViewer.scene.addModel({ id: "myModel", sceneModel });
});
});

Classes

TreeView

Interfaces

TreeViewNode
TreeViewNodeContextMenuEvent
TreeViewNodeTitleClickedEvent
TreeViewParams