Skip to content

Commit

Permalink
[viz] add tentacles as :dev dependency, add commit history example image
Browse files Browse the repository at this point in the history
& docs
  • Loading branch information
postspectacular committed Oct 2, 2015
1 parent 67ff43d commit 5cf9425
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
18 changes: 14 additions & 4 deletions geom-viz/src/core.org
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,18 @@ for list of available presets & how to define new gradients.

*** Github commit history

This example requires [[https://github.com/Raynes/tentacles][raynes/tentacles 0.3.0]] to be added to your
project in order to download the commit history of a given project.
*Note:* This example requires [[https://github.com/Raynes/tentacles][raynes/tentacles 0.3.0]] to be added to
your project in order to download the commit history of a given
project.

This example downloads the commit history for this project from GitHub
and produces a similar activity heatmap as shown on GH user pages
(each column = 1 week).

Btw. You can use the local repo by switching the lines calling
=load-commits-fs= and =load-commits-gh=...

[[http://media.thi.ng/geom/viz/commit-history.svg]]

#+BEGIN_SRC clojure :tangle ../babel/examples/hm-github.clj :mkdirp yes :padline no
(require '[tentacles.repos :as repos])
Expand Down Expand Up @@ -615,8 +625,8 @@ project in order to download the commit history of a given project.
(doseq [[[w d] n] commits] (nd/set-at mat d w n))
mat))

(let [commits (load-commits-fs ".")
;;commits (load-commits-gh "thi-ng" "geom")
(let [;;commits (load-commits-fs ".")
commits (load-commits-gh "thi-ng" "geom")
[from to] (viz/value-domain-bounds commits)
from (* (long (/ from week)) week)
to (* (inc (long (/ to week))) week)
Expand Down
15 changes: 14 additions & 1 deletion geom-viz/src/index.org
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@ thi.ng/geom-viz
target/geom-viz-<<conf-version()>>.js
#+END_SRC

** Extra module dependencies
*** [[https://github.com/Raynes/tentacles][tentacles]]

This library is only used in the =:dev= profile and needed to run the
Github heatmap visualization example.

#+NAME: dep-tentacles
#+BEGIN_SRC clojure
[tentacles "0.3.0"]
#+END_SRC


** Leiningen project file :noexport:

#+BEGIN_SRC clojure :tangle ../babel/project.clj :noweb yes :mkdirp yes :padline no
Expand All @@ -91,7 +103,8 @@ target/geom-viz-<<conf-version()>>.js
<<dep-xerror>>
<<dep-color>>]

:profiles {:dev {:dependencies [<<dep-criterium>>]
:profiles {:dev {:dependencies [<<dep-criterium>>
<<dep-tentacles>>]
:plugins [<<dep-cljsbuild>>
<<dep-cljs-test>>]
:global-vars {*warn-on-reflection* true}
Expand Down

0 comments on commit 5cf9425

Please sign in to comment.