{"id":22713615,"url":"https://github.com/program--/blaeu","last_synced_at":"2025-09-11T21:04:50.682Z","repository":{"id":49850199,"uuid":"498032639","full_name":"program--/blaeu","owner":"program--","description":"Web Mapping Framework for R built on MapLibre GL","archived":false,"fork":false,"pushed_at":"2023-02-11T23:15:50.000Z","size":5278,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T00:27:52.579Z","etag":null,"topics":["maplibre-gl","r","spatial","webmaps"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/program--.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-05-30T17:11:45.000Z","updated_at":"2023-02-09T08:56:29.000Z","dependencies_parsed_at":"2022-09-21T08:22:25.309Z","dependency_job_id":"740af9e2-2ac9-4f2e-aa31-f13a47c1cb1d","html_url":"https://github.com/program--/blaeu","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"3a8266d13c39577316b2740c2d13fb2c1813f0a7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/program--%2Fblaeu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/program--%2Fblaeu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/program--%2Fblaeu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/program--%2Fblaeu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/program--","download_url":"https://codeload.github.com/program--/blaeu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246254097,"owners_count":20747948,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["maplibre-gl","r","spatial","webmaps"],"created_at":"2024-12-10T14:09:40.871Z","updated_at":"2025-03-29T22:44:02.938Z","avatar_url":"https://github.com/program--.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# blaeu\n\n\u003c!-- badges: start --\u003e\n\u003c!-- badges: end --\u003e\n\n**blaeu** is a web mapping framework for R built on top of [MapLibre GL](https://github.com/maplibre/maplibre-gl-js).\n\n## Installation\n\nYou can install the development version of blaeu from [GitHub](https://github.com/) with `devtools` or `pak`:\n\n``` r\n# install.packages(\"devtools\")\ndevtools::install_github(\"program--/blaeu\")\n\n# install.packages(\"pak\")\npak::pkg_install(\"program--/blaeu\")\n```\n\n## Example\n\nCreating a map with a basemap:\n\n```{r example, eval = FALSE}\n# Creating map\nblaeu::map(style = blaeu::carto(\"voyager\"))\n```\n\n![](man/figures/readme_1.png)\n\n**blaeu** currently has functions for adding:\n\nFunction                 | Description\n------------------------ | ---\n`blaeu::openstreetmap()` | OpenStreetMap *raster* basemap tiles,\n`blaeu::stamen()`        | Stamen Watercolor, Terrain, and Toner *raster* basemap tiles,\n`blaeu::carto()`         | Carto Dark Matter, Voyager, and Positron *vector* basemap tiles.\n\nAdding points with `sf` objects:\n```{r sf_example, eval = FALSE}\n# Setting up example data\nexample_data \u003c- quakes\nexample_data$long \u003c- ifelse(\n  example_data$long \u003e 180,\n  example_data$long - 360,\n  example_data$long\n)\n\nexample_data \u003c- sf::st_as_sf(\n  example_data,\n  coords = c(2, 1),\n  crs = 4326\n)\n\nblaeu::map(style = blaeu::carto(\"voyager\")) |\u003e\n  blaeu::map_source(example_data, id = \"quakes\") |\u003e\n  blaeu::map_layer(\n    id = \"pts\",\n    source = \"quakes\",\n    type = \"circle\",\n    # blaeu includes `paint_*` functions that make it\n    # easy to define how your layer should be visualized\n    paint = paint_circle(\n      # MapLibre GL expressions are supported by using\n      # R Lists in place of JS Arrays\n      color = c(\n        list(\n          \"interpolate\",\n          list(\"linear\"),\n          list(\"get\", \"mag\")\n        ),\n        rbind(\n          as.list(seq(from = 0, to = 5)),\n          as.list(substr(viridisLite::inferno(6), 1, 7))\n        )\n      ),\n      blur = 0.2,\n      radius = list(\"^\", list(\"get\", \"mag\"), 1.25)\n    ),\n    # Popups are easy to create if only simple HTML is needed.\n    # Data properties can be included via string interpolation\n    # by using `${VARNAME}`, where VARNAME is the property.\n    popup_text = \"\u003cstrong\u003eMagnitude\u003c/strong\u003e: ${mag}\"\n  )\n```\n\n![](man/figures/readme_2.gif)\n\nAll MapLibre GL layers are supported, including fill extrusions:\n```{r 3d_example, eval = FALSE}\nblaeu::map(style = blaeu::openstreetmap()) |\u003e\n  blaeu::map_source(\n    sf::st_transform(\n      sf::read_sf(system.file(\"gpkg/nc.gpkg\", package = \"sf\")),\n      4326\n    ),\n    id = \"nc\"\n  ) |\u003e\n  blaeu::map_layer(\n    id = \"b\",\n    source = \"nc\",\n    type = \"fill-extrusion\",\n    paint = paint_fill_extrusion(\n      height = list(\"get\", \"BIR79\"),\n      color = list(\n        \"interpolate\",\n        list(\"linear\"),\n        list(\"get\", \"BIR79\"),\n        0,\n        \"#edf8fb\",\n        319,\n        \"#b2e2e2\",\n        1308,\n        \"#66c2a4\",\n        2636,\n        \"#2ca25f\",\n        4989,\n        \"#006d2c\"\n      )\n    ),\n    popup_text = \"Number of Births (1979): ${BIR79}\"\n  )\n```\n\n![](man/figures/readme_3.png)\n\n\n### PMTiles Support\n\n**blaeu** also has support for PMTiles:\n\n```{r pmtiles, eval = FALSE}\nblaeu::map() |\u003e\n  blaeu::map_source(\n    x = \"https://some/url/to/tiles.pmtiles\",\n    type = \"pmtiles\",\n    id = \"my-pmtiles-source\",\n    # Maxzoom must be specified, otherwise\n    # the features will disappear after\n    # passing the maximum zoom\n    maxzoom = 10\n  ) |\u003e\n  blaeu::map_layer(\n    id = \"my-pmtiles-layer\",\n    source = \"my-pmtiles-source\",\n    source_layer = \"my-pmtiles-source-layer\",\n    type = \"line\",\n    paint = blaeu::paint_line(color = \"blue\")\n  )\n```\n\n## Development\n\n**blaeu** uses:\n\n- [TypeScript](https://www.typescriptlang.org/) in place of Javascript,\n- [yarn](https://yarnpkg.com/) for package management,\n- [Vite](https://vitejs.dev/) for building/bundling.\n\nAll TS code is located within the `typescript/` directory.\n\nTo build out the current TS code, navigate to the `typescript/` directory and run:\n\n```\nyarn build\n```\n\nThis will build, bundle, and push the TS code to `inst/htmlwidgets/blaeu.js`, which is the primary\ninterface to R's HTMLWidgets package.\n\n## License\n\n**blaeu** itself is [MIT](https://opensource.org/licenses/MIT)-licensed.\n\nHowever, MapLibre GL has a [3-Clause BSD](https://opensource.org/licenses/BSD-3-Clause) license.\nIts license and dependency licenses are found [here](inst/htmlwidgets/lib/maplibre-gl-2.1.1/LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogram--%2Fblaeu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprogram--%2Fblaeu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogram--%2Fblaeu/lists"}