Vector heatmaps created with R and script from FlowingData.
- Download and Install R
- Launch R in the command line with
R
. - In R, run
install.packages("plotKML")
to install plotKML (a library used by the script) and all its dependencies. - R will attempt to use XQuartz to ask you to choose a mirror to get packages from. If you don't have it, go download, install and repeat step three.
cd
to the directory withmaps.R
and your source.gpx
files.- Run
R CMD BATCH maps.R
. This will generate a PDF calledRplots.pdf
. - The process to make this PDF an SVG is manual (I'd like to try and automate it). But for the moment you'll need to open the PDF in Illustrator and save as an SVG.
Illustrator spits out each GPS line as SVG <polyline>
s. To animate them we need them to be <path>
s.
To convert the polylines to paths you essentially need to replace all instances of <polyline
with <path
and points="
with d="M
. I've documented this process a bit further in this Gist.
You could simply do find and replace but I've written a small Ruby script to automate this.
cd
to directory containingRplots.svg
andpolyline-to-path.rb
.- run
ruby polyline-to-path.rb
cd
to directory containingindex.html
and start a localhost server withpython -m SimpleHTTPServer 8000
.- Visit http://localhost:8000