From 7d688507447fb408db34bbd24b94f614485ae2b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Souchet=20C=C3=A9line?= Date: Fri, 8 Sep 2023 10:43:18 +0200 Subject: [PATCH 01/10] - Refactor how to build the style for the overlay - 'create_style' becomes 'create_overlay_style' --- R/bpmnVisualizationR.R | 29 +++++++------ R/funs.R | 96 +++++++++++++++++++++++++----------------- 2 files changed, 75 insertions(+), 50 deletions(-) diff --git a/R/bpmnVisualizationR.R b/R/bpmnVisualizationR.R index 61779be..083cba0 100644 --- a/R/bpmnVisualizationR.R +++ b/R/bpmnVisualizationR.R @@ -38,10 +38,10 @@ #' # Load the BPMN file #' bpmn_file <- system.file("examples/Order_Management.bpmn", package = "bpmnVisualizationR") #' -#' # Display the BPMN diagram +#' # Example 1: Display the BPMN diagram #' bpmnVisualizationR::display(bpmn_file, width='auto', height='auto') #' -#' # Display the BPMN diagram featuring overlays with their default positions and styles +#' # Example 2: Display the BPMN diagram featuring overlays with their default positions and styles #' overlays <- list( #' bpmnVisualizationR::create_overlay("start_event_1_1", "42"), #' bpmnVisualizationR::create_overlay("sequence_flow_1_1", "42"), @@ -49,6 +49,7 @@ #' bpmnVisualizationR::create_overlay("sequence_flow_1_2", "8"), #' bpmnVisualizationR::create_overlay("call_activity_1_1", "7") #' ) +#' #' bpmnVisualizationR::display( #' bpmn_file, #' overlays, @@ -56,17 +57,19 @@ #' height='auto' #' ) #' -#' # Display the BPMN diagram featuring overlays using custom styles and positions -#' taskStyle <- bpmnVisualizationR::create_style( -#' font = bpmnVisualizationR::create_font(color = 'DarkSlateGray', size = 23), -#' fill = bpmnVisualizationR::create_fill(color = 'MistyRose'), -#' stroke = bpmnVisualizationR::create_stroke(color = 'Red') +#' # Example 3: Display the BPMN diagram featuring overlays using custom styles and positions +#' taskStyle <- bpmnVisualizationR::create_overlay_style( +#' font_color = 'DarkSlateGray', +#' font_size = 23, +#' fill_color = 'MistyRose', +#' stroke_color = 'Red' #' ) #' -#' flowStyle <- bpmnVisualizationR::create_style( -#' font = bpmnVisualizationR::create_font(color = 'WhiteSmoke', size = 19), -#' fill = bpmnVisualizationR::create_fill(color = 'Teal'), -#' stroke = bpmnVisualizationR::create_stroke(color = 'SpringGreen') +#' flowStyle <- bpmnVisualizationR::create_overlay_style( +#' font_color = 'WhiteSmoke', +#' font_size = 19, +#' fill_color = 'Teal', +#' stroke_color = 'SpringGreen' #' ) #' #' overlays <- list( @@ -78,13 +81,15 @@ #' ) #' bpmnVisualizationR::display(bpmn_file, overlays, width='auto', height='auto') #' -#' # Display the BPMN diagram featuring overlays, but exclude their default styles and positions +#' # Example 4: Display the BPMN diagram featuring overlays, +#' # but exclude their default styles and positions #' overlays <- list( #' bpmnVisualizationR::create_overlay("start_event_1_1", "42", position = "middle-left"), #' bpmnVisualizationR::create_overlay("sequence_flow_1_1", "42", flowStyle, "end"), #' bpmnVisualizationR::create_overlay("task_1_1", "9", taskStyle, "bottom-right"), #' bpmnVisualizationR::create_overlay("sequence_flow_1_2", "8", position = 'start') #' ) +#' #' bpmnVisualizationR::display( #' bpmn_file, #' overlays, diff --git a/R/funs.R b/R/funs.R index 8da3cc8..4e13e4c 100644 --- a/R/funs.R +++ b/R/funs.R @@ -17,7 +17,17 @@ #' Use these constants as the \code{position} argument in the \code{\link{create_overlay}} function. #' #' @export -overlay_shape_position <- c("top-left", "top-right", "top-center", "bottom-left", "bottom-right", "bottom-center", "middle-left", "middle-right") +overlay_shape_position <- + c( + "top-left", + "top-right", + "top-center", + "bottom-left", + "bottom-right", + "bottom-center", + "middle-left", + "middle-right" + ) #' @title The overlay positions on \code{Edge} #' @@ -47,7 +57,7 @@ overlay_edge_position <- c("start", "end", "middle") #' @param elementId The bpmn element id to which the overlay will be attached #' @param label 'HTML' element to use as an overlay #' @param style The style of the overlay. -#' Use \code{\link{create_style}} function to create the style object of an overlay and be aware of the `enableDefaultOverlayStyle` parameter in the \code{\link{display}} function. +#' Use \code{\link{create_overlay_style}} function to create the style object of an overlay and be aware of the `enableDefaultOverlayStyle` parameter in the \code{\link{display}} function. #' @param position The position of the overlay #' If the bpmn element where the overlay will be attached is a Shape, use \code{\link{overlay_shape_position}}. #' Otherwise, use \code{\link{overlay_edge_position}}. @@ -56,27 +66,33 @@ overlay_edge_position <- c("start", "end", "middle") #' #' @examples #' # Create an overlay with shape position "top-left" +#' overlay_style <- create_overlay_style( +#' font_color = 'DarkSlateGray', +#' font_size = 23, +#' fill_color = 'MistyRose', +#' stroke_color = 'Red' +#' ) +#' #' overlay <- create_overlay( -#' "my-element-id", -#' "My Overlay Label", -#' create_style( -#' font = create_font(color = 'DarkSlateGray', size = 23), -#' fill = create_fill(color = 'MistyRose'), -#' stroke = create_stroke(color = 'Red') -#' ), -#' overlay_shape_position[1] +#' "my-shape-id", +#' "My Overlay Label", +#' style = overlay_style, +#' position = overlay_shape_position[1] #' ) #' #' # Create an overlay with edge position "end" +#' overlay_style <- create_overlay_style( +#' font_color = 'DarkSlateGray', +#' font_size = 23, +#' fill_color = 'MistyRose', +#' stroke_color = 'Red' +#' ) +#' #' overlay <- create_overlay( -#' "my-edge-id", -#' "My Overlay Label", -#' create_style( -#' font = create_font(color = 'DarkSlateGray', size = 23), -#' fill = create_fill(color = 'MistyRose'), -#' stroke = create_stroke(color = 'Red') -#' ), -#' overlay_edge_position[2] +#' "my-edge-id", +#' "My Overlay Label", +#' style = overlay_style, +#' position = overlay_edge_position[2] #' ) #' #' @export @@ -102,7 +118,7 @@ create_overlay <- function(elementId, label, style = NULL, position = NULL) { #' @title Create the style of an overlay #' -#' @name create_style +#' @name create_overlay_style #' @description #' When adding an overlay to an existing element in a diagram, it's possible to customize its style. #' @@ -110,32 +126,36 @@ create_overlay <- function(elementId, label, style = NULL, position = NULL) { #' #' Use this function to create the correct style structure for an overlay. #' -#' @param font The font style of the overlay -#' Use \code{\link{create_font}} function to create the font style object for the overlay. -#' @param fill The fill style of the overlay -#' Use \code{\link{create_fill}} function to create the fill style object for the overlay. -#' @param stroke The stroke style of the overlay -#' Use \code{\link{create_stroke}} function to create the stroke style object for the overlay. +#' @param font_color The font color of the overlay. Use a custom color string. +#' @param font_size The font size of the overlay. Specify a numeric font size. +#' @param fill_color The color of the background of the overlay. Use a custom color string. +#' @param stroke_color The color of the stroke of the overlay. Use a custom color string. +#' If you don't want to display a stroke, you can set the color to: +#' - \code{transparent}, +#' - the same value as for the \code{fill_color}. This increases the \code{padding}/\code{margin}. #' #' @returns The style object of the overlay #' #' @export -create_style <- function(font = NULL, fill = NULL, stroke = NULL) { +create_overlay_style <- function(font_color = NULL, + font_size = NULL, + fill_color = NULL, + stroke_color = NULL) { ret <- .not_null_list( - font = font, - fill = fill, - stroke = stroke + font = create_font(color = font_color, size = font_size), + fill = create_fill(fill_color), + stroke = create_stroke(stroke_color) ) } -#' @title Create the font style of an overlay +#' @title Internal fun to create the font style of an overlay #' #' @name create_font #' @description #' When adding an overlay to an existing element in a diagram, it's possible to customize its font style. #' -#' Refer to the \code{font} parameter in the \code{\link{create_style}} function for more information. +#' Refer to the \code{font} parameter in the \code{\link{create_overlay_style}} function for more information. #' #' Use this function to create the correct font structure for an overlay. #' @@ -144,7 +164,7 @@ create_style <- function(font = NULL, fill = NULL, stroke = NULL) { #' #' @returns The font style object of the overlay #' -#' @export +#' @noRd create_font <- function(color = NULL, size = NULL) { ret <- .not_null_list( @@ -153,13 +173,13 @@ create_font <- function(color = NULL, size = NULL) { ) } -#' @title Create the fill style of an overlay +#' @title Internal fun to create the fill style of an overlay #' #' @name create_fill #' @description #' When adding an overlay to an existing element in a diagram, it's possible to customize how it is filled. #' -#' Refer to the \code{fill} parameter in the \code{\link{create_style}} function for more information. +#' Refer to the \code{fill} parameter in the \code{\link{create_overlay_style}} function for more information. #' #' Use this function to create the correct fill structure for an overlay. #' @@ -167,7 +187,7 @@ create_font <- function(color = NULL, size = NULL) { #' #' @returns The fill style object of the overlay #' -#' @export +#' @noRd create_fill <- function(color) { ret <- .not_null_list( @@ -175,13 +195,13 @@ create_fill <- function(color) { ) } -#' @title Create the stroke style of an overlay +#' @title Internal fun to create the stroke style of an overlay #' #' @name create_stroke #' @description #' When adding an overlay to an existing element in a diagram, it's possible to customize its stroke. style. #' -#' Refer to the \code{stroke.} parameter in the \code{\link{create_style}} function for more information. +#' Refer to the \code{stroke.} parameter in the \code{\link{create_overlay_style}} function for more information. #' #' Use this function to create the correct stroke structure for an overlay. #' @@ -189,7 +209,7 @@ create_fill <- function(color) { #' #' @returns The stroke style object of the overlay #' -#' @export +#' @noRd create_stroke <- function(color) { ret <- .not_null_list( From 8aa44fc202f2ee9bd032f95f9c5af88522c18480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Souchet=20C=C3=A9line?= Date: Fri, 8 Sep 2023 10:43:47 +0200 Subject: [PATCH 02/10] update the tests --- tests/testthat/test-funs.R | 217 ++++++++++++++++++++----------------- 1 file changed, 115 insertions(+), 102 deletions(-) diff --git a/tests/testthat/test-funs.R b/tests/testthat/test-funs.R index fa08649..ec51e75 100644 --- a/tests/testthat/test-funs.R +++ b/tests/testthat/test-funs.R @@ -1,7 +1,7 @@ describe("create_overlay works", { test_that("with label, style and position", { res <- create_overlay("xyz", "this", "my style", "start") - + expect_true(length(res) == 4) expect_named(res, c("elementId", "label", "style", "position")) expect_equal(res$elementId, "xyz") @@ -9,140 +9,153 @@ describe("create_overlay works", { expect_equal(res$style, "my style") expect_equal(res$position, "start") }) - + test_that("with no label, style and position", { res <- create_overlay("this", NULL, "my style", "middle") - + expect_true(length(res) == 3) - expect_named(res, c("elementId", "style", "position")) + expect_named(res, c("elementId", "style", "position")) expect_equal(res$elementId, "this") expect_equal(res$style, "my style") expect_equal(res$position, "middle") }) - + test_that("with label, no style, and position", { res <- create_overlay("this", "my label", NULL, "top-center") - + expect_true(length(res) == 3) expect_named(res, c("elementId", "label", "position")) expect_equal(res$elementId, "this") expect_equal(res$label, "my label") expect_equal(res$position, "top-center") }) - + test_that("with label, style, and no position", { res <- create_overlay("this", "my label", "my style", NULL) - + expect_true(length(res) == 3) expect_named(res, c("elementId", "label", "style")) expect_equal(res$elementId, "this") expect_equal(res$label, "my label") expect_equal(res$style, "my style") }) - + test_that("throws an exception when position is not valid", { expect_error( - create_overlay("this", "my label", "my style", position = "invalid_position"), + create_overlay("this", "my label", "my style", position = "invalid_position"), "position must be" ) }) }) -describe("create_style works", { - test_that("with font, fill and stroke", { - res <- create_style("my font", "my fill", "my stroke") - - expect_true(length(res) == 3) +describe("create_overlay_style works", { + test_that("with font, fill, and stroke", { + res <- create_overlay_style( + font_color = "my font color", + font_size = "my font size", + fill_color = "my fill color", + stroke_color = "my stroke color" + ) + + expect_type(res, "list") + expect_length(res, 3) expect_named(res, c("font", "fill", "stroke")) - expect_equal(res$font, "my font") - expect_equal(res$fill, "my fill") - expect_equal(res$stroke, "my stroke") - }) - - test_that("with no font, fill and stroke", { - res <- create_style(NULL, "my fill", "my stroke") - - expect_true(length(res) == 2) + + expect_equal(res$font, list(color = "my font color", size = "my font size")) + expect_equal(res$fill, list(color = "my fill color")) + expect_equal(res$stroke, list(color = "my stroke color")) + }) + + test_that("with no font, fill, and stroke", { + res <- create_overlay_style(fill_color = "my fill color", stroke_color = "my stroke color") + + expect_type(res, "list") + expect_length(res, 2) expect_named(res, c("fill", "stroke")) - expect_equal(res$fill, "my fill") - expect_equal(res$stroke, "my stroke") + + expect_equal(res$fill, list(color = "my fill color")) + expect_equal(res$stroke, list(color = "my stroke color")) }) - + test_that("with font, no fill, and stroke", { - res <- create_style("my font", NULL, "my stroke") - - expect_true(length(res) == 2) + res <- create_overlay_style( + font_color = "my font color", + font_size = "my font size", + fill_color = NULL, + stroke_color = "my stroke color" + ) + + expect_type(res, "list") + expect_length(res, 2) expect_named(res, c("font", "stroke")) - expect_equal(res$font, "my font") - expect_equal(res$stroke, "my stroke") + + expect_equal(res$font, list(color = "my font color", size = "my font size")) + expect_equal(res$stroke, list(color = "my stroke color")) }) - - test_that("with font, fill and no stroke", { - res <- create_style("my font", "my fill", NULL) - - expect_true(length(res) == 2) + + test_that("with font, fill, and no stroke", { + res <- create_overlay_style( + font_color = "my font color", + font_size = "my font size", + fill_color = "my fill color", + stroke_color = NULL + ) + + expect_type(res, "list") + expect_length(res, 2) expect_named(res, c("font", "fill")) - expect_equal(res$font, "my font") - expect_equal(res$fill, "my fill") + + expect_equal(res$font, list(color = "my font color", size = "my font size")) + expect_equal(res$fill, list(color = "my fill color")) }) -}) -describe("create_font works", { - test_that("with color and size", { - res <- create_font("my color", "my size") - - expect_true(length(res) == 2) - expect_named(res, c("color", "size")) - expect_equal(res$color, "my color") - expect_equal(res$size, "my size") - }) - - test_that("with no color, and size", { - res <- create_font(NULL, "my size") - - expect_true(length(res) == 1) - expect_named(res, c("size")) - expect_equal(res$size, "my size") - }) - - test_that("with color and no stroke", { - res <- create_font("my color", NULL) - - expect_true(length(res) == 1) - expect_named(res, c("color")) + test_that("with only font_color", { + res <- create_overlay_style(font_color = "my font color") + + expect_type(res, "list") + expect_length(res, 1) + expect_named(res, c("font")) + + expect_equal(res$font, list(color = "my font color")) }) -}) -describe("create_fill works", { - test_that("with color", { - res <- create_fill("my color") - - expect_true(length(res) == 1) - expect_named(res, c("color")) - expect_equal(res$color, "my color") + test_that("with only font_size", { + res <- create_overlay_style(font_size = "my font size") + + expect_type(res, "list") + expect_length(res, 1) + expect_named(res, c("font")) + + expect_equal(res$font, list(size = "my font size")) }) - - test_that("with no color", { - res <- create_fill(NULL) - - expect_true(length(res) == 0) + + test_that("with only fill_color", { + res <- create_overlay_style(fill_color = "my fill color") + + expect_type(res, "list") + expect_length(res, 1) + expect_named(res, c("fill")) + + expect_equal(res$fill, list(color = "my fill color")) }) -}) -describe("create_stroke works", { - test_that("with color", { - res <- create_stroke("my color") - - expect_true(length(res) == 1) - expect_named(res, c("color")) - expect_equal(res$color, "my color") + test_that("with only stroke_color", { + res <- create_overlay_style(stroke_color = "my stroke color") + + expect_type(res, "list") + expect_length(res, 1) + expect_named(res, c("stroke")) + + expect_equal(res$stroke, list(color = "my stroke color")) }) - - test_that("with no color", { - res <- create_stroke(NULL) - - expect_true(length(res) == 0) + + test_that("with no arguments", { + res <- create_overlay_style() + + expect_type(res, "list") + expect_length(res, 0) }) + }) describe("build_bpmnContent works", { @@ -153,11 +166,11 @@ describe("build_bpmnContent works", { ), enableDefaultOverlayStyle = TRUE ) - + expect_true(length(res) == 2) - expect_named(res, c("bpmnContent", "enableDefaultOverlayStyle")) + expect_named(res, c("bpmnContent", "enableDefaultOverlayStyle")) }) - + test_that("with xml_doc and overlays", { res <- build_bpmnContent( xml2::read_xml( @@ -166,13 +179,13 @@ describe("build_bpmnContent works", { enableDefaultOverlayStyle = FALSE, overlays = "this" ) - + expect_true(length(res) == 3) expect_named(res, c("bpmnContent", "enableDefaultOverlayStyle", "overlays")) - + expect_equal(res$overlays, list("this")) }) - + test_that("with xml_doc and overlays is list", { res <- build_bpmnContent( xml2::read_xml( @@ -184,11 +197,11 @@ describe("build_bpmnContent works", { create_overlay("bpmn_element_id_2", "9") ) ) - + expect_true(length(res) == 3) expect_named(res, c("bpmnContent", "enableDefaultOverlayStyle", "overlays")) }) - + test_that("with character and no overlays", { res <- build_bpmnContent( paste( @@ -199,21 +212,21 @@ describe("build_bpmnContent works", { ), enableDefaultOverlayStyle = TRUE ) - + expect_true(length(res) == 2) expect_named(res, c("bpmnContent", "enableDefaultOverlayStyle")) }) - + test_that("with character and no overlays", { res <- build_bpmnContent( system.file("examples/Email_Voting.bpmn", package = "bpmnVisualizationR"), enableDefaultOverlayStyle = TRUE ) - + expect_true(length(res) == 2) expect_named(res, c("bpmnContent", "enableDefaultOverlayStyle")) }) - + test_that("error", { expect_error(build_bpmnContent(iris)) }) @@ -221,7 +234,7 @@ describe("build_bpmnContent works", { test_that("not_null_list works", { res <- .not_null_list(x = 1, y = NULL) - + expect_true(length(res) == 1) expect_named(res, c("x")) }) \ No newline at end of file From 88ad79c7221388d3a9fbff77a7b69bebca33d50a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Souchet=20C=C3=A9line?= Date: Fri, 8 Sep 2023 10:44:12 +0200 Subject: [PATCH 03/10] Update the documentation --- NAMESPACE | 5 +---- man/create_fill.Rd | 21 ------------------- man/create_font.Rd | 23 --------------------- man/create_overlay.Rd | 40 +++++++++++++++++++++---------------- man/create_overlay_style.Rd | 35 ++++++++++++++++++++++++++++++++ man/create_stroke.Rd | 21 ------------------- man/create_style.Rd | 28 -------------------------- man/display.Rd | 29 ++++++++++++++++----------- 8 files changed, 76 insertions(+), 126 deletions(-) delete mode 100644 man/create_fill.Rd delete mode 100644 man/create_font.Rd create mode 100644 man/create_overlay_style.Rd delete mode 100644 man/create_stroke.Rd delete mode 100644 man/create_style.Rd diff --git a/NAMESPACE b/NAMESPACE index 464c706..1a2ffa4 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,11 +1,8 @@ # Generated by roxygen2: do not edit by hand export(bpmnVisualizationROutput) -export(create_fill) -export(create_font) export(create_overlay) -export(create_stroke) -export(create_style) +export(create_overlay_style) export(display) export(overlay_edge_position) export(overlay_shape_position) diff --git a/man/create_fill.Rd b/man/create_fill.Rd deleted file mode 100644 index e1bded9..0000000 --- a/man/create_fill.Rd +++ /dev/null @@ -1,21 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/funs.R -\name{create_fill} -\alias{create_fill} -\title{Create the fill style of an overlay} -\usage{ -create_fill(color) -} -\arguments{ -\item{color}{The color of the background of the overlay} -} -\value{ -The fill style object of the overlay -} -\description{ -When adding an overlay to an existing element in a diagram, it's possible to customize how it is filled. - -Refer to the \code{fill} parameter in the \code{\link{create_style}} function for more information. - -Use this function to create the correct fill structure for an overlay. -} diff --git a/man/create_font.Rd b/man/create_font.Rd deleted file mode 100644 index 7d87c17..0000000 --- a/man/create_font.Rd +++ /dev/null @@ -1,23 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/funs.R -\name{create_font} -\alias{create_font} -\title{Create the font style of an overlay} -\usage{ -create_font(color = NULL, size = NULL) -} -\arguments{ -\item{color}{The color of the font of the overlay} - -\item{size}{The size of the font of the overlay} -} -\value{ -The font style object of the overlay -} -\description{ -When adding an overlay to an existing element in a diagram, it's possible to customize its font style. - -Refer to the \code{font} parameter in the \code{\link{create_style}} function for more information. - -Use this function to create the correct font structure for an overlay. -} diff --git a/man/create_overlay.Rd b/man/create_overlay.Rd index 91ea382..9db9660 100644 --- a/man/create_overlay.Rd +++ b/man/create_overlay.Rd @@ -12,7 +12,7 @@ create_overlay(elementId, label, style = NULL, position = NULL) \item{label}{'HTML' element to use as an overlay} \item{style}{The style of the overlay. -Use \code{\link{create_style}} function to create the style object of an overlay and be aware of the `enableDefaultOverlayStyle` parameter in the \code{\link{display}} function.} +Use \code{\link{create_overlay_style}} function to create the style object of an overlay and be aware of the `enableDefaultOverlayStyle` parameter in the \code{\link{display}} function.} \item{position}{The position of the overlay If the bpmn element where the overlay will be attached is a Shape, use \code{\link{overlay_shape_position}}. @@ -30,27 +30,33 @@ Use this function to create the correct overlay structure. } \examples{ # Create an overlay with shape position "top-left" +overlay_style <- create_overlay_style( + font_color = 'DarkSlateGray', + font_size = 23, + fill_color = 'MistyRose', + stroke_color = 'Red' +) + overlay <- create_overlay( - "my-element-id", - "My Overlay Label", - create_style( - font = create_font(color = 'DarkSlateGray', size = 23), - fill = create_fill(color = 'MistyRose'), - stroke = create_stroke(color = 'Red') - ), - overlay_shape_position[1] + "my-shape-id", + "My Overlay Label", + style = overlay_style, + position = overlay_shape_position[1] ) # Create an overlay with edge position "end" +overlay_style <- create_overlay_style( + font_color = 'DarkSlateGray', + font_size = 23, + fill_color = 'MistyRose', + stroke_color = 'Red' +) + overlay <- create_overlay( - "my-edge-id", - "My Overlay Label", - create_style( - font = create_font(color = 'DarkSlateGray', size = 23), - fill = create_fill(color = 'MistyRose'), - stroke = create_stroke(color = 'Red') - ), - overlay_edge_position[2] + "my-edge-id", + "My Overlay Label", + style = overlay_style, + position = overlay_edge_position[2] ) } diff --git a/man/create_overlay_style.Rd b/man/create_overlay_style.Rd new file mode 100644 index 0000000..a4e6612 --- /dev/null +++ b/man/create_overlay_style.Rd @@ -0,0 +1,35 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/funs.R +\name{create_overlay_style} +\alias{create_overlay_style} +\title{Create the style of an overlay} +\usage{ +create_overlay_style( + font_color = NULL, + font_size = NULL, + fill_color = NULL, + stroke_color = NULL +) +} +\arguments{ +\item{font_color}{The font color of the overlay. Use a custom color string.} + +\item{font_size}{The font size of the overlay. Specify a numeric font size.} + +\item{fill_color}{The color of the background of the overlay. Use a custom color string.} + +\item{stroke_color}{The color of the stroke of the overlay. Use a custom color string. +If you don't want to display a stroke, you can set the color to: +- \code{transparent}, +- the same value as for the \code{fill_color}. This increases the \code{padding}/\code{margin}.} +} +\value{ +The style object of the overlay +} +\description{ +When adding an overlay to an existing element in a diagram, it's possible to customize its style. + +Refer to the \code{style} parameter in the \code{\link{create_overlay}} function for more information. + +Use this function to create the correct style structure for an overlay. +} diff --git a/man/create_stroke.Rd b/man/create_stroke.Rd deleted file mode 100644 index 8a22ad9..0000000 --- a/man/create_stroke.Rd +++ /dev/null @@ -1,21 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/funs.R -\name{create_stroke} -\alias{create_stroke} -\title{Create the stroke style of an overlay} -\usage{ -create_stroke(color) -} -\arguments{ -\item{color}{The color of the stroke of the overlay} -} -\value{ -The stroke style object of the overlay -} -\description{ -When adding an overlay to an existing element in a diagram, it's possible to customize its stroke. style. - -Refer to the \code{stroke.} parameter in the \code{\link{create_style}} function for more information. - -Use this function to create the correct stroke structure for an overlay. -} diff --git a/man/create_style.Rd b/man/create_style.Rd deleted file mode 100644 index b79d247..0000000 --- a/man/create_style.Rd +++ /dev/null @@ -1,28 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/funs.R -\name{create_style} -\alias{create_style} -\title{Create the style of an overlay} -\usage{ -create_style(font = NULL, fill = NULL, stroke = NULL) -} -\arguments{ -\item{font}{The font style of the overlay -Use \code{\link{create_font}} function to create the font style object for the overlay.} - -\item{fill}{The fill style of the overlay -Use \code{\link{create_fill}} function to create the fill style object for the overlay.} - -\item{stroke}{The stroke style of the overlay -Use \code{\link{create_stroke}} function to create the stroke style object for the overlay.} -} -\value{ -The style object of the overlay -} -\description{ -When adding an overlay to an existing element in a diagram, it's possible to customize its style. - -Refer to the \code{style} parameter in the \code{\link{create_overlay}} function for more information. - -Use this function to create the correct style structure for an overlay. -} diff --git a/man/display.Rd b/man/display.Rd index ef7d5bf..f847210 100644 --- a/man/display.Rd +++ b/man/display.Rd @@ -44,10 +44,10 @@ Display 'BPMN' diagram based on 'BPMN' definition in 'XML' format # Load the BPMN file bpmn_file <- system.file("examples/Order_Management.bpmn", package = "bpmnVisualizationR") -# Display the BPMN diagram +# Example 1: Display the BPMN diagram bpmnVisualizationR::display(bpmn_file, width='auto', height='auto') -# Display the BPMN diagram featuring overlays with their default positions and styles +# Example 2: Display the BPMN diagram featuring overlays with their default positions and styles overlays <- list( bpmnVisualizationR::create_overlay("start_event_1_1", "42"), bpmnVisualizationR::create_overlay("sequence_flow_1_1", "42"), @@ -55,6 +55,7 @@ overlays <- list( bpmnVisualizationR::create_overlay("sequence_flow_1_2", "8"), bpmnVisualizationR::create_overlay("call_activity_1_1", "7") ) + bpmnVisualizationR::display( bpmn_file, overlays, @@ -62,17 +63,19 @@ bpmnVisualizationR::display( height='auto' ) -# Display the BPMN diagram featuring overlays using custom styles and positions -taskStyle <- bpmnVisualizationR::create_style( - font = bpmnVisualizationR::create_font(color = 'DarkSlateGray', size = 23), - fill = bpmnVisualizationR::create_fill(color = 'MistyRose'), - stroke = bpmnVisualizationR::create_stroke(color = 'Red') +# Example 3: Display the BPMN diagram featuring overlays using custom styles and positions +taskStyle <- bpmnVisualizationR::create_overlay_style( + font_color = 'DarkSlateGray', + font_size = 23, + fill_color = 'MistyRose', + stroke_color = 'Red' ) -flowStyle <- bpmnVisualizationR::create_style( - font = bpmnVisualizationR::create_font(color = 'WhiteSmoke', size = 19), - fill = bpmnVisualizationR::create_fill(color = 'Teal'), - stroke = bpmnVisualizationR::create_stroke(color = 'SpringGreen') +flowStyle <- bpmnVisualizationR::create_overlay_style( + font_color = 'WhiteSmoke', + font_size = 19, + fill_color = 'Teal', + stroke_color = 'SpringGreen' ) overlays <- list( @@ -84,13 +87,15 @@ overlays <- list( ) bpmnVisualizationR::display(bpmn_file, overlays, width='auto', height='auto') -# Display the BPMN diagram featuring overlays, but exclude their default styles and positions +# Example 4: Display the BPMN diagram featuring overlays, +# but exclude their default styles and positions overlays <- list( bpmnVisualizationR::create_overlay("start_event_1_1", "42", position = "middle-left"), bpmnVisualizationR::create_overlay("sequence_flow_1_1", "42", flowStyle, "end"), bpmnVisualizationR::create_overlay("task_1_1", "9", taskStyle, "bottom-right"), bpmnVisualizationR::create_overlay("sequence_flow_1_2", "8", position = 'start') ) + bpmnVisualizationR::display( bpmn_file, overlays, From 8b9f721776b355bb6d72fc1777eead1ca56d6698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Souchet=20C=C3=A9line?= Date: Fri, 8 Sep 2023 10:44:26 +0200 Subject: [PATCH 04/10] Update the examples in the readme --- README.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 52f0102..734aa84 100644 --- a/README.md +++ b/README.md @@ -115,11 +115,13 @@ bpmnVisualizationR::display(bpmn_file, overlays) ### Style an overlay ```r -font <- bpmnVisualizationR::create_font(color = 'WhiteSmoke', size = 19) -fill <- bpmnVisualizationR::create_fill(color = 'Teal') -stroke <- bpmnVisualizationR::create_stroke(color = 'SpringGreen') +style <- bpmnVisualizationR::create_overlay_style( + font_color = 'WhiteSmoke', + font_size = 19, + fill_color = 'Teal', + stroke_color = 'SpringGreen' +) -style <- bpmnVisualizationR::create_style(font, fill, stroke) overlay <- bpmnVisualizationR::create_overlay("bpmn_element_id_1", "42", style, "middle-right") ``` @@ -143,10 +145,11 @@ library(shiny) displayBpmn <- function() { bpmn_file <- system.file("examples/Travel_Booking.bpmn", package = "bpmnVisualizationR") - style <- bpmnVisualizationR::create_style( - font = bpmnVisualizationR::create_font(color = 'Black', size = 25), - fill = bpmnVisualizationR::create_fill(color = 'MediumSpringGreen'), - stroke = bpmnVisualizationR::create_stroke(color = 'MediumSpringGreen') + style <- bpmnVisualizationR::create_overlay_style( + font_color = 'Black', + font_size = 25, + fill_color = 'MediumSpringGreen', + stroke_color = 'MediumSpringGreen' ) overlays <- list(bpmnVisualizationR::create_overlay("_6-203", "9", style, "bottom-right")) bpmnVisualizationR::display(bpmn_file, overlays) From 6ad5b9a4e698593564c7814ab03cec71152b4ba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Souchet=20C=C3=A9line?= Date: Fri, 8 Sep 2023 11:22:49 +0200 Subject: [PATCH 05/10] Update doc --- R/funs.R | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/R/funs.R b/R/funs.R index 4e13e4c..a0aa6d2 100644 --- a/R/funs.R +++ b/R/funs.R @@ -149,15 +149,14 @@ create_overlay_style <- function(font_color = NULL, ) } -#' @title Internal fun to create the font style of an overlay +#' @title Internal fun to create the font style of an overlay or a 'BPMN' element #' #' @name create_font #' @description -#' When adding an overlay to an existing element in a diagram, it's possible to customize its font style. -#' -#' Refer to the \code{font} parameter in the \code{\link{create_overlay_style}} function for more information. -#' -#' Use this function to create the correct font structure for an overlay. +#' - Overlay: +#' When adding an overlay to an existing element in a diagram, it's possible to customize its font style. +#' Refer to the \code{font} parameter in the \code{\link{create_overlay_style}} function for more information. +#' Use this function to create the correct font structure for an overlay. #' #' @param color The color of the font of the overlay #' @param size The size of the font of the overlay @@ -173,15 +172,14 @@ create_font <- function(color = NULL, size = NULL) { ) } -#' @title Internal fun to create the fill style of an overlay +#' @title Internal fun to create the fill style of an overlay or a 'BPMN' element #' #' @name create_fill #' @description -#' When adding an overlay to an existing element in a diagram, it's possible to customize how it is filled. -#' -#' Refer to the \code{fill} parameter in the \code{\link{create_overlay_style}} function for more information. -#' -#' Use this function to create the correct fill structure for an overlay. +#' - Overlay: +#' When adding an overlay to an existing element in a diagram, it's possible to customize how it is filled. +#' Refer to the \code{fill} parameter in the \code{\link{create_overlay_style}} function for more information. +#' Use this function to create the correct fill structure for an overlay. #' #' @param color The color of the background of the overlay #' @@ -195,15 +193,14 @@ create_fill <- function(color) { ) } -#' @title Internal fun to create the stroke style of an overlay +#' @title Internal fun to create the stroke style of an overlay or a 'BPMN' element #' #' @name create_stroke #' @description -#' When adding an overlay to an existing element in a diagram, it's possible to customize its stroke. style. -#' -#' Refer to the \code{stroke.} parameter in the \code{\link{create_overlay_style}} function for more information. -#' -#' Use this function to create the correct stroke structure for an overlay. +#' - Overlay: +#' When adding an overlay to an existing element in a diagram, it's possible to customize its stroke. style. +#' Refer to the \code{stroke.} parameter in the \code{\link{create_overlay_style}} function for more information. +#' Use this function to create the correct stroke structure for an overlay. #' #' @param color The color of the stroke of the overlay #' From dccf51d23bcd081057dbd33001acd6e726faee25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Souchet=20C=C3=A9line?= <4921914+csouchet@users.noreply.github.com> Date: Mon, 11 Sep 2023 10:03:55 +0200 Subject: [PATCH 06/10] Apply suggestions from code review Co-authored-by: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> --- R/funs.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/funs.R b/R/funs.R index a0aa6d2..8751535 100644 --- a/R/funs.R +++ b/R/funs.R @@ -149,7 +149,7 @@ create_overlay_style <- function(font_color = NULL, ) } -#' @title Internal fun to create the font style of an overlay or a 'BPMN' element +#' @title Internal function to create the font style of an overlay or a 'BPMN' element #' #' @name create_font #' @description @@ -172,7 +172,7 @@ create_font <- function(color = NULL, size = NULL) { ) } -#' @title Internal fun to create the fill style of an overlay or a 'BPMN' element +#' @title Internal function to create the fill style of an overlay or a 'BPMN' element #' #' @name create_fill #' @description @@ -193,7 +193,7 @@ create_fill <- function(color) { ) } -#' @title Internal fun to create the stroke style of an overlay or a 'BPMN' element +#' @title Internal function to create the stroke style of an overlay or a 'BPMN' element #' #' @name create_stroke #' @description From cb9176745c8fe118b57794ed4c5cedaeea1290d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Souchet=20C=C3=A9line?= Date: Mon, 11 Sep 2023 10:09:56 +0200 Subject: [PATCH 07/10] Improve the documentation --- R/funs.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/funs.R b/R/funs.R index 8751535..7c81a58 100644 --- a/R/funs.R +++ b/R/funs.R @@ -65,7 +65,7 @@ overlay_edge_position <- c("start", "end", "middle") #' @returns An overlay object #' #' @examples -#' # Create an overlay with shape position "top-left" +#' # Example 1: Create an overlay with shape position "top-left" #' overlay_style <- create_overlay_style( #' font_color = 'DarkSlateGray', #' font_size = 23, @@ -80,7 +80,7 @@ overlay_edge_position <- c("start", "end", "middle") #' position = overlay_shape_position[1] #' ) #' -#' # Create an overlay with edge position "end" +#' # Example 2: Create an overlay with edge position "end" #' overlay_style <- create_overlay_style( #' font_color = 'DarkSlateGray', #' font_size = 23, @@ -214,7 +214,7 @@ create_stroke <- function(color) { ) } -#' @description Internal fun to build the 'htmlwidget' content +#' @description Internal function to build the 'htmlwidget' content #' #' @inheritParams display #' @returns A list From 62d9663bc80ed7aaff9cc4af3c4d8c2c26401941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Souchet=20C=C3=A9line?= Date: Mon, 11 Sep 2023 10:17:28 +0200 Subject: [PATCH 08/10] Update the documentation of the parameters of create_overlay_style --- R/funs.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/R/funs.R b/R/funs.R index 7c81a58..6c44402 100644 --- a/R/funs.R +++ b/R/funs.R @@ -126,10 +126,10 @@ create_overlay <- function(elementId, label, style = NULL, position = NULL) { #' #' Use this function to create the correct style structure for an overlay. #' -#' @param font_color The font color of the overlay. Use a custom color string. -#' @param font_size The font size of the overlay. Specify a numeric font size. -#' @param fill_color The color of the background of the overlay. Use a custom color string. -#' @param stroke_color The color of the stroke of the overlay. Use a custom color string. +#' @param font_color The font color of the overlay. Use all HTML color names or HEX codes. +#' @param font_size The font size of the overlay. Specify a number in px. +#' @param fill_color The color of the background of the overlay. Use all HTML color names or HEX codes. +#' @param stroke_color The color of the stroke of the overlay. Use all HTML color names or HEX codes. #' If you don't want to display a stroke, you can set the color to: #' - \code{transparent}, #' - the same value as for the \code{fill_color}. This increases the \code{padding}/\code{margin}. From 41db251ba0ad7ad299ecc41bdc1158998abfaefd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Souchet=20C=C3=A9line?= Date: Mon, 11 Sep 2023 10:27:58 +0200 Subject: [PATCH 09/10] Update the documentation for the overlay position --- R/funs.R | 49 ++++++++++++++++++++++++----------- man/create_overlay.Rd | 4 +-- man/create_overlay_style.Rd | 8 +++--- man/overlay_edge_position.Rd | 23 ++++++++++++---- man/overlay_shape_position.Rd | 32 ++++++++++++++++------- 5 files changed, 80 insertions(+), 36 deletions(-) diff --git a/R/funs.R b/R/funs.R index 6c44402..4208208 100644 --- a/R/funs.R +++ b/R/funs.R @@ -3,18 +3,27 @@ #' @description #' To specify the position when creating an overlay object that will be attached to BPMN \code{Shape} elements in the diagram. #' -#' \code{overlay_shape_position} includes the following positions: +#' @section Positions: +#' \describe{ +#' \item{\code{"top-left"}} +#' \item{\code{"top-right"}} +#' \item{\code{"top-center"}} +#' \item{\code{"bottom-left"}} +#' \item{\code{"bottom-right"}} +#' \item{\code{"bottom-center"}} +#' \item{\code{"middle-left"}} +#' \item{\code{"middle-right"}} +#' } +#' +#' @details +#' Use these constants as the \code{position} argument in the \code{\link{create_overlay}} function. #' -#' - \code{"top-left"} -#' - \code{"top-right"} -#' - \code{"top-center"} -#' - \code{"bottom-left"} -#' - \code{"bottom-right"} -#' - \code{"bottom-center"} -#' - \code{"middle-left"} -#' - \code{"middle-right"} +#' @examples +#' # Create an overlay at the top-left corner of a shape +#' overlay <- create_overlay(elementId = 1, label = "My label", position = overlay_shape_position[1]) #' -#' Use these constants as the \code{position} argument in the \code{\link{create_overlay}} function. +#' @seealso +#' \code{\link{create_overlay}} #' #' @export overlay_shape_position <- @@ -34,13 +43,23 @@ overlay_shape_position <- #' @description #' To specify the position when creating an overlay object that will be attached to BPMN \code{Edge} elements in the diagram. #' -#' \code{overlay_edge_position} includes the following positions: -#' - \code{"start"} -#' - \code{"end"} -#' - \code{"middle"} +#' @section Positions: +#' \describe{ +#' \item{\code{"start"}} +#' \item{\code{"middle"}} +#' \item{\code{"end"}} +#' } #' +#' @details #' Use these constants as the \code{position} argument in the \code{\link{create_overlay}} function. -#' +#' +#' @examples +#' # Create an overlay at the starting point of an edge +#' overlay <- create_overlay(elementId = 1, label = "My label", position = overlay_edge_position[1]) +#' +#' @seealso +#' \code{\link{create_overlay}} +#' #' @export overlay_edge_position <- c("start", "end", "middle") diff --git a/man/create_overlay.Rd b/man/create_overlay.Rd index 9db9660..e9ef687 100644 --- a/man/create_overlay.Rd +++ b/man/create_overlay.Rd @@ -29,7 +29,7 @@ See the \code{overlays} argument in the \code{\link{display}} function. Use this function to create the correct overlay structure. } \examples{ -# Create an overlay with shape position "top-left" +# Example 1: Create an overlay with shape position "top-left" overlay_style <- create_overlay_style( font_color = 'DarkSlateGray', font_size = 23, @@ -44,7 +44,7 @@ overlay <- create_overlay( position = overlay_shape_position[1] ) -# Create an overlay with edge position "end" +# Example 2: Create an overlay with edge position "end" overlay_style <- create_overlay_style( font_color = 'DarkSlateGray', font_size = 23, diff --git a/man/create_overlay_style.Rd b/man/create_overlay_style.Rd index a4e6612..d5d2b68 100644 --- a/man/create_overlay_style.Rd +++ b/man/create_overlay_style.Rd @@ -12,13 +12,13 @@ create_overlay_style( ) } \arguments{ -\item{font_color}{The font color of the overlay. Use a custom color string.} +\item{font_color}{The font color of the overlay. Use all HTML color names or HEX codes.} -\item{font_size}{The font size of the overlay. Specify a numeric font size.} +\item{font_size}{The font size of the overlay. Specify a number in px.} -\item{fill_color}{The color of the background of the overlay. Use a custom color string.} +\item{fill_color}{The color of the background of the overlay. Use all HTML color names or HEX codes.} -\item{stroke_color}{The color of the stroke of the overlay. Use a custom color string. +\item{stroke_color}{The color of the stroke of the overlay. Use all HTML color names or HEX codes. If you don't want to display a stroke, you can set the color to: - \code{transparent}, - the same value as for the \code{fill_color}. This increases the \code{padding}/\code{margin}.} diff --git a/man/overlay_edge_position.Rd b/man/overlay_edge_position.Rd index c7909c9..42fb342 100644 --- a/man/overlay_edge_position.Rd +++ b/man/overlay_edge_position.Rd @@ -12,12 +12,25 @@ overlay_edge_position } \description{ To specify the position when creating an overlay object that will be attached to BPMN \code{Edge} elements in the diagram. +} +\details{ +Use these constants as the \code{position} argument in the \code{\link{create_overlay}} function. +} +\section{Positions}{ + +\describe{ + \item{\code{"start"}} + \item{\code{"middle"}} + \item{\code{"end"}} +} +} -\code{overlay_edge_position} includes the following positions: -- \code{"start"} -- \code{"end"} -- \code{"middle"} +\examples{ +# Create an overlay at the starting point of an edge +overlay <- create_overlay(elementId = 1, label = "My label", position = overlay_edge_position[1]) -Use these constants as the \code{position} argument in the \code{\link{create_overlay}} function. +} +\seealso{ +\code{\link{create_overlay}} } \keyword{datasets} diff --git a/man/overlay_shape_position.Rd b/man/overlay_shape_position.Rd index e926387..04f5c5b 100644 --- a/man/overlay_shape_position.Rd +++ b/man/overlay_shape_position.Rd @@ -12,18 +12,30 @@ overlay_shape_position } \description{ To specify the position when creating an overlay object that will be attached to BPMN \code{Shape} elements in the diagram. +} +\details{ +Use these constants as the \code{position} argument in the \code{\link{create_overlay}} function. +} +\section{Positions}{ -\code{overlay_shape_position} includes the following positions: +\describe{ + \item{\code{"top-left"}} + \item{\code{"top-right"}} + \item{\code{"top-center"}} + \item{\code{"bottom-left"}} + \item{\code{"bottom-right"}} + \item{\code{"bottom-center"}} + \item{\code{"middle-left"}} + \item{\code{"middle-right"}} +} +} -- \code{"top-left"} -- \code{"top-right"} -- \code{"top-center"} -- \code{"bottom-left"} -- \code{"bottom-right"} -- \code{"bottom-center"} -- \code{"middle-left"} -- \code{"middle-right"} +\examples{ +# Create an overlay at the top-left corner of a shape +overlay <- create_overlay(elementId = 1, label = "My label", position = overlay_shape_position[1]) -Use these constants as the \code{position} argument in the \code{\link{create_overlay}} function. +} +\seealso{ +\code{\link{create_overlay}} } \keyword{datasets} From b5613304b9fd42c407a90f3a6fe3101c09bc8fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Souchet=20C=C3=A9line?= Date: Mon, 11 Sep 2023 13:47:26 +0200 Subject: [PATCH 10/10] fix doc --- R/funs.R | 52 +++++++++++++++++------------------ man/overlay_edge_position.Rd | 10 +++---- man/overlay_shape_position.Rd | 20 +++++++------- 3 files changed, 41 insertions(+), 41 deletions(-) diff --git a/R/funs.R b/R/funs.R index 4208208..c9b62c8 100644 --- a/R/funs.R +++ b/R/funs.R @@ -3,28 +3,28 @@ #' @description #' To specify the position when creating an overlay object that will be attached to BPMN \code{Shape} elements in the diagram. #' -#' @section Positions: -#' \describe{ -#' \item{\code{"top-left"}} -#' \item{\code{"top-right"}} -#' \item{\code{"top-center"}} -#' \item{\code{"bottom-left"}} -#' \item{\code{"bottom-right"}} -#' \item{\code{"bottom-center"}} -#' \item{\code{"middle-left"}} -#' \item{\code{"middle-right"}} -#' } -#' #' @details #' Use these constants as the \code{position} argument in the \code{\link{create_overlay}} function. #' +#' @section Positions: +#' \itemize{ +#' \item{\code{top-left}}{} +#' \item{\code{top-right}}{} +#' \item{\code{top-center}}{} +#' \item{\code{bottom-left}}{} +#' \item{\code{bottom-right}}{} +#' \item{\code{bottom-center}}{} +#' \item{\code{middle-left}}{} +#' \item{\code{middle-right}}{} +#' } +#' +#' @seealso +#' \code{\link{create_overlay}} +#' #' @examples #' # Create an overlay at the top-left corner of a shape #' overlay <- create_overlay(elementId = 1, label = "My label", position = overlay_shape_position[1]) #' -#' @seealso -#' \code{\link{create_overlay}} -#' #' @export overlay_shape_position <- c( @@ -42,24 +42,24 @@ overlay_shape_position <- #' #' @description #' To specify the position when creating an overlay object that will be attached to BPMN \code{Edge} elements in the diagram. -#' -#' @section Positions: -#' \describe{ -#' \item{\code{"start"}} -#' \item{\code{"middle"}} -#' \item{\code{"end"}} -#' } -#' +#' #' @details #' Use these constants as the \code{position} argument in the \code{\link{create_overlay}} function. #' -#' @examples -#' # Create an overlay at the starting point of an edge -#' overlay <- create_overlay(elementId = 1, label = "My label", position = overlay_edge_position[1]) +#' @section Positions: +#' \itemize{ +#' \item{\code{start}}{} +#' \item{\code{end}}{} +#' \item{\code{middle}}{} +#' } #' #' @seealso #' \code{\link{create_overlay}} #' +#' @examples +#' # Create an overlay at the starting point of an edge +#' overlay <- create_overlay(elementId = 1, label = "My label", position = overlay_edge_position[1]) +#' #' @export overlay_edge_position <- c("start", "end", "middle") diff --git a/man/overlay_edge_position.Rd b/man/overlay_edge_position.Rd index 42fb342..4961537 100644 --- a/man/overlay_edge_position.Rd +++ b/man/overlay_edge_position.Rd @@ -18,11 +18,11 @@ Use these constants as the \code{position} argument in the \code{\link{create_ov } \section{Positions}{ -\describe{ - \item{\code{"start"}} - \item{\code{"middle"}} - \item{\code{"end"}} -} + \itemize{ + \item{\code{start}}{} + \item{\code{end}}{} + \item{\code{middle}}{} + } } \examples{ diff --git a/man/overlay_shape_position.Rd b/man/overlay_shape_position.Rd index 04f5c5b..82231a9 100644 --- a/man/overlay_shape_position.Rd +++ b/man/overlay_shape_position.Rd @@ -18,16 +18,16 @@ Use these constants as the \code{position} argument in the \code{\link{create_ov } \section{Positions}{ -\describe{ - \item{\code{"top-left"}} - \item{\code{"top-right"}} - \item{\code{"top-center"}} - \item{\code{"bottom-left"}} - \item{\code{"bottom-right"}} - \item{\code{"bottom-center"}} - \item{\code{"middle-left"}} - \item{\code{"middle-right"}} -} + \itemize{ + \item{\code{top-left}}{} + \item{\code{top-right}}{} + \item{\code{top-center}}{} + \item{\code{bottom-left}}{} + \item{\code{bottom-right}}{} + \item{\code{bottom-center}}{} + \item{\code{middle-left}}{} + \item{\code{middle-right}}{} + } } \examples{