Skip to contents

A dense monospace theme in the register of a trading terminal. Dark background, amber labels, a rule on every row, and tight padding.

Usage

gt_theme_terminal(
  gt_object,
  accent = "#FFB86C",
  density = c("compact", "comfortable", "social"),
  ...
)

Arguments

gt_object

A gt table object to modify.

accent

Character. A hex color for the column labels, row groups, and the top rule. Defaults to amber "#FFB86C"; "#7EE787" gives a green-phosphor variant.

density

Character. The type and padding scale. One of "comfortable", "compact", or "social". See Density. Defaults to "compact".

...

Additional arguments passed to gt::tab_options, applied last so they override anything the theme sets.

Value

Returns a modified gt table with the theme applied.

Details

The monospace face has fixed-width digits already, so numeric columns line up without any extra formatting.

Density

density sets the type and padding scale together. "comfortable" uses a 14px body with roomy rows, "compact" a 12px body with tight rows, and "social" a 17px body with generous rows and a larger title, at the scale gt_save_crop() and gt_social_crop() export at.

Figures

Preview of the terminal theme

See also

pal_midnight for a color scale that survives a dark ground.

Examples

library(gt)
afc <- subset(
  sdv_example_standings, conference == "AFC",
  c(team_name, wins:points_against)
)
gt(head(afc, 12)) |> gt_theme_terminal()
team_name wins losses ties win_pct points_for points_against
New England Patriots 14 3 0 0.824 490 320
Buffalo Bills 12 5 0 0.706 481 365
Miami Dolphins 7 10 0 0.412 347 424
New York Jets 3 14 0 0.176 300 503
Pittsburgh Steelers 10 7 0 0.588 397 387
Baltimore Ravens 8 9 0 0.471 424 398
Cincinnati Bengals 6 11 0 0.353 414 492
Cleveland Browns 5 12 0 0.294 279 379
Jacksonville Jaguars 13 4 0 0.765 474 336
Houston Texans 12 5 0 0.706 404 295
Indianapolis Colts 8 9 0 0.471 466 412
Tennessee Titans 3 14 0 0.176 284 478
east <- subset( sdv_example_standings, league == "nba" & conference == "Eastern", c(team_name, wins, losses, win_pct:points_against) ) gt(east) |> gt_theme_terminal(accent = "#7EE787")
team_name wins losses win_pct points_for points_against
Boston Celtics 56 26 0.683 9418 8787
New York Knicks 53 29 0.646 9549 9030
Toronto Raptors 46 36 0.561 9400 9168
Philadelphia 76ers 45 37 0.549 9502 9517
Brooklyn Nets 20 62 0.244 8686 9505
Detroit Pistons 60 22 0.732 9657 8988
Cleveland Cavaliers 52 30 0.634 9801 9464
Milwaukee Bucks 32 50 0.390 9072 9581
Chicago Bulls 31 51 0.378 9537 9964
Indiana Pacers 19 63 0.232 9219 9874
Atlanta Hawks 46 36 0.561 9714 9516
Orlando Magic 45 37 0.549 9491 9439
Charlotte Hornets 44 38 0.537 9513 9117
Miami Heat 43 39 0.524 9911 9720
Washington Wizards 17 65 0.207 9258 10240