Liking cljdoc? Tell your friends :D
All platforms.

clj-tree-layout.core


layout-treeclj/s

(layout-tree t
             {:keys [sizes childs-fn id-fn branch-fn h-gap v-gap]
              :or {h-gap 5 v-gap 5}})

Given any tree and a map of directives, returns a map from node ids to {:x :y :width :height} for every node. Directives:

:sizes a map from node ids to [width height] :childs-fn a fn that, given a branch node, returns a seq of its children. :id-fn a fn that, given a node, returns anything that can be used as a node uniq id. :branch-fn a fn that, given a node, returns true if can have children, even if it currently doesn't. :h-gap an integer used as horizontal gap between nodes. :v-gap an integer used as vertical gap between nodes.

Given any tree and a map of directives, returns a map from node ids to
{:x :y :width :height} for every node.
Directives:

   :sizes a map from node ids to [width height]
   :childs-fn a fn that, given a branch node, returns a seq of its children.
   :id-fn a fn that, given a node, returns anything that can be used as a node uniq id.
   :branch-fn a fn that, given a node, returns true if can have children, even if it currently doesn't.
   :h-gap an integer used as horizontal gap between nodes.
   :v-gap an integer used as vertical gap between nodes.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close