display {bpmnVisualizationR} | R Documentation |
Display 'BPMN' diagram in an 'HTML' Widget
Description
Display 'BPMN' diagram based on 'BPMN' definition in 'XML' format
Usage
display(
bpmnXML,
overlays = NULL,
enableDefaultOverlayStyle = TRUE,
bpmnElementStyles = NULL,
width = NULL,
height = NULL,
elementId = NULL
)
Arguments
bpmnXML |
A file name or 'XML' document or string in 'BPMN' 'XML' format |
overlays |
An element or a list of elements to be added to the diagram's existing elements.
Use the |
enableDefaultOverlayStyle |
If no style is set on an overlay, and this parameter is set to |
bpmnElementStyles |
a list of existing elements with their style to apply.
Use the |
width |
A fixed width for the widget (in CSS units).
The default value is |
height |
A fixed height for the widget (in CSS units).
The default value is |
elementId |
The ID of the 'HTML' element to enclose the widget. Use an explicit element ID for the widget (rather than an automatically generated one). This is useful if you have other 'JavaScript' that needs to explicitly discover and interact with a specific widget instance. |
Value
A bpmnVisualizationR
widget that will intelligently print itself into 'HTML' in a variety of contexts
including the 'R' console, within 'R Markdown' documents, and within 'Shiny' output bindings.
See Also
-
create_overlay
to create an overlay -
create_shape_style
to create the structure style for the shape -
create_edge_style
to create the structure style for the edge
Examples
# Load the BPMN file
bpmn_file <- system.file("examples/Order_Management.bpmn", package = "bpmnVisualizationR")
# Example 1: Display the BPMN diagram
bpmnVisualizationR::display(bpmn_file, width='auto', height='auto')
# 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"),
bpmnVisualizationR::create_overlay("task_1_1", "9"),
bpmnVisualizationR::create_overlay("sequence_flow_1_2", "8"),
bpmnVisualizationR::create_overlay("call_activity_1_1", "7")
)
bpmnVisualizationR::display(
bpmn_file,
overlays,
width='auto',
height='auto'
)
# 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_overlay_style(
font_color = 'WhiteSmoke',
font_size = 19,
fill_color = 'Teal',
stroke_color = 'SpringGreen'
)
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),
bpmnVisualizationR::create_overlay("sequence_flow_1_2", "8"),
bpmnVisualizationR::create_overlay("call_activity_1_1", "7")
)
bpmnVisualizationR::display(bpmn_file, overlays, width='auto', height='auto')
# 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,
enableDefaultOverlayStyle=FALSE,
width='auto',
height='auto'
)
# Example 5: Display the BPMN diagram featuring styling for BPMN elements
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'
)