Treemap 4.1 Documentation


[Previous]   [Table of Contents]   [Next]

Create your own TM3 data file

.

Note: Treemap does not support the .tm2 format any longer.

Treemap uses a very simple TAB-delimited format that includes both the attributes values and the tree structure. You can create the data with a spreadsheet, or export it from a database.

Standard Treemap file including a default hierarchy

Creating a new Treemap file with a spreadsheet program:

  • On the first row of the spreadsheet, put all the attribute labels for your data, placing one label per cell. For example, to create a data file on traffic information (as seen above), you would put "Length (miles)" in the first cell, "Traffic Lights" in the next cell, "Speed Limit" in the third cell, and "Repairs per week" in the fourth cell.

  • In the next row, put the type of each attribute data. Data can be of type FLOAT, INTEGER, DATE, or STRING. Data types must be typed in UPPERCASE letters. In the traffic example, one would have "FLOAT" in the first cell of the second row, "INTEGER" in the second, "INTEGER" in the third, and "FLOAT" in the fourth.

    NOTE: If the attribute type is DATE, then the format should be MM/DD/YYYY. Please do not add any other values like time or day along with the date value. Make sure you enter the data values using the above mentioned date pattern only.

  • Fill in the values for each attribute for an item, placing one item per row. After all the attribute values are filled, include one blank column. After the blank column, list the hierarchy path starting with the name of the root. For example, "Roads" would be in the first cell after the blank column, "Highway" in the second, and "Route 1" in the last cell. (Note that the leaves of the tree do not need to be at the same depth.)

  • Now save the file as a tab-delimited text file, such as, traffic.txt. The file is now ready to be loaded by Treemap, but we like to rename the data file with an .tm3 extension to identify them as treemap datafiles. Rename the data so the extension is .tm3 instead of .txt.

  • After loading the .tm3 file, you can change the Legend for Color to "Location" from the control panel of treemap, which is a column containing controls on the right hand side.

  • The picture below shows how Treemap looks like after loading the created file, traffic.txt (or traffic.tm3) and applying several settings from the control panel. (If you don't do anything after you load the file, all cells will appear as white because the default Legend for Color is "(None)".)

  • If you apply some settings after loading a .tm3 file, you can save them. See Save Settings.


  • Simplified format for use with the flexible hierarchy

    If you do no want to - or need to - include a hierarchy in the treemap because it can be created with the flexible hierarchy, simply omit to include a hierarchy in the file. The firearm.tm3 file is an example of such file. Treemap will pick the first string attribute as default attribute for labeling (the default labeling being usually the last string of the path definition found in the data file for each node.

    Common Problems

    If your newly created Treemap file does not load correctly it could be caused by one of the following problems.
    1. Make sure you have no empty values in your attribute data table.

    2. Excel sometimes adds extra white space if you move your cursor to areas outside your data, or replace cells that once had information with white space when deleted. This causes a problem with Treemap. To remedy this, open your file in excel. Select all of your data, but only your data. DO NOT SELECT ANY OUTSIDE BLANK CELLS. Select the copy command. Then open a new spreadsheet and paste the information you had selected. Now without changing or exploring the data save the file as a tab delimited text file and the white space should be gone.

    3. Make sure that INTEGERs are really integers.

    4. Make sure that DATEs have the format MM/DD/YYYY.
      If they have other formats than this, you can change it in Excel.
      1. Open the file in Excel.
      2. Click on the column's letter (e.g. G) to select the whole column with the different date format.
      3. From the menu, select Format and then Cells.
      4. From the Category: select Date.
      5. Choose the type that conforms to MM/DD/YYYY (e.g. 3/14/1998).

    5. If you have nodes with negative values for the attribute you chose for map to size, those nodes will not be shown.

    6. Remember that there may not be enough pixels to show every node in your tree. Make the window size bigger, use zooming and filtering to limit the number of nodes shown, remove the borders, and of course set the size attribute to fit the characteristic of the nodes you care about and want to see.

    7. If you try to open your .tm3 file with Excel and it complains that your file has an invalid SYLK file format, this means that the first 2 characters of the file is "ID". One way to avoid this problem is to change the case, such as "Id". Read more about SYLK file format problem at Microsoft support.


      Questions

      Contact us at: treemap@cs.umd.edu
      Return to Treemap main page

      Web Accessibility