Skip to main content

Function: footballField()

footballField(league, opts?): Scene

Defined in: packages/sporty/src/football/field.ts:65

Port of sportyR geom_football(): one PolygonFeature per ggplot polygon layer and one TextFeature per ggfittext::geom_fit_text layer, in R's layer order. Divergences: an unknown displayRange throws (R falls back to "full"); units also converts the anchors and display limits (R converts only the feature points); custom's all-zero defaults give empty yard-line sets (R errors in seq()).

Parameters​

league​

"custom" | "ncaa" | string & object | "cfl" | "nfhs11" | "nfhs6" | "nfhs8" | "nfhs9" | "nfl"

opts?​

SurfaceOptions<FootballParamUpdates, "plot_background" | "sideline" | "field_apron" | "end_line" | "field_border" | "field_border_outline" | "red_zone_border" | "red_zone_border_outline" | "goal_line" | "major_yard_line" | "minor_yard_line" | "try_mark" | "coaching_box_line" | "directional_arrow" | "restricted_area" | "coaching_box" | "team_bench_area" | "team_bench_area_outline" | "yardage_marker" | "offensive_half" | "defensive_half" | "offensive_endzone" | "defensive_endzone", "full" | "in_bounds_only" | "in bounds only" | "offense" | "offence" | "defense" | "defence" | "offensivehalffield" | "offensive_half_field" | "offensive half field" | "defensivehalffield" | "defensive_half_field" | "defensive half field" | "redzone" | "red_zone" | "red zone" | "oredzone" | "offensive_red_zone" | "offensive red zone" | "dredzone" | "defensive_red_zone" | "defensive red zone"> = {}

Returns​

Scene