- Heatmap General Description
- Usage Java Heatmap
- Example Heatmaps
- Download Java Heatmap Example Implementation
A heatmap is a visual representation of a list of points.
This is handy in a lot of situations. If you want to quickly analyze a log you created of positions players died in a game, positions your users clicked on your website, etc.
Basically anywhere where the log of points is generated from something visual.
The code below is quite easy to use. Just include the .java file and use it as following:
List<java.awt.Point> points; // your points String outputFile; String originalImage; // the path to the image the heatmap is to be layed over. eg a screenshot of a homepage or a level HeatMap myMap = newHeatMap(points, outputFile, originalImage); myMap.createHeatMap(multiplier); // multiplier depends on density of points. try something between 1f and 10f
The heatmap will be created now and you will find it at the specified output file.
If not: you might have to adjust the following paths:
private static final String CIRCLEPIC
private static final String SPECTRUMPIC
so that they point to where the two .png files (added in the download) or the files you created yourself for this purpose are stored.
If it is still not working I will refer you to the exception messages. Most likely is that it has to do with file permissions.
Be warned: If the list of points is too big, this program will take quite a long time to execute and also consume some memory. Try it with a couple of points first and then increase the amount. I tried it on my computer with generated random points: 500k were no problem, 1m still where computed quite fast, but my computer made weird noises with 2m^^
If someone knows a way to make remap and negateImage faster I would be very thankful. Right now, they each take up about 48% of the time (depending on amount of points of course, this is with about 6k).