An overlay can be added to existing elements in the diagram.
See the overlays
argument in the display
function.
Use this function to create the correct overlay structure.
Arguments
- elementId
The bpmn element id to which the overlay will be attached
- label
'HTML' element to use as an overlay
- style
The style of the overlay. Use
create_overlay_style
function to create the style object of an overlay and be aware of theenableDefaultOverlayStyle
parameter in thedisplay
function.- position
The position of the overlay If the bpmn element where the overlay will be attached is a Shape, use
overlay_shape_position
. Otherwise, useoverlay_edge_position
.
Examples
# Example 1: 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-shape-id",
"My Overlay Label",
style = overlay_style,
position = overlay_shape_position[1]
)
# Example 2: 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",
style = overlay_style,
position = overlay_edge_position[2]
)