Skip to content

Render arbitrary sets of icons #2

@jimjam-slam

Description

@jimjam-slam

A logical extension of this package would be a geom that renders an arbitrary set of icons, specified by supplying a named vector of paths to a scale like:

my_icons = c(
  'soccer' = 'icons/soccer.svg',
  'rugby' = 'icons/rugby.svg',
  'basketball' = 'icons/basketball.svg')

sportevents = ggplot(data) +
  geom_icon(aes(x = longitude, y = latitude, size = interest, icon = sport)) +
  scale_icon(values = my_icons)

This would be similar to the way custom colour scales are implemented. I think this could be done either with rastered PNG icons, building on baptiste/ggflags, or with vector SVG icons if I implemented #1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions