The Frame's output targets (spec/10 §10.2), copied from visualize's
Visualize.Render.to_document/2, Visualize.Stylesheet (rules/1, classes/1,
embed/1), Visualize.Render.to_png/2 and Visualize.Chart.render/2 (root: true):
a Frame's value as a standalone document, which no page CSP governs.
- The output target decides; there is no setting (visualize #1103, D-296). Page
markup writes classes and never their rules; a self-contained document carries its
own
<style data-mw-sheet="">holding the static stylesheet's rules its classes select, the first child of its first<svg>(embed/1). svg/3renders the Frame as one<svg>root in:literalresolution (the theme's colors as literals),xmlnsset, every layer SVG as in every mode outside live (§2.7), embedded, tile hrefs left at the proxy route (§8), the summary as its<desc>; no motion class (a file draws the end state). It renders at the context'snow, size and theme, reading no clock.png/3issvg/3's document rasterized byMacaw.Draw.Render.Raster(§9), with:scale,:background,:fonts,:resvgand:timeoutpassed through, the Frame realized atresolution: scale(visualize D-269); its warnings are the SVG's and the raster's together.
Summary
Functions
The class names the markup's class attributes hold, each once, in order of first
appearance.
Markup made self-contained: a <style data-mw-sheet=""> holding the static
stylesheet's rules (Macaw.Frame.Render.stylesheet/0) that select any class the
markup's class attributes hold, in the sheet's order, inserted as the first child of
its first <svg>. Markup with no rule to embed, with no <svg>, or already embedded is
returned as it is, so embedding twice is embedding once.
svg/3's document rasterized (§9): {:ok, png, warnings}, or the raster's
{:error, reason}; the Frame realized at resolution: scale.
The rules of the static stylesheet that select any of classes, in the sheet's order,
each followed by a new line.
The Frame of value as a standalone SVG document in context (its now, size and
theme): {:ok, svg, warnings}, or {:error, faults} for a value that draws nothing.
Options: title: and description: (spec/11 §3).
Functions
The class names the markup's class attributes hold, each once, in order of first
appearance.
iex> Macaw.Frame.Output.classes(~s(<svg class="a b"><g class="b c"/></svg>))
["a", "b", "c"]
@spec embed(String.t()) :: String.t() | {:error, [Macaw.Base.Fault.t()]}
Markup made self-contained: a <style data-mw-sheet=""> holding the static
stylesheet's rules (Macaw.Frame.Render.stylesheet/0) that select any class the
markup's class attributes hold, in the sheet's order, inserted as the first child of
its first <svg>. Markup with no rule to embed, with no <svg>, or already embedded is
returned as it is, so embedding twice is embedding once.
iex> Macaw.Frame.Output.embed(~s(<svg class="none-of-ours"></svg>))
~s(<svg class="none-of-ours"></svg>)
@spec png(Macaw.Frame.Value.t(), Macaw.Component.Context.t(), keyword()) :: {:ok, binary(), [term()]} | {:error, term()}
svg/3's document rasterized (§9): {:ok, png, warnings}, or the raster's
{:error, reason}; the Frame realized at resolution: scale.
The rules of the static stylesheet that select any of classes, in the sheet's order,
each followed by a new line.
@spec svg(Macaw.Frame.Value.t(), Macaw.Component.Context.t(), keyword()) :: {:ok, String.t(), [term()]} | {:error, [Macaw.Base.Fault.t()]}
The Frame of value as a standalone SVG document in context (its now, size and
theme): {:ok, svg, warnings}, or {:error, faults} for a value that draws nothing.
Options: title: and description: (spec/11 §3).