Choose Language Hide Translation Bar
Highlighted
Level I

## Does anybody know which algorithm JMP uses to create tree map?

It seems to be pivot-by-middle proposed by Ben Shneiderman, but I'm not sure. Does anybody know this?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Staff (Retired)

## Re: Does anybody know which algorithm JMP uses to create tree map?

It actually is a variation on Split. It recursively divides the space, splitting the rectangle in the larger dimension. The variation is that it doesn't split in half but rather it uses the golden ratio. This algorithm preserves the order of the data but it does result in some rectangles with a larger aspect ratio.

We are looking at new tiling algorithms for a future version of JMP.

4 REPLIES 4
Highlighted
Staff (Retired)

## Re: Does anybody know which algorithm JMP uses to create tree map?

It actually is a variation on Split. It recursively divides the space, splitting the rectangle in the larger dimension. The variation is that it doesn't split in half but rather it uses the golden ratio. This algorithm preserves the order of the data but it does result in some rectangles with a larger aspect ratio.

We are looking at new tiling algorithms for a future version of JMP.

Highlighted
Level I

## Re: Does anybody know which algorithm JMP uses to create tree map?

Thank you. I'm trying to reproduce the treemap produced by JMP. While the treemap produced by me and that by JMP are similar overall, there are some difference.

Let me show you an example. I used the first twenty rows in Cities.jmp which is used by JMP to show the feature of treemap.

index  city                         POP

 1 ALBANY 846 2 ALBUQUERQUE 486 3 ATLANTA 2657 4 ATLANTIC CITY 303 5 BALTIMORE 2303 6 BOSTON 2842 7 BURLINGTON 127 8 CHARLESTON 502 9 CHARLOTTE 1091 10 CHEYENNE 76 11 CHICAGO 6199 12 CINCINNATI 1438 13 CLEVELAND 1851 14 DENVER 1645 15 DES MOINES 385 16 DETROIT 4362 17 DUBUQUE 91 18 GALVESTON-T.C. 211 19 HARRISBURG 584 20 HARTFORD 748

All POP sum to 28747, the first nine POP sum to 11157. The ratio is 11157/28747=0.3881, it already exceeded the golden ratio 0.382. However, the treemap produced by JMP further included the tenth datum in the upper part. So my question is that whether JMP uses exactly 0.382 as the split ratio or apart from this ratio, there are other factors affecting which part the datum should belong to(eg. to optimize the aspect ratio).

The two pictures below are produced by JMP and me, respectively. Notice the rectangles in the red area represent the same datum, but in different position. The layout box are both square.

Thanks

Highlighted
Staff (Retired)

## Re: Does anybody know which algorithm JMP uses to create tree map?

The difference is in the aspect ratio we are using. Looking at the code, we are using .39 instead of .382. When I change the code to use .382, I am able to reproduce your treemap. If you use .39 you should be able to reproduce the treemap in JMP.

Highlighted
Level I

## Re: Does anybody know which algorithm JMP uses to create tree map?

Yes, when I use 0.39, the results are the same. Thanks a lot!

Article Labels

There are no labels assigned to this post.