Skip to content

Commit 9cd9a10

Browse files
authored
docs: add more examples for styles and positions of overlays (#218)
Highlight the default positions and styles in a dedicated example.
1 parent 94244de commit 9cd9a10

File tree

2 files changed

+48
-18
lines changed

2 files changed

+48
-18
lines changed

R/bpmnVisualizationR.R

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
#' Use the \code{create_overlay} function to create an overlay object with content and a relative position.
2323
#' @param 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.
2424
#' By default, \code{enableDefaultOverlayStyle} is set to \code{TRUE}.
25-
#' @param width A fixed width for the widget (in CSS units).
25+
#' @param width A fixed width for the widget (in CSS units).
2626
#' The default value is \code{NULL}, which results in intelligent automatic sizing based on the widget's container.
27-
#' @param height A fixed height for the widget (in CSS units).
27+
#' @param height A fixed height for the widget (in CSS units).
2828
#' The default value is \code{NULL}, which results in intelligent automatic sizing based on the widget's container.
2929
#' @param elementId The ID of the 'HTML' element to enclose the widget.
30-
#' Use an explicit element ID for the widget (rather than an automatically generated one).
30+
#' Use an explicit element ID for the widget (rather than an automatically generated one).
3131
#' This is useful if you have other 'JavaScript' that needs to explicitly
3232
#' discover and interact with a specific widget instance.
3333
#'
@@ -41,7 +41,22 @@
4141
#' # Display the BPMN diagram
4242
#' bpmnVisualizationR::display(bpmn_file, width='auto', height='auto')
4343
#'
44-
#' # Display the BPMN diagram featuring overlays and their default style/position
44+
#' # Display the BPMN diagram featuring overlays with their default positions and styles
45+
#' overlays <- list(
46+
#' bpmnVisualizationR::create_overlay("start_event_1_1", "42"),
47+
#' bpmnVisualizationR::create_overlay("sequence_flow_1_1", "42"),
48+
#' bpmnVisualizationR::create_overlay("task_1_1", "9"),
49+
#' bpmnVisualizationR::create_overlay("sequence_flow_1_2", "8"),
50+
#' bpmnVisualizationR::create_overlay("call_activity_1_1", "7")
51+
#' )
52+
#' bpmnVisualizationR::display(
53+
#' bpmn_file,
54+
#' overlays,
55+
#' width='auto',
56+
#' height='auto'
57+
#' )
58+
#'
59+
#' # Display the BPMN diagram featuring overlays using custom styles and positions
4560
#' taskStyle <- bpmnVisualizationR::create_style(
4661
#' font = bpmnVisualizationR::create_font(color = 'DarkSlateGray', size = 23),
4762
#' fill = bpmnVisualizationR::create_fill(color = 'MistyRose'),
@@ -63,18 +78,18 @@
6378
#' )
6479
#' bpmnVisualizationR::display(bpmn_file, overlays, width='auto', height='auto')
6580
#'
66-
#' # Display the BPMN diagram featuring overlays, but exclude their default style/position
81+
#' # Display the BPMN diagram featuring overlays, but exclude their default styles and positions
6782
#' overlays <- list(
6883
#' bpmnVisualizationR::create_overlay("start_event_1_1", "42", position = "middle-left"),
6984
#' bpmnVisualizationR::create_overlay("sequence_flow_1_1", "42", flowStyle, "end"),
7085
#' bpmnVisualizationR::create_overlay("task_1_1", "9", taskStyle, "bottom-right"),
7186
#' bpmnVisualizationR::create_overlay("sequence_flow_1_2", "8", position = 'start')
7287
#' )
7388
#' bpmnVisualizationR::display(
74-
#' bpmn_file,
75-
#' overlays,
76-
#' enableDefaultOverlayStyle=FALSE,
77-
#' width='auto',
89+
#' bpmn_file,
90+
#' overlays,
91+
#' enableDefaultOverlayStyle=FALSE,
92+
#' width='auto',
7893
#' height='auto'
7994
#' )
8095
#'

man/display.Rd

Lines changed: 24 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)