From 5cf9425d4e83ff2a21aa9909a23f038b8180824c Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Fri, 2 Oct 2015 13:48:37 +0100 Subject: [PATCH] [viz] add tentacles as :dev dependency, add commit history example image & docs --- geom-viz/src/core.org | 18 ++++++++++++++---- geom-viz/src/index.org | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/geom-viz/src/core.org b/geom-viz/src/core.org index ac525edf..37578aea 100644 --- a/geom-viz/src/core.org +++ b/geom-viz/src/core.org @@ -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]) @@ -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) diff --git a/geom-viz/src/index.org b/geom-viz/src/index.org index 44cbbbdc..811addd5 100644 --- a/geom-viz/src/index.org +++ b/geom-viz/src/index.org @@ -69,6 +69,18 @@ thi.ng/geom-viz target/geom-viz-<>.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 @@ -91,7 +103,8 @@ target/geom-viz-<>.js <> <>] - :profiles {:dev {:dependencies [<>] + :profiles {:dev {:dependencies [<> + <>] :plugins [<> <>] :global-vars {*warn-on-reflection* true}