A Paper to Draw JointJS Diagrams on
jointjs_paper.RdSet up a sheet of paper to draw jointjs diagrams on. This class can be used
to define the paper specifications. These specifications are needed when
creating a widget with jointjs().
See also
Other root-classes:
jointjs_cell,
jointjs_graph
Methods
jointjs_paper$new()
Initiate a paper object
Usage
jointjs_paper$new(
width,
height,
background = list(color = "#E9ECEF"),
gridSize = 20,
drawGrid = list(name = "dot", args = list(color = "#808080", thickness = 1)),
interactive = TRUE,
snapLinks = list(radius = 20),
defaultLink = jointjs::jointjs_cell$new(NULL, "standard.Link", .connection =
list(stroke = "#2C3E50", strokeWidth = 2), `.marker-target` = list(fill = "#2C3E50",
d = "M 10 0 L 0 5 L 10 10 z")),
validateConnection =
htmlwidgets::JS("\n function(cellViewS, magnetS, cellViewT, magnetT, end, linkView) {\n if (cellViewS === cellViewT) return false;\n return cellViewT && cellViewT.model.isElement();\n }\n "),
...
)Arguments
widthPaper width in CSS units.
heightPaper height in CSS units.
backgroundA named list with background properties. The list can contain the elements
color,image(an URL for a background image),position(xandycoordinate for the image),sizeof the background image (widthandheight),repeata CSSbackground-repeatproperty,qualitycoefficient for image quality,opacityin the range of 0-1,watermarkAnglein degrees. If set toFALSEno background is drawn.gridSizegridSize in CSS units
drawGridA named list specifying how to draw a grid on the paper. An element
namecan use any of these predefined grid patterns:"dot"(default),"fixedDot","mesh", or"doubleMesh". Use an element namedargsto specify pattern properties. If set toFALSE, no grid is drawn.interactiveUse a
logicalvalue to enable or disable all interactive elements. Or use a named list of interactions with logical values to enable or disable specific interactionssnapLinksA
logicalvalue indicating if links should be snapped to magnets. Or a namedlistwith elementradiusin pixels, giving the distance for snapping links.defaultLinkDefault properties for links. A jointjs_link class object.
validateConnectionA JavaScript function that validates if a connection between a specific source and target is allowed. It should return a logical value.
...Other options passed to the JointJS JavaScript library.