Skip to content

A declarative generator of task dependency graphs and gantt charts, written in Clojure.

License

Notifications You must be signed in to change notification settings

PavlosMelissinos/henry

Repository files navigation

CircleCI

henry

Finance and industry must be socialized somehow.

-- Henry Laurence Gantt

Description

henry is a declarative generator of task dependency graphs and gantt charts.

The following libraries have been used:

  1. weavejester/dependency - to manipulate graphs
  2. macroz/tangle - to visualize dependency graphs (png)
  3. metasoarous/oz - to visualize gantt charts (png/html)
  4. applied-science/darkstar - to visualize gantt charts (svg)
  5. stathisideris/dali - to rasterize images (svg to png)

Setup

Add the project to your deps.edn file:

{:deps [henry {:git/url "https://github.com/PavlosMelissinos/henry.git"
               :sha ???}]}

Features

Common task definition format

{:description  "Project X roadmap"
 :tasks        [{:id :a :duration 2 :styles [:critical]}
                {:id :b :duration 1 :styles [:critical]}
                {:id :c :duration 3 :styles [:major]}
                {:id :d :duration 3 :styles [:trivial]}
                {:id :e :duration 2 :styles [:major]}
                {:id :f :duration 3 :styles [:trivial]}]
 :dependencies [[:b :a] [:c :b] [:c :a] [:d :c] [:f :e]]
 :styles       {:critical {:fillcolor "#FF0000" :style "filled"}
                :major    {:fillcolor "#FFFF00" :style "filled"}
                :trivial  {:fillcolor "#00FF00" :style "filled"}}}

Task dependency graphs

(ns example.core
  (:require [henry.core :as henry]))

;; Load the spec
(def spec (henry/load-edn "test_resources/data.edn"))

;; Given a spec, translate to dot syntax
(def deps (henry/convert spec :deps :dot))

;; Given a spec, generate a png using graphviz
(henry/export spec :deps :png "test_resources/data.deps.png")

Results in:

data.tasks.png

Gantt charts

(ns example.core
  (:require [henry.core :as henry]))

;; Load the spec
(def spec (henry/load-edn "test_resources/data.edn"))

;; Given a spec, translate to vega-lite (json)
(henry/convert spec :gantt :json)

;; Given a spec, export to svg file
(henry/export spec :gantt :svg "test_resources/data.gantt.svg")

Results in:

gantt chart html screenshot

To-Do

  • Polish/fix bugs
  • Dali vs vega-lite (via oz)?
  • Improve specs!
  • Support exporting dependency graphs to svg (tangle/dot not working properly? investigate)
  • Improve vega-lite defaults
  • Support hiccup syntax in styles?
  • Also maybe documan (based on dali) to generate sequence diagrams?

About

A declarative generator of task dependency graphs and gantt charts, written in Clojure.

Resources

License

Stars

Watchers

Forks

Packages

No packages published