(->xy coordinates)
Ensure that coordinates (potentially map of {:x :y}
) are a seq or vector pair.
Ensure that coordinates (potentially map of `{:x :y}`) are a seq or vector pair.
(arc
&
{:keys [inner-radius outer-radius start-angle end-angle angle-offset]
:or
{inner-radius 0 outer-radius 1 start-angle 0 end-angle Pi angle-offset 0}})
Calculate SVG path data for an arc.
Calculate SVG path data for an arc.
(axis scale
ticks
&
{:keys [orientation formatter major-tick-width text-margin label
label-margin]
:or {orientation :left
formatter str
major-tick-width 6
text-margin 9
label-margin 28}})
Returns axis <g> hiccup vector for provided input scale
and collection of ticks
(numbers).
Direction away from the data frame is defined to be positive; use negative margins and widths to render axis inside of data frame.
Kwargs:
:orientation ∈ (
:top
,:bottom
,:left
,:right
), where the axis should be relative to the data frame, defaults to:left
:formatter fn run on tick values, defaults tostr
:major-tick-width width of ticks (minor ticks not yet implemented), defaults to 6 :text-margin distance between axis and start of text, defaults to 9 :label axis label, centered on axis; :left and :right orientation labels are rotated by +/- pi/2, respectively :label-margin distance between axis and label, defaults to 28
Returns axis <g> hiccup vector for provided input `scale` and collection of `ticks` (numbers). Direction away from the data frame is defined to be positive; use negative margins and widths to render axis inside of data frame. Kwargs: > *:orientation* ∈ (`:top`, `:bottom`, `:left`, `:right`), where the axis should be relative to the data frame, defaults to `:left` > *:formatter* fn run on tick values, defaults to `str` > *:major-tick-width* width of ticks (minor ticks not yet implemented), defaults to 6 > *:text-margin* distance between axis and start of text, defaults to 9 > *:label* axis label, centered on axis; :left and :right orientation labels are rotated by +/- pi/2, respectively > *:label-margin* distance between axis and label, defaults to 28
(circle radius)
(circle coordinates radius)
Calculate SVG path data for a circle of radius
starting at 3 o'clock and sweeping in positive y.
Calculate SVG path data for a circle of `radius` starting at 3 o'clock and sweeping in positive y.
(get-bounds $svg-el)
Returns map of {:x :y :width :height}
containing SVG element bounding box.
All coordinates are in userspace. Ref SVG spec
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)
(line points)
Return a Hiccup path SVG element with the [x,y] coordinates in the points sequence connected by lines
Return a Hiccup path SVG element with the [x,y] coordinates in the points sequence connected by lines
(transform-to-center element container)
Returns a transform string that will scale and center provided element {:width :height :x :y}
within container {:width :height}
.
Returns a transform string that will scale and center provided element `{:width :height :x :y}` within container `{:width :height}`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close