Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jack-davison/leaf.magic
R package for more customisable Font Awesome markers in Leaflet
https://github.com/jack-davison/leaf.magic
leaflet package r rstats
Last synced: about 1 month ago
JSON representation
R package for more customisable Font Awesome markers in Leaflet
- Host: GitHub
- URL: https://github.com/jack-davison/leaf.magic
- Owner: jack-davison
- License: other
- Created: 2024-07-18T07:03:33.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-10-27T21:12:41.000Z (3 months ago)
- Last Synced: 2024-10-28T01:16:53.208Z (3 months ago)
- Topics: leaflet, package, r, rstats
- Language: R
- Homepage: https://jack-davison.github.io/leaf.magic/
- Size: 13 MB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# {leaf.magic} - Use Modern Icon Libraries in Leaflet Markers
[![CRAN status](https://www.r-pkg.org/badges/version/leaf.magic)](https://CRAN.R-project.org/package=leaf.magic)
[![R-CMD-check](https://github.com/jack-davison/leaf.magic/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jack-davison/leaf.magic/actions/workflows/R-CMD-check.yaml)The goal of `{leaf.magic}` is to overcome the somewhat outdated "Font Awesome" implementation in vanilla R `{leaflet}` by constructing markers on the fly using `{fontawesome}` or `{bsicons}` and `{magick}`. There are three issues `{leaf.magic}` sets out to overcome:
* `leaflet::awesomeIcons()` is limited to Font Awesome 4 👎
* `leaflet::awesomeIcons()` is limited to a handful of discrete colours 👎
* `leaflet::awesomeIcons()` is limited to a single marker size 👎
* Vanilla `{leaflet}` doesn't provide any additional features to construct legends, icon palettes, or such like 👎
`{leaf.magic}` attempts to solve all of this:
* `magicIcons()` uses up-to-date versions of Font Awesome, Bootstrap, and Ionicons Icons, powered by `{fontawesome}` and `{bsicons}` ✅
* `magicIcons()` uses `{fontawesome}` to grab a marker shape, and can therefore colour and resize it however the user desires ✅
* `{leaf.magic}` exports functions like `iconBin()` and `addIconLegend()` to help developers communicate the meanings of icons to users ✅
`{leaf.magic}` is thoroughly documented on the [package website](https://jack-davison.github.io/leaf.magic/), which includes a [getting started guide](https://jack-davison.github.io/leaf.magic/articles/leaf-magic.html).
## Installation
You can install the development version of `{leaf.magic}` like so:
``` r
# install.packages("pak")
pak::pak("jack-davison/leaf.magic")
```![A screenshot of a map produced using the {leaf.magic} R package.](man/figures/webshot.png)
## Attributions
`{leaf.magic}` is licensed under the [MIT License](https://jack-davison.github.io/leaf.magic/LICENSE.html), and would not be possible without the following icon libraries:
* **Font Awesome** - [Website](https://fontawesome.com/) | [License](https://fontawesome.com/license/free) | [R Package {fontawesome}](https://github.com/rstudio/fontawesome)
* **Bootstrap Icons** - [Website](https://icons.getbootstrap.com/) | [License](https://getbootstrap.com/docs/5.3/about/license/) | [R Package {bsicons}](https://github.com/rstudio/bsicons)
* **Ionicons** - [Website](https://ionic.io/ionicons) | [License](https://github.com/ionic-team/ionicons/blob/main/LICENSE)
## Code of Conduct
Please note that the leaf.magic project is released with a [Contributor Code of Conduct](https://jack-davison.github.io/leaf.magic/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.