Layout in EJ 1 Angular TreeMap

You can decide on the visual representation of nodes belonging to all the treemap levels using the itemsLayoutMode property of the TreeMap.

There are four different TreeMap layouts such as

  • Squarified
  • SliceAndDiceAuto
  • SliceAndDiceHorizontal
  • SliceAndDiceVertical

Squarified

Squarified layout creates rectangles with best aspect ratio.

  • html
  • <ej-treemap id="treemap"  [dataSource]="population_data" itemsLayoutMode="squarified"
                              weightValuePath= "Population"  colorValuePath= "Growth">
         <e-levels>
             <e-level groupPath="Continent" [groupGap]=5></e-level>
         </e-levels>
    </ej-treemap>

    Layout_img1

    SliceAndDiceAuto

    SliceAndDiceAuto layout creates rectangles with high aspect ratio and displays them sorted both horizontally and vertically.

  • html
  • <ej-treemap id="treemap"  [dataSource]="population_data" itemsLayoutMode="sliceanddiceauto"
                                     weightValuePath= "Population"  colorValuePath= "Growth">
        <e-levels>
             <e-level groupPath="Continent" [groupGap]=5></e-level>
        </e-levels>
    </ej-treemap>

    Layout_img2

    SliceAndDiceHorizontal

    SliceAndDiceHorizontal layout creates rectangles with high aspect ratio and displays them sorted horizontally.

  • html
  • <ej-treemap id="treemap"  [dataSource]="population_data" 
            itemsLayoutMode="sliceanddicehorizontal" weightValuePath= "Population"
            colorValuePath= "Growth">
           <e-levels>
               <e-level groupPath="Continent" [groupGap]=5></e-level>
           </e-levels>
    </ej-treemap>

    Layout_img3

    SliceAndDiceVertical

    SliceAndDiceVertical layout creates rectangles with high aspect ratio and displays them sorted vertical.

  • html
  • <ej-treemap id="treemap"  [dataSource]="population_data" 
           itemsLayoutMode="sliceanddicevertical" weightValuePath= "Population"
                                                      colorValuePath= "Growth">
         <e-levels>
            <e-level groupPath="Continent" [groupGap]=5></e-level>
         </e-levels>
    </ej-treemap>

    Layout_img4