Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
^.*\.Rproj$
^\.Rproj\.user$
^\.vscode($|/)
^docs$
^vignettes$
^data-raw$
Expand All @@ -20,4 +21,5 @@ CLAUDE.md
.DS_Store
^tools/check-save-map-integration\.R$
^tmp$
^private($|/)
^\.dockerignore$
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ CLAUDE.md
.claude
tmp/
examples/
data-raw/flowmap-vendor/node_modules/
10 changes: 8 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ Package: mapgl
Title: Interactive Maps with 'Mapbox GL JS' and 'MapLibre GL JS'
Version: 0.4.9.9000
Date: 2026-05-14
Authors@R:
person(given = "Kyle", family = "Walker", email = "kyle@walker-data.com", role = c("aut", "cre"))
Authors@R: c(
person(given = "Kyle", family = "Walker", email = "kyle@walker-data.com", role = c("aut", "cre")),
person(given = "Egor", family = "Kotov", email = "kotov.egor@gmail.com", role = c("aut", "ctb"), comment = c(ORCID = "0000-0001-6690-5345", "added Flowmap.gl, layer tuner, time control")
)
)
Description: Provides an interface to the 'Mapbox GL JS' (<https://docs.mapbox.com/mapbox-gl-js/guides>)
and the 'MapLibre GL JS' (<https://maplibre.org/maplibre-gl-js/docs/>) interactive mapping libraries to help users
create custom interactive maps in R. Users can create interactive globe visualizations; layer 'sf' objects to create
Expand All @@ -12,6 +15,7 @@ Description: Provides an interface to the 'Mapbox GL JS' (<https://docs.mapbox.c
URL: https://walker-data.com/mapgl/
BugReports: https://github.com/walkerke/mapgl/issues
License: MIT + file LICENSE
Copyright: See LICENSE.note for bundled third-party JavaScript components.
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.3
Expand Down Expand Up @@ -40,3 +44,5 @@ Suggests:
usethis,
leaflet
Config/testthat/edition: 3
LazyData: true

78 changes: 78 additions & 0 deletions LICENSE.note
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
This package as a whole is licensed under the MIT License (see LICENSE file).

It bundles several third-party JavaScript components. The FlowmapGL browser bundle shipped at `inst/htmlwidgets/lib/flowmap-gl/flowmap-gl-bundle.min.js` is generated from npm release packages by `data-raw/flowmap-vendor/build-flowmap.sh build`.

Below are the licenses of the individual bundled components:

| Package | Version | License | Source |
| --- | --- | --- | --- |
| @deck.gl/core | 9.3.2 | MIT | https://github.com/visgl/deck.gl.git |
| @deck.gl/layers | 9.3.2 | MIT | https://github.com/visgl/deck.gl.git |
| @deck.gl/mapbox | 9.3.2 | MIT | https://github.com/visgl/deck.gl.git |
| @esbuild/darwin-arm64 | 0.28.0 | MIT | git+https://github.com/evanw/esbuild.git |
| @flowmap.gl/data | 9.3.0 | Apache-2.0 | git@github.com:visgl/flowmap.gl.git |
| @flowmap.gl/layers | 9.3.0 | Apache-2.0 | git@github.com:visgl/flowmap.gl.git |
| @loaders.gl/core | 4.4.2 | MIT | https://github.com/visgl/loaders.gl |
| @loaders.gl/images | 4.4.2 | MIT | https://github.com/visgl/loaders.gl |
| @loaders.gl/loader-utils | 4.4.2 | MIT | https://github.com/visgl/loaders.gl |
| @loaders.gl/schema | 4.4.2 | MIT | https://github.com/visgl/loaders.gl |
| @loaders.gl/schema-utils | 4.4.2 | MIT | https://github.com/visgl/loaders.gl |
| @loaders.gl/worker-utils | 4.4.2 | MIT | https://github.com/visgl/loaders.gl |
| @luma.gl/core | 9.3.3 | MIT | https://github.com/visgl/luma.gl |
| @luma.gl/engine | 9.3.3 | MIT | https://github.com/visgl/luma.gl |
| @luma.gl/shadertools | 9.3.3 | MIT | https://github.com/visgl/luma.gl |
| @luma.gl/webgl | 9.3.3 | MIT | https://github.com/visgl/luma.gl |
| @mapbox/tiny-sdf | 2.2.0 | BSD-2-Clause | git+https://github.com/mapbox/tiny-sdf.git |
| @math.gl/core | 4.1.0 | MIT | https://github.com/visgl/math.gl.git |
| @math.gl/polygon | 4.1.0 | MIT | https://github.com/visgl/math.gl.git |
| @math.gl/sun | 4.1.0 | MIT | https://github.com/visgl/math.gl.git |
| @math.gl/types | 4.1.0 | MIT | https://github.com/visgl/math.gl.git |
| @math.gl/web-mercator | 4.1.0 | MIT | https://github.com/visgl/math.gl.git |
| @probe.gl/env | 4.1.1 | MIT | https://github.com/visgl/probe.gl.git |
| @probe.gl/log | 4.1.1 | MIT | https://github.com/visgl/probe.gl.git |
| @probe.gl/stats | 4.1.1 | MIT | https://github.com/visgl/probe.gl.git |
| @swc/helpers | 0.5.23 | Apache-2.0 | git+https://github.com/swc-project/swc.git |
| @types/command-line-args | 5.2.3 | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git |
| @types/command-line-usage | 5.0.4 | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git |
| @types/geojson | 7946.0.16 | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git |
| @types/node | 24.12.4 | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git |
| @types/offscreencanvas | 2019.7.3 | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git |
| ansi-styles | 4.3.0 | MIT | chalk/ansi-styles |
| apache-arrow | 21.1.0 | Apache-2.0 | git+https://github.com/apache/arrow-js.git |
| array-back | 6.2.3 | MIT | git+https://github.com/75lb/array-back.git |
| chalk | 4.1.2 | MIT | chalk/chalk |
| chalk-template | 0.4.0 | MIT | chalk/chalk-template |
| color-convert | 2.0.1 | MIT | Qix-/color-convert |
| color-name | 1.1.4 | MIT | git@github.com:colorjs/color-name.git |
| command-line-args | 6.0.2 | MIT | git+https://github.com/75lb/command-line-args.git |
| command-line-usage | 7.0.4 | MIT | https://github.com/75lb/command-line-usage |
| d3 | 7.9.0 | ISC | https://github.com/d3/d3.git |
| d3-array | 3.2.4 | ISC | https://github.com/d3/d3-array.git |
| d3-color | 3.1.0 | ISC | https://github.com/d3/d3-color.git |
| d3-format | 3.1.2 | ISC | https://github.com/d3/d3-format.git |
| d3-geo | 3.1.1 | ISC | https://github.com/d3/d3-geo.git |
| d3-interpolate | 3.0.1 | ISC | https://github.com/d3/d3-interpolate.git |
| d3-scale | 4.0.2 | ISC | https://github.com/d3/d3-scale.git |
| d3-scale-chromatic | 3.1.0 | ISC | https://github.com/d3/d3-scale-chromatic.git |
| d3-time | 3.1.0 | ISC | https://github.com/d3/d3-time.git |
| d3-time-format | 4.1.0 | ISC | https://github.com/d3/d3-time-format.git |
| earcut | 2.2.4 | ISC | git://github.com/mapbox/earcut.git |
| esbuild | 0.28.0 | MIT | git+https://github.com/evanw/esbuild.git |
| find-replace | 5.0.2 | MIT | git+https://github.com/75lb/find-replace.git |
| flatbuffers | 25.9.23 | Apache-2.0 | git+https://github.com/google/flatbuffers.git |
| gl-matrix | 3.4.4 | MIT | https://github.com/toji/gl-matrix.git |
| has-flag | 4.0.0 | MIT | sindresorhus/has-flag |
| internmap | 2.0.3 | ISC | https://github.com/mbostock/internmap.git |
| json-bignum | 0.0.3 | MIT | https://github.com/datalanche/json-bignum.git |
| kdbush | 4.1.0 | ISC | git://github.com/mourner/kdbush.git |
| lil-gui | 0.19.0 | MIT | https://github.com/georgealways/lil-gui |
| lodash.camelcase | 4.3.0 | MIT | lodash/lodash |
| mjolnir.js | 3.0.0 | MIT | https://github.com/visgl/mjolnir.js |
| reselect | 5.2.0 | MIT | https://github.com/reduxjs/reselect.git |
| seedrandom | 3.0.5 | MIT | git://github.com/davidbau/seedrandom.git |
| supports-color | 7.2.0 | MIT | chalk/supports-color |
| table-layout | 4.1.1 | MIT | https://github.com/75lb/table-layout |
| tslib | 2.8.1 | 0BSD | https://github.com/Microsoft/tslib.git |
| typical | 7.3.0 | MIT | git+https://github.com/75lb/typical.git |
| undici-types | 7.16.0 | MIT | git+https://github.com/nodejs/undici.git |
| wordwrapjs | 5.1.1 | MIT | https://github.com/75lb/wordwrapjs |
8 changes: 8 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export(add_draw_control)
export(add_features_to_draw)
export(add_fill_extrusion_layer)
export(add_fill_layer)
export(add_flowmap)
export(add_fullscreen_control)
export(add_geocoder_control)
export(add_geolocate_control)
Expand All @@ -24,6 +25,7 @@ export(add_heatmap_layer)
export(add_image)
export(add_image_source)
export(add_layer)
export(add_layer_tuner)
export(add_layers_control)
export(add_legend)
export(add_line_layer)
Expand All @@ -38,6 +40,7 @@ export(add_scale_control)
export(add_screenshot_control)
export(add_source)
export(add_symbol_layer)
export(add_time_control)
export(add_vector_source)
export(add_video_source)
export(add_view)
Expand All @@ -59,6 +62,7 @@ export(enable_shiny_hover)
export(esri_open_style)
export(esri_style)
export(fit_bounds)
export(flowmap_color_schemes)
export(fly_to)
export(get_breaks)
export(get_column)
Expand Down Expand Up @@ -90,6 +94,7 @@ export(number_format)
export(on_section)
export(openfreemap_style)
export(palette_to_lut)
export(popup_options)
export(print_map)
export(query_rendered_features)
export(renderMapboxgl)
Expand All @@ -99,6 +104,8 @@ export(renderMaplibreCompare)
export(save_map)
export(set_config_property)
export(set_filter)
export(set_flowmap_filter)
export(set_flowmap_settings)
export(set_fog)
export(set_layout_property)
export(set_paint_property)
Expand All @@ -119,6 +126,7 @@ export(story_leaflet)
export(story_map)
export(story_maplibre)
export(story_section)
export(tooltip_options)
export(turf_area)
export(turf_buffer)
export(turf_center_of_mass)
Expand Down
15 changes: 15 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
# mapgl 0.5.0

* `add_layer_tuner()` now applies the Filter Arguments control to flowmap
layer controls and includes Undo and Redo buttons with up to 1,000 undo
states. Numeric sliders automatically expand when current or typed values
exceed the default range, and color controls normalize common color formats
to editable hex values. The tuner panel can now be initialized with a custom
title, position, size, and collapsed state.

* `add_flowmap()` now supports `flow_temporal_scale_domain` for temporal
flowmaps, allowing flow thickness and color scales to use either the
selected time interval or the full temporal extent.

* New bivariate mapping support with `bivariate_scale()`, `bivariate_palettes()`, and `add_bivariate_legend()`. Bivariate scales use 3-by-3 palettes, support custom 3-by-3 color matrices, optional `x_breaks` and `y_breaks` for stable bins, and explicit `na_color` handling (#181).

* Continuous legends can now expose an opt-in color-ramp picker. Use `color_ramps`, `selected_ramp`, and `ramp_picker = TRUE` with continuous legends to let readers switch palettes directly from the legend; named ramps display labels by default, and `ramp_labels = FALSE` creates a compact picker.

* `interpolate_palette()` now carries additional scale metadata for downstream legends, including the source column, missing-value color, available color ramps, and selected ramp.

* `set_flowmap_settings()` now updates a single validated FlowMapGL setting at
a time with `name` and `value` arguments. Snake-case aliases are still
accepted, and filter state remains handled by `set_flowmap_filter()`.

* Compare maps now initialize legend interactivity assets so supported dynamic legend features can be used in compare views.

* GitHub source archives are now slimmed with `.gitattributes export-ignore` rules for generated site and vignette assets. This preserves GitHub Pages content in the repository while avoiding large downloads during GitHub-based package installs.
Expand Down
49 changes: 49 additions & 0 deletions R/data.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#' BIXI Montréal Bike Share Stations (2019)
#'
#' A dataset containing the names and coordinates of BIXI bicycle sharing
#' stations in Montréal, Quebec, Canada.
#'
#' @format A data frame with 618 rows and 4 variables:
#' \describe{
#' \item{id}{Unique station ID (character, e.g., `"4000"`, `"MTL-ECO5.1-01"`)}
#' \item{name}{Station name (character, e.g., `"Jeanne-d'Arc / Ontario"`)}
#' \item{lat}{Latitude coordinate (numeric)}
#' \item{lon}{Longitude coordinate (numeric)}
#' }
#' @source BIXI Montréal Open Data (\url{https://bixi.com/fr/donnees-ouvertes}).
#' Prepared for \url{https://github.com/FlowmapBlue/FlowmapBlue} by Ilya Boyandin (\url{https://twitter.com/ilyabo}).
#' @seealso \code{\link{bixi_flows}}
#' @examples
#' # Convert to sf object to view on a map
#' if (requireNamespace("sf", quietly = TRUE)) {
#' bixi_sf <- sf::st_as_sf(bixi_locations, coords = c("lon", "lat"), crs = 4326)
#' print(head(bixi_sf))
#' }
"bixi_locations"

#' BIXI Montréal Hourly Bike Sharing Flows (July 1-7, 2019)
#'
#' A dataset containing hourly aggregated bike sharing trips between BIXI
#' stations in Montréal during the week of July 1 to July 7, 2019.
#'
#' To minimize the package footprint, the dataset has been truncated to a
#' **minimum of three trips** (retaining only flows where \code{count > 2}),
#' which reduces the rows from 213,227 to 6,092, and compresses the final size
#' to just **~22 KB**.
#'
#' @format A data frame with 6,092 rows and 4 variables:
#' \describe{
#' \item{time}{Hourly timestamp (POSIXct, UTC)}
#' \item{origin}{Origin station ID (factor, matching \code{bixi_locations$id})}
#' \item{dest}{Destination station ID (factor, matching \code{bixi_locations$id})}
#' \item{count}{Aggregated number of bike sharing trips in that hour (integer)}
#' }
#' @source BIXI Montréal Open Data (\url{https://bixi.com/fr/donnees-ouvertes}).
#' Prepared for \url{https://github.com/FlowmapBlue/FlowmapBlue} by Ilya Boyandin (\url{https://twitter.com/ilyabo}).
#' Original interactive visualization on Flowmap.blue:
#' \url{https://www.flowmap.blue/1qTVOzkPB7U1ySI4g4uPtVBzzEDCI8n1WXAmQeZL15fE}
#' @seealso \code{\link{bixi_locations}}
#' @examples
#' # Check first few records
#' print(head(bixi_flows))
"bixi_flows"
Loading
Loading