Visualizing data with Tree

The Tree component is used to display a hierarchical representation of data in a graphical format. It provides an array of the TreeNode objects as its value. The TreeNode API provides many properties to create tree node objects. The tree structure has basically three major components as listed here:

  • The tree elements are called nodes
  • The lines connecting elements are called branches
  • The nodes without children are called leaf nodes or leaves

A basic example of a Tree component with nodes would be written as follows (the node will represent tourist places):

<p-tree [value]="basicTree"></p-tree>

The data for the Tree component should be provided in a nested parent-child hierarchy. Each tree node is created with ...

Get Angular UI Development with PrimeNG now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.