 
 
 (defn ^:cljs get-bounds
-  "Returns map of {:x :y :width :height} containing SVG element bounding box.
-   All coordinates are in userspace. See: http://www.w3.org/TR/SVG/types.html#InterfaceSVGLocatable"
+  "Returns map of `{:x :y :width :height}` containing SVG element bounding box.
+   All coordinates are in userspace. Ref [SVG spec](http://www.w3.org/TR/SVG/types.html#InterfaceSVGLocatable)"
   [$svg-el]
   (let [b (.getBBox $svg-el)]
     {:x (.-x b)

(def ArcMax (- Tau 0.0000001))

(defn circle
  "Returns svg path data for a circle starting at 3 o'clock and sweeping in positive y."
  ([radius] (circle [0 0] radius))
  ([[x y] radius]
     (str "M"  (+ x radius) "," y
          "A" (+ x radius) "," (+ y radius) " 0 1,1" (- (+ x radius)) "," y
          "A" (+ x radius) "," (+ y radius) " 0 1,1" (+ x radius) "," y)))

(defn arc
  [& {:keys [inner-radius, outer-radius
             start-angle, end-angle, angle-offset]
      :or {inner-radius 0, outer-radius 1

;;Collection of helpers for dealing with scalable vector graphics.
;;
;;Coordinates to any fn can be 2-vector `[x y]` or map `{:x x :y y}`.
^:clj (ns c2.svg
        (:use [c2.maths :only [Pi Tau radians-per-degree
                               sin cos]]
