Scenic.Primitives.group_spec_r

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

group_spec_r(opts, list)

View Source

Specs

group_spec_r(
  options :: list(),
  items :: Scenic.Graph.deferred() | [Scenic.Graph.deferred(), ...]
) :: Scenic.Graph.deferred()

Bundle a list of specifications together, and return a function that, when called, will add those specs as a group to a graph.

The options are the same as for group_spec/2, but reversed, making it suitable to use when declaring graph specs as big literals due to the increased readability.

Example:

line = {{0, 0}, {60, 60}}

line_group = group_spec_r([t: {100, 100}], [
  line_spec(@line, stroke: {4, :red}),
  line_spec(@line, stroke: {20, :green}, cap: :butt, t: {60, 0}),
  line_spec(@line, stroke: {20, :yellow}, cap: :round, t: {120, 0}),
])

graph = line_group.(graph)

You can also pass in a single primitive spec:

line = line_spec({{0, 0}, {60, 60}}, stroke: {4, :red}),
line_group = group_spec_r([t: {100, 100}], line)

graph = line_group.(graph)