Tree Map Generator
This project focuses on creating a program capable of generating tree maps—visual diagrams that partition a rectangular space into regions proportional to the given data values. The process encompasses parsing input data, employing recursive splitting algorithms, and producing the final output as a PDF image.
Final Result
Here is an example of the final tree map generated by the program :

Project Structure
The program follows a pipeline structure:
- Input Data: Parses input in various formats (plain text, optional SQL database, etc.).
- Data Splitting: Groups data hierarchically using recursive splitting strategies.
- Placement: Assigns regions to data values within a square.
- Rendering: Produces a visual representation in PDF format.
The project includes:
- A main program,
treemap.c
, that orchestrates the pipeline. - A test suite,
test-treemap.c
, implemented with the Check library. - Utility scripts for generating PDF files from vector output.
Difficulties Encountered
vector2tex
and pdflatex
1. Configuring The provided script vector2tex.sh
converts vector output into LaTeX code for rendering. Challenges included:
- Ensuring that the script had executable permissions (
chmod +x vector2tex.sh
). - Handling errors in LaTeX compilation with
pdflatex
, such as missing or malformed.tex
files.
<check.h>
Not Found
2. The Check library, used for the test suite, was not initially recognized by the compiler. This required:
- Installing the library with Homebrew:
brew install check
. - Adding the appropriate include (
-I
) and library (-L
) paths:
gcc -I/opt/homebrew/include -L/opt/homebrew/lib -lcheck test-treemap.c -o test-treemap
Command
Run the following command:
make all
Support
For questions or issues, you can:
Open an issue in the GitLab repository. Email cemrenurkeles@gmail.com for further assistance.
Roadmap
Future enhancements for the project could include:
- Additional Input Methods:
- Support for JSON or XML formats.
- Dynamic database queries.
- New Placement Strategies:
- Incorporate advanced algorithms for hierarchical grouping.
- Implement customizable aspect ratio preservation.
- Improved Output Formats:
- Add rasterized image export options (e.g., PNG).
- Support for interactive SVG outputs.
- Cross-Platform Compatibility:
- Better support for Windows and macOS environments.
- Contributing
We welcome contributions! To get started:
Clone the repository:
git clone https://gitlab.unistra.fr/username/Treemap.git
cd Treemap
Set up the environment:
- Install dependencies (e.g., check, doxygen, pdflatex).
- Compile the project using make all.
Run tests:
make test
Submit a pull request:
- Ensure your code follows the project’s conventions.
- Include tests for new features.
- Run valgrind to confirm no memory leaks.
Authors and Acknowledgments
This project was developed by Cemrenur KELES and Selin YAGIZ as part of the undergraduate computer sciences program of University of Strasbourg. Special thanks to:
- Alain for providing guidance and support.
- Contributors to the open-source libraries used, including Check, Pdflatex, Homebrew and Doxygen.
License
This project is licensed under the MIT License. Feel free to use, modify, and distribute it under the terms of this license.
Project Status
This project is currently complete and maintained for educational purposes. Future contributions and forks are welcome. If you are interested in becoming a maintainer, please contact cemrenurkeles@gmail.com.