Feature/tree map vis
Created by: S4K4YUME
Overview
fixes #55 (closed) fixes #48 (closed)
OpenGL demo visualization
To provide a visual demo of the openGL methods and a visual guide (the red centered-cross) indicating how our axis are aligned. The cross has a domain and range of [-200, 200] with ticks every 10 units. The addition of this visualization can prove a decent starting point for those who want to get started with creating their own visualization. In the future this visualization can be modified to suit our needs better as more features are added to the tool in general. (i.e. we could also -soon- showcase basic usage of parameters in this visualization as well when #59 is merged)
Additionally I made the demo visualization the first visualization to be loaded, as that seems like a reasonable thing to do at this stage.
The demo visualization
Treemap implementation
I had to do research on the tree-map, and whilst there are many variations, I opted to start with the most straight-forward implementation. I know the task originally only said to research, but determining the algorithm for the tree-map is something I found easier to do whilst implementing it immediately. Hence we now have an extra visualization implemented in a basic form.
As a minor feature there is also a 2-color gradient implemented, but that works better when the offset
is also implemented later on. This is because a non-nested treemap visualizes the leaves, which have colorA in a colorA -> colorB gradient. A common use-case for color in a treemap which could perhaps be better, is to do it based on some property of the node, e.g. file-extension in a filesystem.
the treemap visualization
Problems / issues
The treemap visually works better if there is both an outline ánd a fill. This however means that on a hierarchy of 300.000 items, there are 600.000 calls to draw a rectangle on screen.
Hence large-hierarchies on a laptop system are not yet supported, and untested on a better system.
What also popped up is that by default my laptop would render using the internal IntelHD graphics chip, this caused performance to be bad, even when only drawing the filled quads. (Hence having only 300.000 elements, not 600.000). Forcing my laptop to use the gtx1050m it has gave rise to major improvements in terms of speed. However, my system has 16GB of memory, and it can't manage drawing the 600.000 elements with either GPU without causing the openGL context
to be lost
.
Perhaps something to discuss in a different issue/topic/thread.
Future todo
As visualizations are very stand-alone, I would propose to merge this as is
right now. However, the treemap visualization aspect of this PR is still open to some improvements which, due to the modular nature of visualizations, I would opt to push forward a bit in a future issue/PR.
The following items I would like to improve upon in the future / separate issues:
- Offset implementation to create a 'nested' tree-map
- Colour parameters
- Offset parameter
- Intitial base-width/height based on canvas size
- Better color usage
- Optimazation