Skip to content

Commit

Permalink
ready for v1.1.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
tomroh committed Aug 18, 2023
1 parent 197f07f commit 189112a
Show file tree
Hide file tree
Showing 90 changed files with 3,864 additions and 526 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ inst/examples/recipes.html
inst/examples/recipes.gfm.md
inst/examples/test.html
inst/examples/img
inst/examples/recipes.md
inst/examples/viz-test.R
inst/examples/gen-symbol-svg.R
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: leaflegend
Type: Package
Title: Add Custom Legends to 'leaflet' Maps
Version: 1.1.0
Version: 1.1.1
Authors@R: c(
person("Thomas", "Roh", email = "thomas@roh.engineering", role = c("aut", "cre")),
person("Ricardo Rodrigo", "Basa", email = "radbasa@gmail.com", role = c("ctb")))
Expand All @@ -18,7 +18,7 @@ Imports:
stats,
base64enc,
htmlwidgets
RoxygenNote: 7.2.2
RoxygenNote: 7.2.3
URL: https://leaflegend.roh.engineering, https://github.com/tomroh/leaflegend
BugReports: https://github.com/tomroh/leaflegend/issues
Suggests:
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# leaflegend 1.1.1

* updating test for 'leaflet' changes in v2.2.0

* pch solid symbols 15-20 will use `color` if `fillColor` is missing

# leaflegend 1.1.0

* `availableShapes` is provided for convenience to look up supported symbol
Expand Down
17 changes: 11 additions & 6 deletions R/legend.R
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ pchSvg <- function(shape, width, height, color, fillColor, opacity,
if ( 'stroke-width' %in% names(list(...)) ) {
strokeWidth <- list(...)[['stroke-width']]
}
# TODO: handle 15-20, contains solid
# if missing fillColor, use color
pchShape <-
list(
'open-rect' = htmltools::tags$g(
Expand Down Expand Up @@ -741,7 +743,7 @@ pchSvg <- function(shape, width, height, color, fillColor, opacity,
height = height,
width = width,
stroke = 'transparent',
fill = fillColor,
fill = coalesce_missing(fillColor, color),
'fill-opacity' = fillOpacity,
...
),
Expand All @@ -751,7 +753,7 @@ pchSvg <- function(shape, width, height, color, fillColor, opacity,
cy = height / 2 + strokeWidth,
r = height * 3 / 4 / 2,
stroke = 'transparent',
fill = fillColor,
fill = coalesce_missing(fillColor, color),
'fill-opacity' = fillOpacity,
...
),
Expand All @@ -760,7 +762,7 @@ pchSvg <- function(shape, width, height, color, fillColor, opacity,
points = drawTriangle(width = width, height = height,
offset = strokeWidth),
stroke = 'transparent',
fill = fillColor,
fill = coalesce_missing(fillColor, color),
'fill-opacity' = fillOpacity,
...
),
Expand All @@ -769,7 +771,7 @@ pchSvg <- function(shape, width, height, color, fillColor, opacity,
points = drawDiamond(width = width, height = height,
offset = strokeWidth),
stroke = 'transparent',
fill = fillColor,
fill = coalesce_missing(fillColor, color),
'fill-opacity' = fillOpacity,
...
),
Expand All @@ -779,7 +781,7 @@ pchSvg <- function(shape, width, height, color, fillColor, opacity,
cy = height / 2 + strokeWidth,
r = height * 4 / 4 / 2,
stroke = 'transparent',
fill = fillColor,
fill = coalesce_missing(fillColor, color),
'fill-opacity' = fillOpacity,
...
),
Expand All @@ -789,7 +791,7 @@ pchSvg <- function(shape, width, height, color, fillColor, opacity,
cy = height / 2 + strokeWidth,
r = height * 2 / 4 / 2,
stroke = 'transparent',
fill = fillColor,
fill = coalesce_missing(fillColor, color),
'fill-opacity' = fillOpacity,
...
),
Expand Down Expand Up @@ -858,6 +860,9 @@ pchSvg <- function(shape, width, height, color, fillColor, opacity,
}
pchShape[[shape]]
}
coalesce_missing <- function(x, y) {
if (missing(x)) y else x
}
#' @param svg
#'
#' inner svg tags for symbol
Expand Down
8 changes: 4 additions & 4 deletions docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 189112a

Please sign in to comment.