Skip to content

Commit a557613

Browse files
committed
remove cli dependency, update docs
1 parent acca143 commit a557613

3 files changed

Lines changed: 12 additions & 14 deletions

File tree

NEWS.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# insetplot 1.4.0
22

3-
- Migrate bbox logic from data-based to lims-based to get more accurate ratios
4-
- Bug fix: fixed incorrect main plot ratio calculation when the main extend is clipped
3+
* Main logic: Migrate bbox logic from data-based to lims-based to get more accurate ratios
4+
* Bug fix: fixed incorrect main plot ratio calculation when the main extend is clipped
55

66
# insetplot 1.3.0
77

8+
* Reconstruct bbox handling logic to support more flexible congigurations
9+
810
# insetplot 1.0.0
911

1012
* Initial CRAN submission.

R/map_utils.R

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616
xlim <- c(bbox[["xmin"]], bbox[["xmax"]])
1717
ylim <- c(bbox[["ymin"]], bbox[["ymax"]])
1818
if (!all(is.finite(c(xlim, ylim))) && method != "geometry_bbox") {
19-
cli::cli_abort(c(
20-
"Scale limits cannot be mapped onto spatial coordinates in {.fn coord_sf}.",
21-
"i" = "Consider setting {.code lims_method = \"geometry_bbox\"} or {.code default_crs = NULL}."
22-
))
19+
stop("Cannot calculate limits bbox with non-finite values unless method is 'geometry_bbox'")
2320
}
2421

2522
bbox <- switch(method,

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ devtools::install_github("fncokg/insetplot")
8787

8888
Full documentation and more examples are available at [insetplot package site](https://fncokg.github.io/insetplot/).
8989

90-
## Core functions
90+
## Fast overview of main functions
9191

9292
- `inset_spec()` — Define bbox, position, and size for each subplot
9393
- bbox: `xmin, xmax, ymin, ymax`
@@ -97,15 +97,14 @@ Full documentation and more examples are available at [insetplot package site](h
9797
- `main`: exactly one spec must set `main = TRUE`
9898

9999
- `config_insetmap()` — Build and store configuration
100-
- `bbox`: overall bounding box (sf bbox or similar)
101-
- `to_crs`: target Coordinate Reference System
102-
- `from_crs`: source CRS for non-sf inputs
103-
- `specs`: list of `inset_spec()`
104-
- `crs`: target CRS (passed to coord_sf as `crs`)
105-
- `border_args`: forwarded to `map_border()` for inset borders
100+
- `specs`: list of `inset_spec()`, **required**
101+
- `bbox`: overall bounding box (sf bbox or similar), *optional* (all specs must have fullly defined bboxes if omitted)
102+
- `to_crs`: target Coordinate Reference System, *optional*, by default "EPSG:4326"
103+
- `from_crs`: source CRS for non-sf inputs, *optional*, by default "EPSG:4326"
104+
- `border_args`: forwarded to `map_border()` for inset borders, *optional*
106105

107106
- `with_inset()` — Compose main plot with insets
108-
- `plot`: single ggplot or list per spec (optional)
107+
- `plot`: single ggplot or list per spec
109108
- `.as_is`: return the input plot as-is (skip inset composition)
110109
- `.return_details`: return `list(full, subplots, subplot_layouts, main_ratio)`
111110

0 commit comments

Comments
 (0)