Liking cljdoc? Tell your friends :D

scicloj.plotje.render.svg

Convert membrane drawable trees to SVG hiccup.

Convert membrane drawable trees to SVG hiccup.
raw docstring

default-ctxclj

source

hiccup->svg-strclj

(hiccup->svg-str elem)

Convert SVG hiccup to an SVG string. Handles the subset of hiccup used by plotje: vectors with tag + optional attrs map + children.

Convert SVG hiccup to an SVG string.
Handles the subset of hiccup used by plotje:
vectors with tag + optional attrs map + children.
sourceraw docstring

membrane->svgclj

(membrane->svg elem)
(membrane->svg elem ctx)

Convert a membrane drawable element to SVG hiccup. ctx tracks inherited drawing state (color, style, stroke-width).

Convert a membrane drawable element to SVG hiccup.
ctx tracks inherited drawing state (color, style, stroke-width).
sourceraw docstring

rgba->cssclj

(rgba->css [r g b a])

Convert [r g b] or [r g b a] to CSS rgb string and opacity.

Convert [r g b] or [r g b a] to CSS rgb string and opacity.
sourceraw docstring

svg-summaryclj

(svg-summary svg)
(svg-summary svg theme)

Extract structural summary from SVG hiccup for testing. Returns a map with :width, :height, :panels, :points, :lines, :polygons, :tiles, :visible-tiles, :texts, :colors, :sizes, :alphas, and :shapes — useful for asserting plot structure and that aesthetic mappings (color/size/alpha/shape) took effect. (svg-summary (plot pose)) — summary of rendered SVG

Structure counts: :panels — number of plot panels (large background rectangles) :points — number of data point markers (small rounded rects) :lines — number of non-grid polylines (data lines, annotations, whiskers) :polygons — number of filled polygons (bars, histogram bins, areas, violins) :tiles — number of heatmap tile rectangles (small rects without border-radius) :visible-tiles — tiles with positive width and height (excludes degenerate zero-extent tiles) :texts — vector of all text content strings

Aesthetic-coverage sets (extracted across data shapes only; theme/legend/axis chrome is excluded): :colors — sorted set of distinct fill/stroke colors :sizes — sorted set of distinct point :rx values :alphas — sorted set of distinct non-default opacity values :shapes — sorted set of distinct SVG element types used by data marks

Accepts an optional theme map to detect grid-colored polylines correctly when a custom theme is used.

Extract structural summary from SVG hiccup for testing.
Returns a map with :width, :height, :panels, :points, :lines,
:polygons, :tiles, :visible-tiles, :texts, :colors, :sizes,
:alphas, and :shapes — useful for asserting plot structure and
that aesthetic mappings (color/size/alpha/shape) took effect.
(svg-summary (plot pose))  — summary of rendered SVG

Structure counts:
:panels  — number of plot panels (large background rectangles)
:points  — number of data point markers (small rounded rects)
:lines   — number of non-grid polylines (data lines, annotations, whiskers)
:polygons — number of filled polygons (bars, histogram bins, areas, violins)
:tiles   — number of heatmap tile rectangles (small rects without border-radius)
:visible-tiles — tiles with positive width and height (excludes degenerate zero-extent tiles)
:texts   — vector of all text content strings

Aesthetic-coverage sets (extracted across data shapes only;
theme/legend/axis chrome is excluded):
:colors  — sorted set of distinct fill/stroke colors
:sizes   — sorted set of distinct point :rx values
:alphas  — sorted set of distinct non-default opacity values
:shapes  — sorted set of distinct SVG element types used by data marks

Accepts an optional theme map to detect grid-colored polylines correctly
when a custom theme is used.
sourceraw docstring

ToSVGcljprotocol

Convert a membrane drawable element to SVG hiccup.

Convert a membrane drawable element to SVG hiccup.

-to-svgclj

(-to-svg elem ctx)
sourceraw docstring

wrap-svgclj

(wrap-svg width height body)
(wrap-svg width height body title)

Wrap SVG hiccup body in an <svg> root element.

Wrap SVG hiccup body in an <svg> root element.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close