Permalink
Fetching contributors…
Cannot retrieve contributors at this time
164 lines (122 sloc) 6.11 KB

thi.ng/geom-viz

About the project

Overview

This sub-module of thi.ng/geom is dealing with 2d/3d data visualizations using SVG (soon WebGL & others) and is in early stage development. Examples are currently littered throughout the core namespace of this module, linked below….

http://media.thi.ng/geom/viz/bars-interleave-3.svghttp://media.thi.ng/geom/viz/lens-focus-2.gif
http://media.thi.ng/geom/viz/areaplot-3.svghttp://media.thi.ng/geom/viz/hmp-yellow-magenta-cyan.svg
http://media.thi.ng/geom/viz/scatter-log-3.svghttp://media.thi.ng/geom/viz/radarplot-minmax.svg
http://media.thi.ng/geom/viz/contours-4.svghttp://media.thi.ng/geom/viz/terrain-6.svg
http://media.thi.ng/geom/viz/hms-rainbow2.svghttp://media.thi.ng/color/presets/rainbow1.svg
http://media.thi.ng/geom/viz/timeline-3.svghttp://media.thi.ng/geom/viz/contours-polar.gif

Scope

The aim of this module is to define a largely declarative and output format independent data visualization system. A visualization spec (a hashmap) is used to configure all aspects of the desired output and then passed to a single visualization handler to produce an visualization asset. The sole role of the visualization handler is to translate the spec into a concrete graphics format representation, though this translation is only occurring as the final step and the spec based approach allows creating multiple outputs, re-using visualization recipes and therefore building higher level tooling on top of this basic setup. Everything prior to the final translation is completely format independent and can also be processed further via 3rd party tooling.

Having said this, since this module is still in its infancy, currently only SVG output is implemented as test bed. However, many (if not all) required parts to support other targets are already existing in isolation and once the core API has stabilized will be fairly trivial to add.

Status

ALPHA quality, in active development.

Namespaces

Tests

Module definition

Building & testing this project

Please see the parent project for further information.

Injected properties

This template uses shared project configuration defined in config.org. Module specific settings are defined below:

Extra module dependencies

tentacles

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

[tentacles "0.3.0"]

Leiningen project file

(defproject <<project-name>> "<<conf-version()>>"
  :description  "thi.ng geometry kit - data visualization module"
  :url          "<<conf-project-url>>"
  :license      {:name "Apache Software License"
                 :url "http://www.apache.org/licenses/LICENSE-2.0"
                 :distribution :repo}
  :scm          {:name "git"
                 :url  "<<conf-project-url>>"}

  :min-lein-version "2.4.0"

  :dependencies [<<dep-clj>>
                 <<dep-cljs>>
                 [thi.ng/geom-svg "<<conf-version()>>"]
                 <<dep-ndarray>>
                 <<dep-strf>>
                 <<dep-xerror>>
                 <<dep-color>>]

  :profiles     {:dev {:dependencies [<<dep-criterium>>
                                      <<dep-tentacles>>]
                       :plugins      [<<dep-cljsbuild>>
                                      <<dep-cljs-test>>]
                       :global-vars {*warn-on-reflection* true}
                       :jvm-opts ^:replace []
                       :aliases {"cleantest" ["do" "clean," "test," "cljsbuild" "test"]}}}

  :cljsbuild    {:builds [{:source-paths ["src" "test"]
                           :id "simple"
                           :compiler {:output-to "<<cljs-artefact-path>>"
                                      :optimizations :whitespace
                                      :pretty-print true}}]
                 :test-commands {"unit-tests" ["phantomjs" :runner "<<cljs-artefact-path>>"]}}

  :pom-addition [:developers [:developer
                              [:name "Karsten Schmidt"]
                              [:url "http://postspectacular.com"]
                              [:timezone "0"]]])

ClojureScript HTML harness

<!DOCTYPE html>
<html lang="en">
  <head>
    <title><<lein-coords>> test</title>
  </head>
  <body>
    <script type="text/javascript" src="<<cljs-artefact-path>>"></script>
  </body>
</html>

Accessing library version during runtime

The autogenerated namespace thi.ng.geom.viz.version contains a single symbol version holding the version string defined above:

(use 'thi.ng.geom.viz.version)

(prn version)
; "<<conf-version()>>"

Version namespace

(ns thi.ng.geom.viz.version)
(def version "<<conf-version()>>")

Contributors

NameRoleWebsite
Karsten Schmidtinitiator & principal developerpostspectacular.com, http://thi.ng