Scenic.Primitives.arc

You're seeing just the function arc, go back to Scenic.Primitives module for more information.
Link to this function

arc(graph_or_primitive, arc, opts \\ [])

View Source

Specs

arc(
  source :: Scenic.Graph.t() | Scenic.Primitive.t(),
  arc :: {radius :: number(), start :: number(), finish :: number()},
  options :: list()
) :: Scenic.Graph.t() | Scenic.Primitive.t()

Add an arc to a graph

An arc is the outer edge of a part of a circle or ellipse. It is the sort of thing you would use a compass to draw on a piece of paper. It has a radius, a start angle and an ending angle. The angles are specified in radians.

Data:

{radius, start, finish}

If you want something that looks like a piece of pie (maybe for a pie chart??), then you want a Sector, not an Arc.

To create an arc of an ellipse, create a normal arc, and apply a :scale transform with unequal x and y sizing.

The following example will draw a simple arc with a radius of 100, starting straight out to the right, then going down 0.4 radians.

graph
|> arc( {100, 0, 0.4} )

Styles

Arcs honor the following styles

  • :hidden - If true, the outline is rendered. If false, it is skipped. Default: false.
  • :fill - Fills in the interior with the specified paint. If not set, the default is to not draw anything in the interior. This is similar to specifying fill: :clear, but optimized.
  • :stroke - Draws the outline with the specified width and paint. The default if not set is {1, :white}.

Example:

graph
|> arc( {100, 0, 0.4}, stroke: {4, :blue} )