Skip to contents

Sets the chart's trace colours to the teams' colours, in order.

Usage

sdv_colorway(
  p,
  league,
  teams = NULL,
  which = c("primary", "secondary"),
  season = NULL,
  id_system = "auto"
)

Arguments

p

A plotly object.

league

A league key from sdv_leagues(). Required: one abbreviation means different teams in different leagues.

teams

Team identifiers, or NULL for every team.

which

"primary" or "secondary".

season

NULL for today's mark, or a season (or one per team): the mark the team wore that season where the archive dates its marks.

id_system

For headshots, as in sdv_headshot_url().

Value

The plotly object (an htmlwidget).

Examples

# \donttest{
if (requireNamespace("plotly", quietly = TRUE)) {
  plotly::plot_ly(type = "bar") |> sdv_colorway("nfl", c("KC", "BUF"))
}
# }