From 344aa597d742b4f32e72c1392396889540847b3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Souchet=20C=C3=A9line?= Date: Tue, 12 Sep 2023 16:47:01 +0200 Subject: [PATCH] genarate doc --- NAMESPACE | 3 + man/create_edge_style.Rd | 102 ++++++++++++++++++++++++++++++++ man/create_element_style.Rd | 93 ++++++++++++++++++++++++++++++ man/create_gradient_fill.Rd | 22 +++++++ man/create_shape_style.Rd | 112 ++++++++++++++++++++++++++++++++++++ man/display.Rd | 50 +++++++++++++++- 6 files changed, 381 insertions(+), 1 deletion(-) create mode 100644 man/create_edge_style.Rd create mode 100644 man/create_element_style.Rd create mode 100644 man/create_gradient_fill.Rd create mode 100644 man/create_shape_style.Rd diff --git a/NAMESPACE b/NAMESPACE index 1a2ffa4..292c6b6 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,8 +1,11 @@ # Generated by roxygen2: do not edit by hand export(bpmnVisualizationROutput) +export(create_edge_style) +export(create_gradient_fill) export(create_overlay) export(create_overlay_style) +export(create_shape_style) export(display) export(overlay_edge_position) export(overlay_shape_position) diff --git a/man/create_edge_style.Rd b/man/create_edge_style.Rd new file mode 100644 index 0000000..1f21d95 --- /dev/null +++ b/man/create_edge_style.Rd @@ -0,0 +1,102 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/funs.R +\name{create_edge_style} +\alias{create_edge_style} +\title{Create the style for BPMN edge} +\usage{ +create_edge_style( + elementIds, + stroke_color = NULL, + stroke_width = NULL, + stroke_opacity = NULL, + font_color = NULL, + font_family = NULL, + font_size = NULL, + font_bold = NULL, + font_italic = NULL, + font_strike_through = NULL, + font_underline = NULL, + font_opacity = NULL, + opacity = NULL +) +} +\arguments{ +\item{elementIds}{The IDs of the BPMN elements to style.} + +\item{stroke_color}{The stroke color for the element. +It can be any HTML color name or HEX code, or special keywords.} + +\item{stroke_width}{The stroke width for the element, in pixels (1 to 50). +\itemize{ +\item If the set value is less than 1, the used value is 1. +\item If the set value is greater than 50, the used value is 50. +\item To hide the stroke, set the \code{stroke_color} property to \code{none}. +}} + +\item{stroke_opacity}{The stroke opacity for the element, ranging from 0 to 100.} + +\item{font_color}{The font color for the element. +It can be any HTML color name or HEX code, or special keywords.} + +\item{font_family}{The font family for the element.} + +\item{font_size}{The font size for the element, in pixels.} + +\item{font_bold}{Should the font be bold? (default: \code{FALSE})} + +\item{font_italic}{Should the font be italic? (default: \code{FALSE})} + +\item{font_strike_through}{Should the font have a strike-through style? (default: \code{FALSE})} + +\item{font_underline}{Should the font be underlined? (default: \code{FALSE})} + +\item{font_opacity}{The font opacity for the element, ranging from 0 to 100.} + +\item{opacity}{The opacity for the element, ranging from 0 to 100.} +} +\value{ +A list representing the style for the BPMN edge. +} +\description{ +Use this function to create the correct style structure for the edge. +} +\section{Special keywords}{ +\describe{ +\item{\code{default}}{ +\itemize{ +\item This keyword allows you to reset a style property of the BPMN element to its initial value. +\item When applied to color properties, it bypasses the color specified in the 'BPMN' source if 'BPMN in Color' support is enabled. Instead, it uses the color defined in the default style of the 'BPMN' element.. +} +} +\item{\code{inherit}}{Applies the value from the immediate parent element.} +\item{\code{none}}{No color (used to hide strokes). Not available for \code{font_color}.} +\item{\code{swimlane}}{Applies the value from the nearest parent element with type \code{ShapeBpmnElementKind.LANE} or \code{ShapeBpmnElementKind.POOL}.} +} +} + +\section{Note}{ +\subsection{Opacity properties}{ +\itemize{ +\item If the set value is less than 0, the used value is 0. +\item If the set value is greater than 100, the used value is 100. +} +} + +\subsection{⚠️⚠️⚠️ \code{stroke_width} property ⚠️⚠️⚠️}{ + +Changing the stroke width of Activities may be misleading, as the default stroke widths have a meaning according to the 'BPMN' Specification.\cr +For example, updating the stroke width of a task using the same value as the default stroke width of a Call Activity can be confusing.\cr +In this case, you should also change another property, such as the stroke color, to allow the user to differentiate between them. +} +} + +\examples{ +# Create a style with a blue stroke and a bold, red font. +edge_style <- create_edge_style( + elementIds = list('id_1', 'id_2'), + stroke_color = "blue", + stroke_width = 2, + font_color = "red", + font_bold = TRUE +) +} diff --git a/man/create_element_style.Rd b/man/create_element_style.Rd new file mode 100644 index 0000000..f2aa08a --- /dev/null +++ b/man/create_element_style.Rd @@ -0,0 +1,93 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/funs.R +\name{create_element_style} +\alias{create_element_style} +\title{Create the style for BPMN element} +\usage{ +create_element_style( + elementIds, + stroke_color = NULL, + stroke_width = NULL, + stroke_opacity = NULL, + font_color = NULL, + font_family = NULL, + font_size = NULL, + font_bold = NULL, + font_italic = NULL, + font_strike_through = NULL, + font_underline = NULL, + font_opacity = NULL, + opacity = NULL +) +} +\arguments{ +\item{elementIds}{The IDs of the BPMN elements to style.} + +\item{stroke_color}{The stroke color for the element. +It can be any HTML color name or HEX code, or special keywords.} + +\item{stroke_width}{The stroke width for the element, in pixels (1 to 50). +\itemize{ +\item If the set value is less than 1, the used value is 1. +\item If the set value is greater than 50, the used value is 50. +\item To hide the stroke, set the \code{stroke_color} property to \code{none}. +}} + +\item{stroke_opacity}{The stroke opacity for the element, ranging from 0 to 100.} + +\item{font_color}{The font color for the element. +It can be any HTML color name or HEX code, or special keywords.} + +\item{font_family}{The font family for the element.} + +\item{font_size}{The font size for the element, in pixels.} + +\item{font_bold}{Should the font be bold? (default: \code{FALSE})} + +\item{font_italic}{Should the font be italic? (default: \code{FALSE})} + +\item{font_strike_through}{Should the font have a strike-through style? (default: \code{FALSE})} + +\item{font_underline}{Should the font be underlined? (default: \code{FALSE})} + +\item{font_opacity}{The font opacity for the element, ranging from 0 to 100.} + +\item{opacity}{The opacity for the element, ranging from 0 to 100.} +} +\value{ +A list representing the style for the specified BPMN elements. +} +\description{ +Internal function to create the correct style structure for the 'BPMN' element. +} +\section{Special keywords}{ +\describe{ +\item{\code{default}}{ +\itemize{ +\item This keyword allows you to reset a style property of the BPMN element to its initial value. +\item When applied to color properties, it bypasses the color specified in the 'BPMN' source if 'BPMN in Color' support is enabled. Instead, it uses the color defined in the default style of the 'BPMN' element.. +} +} +\item{\code{inherit}}{Applies the value from the immediate parent element.} +\item{\code{none}}{No color (used to hide strokes). Not available for \code{font_color}.} +\item{\code{swimlane}}{Applies the value from the nearest parent element with type \code{ShapeBpmnElementKind.LANE} or \code{ShapeBpmnElementKind.POOL}.} +} +} + +\section{Note}{ +\subsection{Opacity properties}{ +\itemize{ +\item If the set value is less than 0, the used value is 0. +\item If the set value is greater than 100, the used value is 100. +} +} + +\subsection{⚠️⚠️⚠️ \code{stroke_width} property ⚠️⚠️⚠️}{ + +Changing the stroke width of Activities may be misleading, as the default stroke widths have a meaning according to the 'BPMN' Specification.\cr +For example, updating the stroke width of a task using the same value as the default stroke width of a Call Activity can be confusing.\cr +In this case, you should also change another property, such as the stroke color, to allow the user to differentiate between them. +} +} + +\keyword{internal} diff --git a/man/create_gradient_fill.Rd b/man/create_gradient_fill.Rd new file mode 100644 index 0000000..ce98dcd --- /dev/null +++ b/man/create_gradient_fill.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/funs.R +\name{create_gradient_fill} +\alias{create_gradient_fill} +\title{Create a gradient fill style for an element} +\usage{ +create_gradient_fill(direction, start_color, end_color) +} +\arguments{ +\item{direction}{The direction of the gradient (e.g., \code{left-to-right}, \code{right-to-left}, \code{bottom-to-top}, \code{top-to-bottom}). +Taking the example of bottom-to-top, this means that the start color is at the bottom of the paint pattern and the end color is at the top, with a gradient between them.} + +\item{start_color}{The starting color of the gradient. It can be any HTML color name or HEX code, as well as special keywords such as \code{inherit}, \code{none}, \code{swimlane}.} + +\item{end_color}{The ending color of the gradient. It can be any HTML color name or HEX code, as well as special keywords such as \code{inherit}, \code{none}, \code{swimlane}.} +} +\value{ +A gradient fill style object. +} +\description{ +Create a gradient fill style for an element. +} diff --git a/man/create_shape_style.Rd b/man/create_shape_style.Rd new file mode 100644 index 0000000..1a75299 --- /dev/null +++ b/man/create_shape_style.Rd @@ -0,0 +1,112 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/funs.R +\name{create_shape_style} +\alias{create_shape_style} +\title{Create the style for BPMN shape} +\usage{ +create_shape_style( + elementIds, + stroke_color = NULL, + stroke_width = NULL, + stroke_opacity = NULL, + font_color = NULL, + font_family = NULL, + font_size = NULL, + font_bold = NULL, + font_italic = NULL, + font_strike_through = NULL, + font_underline = NULL, + font_opacity = NULL, + opacity = NULL, + fill_color = NULL, + fill_opacity = NULL +) +} +\arguments{ +\item{elementIds}{The IDs of the BPMN elements to style.} + +\item{stroke_color}{The stroke color for the element. +It can be any HTML color name or HEX code, or special keywords.} + +\item{stroke_width}{The stroke width for the element, in pixels (1 to 50). +\itemize{ +\item If the set value is less than 1, the used value is 1. +\item If the set value is greater than 50, the used value is 50. +\item To hide the stroke, set the \code{stroke_color} property to \code{none}. +}} + +\item{stroke_opacity}{The stroke opacity for the element, ranging from 0 to 100.} + +\item{font_color}{The font color for the element. +It can be any HTML color name or HEX code, or special keywords.} + +\item{font_family}{The font family for the element.} + +\item{font_size}{The font size for the element, in pixels.} + +\item{font_bold}{Should the font be bold? (default: \code{FALSE})} + +\item{font_italic}{Should the font be italic? (default: \code{FALSE})} + +\item{font_strike_through}{Should the font have a strike-through style? (default: \code{FALSE})} + +\item{font_underline}{Should the font be underlined? (default: \code{FALSE})} + +\item{font_opacity}{The font opacity for the element, ranging from 0 to 100.} + +\item{opacity}{The opacity for the element, ranging from 0 to 100.} + +\item{fill_color}{The fill color for the shape +It can be any HTML color name or HEX code, special keywords, or a gradient create with \code{\link{create_gradient_fill}}.} + +\item{fill_opacity}{The fill opacity for the shape, ranging from 0 to 100.} +} +\value{ +A list representing the style for the BPMN shape. +} +\description{ +Use this function to create the correct style structure for the shape. +} +\section{Special keywords}{ +\describe{ +\item{\code{default}}{ +\itemize{ +\item This keyword allows you to reset a style property of the BPMN element to its initial value. +\item When applied to color properties, it bypasses the color specified in the 'BPMN' source if 'BPMN in Color' support is enabled. Instead, it uses the color defined in the default style of the 'BPMN' element.. +} +} +\item{\code{inherit}}{Applies the value from the immediate parent element.} +\item{\code{none}}{No color (used to hide strokes). Not available for \code{font_color}.} +\item{\code{swimlane}}{Applies the value from the nearest parent element with type \code{ShapeBpmnElementKind.LANE} or \code{ShapeBpmnElementKind.POOL}.} +} +} + +\section{Note}{ +\subsection{Opacity properties}{ +\itemize{ +\item If the set value is less than 0, the used value is 0. +\item If the set value is greater than 100, the used value is 100. +} +} + +\subsection{⚠️⚠️⚠️ \code{stroke_width} property ⚠️⚠️⚠️}{ + +Changing the stroke width of Activities may be misleading, as the default stroke widths have a meaning according to the 'BPMN' Specification.\cr +For example, updating the stroke width of a task using the same value as the default stroke width of a Call Activity can be confusing.\cr +In this case, you should also change another property, such as the stroke color, to allow the user to differentiate between them. +} +} + +\examples{ +# Create a style with a blue stroke, red font, and green fill color. +shape_style <- create_shape_style( + elementIds = list('id_1', 'id_2'), + stroke_color = "blue", + stroke_width = 2, + font_color = "red", + fill_color = "green" +) +} +\seealso{ +\code{\link{create_gradient_fill}} +} diff --git a/man/display.Rd b/man/display.Rd index 17a2f01..6fbd18e 100644 --- a/man/display.Rd +++ b/man/display.Rd @@ -8,6 +8,7 @@ display( bpmnXML, overlays = NULL, enableDefaultOverlayStyle = TRUE, + bpmnElementStyles = NULL, width = NULL, height = NULL, elementId = NULL @@ -22,6 +23,9 @@ Use the \code{\link{create_overlay}} function to create an overlay object with c \item{enableDefaultOverlayStyle}{If no style is set on an overlay, and this parameter is set to \code{TRUE}, the default style will be applied to the overlay. By default, \code{enableDefaultOverlayStyle} is set to \code{TRUE}.} +\item{bpmnElementStyles}{a list of existing elements with their style to apply. +Use the \code{\link{create_shape_style}} or \code{\link{create_edge_style}} functions to create the style of 'BPMN' elements.} + \item{width}{A fixed width for the widget (in CSS units). The default value is \code{NULL}, which results in intelligent automatic sizing based on the widget's container.} @@ -104,7 +108,51 @@ bpmnVisualizationR::display( height='auto' ) +# Example 5: Display the BPMN diagram featuring bpmnElementStyles +bpmnElementStyles <- list( + bpmnVisualizationR::create_shape_style( + elementIds = list("call_activity_1_1"), + stroke_color = 'RoyalBlue', + font_color = 'DarkOrange', + font_family = 'Arial', + font_size = 12, + font_bold = TRUE, + font_italic = TRUE, + font_strike_through = TRUE, + font_underline = TRUE, + opacity = 75, + fill_color = 'Yellow', + fill_opacity = 50 + ), + bpmnVisualizationR::create_edge_style( + elementIds = list("sequence_flow_1_4"), + stroke_color = 'DeepPink', + stroke_width = 3, + stroke_opacity = 70, + font_color = 'ForestGreen', + font_family = 'Courier New', + font_size = 14, + font_bold = TRUE, + font_italic = TRUE, + font_strike_through = FALSE, + font_underline = FALSE, + font_opacity = 80, + opacity = 80 + ) +) + +bpmnVisualizationR::display( + bpmn_file, + bpmnElementStyles = bpmnElementStyles, + width='auto', + height='auto' +) + } \seealso{ -\code{\link{create_overlay}} to create an overlay +\itemize{ +\item \code{\link{create_overlay}} to create an overlay +\item \code{\link{create_shape_style}} to create the structure style for the shape +\item \code{\link{create_edge_style}} to create the structure style for the edge +} }