Skip to contents

A generic template to create shapes for a jointjs_graph. Shapes are visualised by https://www.w3.org/groups/wg/svg/ elements. jointjs_element objects are R's representation of such elements. This R class specifies the elements such that they can be used to construct a jointjs_graph. It's usually more effective to initialise a child class, such as jointjs_rectangle, jointjs_image, jointjs_circle, etc.

Parameters are all based on SVG attributes, you can use the ... arguments to pass other valid attributes. Note that the attributes are renamed in camel-case conform the JointJS spefications. So, SVG attribute font-family becomes fontFamily, stroke-width becomes strokeWidth, etc.

Super class

jointjs_cell -> jointjs_element

Methods

Inherited methods


jointjs_element$set_position()

Set the element's position relative to its parent container.

Usage

jointjs_element$set_position(x, y)

Arguments

x, y

Coordinates relative to its parent container.


jointjs_element$set_image()

Set image attributes for the element.

Usage

jointjs_element$set_image(href, ...)

Arguments

href

A Uniform Resource Identifier (URI) to locate a resource (e.g. image)

...

Additional SVG attributes accepted by the specific SVG element


jointjs_element$set_border()

Set border attributes for the element.

Usage

jointjs_element$set_border(fill, stroke, strokeWidth, ...)

Arguments

fill

Fill colour

stroke

Stroke colour

strokeWidth

Width of the stroke line

...

Additional SVG attributes accepted by the specific SVG element


jointjs_element$set_background()

Set background attributes for the element.

Usage

jointjs_element$set_background(fill, stroke, strokeWidth, ...)

Arguments

fill

Fill colour

stroke

Stroke colour

strokeWidth

Width of the stroke line

...

Additional SVG attributes accepted by the specific SVG element


jointjs_element$set_top()

Set top attributes for the element (used to visualise the top of a cylinder base).

Usage

jointjs_element$set_top(fill, stroke, strokeWidth, ...)

Arguments

fill

Fill colour

stroke

Stroke colour

strokeWidth

Width of the stroke line

...

Additional SVG attributes accepted by the specific SVG element


jointjs_element$set_line()

Set line attributes for the element.

Usage

jointjs_element$set_line(stroke, strokeWidth, ...)

Arguments

stroke

Stroke colour

strokeWidth

Width of the stroke line

...

Additional SVG attributes accepted by the specific SVG element


jointjs_element$set_shadow()

Set shadow attributes for the element.

Usage

jointjs_element$set_shadow(stroke, strokeWidth, ...)

Arguments

stroke

Stroke colour

strokeWidth

Width of the stroke line

...

Additional SVG attributes accepted by the specific SVG element


jointjs_element$set_outline()

Set outline attributes for the element.

Usage

jointjs_element$set_outline(stroke, strokeWidth, ...)

Arguments

stroke

Stroke colour

strokeWidth

Width of the stroke line

...

Additional SVG attributes accepted by the specific SVG element


jointjs_element$set_wrapper()

Set wrapper attributes for the element.

Usage

jointjs_element$set_wrapper(stroke, strokeWidth, ...)

Arguments

stroke

Stroke colour

strokeWidth

Width of the stroke line

...

Additional SVG attributes accepted by the specific SVG element


jointjs_element$set_header()

Set header attributes for the element.

Usage

jointjs_element$set_header(fill, stroke, strokeWidth, ...)

Arguments

fill

Fill colour

stroke

Stroke colour

strokeWidth

Width of the stroke line

...

Additional SVG attributes accepted by the specific SVG element


jointjs_element$set_headerText()

Set headerText attributes for the element.

Usage

jointjs_element$set_headerText(text, color, fontFamily, fontSize, ...)

Arguments

text

A text to display

color

Colour of the element

fontFamily

Font family for the text to display

fontSize

Font size for the text to display

...

Additional SVG attributes accepted by the specific SVG element


jointjs_element$set_bodyText()

Set bodyText attributes for the element.

Usage

jointjs_element$set_bodyText(text, color, fontFamily, fontSize, ...)

Arguments

text

A text to display

color

Colour of the element

fontFamily

Font family for the text to display

fontSize

Font size for the text to display

...

Additional SVG attributes accepted by the specific SVG element


jointjs_element$set_body()

Set body attributes for the element.

Usage

jointjs_element$set_body(fill, stroke, strokeWidth, magnet, ...)

Arguments

fill

Fill colour

stroke

Stroke colour

strokeWidth

Width of the stroke line

magnet

When set to TRUE, the element can be used as source or target for a jointjs_link.

...

Additional SVG attributes accepted by the specific SVG element


jointjs_element$set_label()

Set label attributes for the element.

Usage

jointjs_element$set_label(text, color, fontFamily, fontSize, ...)

Arguments

text

A text to display

color

Colour of the element

fontFamily

Font family for the text to display

fontSize

Font size for the text to display

...

Additional SVG attributes accepted by the specific SVG element


jointjs_element$get_list()

Returns a named list representation of the element.

Usage

jointjs_element$get_list()


jointjs_element$clone()

The objects of this class are cloneable with this method.

Usage

jointjs_element$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.