Liverpool 2023-2024

“If you had Wikipedia or Google and put in ‘European nights’ the answer must be: Anfield.”

Nice memories

Wall of Fame

honours %>% 
  reactable(
    theme = clean(),
    compact = TRUE,
    defaultSortOrder = 'desc',
    defaultSorted = 'No.',
    defaultColDef = colDef(align = "left", footerStyle = list(fontWeight = "bold")),
    showSortIcon = TRUE,
    columns = list(
      Honour = colDef(
      cell = pill_buttons(
      data = .,
      colors = "white",
      bold_text = TRUE,
      text_color = 'FIREBRICK',
      )
    ),
      No. = colDef(cell = icon_assign(data = ., icon = "trophy", fill_color = "gold1", empty_color = "white", show_values = "right"))
    )
  )

SQUAD

The squad during the 2023-2024 season:

squad %>% reactable(
  theme = clean(),
  compact = TRUE,
  defaultSortOrder = 'asc',
  defaultSorted = 'Player',
  defaultColDef = colDef(footerStyle = list(fontWeight = "bold")),
  pagination = TRUE,
  showSortIcon = TRUE,
  columns = list(
    X. = colDef(
        '#',
        align = 'left',
        minWidth = 175),
    Player = colDef(
        align = 'left',
        minWidth = 175),
    Position = colDef(
        align = 'center',
        
        minWidth = 175,
        cell = pill_buttons(
          data = .,
          color_ref = 'colors',
          box_shadow = TRUE
        )
      ),
    colors = colDef(show = FALSE)
    )
  )

GAMES

Games for the 2023-2024 season:

games %>% reactable(
  theme = clean(),
  compact = TRUE,
  defaultSortOrder = 'asc',
  defaultSorted = 'Date',
  defaultColDef = colDef(footerStyle = list(fontWeight = "bold")),
  defaultPageSize = 15,
  paginationType = 'jump',
  showSortIcon = TRUE,
  columns = list(
    colors = colDef(show = FALSE),
    colors_02 = colDef(show = FALSE),
    Date = colDef(
      maxWidth = 150,
      cell = pill_buttons(
      data = .,
      opacity = 0.8
      )
    ),
    Score = colDef(
        align = 'center',
        maxWidth = 125,
        cell = pill_buttons(
          data = .,
          colors = "white",
          bold_text = TRUE,
          text_color = 'FIREBRICK',
      )
    ),
    Result = colDef(
        align = 'center',
        maxWidth = 100,
        cell = pill_buttons(
          data = .,
          color_ref = 'colors',
          box_shadow = TRUE
          )
        ),
     Stadium = colDef(
        align = 'center',
        minWidth = 150,
        cell = pill_buttons(
          data = .,
          color_ref = 'colors_02',
          box_shadow = FALSE
        )
      )
    )
  )

STATS

Appearances/Goalscorers/Assists for the 2023-2024 season:

Appearances

appearances %>% reactable(
  theme = clean(),
  compact = TRUE,
  defaultSortOrder = 'desc',
  defaultSorted = 'Total',
  defaultPageSize = 15,
  paginationType = 'jump',
  showSortIcon = TRUE,
  columns = list(
    medals = colDef(show = FALSE),
    medal_colors = colDef(show = FALSE),
    Rank = colDef(
      align = 'left',
      maxWidth = 60,
      cell = icon_sets(
        data = .,
        icon_ref = 'medals',
        icon_color_ref = 'medal_colors',
        icon_position = 'left',
        number_fmt = scales::number_format(accuracy = 1)
      )
    ),
    League = colDef(
      align = 'center',
      maxWidth = 80,
      cell = color_tiles(
        data= ., 
        number_fmt = scales::label_number(accuracy = 1), 
        colors = RColorBrewer::brewer.pal(5, 'Reds'), 
        bias = 1.3, 
        box_shadow = FALSE)
    ),
    FA.Cup = colDef(
      'FA Cup',
      align = 'center',
      maxWidth = 80,
      cell = color_tiles(
        data= ., 
        number_fmt = scales::label_number(accuracy = 1), 
        colors = RColorBrewer::brewer.pal(5, 'Reds'), 
        bias = 1.3, 
        box_shadow = FALSE)
    ),
    League.Cup = colDef(
      'League Cup',
      align = 'center',
      maxWidth = 80,
      cell = color_tiles(
        data= ., 
        number_fmt = scales::label_number(accuracy = 1), 
        colors = RColorBrewer::brewer.pal(5, 'Reds'), 
        bias = 1.3, 
        box_shadow = FALSE)
    ),
    Europe = colDef(
      align = 'center',
      maxWidth = 80,
      cell = color_tiles(
        data= ., 
        number_fmt = scales::label_number(accuracy = 1), 
        colors = RColorBrewer::brewer.pal(5, 'Reds'), 
        bias = 1.3, 
        box_shadow = FALSE)
    ),
    # Other = colDef(
    #   align = 'center',
    #   maxWidth = 80,
    #   cell = color_tiles(
    #     data= .,
    #     number_fmt = scales::label_number(accuracy = 1),
    #     colors = RColorBrewer::brewer.pal(5, 'Reds'),
    #     bias = 1.3,
    #     box_shadow = FALSE)
    # ),
    Total = colDef(
      align = 'center',
      minWidth = 200,
      cell = data_bars(
        data = .,
        fill_color = 'firebrick',
        background = '#FFFFFF',
        bar_height = 7,
        number_fmt = scales::label_number(accuracy = 1),
        text_position = 'outside-end',
        icon_color = 'firebrick',
        text_color = 'firebrick',
        round_edges = TRUE
      )
    )
  )
)

Goalscorers

goalscorers %>% reactable(
  theme = clean(),
  compact = TRUE,
  defaultSortOrder = 'desc',
  defaultSorted = 'Total',
  pagination = FALSE,
  showSortIcon = TRUE,
  columns = list(
    medals = colDef(show = FALSE),
    medal_colors = colDef(show = FALSE),
    Rank = colDef(
      align = 'left',
      maxWidth = 60,
      cell = icon_sets(
        data = .,
        icon_ref = 'medals',
        icon_color_ref = 'medal_colors',
        icon_position = 'left',
        number_fmt = scales::number_format(accuracy = 1)
      )
    ),
    League = colDef(
      align = 'center',
      maxWidth = 80,
      cell = color_tiles(
        data= ., 
        number_fmt = scales::label_number(accuracy = 1), 
        colors = RColorBrewer::brewer.pal(5, 'Reds'), 
        bias = 1.3, 
        box_shadow = FALSE)
    ),
    FA.Cup = colDef(
      'FA Cup',
      align = 'center',
      maxWidth = 80,
      cell = color_tiles(
        data= ., 
        number_fmt = scales::label_number(accuracy = 1), 
        colors = RColorBrewer::brewer.pal(5, 'Reds'), 
        bias = 1.3, 
        box_shadow = FALSE)
    ),
    League.Cup = colDef(
      'League Cup',
      align = 'center',
      maxWidth = 80,
      cell = color_tiles(
        data= ., 
        number_fmt = scales::label_number(accuracy = 1), 
        colors = RColorBrewer::brewer.pal(5, 'Reds'), 
        bias = 1.3, 
        box_shadow = FALSE)
    ),
    Europe = colDef(
      align = 'center',
      maxWidth = 80,
      cell = color_tiles(
        data= ., 
        number_fmt = scales::label_number(accuracy = 1), 
        colors = RColorBrewer::brewer.pal(5, 'Reds'), 
        bias = 1.3, 
        box_shadow = FALSE)
    ),
    # Other = colDef(
    #   align = 'center',
    #   maxWidth = 80,
    #   cell = color_tiles(
    #     data= .,
    #     number_fmt = scales::label_number(accuracy = 1),
    #     colors = RColorBrewer::brewer.pal(5, 'Reds'),
    #     bias = 1.3,
    #     box_shadow = FALSE)
    # ),
    Total = colDef(
      align = 'center',
      minWidth = 200,
      cell = data_bars(
        data = .,
        fill_color = 'firebrick',
        background = '#FFFFFF',
        bar_height = 7,
        number_fmt = scales::label_number(accuracy = 1),
        text_position = 'outside-end',
        icon_color = 'firebrick',
        text_color = 'firebrick',
        round_edges = TRUE
      )
    )
  )
)

Assists

assists %>% reactable(
  theme = clean(),
  compact = TRUE,
  defaultSortOrder = 'desc',
  defaultSorted = 'Total',
  pagination = FALSE,
  showSortIcon = TRUE,
  columns = list(
    medals = colDef(show = FALSE),
    medal_colors = colDef(show = FALSE),
    Rank = colDef(
      align = 'left',
      maxWidth = 60,
      cell = icon_sets(
        data = .,
        icon_ref = 'medals',
        icon_color_ref = 'medal_colors',
        icon_position = 'left',
        number_fmt = scales::number_format(accuracy = 1)
      )
    ),
    League = colDef(
      align = 'center',
      maxWidth = 80,
      cell = color_tiles(
        data= ., 
        number_fmt = scales::label_number(accuracy = 1), 
        colors = RColorBrewer::brewer.pal(5, 'Reds'), 
        bias = 1.3, 
        box_shadow = FALSE)
    ),
    FA.Cup = colDef(
      'FA Cup',
      align = 'center',
      maxWidth = 80,
      cell = color_tiles(
        data= ., 
        number_fmt = scales::label_number(accuracy = 1), 
        colors = RColorBrewer::brewer.pal(5, 'Reds'), 
        bias = 1.3, 
        box_shadow = FALSE)
    ),
    League.Cup = colDef(
      'League Cup',
      align = 'center',
      maxWidth = 80,
      cell = color_tiles(
        data= ., 
        number_fmt = scales::label_number(accuracy = 1), 
        colors = RColorBrewer::brewer.pal(5, 'Reds'), 
        bias = 1.3, 
        box_shadow = FALSE)
    ),
    Europe = colDef(
      align = 'center',
      maxWidth = 80,
      cell = color_tiles(
        data= ., 
        number_fmt = scales::label_number(accuracy = 1), 
        colors = RColorBrewer::brewer.pal(5, 'Reds'), 
        bias = 1.3, 
        box_shadow = FALSE)
    ),
    # Other = colDef(
    #   align = 'center',
    #   maxWidth = 80,
    #   cell = color_tiles(
    #     data= .,
    #     number_fmt = scales::label_number(accuracy = 1),
    #     colors = RColorBrewer::brewer.pal(5, 'Reds'),
    #     bias = 1.3,
    #     box_shadow = FALSE)
    # ),
    Total = colDef(
      align = 'center',
      minWidth = 200,
      cell = data_bars(
        data = .,
        fill_color = 'firebrick',
        background = '#FFFFFF',
        bar_height = 7,
        number_fmt = scales::label_number(accuracy = 1),
        text_position = 'outside-end',
        icon_color = 'firebrick',
        text_color = 'firebrick',
        round_edges = TRUE
      )
    )
  )
)

TRANSFERS

Transfers for the 2023-2024 season:

In

transfers_in$Date<-as.Date(transfers_in$Date, format = ("%d %b %Y"))

transfers_in %>% reactable(
  theme = clean(),
  compact = TRUE,
  defaultSortOrder = 'asc',
  defaultSorted = 'Date',
  pagination = FALSE,
  showSortIcon = TRUE,
  columns = list(
      Date = colDef(
        minWidth = 125,
        cell = pill_buttons(
          data = .,
          opacity = 0.8
        )
      )
    )
  )

Out

transfers_out$Date<-as.Date(transfers_out$Date, format = ("%d %b %Y"))

transfers_out %>% reactable(
  theme = clean(),
  compact = TRUE,
  defaultSortOrder = 'asc',
  defaultSorted = 'Date',
  pagination = FALSE,
  showSortIcon = TRUE,
  columns = list(
      Date = colDef(
        minWidth = 125,
        cell = pill_buttons(
          data = .,
          opacity = 0.8
        )
      )
    )
  )

STADIUM

leaflet(map) %>% addTiles() %>%
  addAwesomeMarkers(lng = ~lng, lat = ~lat,
                    label= ~paste(team, " - ", stadium),
                    labelOptions = labelOptions(noHide = F, direction = "bottom",
                                                style = list(
                                                  "color" = "#27374D",
                                                  "font-family" = "Montserrat",
                                                  "font-style" = "bold",
                                                  "font-size" = "12px",
                                                  "border-color" = "#27374D",
                                                  "weight" = 5)
                                                ),
                    icon = awesomeIcons(
                      icon = 'ios-football',
                      markerColor = ~ifelse(team == "Liverpool", "red", "blue"),
                      library = 'ion')
                    )