Skip to content

Commit

Permalink
Rename {gguidance} to {legendry} (#25)
Browse files Browse the repository at this point in the history
* Rename infrastructural parts

* rename ggproto doc

* rename theme settings

* rename remaining remnants

* rebuild readme
  • Loading branch information
teunbrand authored Oct 8, 2024
1 parent 7ced72e commit 8812c62
Show file tree
Hide file tree
Showing 48 changed files with 230 additions and 228 deletions.
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
^gguidance\.Rproj$
^legendry\.Rproj$
^\.Rproj\.user$
^LICENSE\.md$
^README\.Rmd$
Expand Down
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Package: gguidance
Package: legendry
Title: Extended guide options for 'ggplot2'
Version: 0.0.0.9001
Authors@R:
Expand All @@ -15,8 +15,8 @@ Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
Config/testthat/edition: 3
VignetteBuilder: knitr
URL: https://teunbrand.github.io/gguidance/,
https://github.com/teunbrand/gguidance
URL: https://teunbrand.github.io/legendry/,
https://github.com/teunbrand/legendry
Depends:
ggplot2 (>= 3.5.0),
R (>= 4.1.0)
Expand Down
6 changes: 4 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# gguidance 0.0.0.9001
# legendry 0.0.0.9001

Renamed {gguidance} to {legendry}.

Restarted package from scratch, using a different approach.

Expand All @@ -8,7 +10,7 @@ Thanks to the following people for catching and reporting early bugs:

## Mechanism

The crux in gguidance is that you combine a 'key', that contains instructions
The crux in legendry is that you combine a 'key', that contains instructions
on which values are represented, with a 'guide' that controls how these values
are represented.

Expand Down
4 changes: 2 additions & 2 deletions R/compose-.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ new_compose <- function(guides, args = list(), ...,
# Class -------------------------------------------------------------------

#' @export
#' @rdname gguidance_extensions
#' @rdname legendry_extensions
#' @format NULL
#' @usage NULL
Compose <- ggproto(
Expand All @@ -63,7 +63,7 @@ Compose <- ggproto(
key = NULL, angle = waiver()
),

elements = list(spacing = "gguidance.guide.spacing"),
elements = list(spacing = "legendry.guide.spacing"),

train = function(self, params = self$params, scale, aesthetic = NULL,
title = waiver(), ...) {
Expand Down
2 changes: 1 addition & 1 deletion R/compose-crux.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ compose_crux <- function(
# Class -------------------------------------------------------------------

#' @export
#' @rdname gguidance_extensions
#' @rdname legendry_extensions
#' @format NULL
#' @usage NULL
ComposeCrux <- ggproto(
Expand Down
2 changes: 1 addition & 1 deletion R/compose-ontop.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ compose_ontop <- function(
# Class -------------------------------------------------------------------

#' @export
#' @rdname gguidance_extensions
#' @rdname legendry_extensions
#' @format NULL
#' @usage NULL
ComposeOntop <- ggproto(
Expand Down
2 changes: 1 addition & 1 deletion R/compose-sandwich.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ compose_sandwich <- function(
# Class -------------------------------------------------------------------

#' @export
#' @rdname gguidance_extensions
#' @rdname legendry_extensions
#' @format NULL
#' @usage NULL
ComposeSandwich <- ggproto(
Expand Down
8 changes: 4 additions & 4 deletions R/compose-stack.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ compose_stack <- function(
# Class -------------------------------------------------------------------

#' @export
#' @rdname gguidance_extensions
#' @rdname legendry_extensions
#' @format NULL
#' @usage NULL
ComposeStack <- ggproto(
Expand All @@ -73,9 +73,9 @@ ComposeStack <- ggproto(
),

elements = list(
side_titles = "gguidance.axis.subtitle",
side_position = "gguidance.axis.subtitle.position",
spacing = "gguidance.guide.spacing"
side_titles = "legendry.axis.subtitle",
side_position = "legendry.axis.subtitle.position",
spacing = "legendry.guide.spacing"
),

train = function(self, params = self$params, scale, aesthetic = NULL, ...) {
Expand Down
2 changes: 1 addition & 1 deletion R/gizmo-barcap.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ gizmo_barcap <- function(key = "sequence", shape = "triangle", size = NULL,
# Class -------------------------------------------------------------------

#' @export
#' @rdname gguidance_extensions
#' @rdname legendry_extensions
#' @format NULL
#' @usage NULL
GizmoBarcap <- ggproto(
Expand Down
2 changes: 1 addition & 1 deletion R/gizmo-density.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ gizmo_density <- function(
# Class -------------------------------------------------------------------

#' @export
#' @rdname gguidance_extensions
#' @rdname legendry_extensions
#' @format NULL
#' @usage NULL
GizmoDensity <- ggproto(
Expand Down
2 changes: 1 addition & 1 deletion R/gizmo-grob.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ gizmo_grob <- function(
# Class -------------------------------------------------------------------

#' @export
#' @rdname gguidance_extensions
#' @rdname legendry_extensions
#' @format NULL
#' @usage NULL
GizmoGrob <- ggproto(
Expand Down
2 changes: 1 addition & 1 deletion R/gizmo-histogram.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ gizmo_histogram <- function(
# Class -------------------------------------------------------------------

#' @export
#' @rdname gguidance_extensions
#' @rdname legendry_extensions
#' @format NULL
#' @usage NULL
GizmoHistogram <- ggproto(
Expand Down
2 changes: 1 addition & 1 deletion R/gizmo-stepcap.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ gizmo_stepcap <- function(key = "bins", shape = "triangle", size = NULL, show =
# Class -------------------------------------------------------------------

#' @export
#' @rdname gguidance_extensions
#' @rdname legendry_extensions
#' @format NULL
#' @usage NULL
GizmoStepcap <- ggproto(
Expand Down
4 changes: 2 additions & 2 deletions R/guide_axis_base.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ guide_axis_base <- function(
cap = "none", bidi = FALSE, order = 0, position = waiver()
) {
theme <- theme %||% theme()
theme$gguidance.guide.spacing <-
theme$gguidance.guide.spacing %||% unit(0, "cm")
theme$legendry.guide.spacing <-
theme$legendry.guide.spacing %||% unit(0, "cm")

compose_stack(
primitive_line(cap = cap, position = position),
Expand Down
4 changes: 2 additions & 2 deletions R/guide_axis_nested.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ guide_axis_nested <- function(
) {

theme <- theme %||% theme()
theme$gguidance.guide.spacing <-
theme$gguidance.guide.spacing %||% unit(0, "cm")
theme$legendry.guide.spacing <-
theme$legendry.guide.spacing %||% unit(0, "cm")

nesting <- switch(
arg_match0(type, c("bracket", "box", "fence")),
Expand Down
2 changes: 1 addition & 1 deletion R/guide_colring.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ guide_colring <- function(
# Class -------------------------------------------------------------------

#' @export
#' @rdname gguidance_extensions
#' @rdname legendry_extensions
#' @format NULL
#' @usage NULL
GuideColring <- ggproto(
Expand Down
10 changes: 5 additions & 5 deletions R/gguidance-package.R → R/legendry-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@
## usethis namespace: end
NULL

#' @name gguidance_extensions
#' @title `ggproto` objects in \pkg{gguidance}
#' @name legendry_extensions
#' @title `ggproto` objects in \pkg{legendry}
#'
#' @description The \pkg{gguidance} package relies on an extension system of
#' @description The \pkg{legendry} package relies on an extension system of
#' \pkg{ggplot2} through [`ggproto`][ggplot2::ggproto] class objects, which
#' allow cross-package inheritance of objects such as geoms, stats, facets,
#' scales and coordinate systems. For the purpose of making plots, users are
#' invited to wholly ignore these objects, since interacting with these
#' objects is preferred through various constructor functions. The
#' \pkg{gguidance} package introduces a new `<Guide>` ggproto class to support
#' \pkg{legendry} package introduces a new `<Guide>` ggproto class to support
#' variations on axes, legends and colourbars.
#'
#' @seealso The documentation over at [`ggproto`][ggplot2::ggproto()].
#' @keywords internal
NULL

#' @name common_parameters
#' @title common parameters in \pkg{gguidance}
#' @title common parameters in \pkg{legendry}
#'
#' @description
#' This is a collection of common parameters so they needn't be re-documented
Expand Down
8 changes: 4 additions & 4 deletions R/primitive-box.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#'
#' Common to both types is the following:
#'
#' * `gguidance.box` an [`<element_rect>`][ggplot2::element_rect] for the boxes
#' * `legendry.box` an [`<element_rect>`][ggplot2::element_rect] for the boxes
#' to draw.
#'
#' ## As an axis guide
Expand Down Expand Up @@ -96,7 +96,7 @@ primitive_box <- function(
# Class -------------------------------------------------------------------

#' @export
#' @rdname gguidance_extensions
#' @rdname legendry_extensions
#' @format NULL
#' @usage NULL
PrimitiveBox <- ggproto(
Expand All @@ -111,8 +111,8 @@ PrimitiveBox <- ggproto(
),

elements = list(
position = list(text = "axis.text", box = I("gguidance.box")),
legend = list(text = "legend.text", box = I("gguidance.box"))
position = list(text = "axis.text", box = I("legendry.box")),
legend = list(text = "legend.text", box = I("legendry.box"))
),

extract_key = range_extract_key,
Expand Down
14 changes: 7 additions & 7 deletions R/primitive-bracket.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
#'
#' Common to both types is the following:
#'
#' * `gguidance.bracket` an [`<element_line>`][ggplot2::element_line] for the
#' * `legendry.bracket` an [`<element_line>`][ggplot2::element_line] for the
#' line used to draw the brackets.
#' * `gguidance.backet.size` a [`<unit>`][grid::unit] setting the space afforded
#' * `legendry.backet.size` a [`<unit>`][grid::unit] setting the space afforded
#' to a bracket.
#'
#' ## As an axis guide
Expand Down Expand Up @@ -115,7 +115,7 @@ primitive_bracket <- function(
# Class -------------------------------------------------------------------

#' @export
#' @rdname gguidance_extensions
#' @rdname legendry_extensions
#' @format NULL
#' @usage NULL
PrimitiveBracket <- ggproto(
Expand All @@ -131,12 +131,12 @@ PrimitiveBracket <- ggproto(

elements = list(
position = list(
text = "axis.text", line = I("gguidance.bracket"),
size = I("gguidance.bracket.size")
text = "axis.text", line = I("legendry.bracket"),
size = I("legendry.bracket.size")
),
legend = list(
text = "legend.text", line = I("gguidance.bracket"),
size = I("gguidance.bracket.size")
text = "legend.text", line = I("legendry.bracket"),
size = I("legendry.bracket.size")
)
),

Expand Down
14 changes: 7 additions & 7 deletions R/primitive-fence.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
#'
#' Common to both types is the following:
#'
#' * `gguidance.fence.post` an [`<element_line>`][ggplot2::element_line] for the
#' * `legendry.fence.post` an [`<element_line>`][ggplot2::element_line] for the
#' line used to draw the pieces orthogonal to the direction of the scale.
#' * `gguidance.fence.rail` an [`<element_line>`][ggplot2::element_line] for the
#' * `legendry.fence.rail` an [`<element_line>`][ggplot2::element_line] for the
#' line used to draw the pieces parallel to the direction of the scale.
#'
#' ## As an axis guide
Expand Down Expand Up @@ -113,7 +113,7 @@ primitive_fence <- function(
# Class -------------------------------------------------------------------

#' @export
#' @rdname gguidance_extensions
#' @rdname legendry_extensions
#' @format NULL
#' @usage NULL
PrimitiveFence <- ggproto(
Expand All @@ -131,13 +131,13 @@ PrimitiveFence <- ggproto(
elements = list(
position = list(
text = "axis.text",
post = I("gguidance.fence.post"),
rail = I("gguidance.fence.rail")
post = I("legendry.fence.post"),
rail = I("legendry.fence.rail")
),
legend = list(
text = "legend.text",
post = I("gguidance.fence.post"),
rail = I("gguidance.fence.rail")
post = I("legendry.fence.post"),
rail = I("legendry.fence.rail")
)
),

Expand Down
2 changes: 1 addition & 1 deletion R/primitive-labels.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ primitive_labels <- function(key = NULL, angle = waiver(), n.dodge = 1,
# Class -------------------------------------------------------------------

#' @export
#' @rdname gguidance_extensions
#' @rdname legendry_extensions
#' @format NULL
#' @usage NULL
PrimitiveLabels <- ggproto(
Expand Down
2 changes: 1 addition & 1 deletion R/primitive-line.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ primitive_line <- function(key = NULL, cap = "none", theme = NULL,
# Class -------------------------------------------------------------------

#' @export
#' @rdname gguidance_extensions
#' @rdname legendry_extensions
#' @format NULL
#' @usage NULL
PrimitiveLine <- ggproto(
Expand Down
6 changes: 3 additions & 3 deletions R/primitive-spacer.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#' this guide. This guide does not have option dependent on its role as axis or
#' legend.
#'
#' * `gguidance.guide.spacing` A [`<unit>`][grid::unit] setting the amount of
#' * `legendry.guide.spacing` A [`<unit>`][grid::unit] setting the amount of
#' spacing when the `space` argument is `NULL`.
#'
#' @examples
Expand All @@ -41,7 +41,7 @@ primitive_spacer <- function(space = NULL, title = waiver(),
# Class -------------------------------------------------------------------

#' @export
#' @rdname gguidance_extensions
#' @rdname legendry_extensions
#' @format NULL
#' @usage NULL
PrimitiveSpacer <- ggproto(
Expand All @@ -63,7 +63,7 @@ PrimitiveSpacer <- ggproto(
draw = function(self, theme, position = NULL, direction = NULL,
params = self$params) {
space <- params$space %||%
calc_element("gguidance.guide.spacing", theme + params$theme)
calc_element("legendry.guide.spacing", theme + params$theme)
primitive_grob(
zeroGrob(), sum(space), params$position %||% position, "spacer"
)
Expand Down
Loading

0 comments on commit 8812c62

Please sign in to comment.