View Source Scenic.Primitive.Ellipse (Scenic v0.11.2)

Draw an ellipse on the screen.

data

Data

{radius_1, radius_2}

The data for an arc is a single number.

  • radius_1 - the radius of the ellipse in one direction
  • radius_2 - the radius of the ellipse in the other direction

styles

Styles

This primitive recognizes the following styles

  • hidden - show or hide the primitive
  • scissor - "scissor rectangle" that drawing will be clipped to.
  • fill - fill in the area of the primitive
  • stroke - stroke the outline of the primitive. In this case, only the curvy part.

Note: you can achieve the same effect with a Circle primitive by applying a :scale transform to it with unequal values on the axes

usage

Usage

You should add/modify primitives via the helper functions in Scenic.Primitives

graph
  |> ellipse( {75, 100}, stroke: {1, :yellow} )

Link to this section Summary

Functions

Compile the data for this primitive into a mini script. This can be combined with others to generate a larger script and is called when a graph is compiled.

Returns a list of styles recognized by this primitive.

Link to this section Types

@type styles_t() :: [:hidden | :scissor | :fill | :stroke_width | :stroke_fill]
@type t() :: {radius_1 :: number(), radius_2 :: number()}

Link to this section Functions

Link to this function

compile(primitive, styles)

View Source
@spec compile(primitive :: Scenic.Primitive.t(), styles :: Scenic.Primitive.Style.t()) ::
  Scenic.Script.t()

Compile the data for this primitive into a mini script. This can be combined with others to generate a larger script and is called when a graph is compiled.

@spec valid_styles() :: styles_t()

Returns a list of styles recognized by this primitive.