Title: | Make Planning Maps, Tables, and Visualizations |
---|---|
Description: | This package helps create maps, tables, and figures for planning documents using open spatial data. birdseyeview is designed to work with the sfext and maplayer packages and relies on sf, ggplot2, and gt. |
Authors: | Eli Pousson [aut, cre] |
Maintainer: | Eli Pousson <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2024-11-09 03:22:51 UTC |
Source: | https://github.com/elipousson/birdseyeview |
gt
(variation on {gtExtras}
)A variation on the gtExtras::gt_merge_stack function that implements a
horizontal rule parameter separating the top and bottom text and simplifies
the requirements for the input variables. {gtExtras}
was created by Thomas
Mock and is available under an MIT License.
gt_merge_stack( gt_object, columns = c(1, 2), font_color = c("black", "grey"), ..., small_cap = FALSE, font_size = c(14, 10), font_weight = "bold", h_rule = FALSE )
gt_merge_stack( gt_object, columns = c(1, 2), font_color = c("black", "grey"), ..., small_cap = FALSE, font_size = c(14, 10), font_weight = "bold", h_rule = FALSE )
gt_object |
An existing gt table object of class |
columns |
Columns to stack, Default: c(1, 2) |
font_color |
Color(s) to use for stacked text. Default: c("black", "grey") |
... |
Arguments passed on to
|
small_cap |
a logical indicating whether to use 'small-cap' on the top line of text |
font_size |
a string of length 2 indicating the font-size in px of the top and bottom text |
font_weight |
a string of length 2 indicating the 'font-weight' of the top and bottom text. Must be one of 'bold', 'normal', 'lighter' |
h_rule |
Horizontal rule to separate top and bottom column text. If
|
gt
tableAdd maps of simple features into rows of a gt
table with ggplot2.
Function naming convention borrowed from gtExtras::gt_img_rows. Previously
named gt_geom_sf_rows.
gt_sf_rows( gt_object, mapping = NULL, fill = NA, color = "black", size = 1, linetype = "solid", height = 100, asp = 1, geom = "sf", layer_fn = NULL, sf_label = "map", ... )
gt_sf_rows( gt_object, mapping = NULL, fill = NA, color = "black", size = 1, linetype = "solid", height = 100, asp = 1, geom = "sf", layer_fn = NULL, sf_label = "map", ... )
gt_object |
An existing gt table object of class gt_tbl or an sf object.
If a gt_object must be convertible to an sf object with |
mapping |
aesthetic mapping passed to |
fill |
Fill (used for polygon geometry), Default: |
color |
Color (used for polygon, point, and line geometry), Default: 'black' |
size |
Color (used for polygon, point, and line geometry), Default: 1 |
linetype |
Color (used for polygon and line geometry), Default: 'solid' |
height |
The absolute height (px) of the map in the table cell |
asp |
The aspect ratio of the map in the table cell. |
layer_fn |
Optional rowwise function that results in ggplot2 map the replaces geometry column. |
sf_label |
Label used for column with ggplot2 map. |
Designed for use with maps created using layer_show_markers()
tbl_marker_key( data, title_col = NULL, groupname_col = NULL, number_col = NULL, color = FALSE, palette = NULL )
tbl_marker_key( data, title_col = NULL, groupname_col = NULL, number_col = NULL, color = FALSE, palette = NULL )
data |
Data frame or sf object with marker data |
title_col |
Title column name, Default: |
groupname_col |
Group column name, Default: |
number_col |
Number column name, Default: |
color |
If |
palette |
palette to use for the group heading fill colors (passed to
|
gt
table (not working)Designed to work with the sfext::read_sf_exif
function. More information
on this approach here
https://elipousson.github.io/posts/2021-03-06-creating-a-key-map-for-photographs-with-r/
tbl_photo_key( data, height = 240, asp = 0.75, photo_col = "photo", title_col = "title", title_size = "large", title_align = "right", number = FALSE, orientation = NULL )
tbl_photo_key( data, height = 240, asp = 0.75, photo_col = "photo", title_col = "title", title_size = "large", title_align = "right", number = FALSE, orientation = NULL )
data |
sf object or data frame with photo column containing the file path or url for photos. |
height |
The height in pixels of image in table. |
asp |
Aspect ratio of image (width/height) |
photo_col |
Photo path/url column name. |
title_col |
Title/description column name. |
title_size |
Title text size, Default: 'large' |
title_align |
Title tex alignment, Default: 'right' |
number |
If |
orientation |
Orientation to filter by if data contains image_width and image_height columns. |
Function naming convention inspired by the gtsummary package https://www.danieldsjoberg.com/gtsummary/index.html