Quartz.Figure (Quartz v0.8.1)
View SourceFigure
The figure is the highest level entity that Quartz deals with. Every drawing is a figure, and objects in a figure can interact in stateful ways that break referential transparency. However, figures can't interact with each other.
Summary
Functions
Add an unmeasure item to the figure.
Get bounds for plots in a grid. Currently only regular grids are supported.
Returns true if the current figure is being created with :debug mode active.
Create a new figure.
Place a sketch in a canvas with the given parameters.s
TODO: document this
Renders a figure into a PNG binary.
Renders a figure into a PNG file and saves it in the given path.
Renders a figure into a PNG file and saves it in the given path. Raises an error if it can't write to the file.
Renders a figure into an SVG string (not iodata).
Renders a figure into SVG and saves it in the given path.
Renders a figure into SVG and saves it in the given path. Raises an error if it can't write to the file.
Renders a figure into SVG iodata (not a string).
Types
@type bounds() :: Keyword.t()
Functions
Add an unmeasure item to the figure.
Unmeasured items are items in which the item dimensions can't be determined without rendering them first. Before rendering the final output, Quartz will render the unmeasured items and query the renderer for their dimensions.
Get bounds for plots in a grid. Currently only regular grids are supported.
Supports the following options:
:nr_of_rows- required (integer):nr_of_columns- required (integer):padding- optional (default:Length.pt(8)): the padding between plots:horizontal_padding- optional (default: the value of:padding): the horizontal padding between plots:vertical_padding- optional (default: the value of:padding): the vertical padding between plots
Returns a neste list of bounds.
Returns true if the current figure is being created with :debug mode active.
Create a new figure.
Place a sketch in a canvas with the given parameters.s
TODO: document this
@spec render_to_png_binary(Figure.t()) :: String.t()
Renders a figure into a PNG binary.
Renders a figure into a PNG file and saves it in the given path.
Renders a figure into a PNG file and saves it in the given path. Raises an error if it can't write to the file.
@spec render_to_svg_binary(Figure.t()) :: String.t()
Renders a figure into an SVG string (not iodata).
@spec render_to_svg_file(Figure.t(), Path.t()) :: :ok | {:error, File.posix()}
Renders a figure into SVG and saves it in the given path.
@spec render_to_svg_file!(Figure.t(), Path.t()) :: :ok
Renders a figure into SVG and saves it in the given path. Raises an error if it can't write to the file.
Renders a figure into SVG iodata (not a string).