# foreignObject

The foreignObject SVG element includes elements from a different XML namespace. In the context of a browser, it is most likely (X)HTML.

Usually, this element is create with:

const foreignObject = parentElement.add('foreignObject')

It's possible create as a disconnected element with gySVG('foreignObject') and attach it to the SVG document with .attachTo().

More info: mdn (opens new window) | w3c (opens new window)

# .height()

foreignObject.height( _ )

Set the height of the foreignObject.

  • argument: {} _

  • returns: {gySVGObject} The original object

const height = element.height();

Get the height current value.

  • returns: {}

# .width()

foreignObject.width( _ )

Set the width of the foreignObject.

  • argument: {} _

  • returns: {gySVGObject} The original object

const width = element.width();

Get the width current value.

  • returns: {}

# .x()

foreignObject.x( _ )

Set the x coordinate of the foreignObject.

  • argument: {} _

  • returns: {gySVGObject} The original object

const x = element.x();

Get the x current value.

  • returns: {}

# .y()

foreignObject.y( _ )

Set the y coordinate of the foreignObject.

  • argument: {} _

  • returns: {gySVGObject} The original object

const y = element.y();

Get the y current value.