Class JXG.ForeignObject
JXG.GeometryElement,JXG.CoordsElement
↳ JXG.ForeignObject
Creates a new foreignObject object. Do not use this constructor to create a foreignObject. Use JXG.Board#create with
type foreignobject instead.
Defined in: foreignobject.js.
Extends
JXG.CoordsElement, JXG.GeometryElement.
Constructor Attributes | Constructor Name and Description |
---|---|
JXG.ForeignObject(board, coordinates, attributes, url, size)
Construct and handle SVG foreignObjects.
|
- Fields borrowed from class JXG.GeometryElement:
- _org_type, _pos, ancestors, aria, baseElement, board, childElements, cssClass, dash, dashScale, descendants, draft, dragToTopOfLayer, dump, element3D, elementClass, elType, fillColor, fillOpacity, fixed, frozen, gradient, gradientAngle, gradientCX, gradientCY, gradientEndOffset, gradientFR, gradientFX, gradientFY, gradientR, gradientSecondColor, gradientSecondOpacity, gradientStartOffset, hasLabel, highlight, highlightCssClass, highlighted, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, id, inherits, isDraggable, isLabel, isReal, lastDragTime, layer, lineCap, methodMap, mouseover, name, needsRegularUpdate, needsUpdate, nonnegativeOnly, notExistingParents, numTraces, parents, precision, priv, quadraticform, rendNode, rotatable, scalable, shadow, snapToGrid, stdform, strokeColor, strokeOpacity, strokeWidth, subs, symbolic, tabindex, trace, traceAttributes, traces, transformations, transitionDuration, transitionProperties, type, visible, visProp, visPropCalc, withLabel
- Fields borrowed from class JXG.CoordsElement:
- coords, groups, isConstrained, needsUpdateFromParent, onPolygon, position, slideObject, slideObjects
Field Attributes | Field Name and Description |
---|---|
'href' of the foreignObject.
|
|
Array of length two containing [width, height] of the foreignObject in pixel.
|
- Fields borrowed from class JXG.GeometryElement:
- _org_type, _pos, ancestors, aria, baseElement, board, childElements, cssClass, dash, dashScale, descendants, draft, dragToTopOfLayer, dump, element3D, elementClass, elType, fillColor, fillOpacity, fixed, frozen, gradient, gradientAngle, gradientCX, gradientCY, gradientEndOffset, gradientFR, gradientFX, gradientFY, gradientR, gradientSecondColor, gradientSecondOpacity, gradientStartOffset, hasLabel, highlight, highlightCssClass, highlighted, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, id, inherits, isDraggable, isLabel, isReal, lastDragTime, layer, lineCap, methodMap, mouseover, name, needsRegularUpdate, needsUpdate, nonnegativeOnly, notExistingParents, numTraces, parents, precision, priv, quadraticform, rendNode, rotatable, scalable, shadow, snapToGrid, stdform, strokeColor, strokeOpacity, strokeWidth, subs, symbolic, tabindex, trace, traceAttributes, traces, transformations, transitionDuration, transitionProperties, type, visible, visProp, visPropCalc, withLabel
- Fields borrowed from class JXG.CoordsElement:
- coords, groups, isConstrained, needsUpdateFromParent, onPolygon, position, slideObject, slideObjects
Method Attributes | Method Name and Description |
---|---|
H()
Returns the height of the foreignObject in user coordinates.
|
|
hasPoint(x, y)
Checks whether (x,y) is over or near the image;
|
|
setSize(width, height)
Set the width and height of the foreignObject.
|
|
<private> |
update(fromParent)
Recalculate the coordinates of lower left corner and the width and height.
|
<private> |
Send an update request to the renderer.
|
<private> |
Updates the internal arrays containing size of the foreignObject.
|
<private> |
Update the anchor point of the foreignObject, i.e.
|
W()
Returns the width of the foreignObject in user coordinates.
|
- Methods borrowed from class JXG.GeometryElement:
- _set, addChild, addDescendants, addParents, addParentsFromJCFunctions, addRotation, addTicks, addTransform, animate, bounds, clearTrace, cloneToBackground, countChildren, createGradient, createLabel, draggable, eval, evalVisProp, formatNumberLocale, fullUpdate, generatePolynomial, getAttribute, getAttributes, getLabelAnchor, getName, getParents, getProperty, getSnapSizes, getTextAnchor, getType, handleSnapToGrid, hide, hideElement, noHighlight, normalize, prepareUpdate, remove, removeAllTicks, removeChild, removeDescendants, removeTicks, resolveShortcuts, setArrow, setAttribute, setDash, setDisplayRendNode, setLabel, setLabelText, setName, setParents, setPosition, setPositionDirectly, setProperty, show, showElement, snapToPoints, updateVisibility, useLocale
- Methods borrowed from class JXG.CoordsElement:
- _anim, addAnchor, addConstraint, Coords, Dist, findClosestSnapValue, free, handleAttractors, handleSnapToPoints, makeGlider, moveAlong, moveTo, popSlideObject, setGliderPosition, setPositionByTransform, updateConstraint, updateCoords, updateGlider, updateGliderFromParent, updateTransform, visit, X, XEval, Y, YEval, Z, ZEval
- Events borrowed from class JXG.GeometryElement:
- attribute, attribute:key, down, drag, keydrag, mousedown, mousedrag, mousemove, mouseout, mouseover, mouseup, move, out, over, pendown, pendrag, penup, touchdown, touchdrag, touchup, up
Class Detail
JXG.ForeignObject(board, coordinates, attributes, url, size)
Construct and handle SVG foreignObjects.
- Parameters:
- {string|JXG.Board} board
- The board the new foreignObject is drawn on.
- {Array} coordinates
- An array with the user coordinates of the foreignObject.
- {Object} attributes
- An object containing visual and - optionally - a name and an id.
- {string|function} url
- An URL string or a function returning an URL string.
- {Array} size
- Array containing width and height of the foreignObject in user coordinates.
Field Detail
content
'href' of the foreignObject.
{Array}
size
Array of length two containing [width, height] of the foreignObject in pixel.
Method Detail
{number}
H()
Returns the height of the foreignObject in user coordinates.
- Returns:
- {number} height of the image in user coordinates
{Boolean}
hasPoint(x, y)
Checks whether (x,y) is over or near the image;
- Parameters:
- {Number} x
- Coordinate in x direction, screen coordinates.
- {Number} y
- Coordinate in y direction, screen coordinates.
- Returns:
- {Boolean} True if (x,y) is over the image, False otherwise.
{JXG.ForeignObject}
setSize(width, height)
Set the width and height of the foreignObject. After setting a new size,
board.update() or foreignobject.fullUpdate()
has to be called to make the change visible.
- Parameters:
- {numbe|function|string} width
- Number, function or string that determines the new width of the foreignObject
- {number|function|string} height
- Number, function or string that determines the new height of the foreignObject
- Returns:
- {JXG.ForeignObject} A reference to the element
<private>
{JXG.ForeignObject}
update(fromParent)
Recalculate the coordinates of lower left corner and the width and height.
- Parameters:
- fromParent
- Returns:
- {JXG.ForeignObject} A reference to the element
<private>
updateRenderer()
Send an update request to the renderer.
<private>
{JXG.ForeignObject}
updateSize()
Updates the internal arrays containing size of the foreignObject.
- Returns:
- {JXG.ForeignObject} A reference to the element
<private>
{JXG.ForeignObject}
updateSpan()
Update the anchor point of the foreignObject, i.e. the lower left corner
and the two vectors which span the rectangle.
- Returns:
- {JXG.ForeignObject} A reference to the element
{number}
W()
Returns the width of the foreignObject in user coordinates.
- Returns:
- {number} width of the image in user coordinates