Class JXG.CanvasRenderer
JXG.AbstractRenderer
↳ JXG.CanvasRenderer
JXG.AbstractRenderer
Defined in: canvas.js.
Extends
JXG.AbstractRenderer.
Constructor Attributes | Constructor Name and Description |
---|---|
JXG.CanvasRenderer(container, dim)
Uses HTML Canvas to implement the rendering methods defined in JXG.AbstractRenderer.
|
- Fields borrowed from class JXG.AbstractRenderer:
- container, enhancedRendering, type, vOffsetText
- Fields borrowed from class JXG.AbstractRenderer:
- container, enhancedRendering, type, vOffsetText
Method Attributes | Method Name and Description |
---|---|
<private> |
_drawFilledPolygon(shape)
Draws a filled polygon.
|
<private> |
_fill(element)
Sets the fill color and fills an area.
|
<private> |
_rotatePoint(angle, x, y)
Rotates a point around (0, 0) by a given angle.
|
<private> |
_rotateShape(shape, angle)
Rotates an array of points around (0, 0).
|
<private> |
_setColor(element, type, targetType)
Sets color and opacity for filling and stroking.
|
<private> |
_stroke(element)
Sets color and opacity for drawing paths and lines and draws the paths and lines.
|
<private> |
_translateShape(shape, x, y)
Translates a set of points.
|
- Methods borrowed from class JXG.AbstractRenderer:
- _updateVisual, appendChildPrim, appendNodesToElement, changePointStyle, createPrim, createTouchpoints, displayCopyright, drawCurve, drawEllipse, drawImage, drawInternalText, drawLine, drawPoint, drawPolygon, drawText, drawTicks, drawZoomBar, getElementById, hide, hideTouchpoint, highlight, joinTransforms, makeArrows, noHighlight, remove, removeDraft, removeToInsertLater, resize, setBuffering, setDashStyle, setDraft, setGradient, setObjectFillColor, setObjectStrokeColor, setObjectStrokeWidth, setPropertyPrim, setShadow, show, showTouchpoint, suspendRedraw, transformImage, unsuspendRedraw, updateCurve, updateEllipse, updateEllipsePrim, updateGradient, updateImage, updateImageStyle, updateImageURL, updateInternalText, updateInternalTextStyle, updateLine, updateLinePrim, updatePathPrim, updatePathStringBezierPrim, updatePathStringPoint, updatePathStringPrim, updatePoint, updatePolygon, updatePolygonPrim, updateRectPrim, updateText, updateTextStyle, updateTicks, updateTouchpoint
Class Detail
JXG.CanvasRenderer(container, dim)
Uses HTML Canvas to implement the rendering methods defined in JXG.AbstractRenderer.
- Parameters:
- {Node} container
- Reference to a DOM node containing the board.
- {Object} dim
- The dimensions of the board
- {Number} dim.width
- {Number} dim.height
- See:
- JXG.AbstractRenderer
Method Detail
<private>
_drawFilledPolygon(shape)
Draws a filled polygon.
- Parameters:
- {Array} shape
- A matrix presented by a two dimensional array of numbers.
<private>
_fill(element)
Sets the fill color and fills an area.
- Parameters:
- {JXG.GeometryElement} element
- An arbitrary JSXGraph element, preferably one with an area.
<private>
{Array}
_rotatePoint(angle, x, y)
Rotates a point around (0, 0) by a given angle.
- Parameters:
- {Number} angle
- An angle, given in rad.
- {Number} x
- X coordinate of the point.
- {Number} y
- Y coordinate of the point.
- Returns:
- {Array} An array containing the x and y coordinate of the rotated point.
<private>
{Array}
_rotateShape(shape, angle)
Rotates an array of points around (0, 0).
- Parameters:
- {Array} shape
- An array of array of point coordinates.
- {Number} angle
- The angle in rad the points are rotated by.
- Returns:
- {Array} Array of array of two dimensional point coordinates.
<private>
{Boolean}
_setColor(element, type, targetType)
Sets color and opacity for filling and stroking.
type is the attribute from visProp and targetType the context[targetTypeStyle].
This is necessary, because the fill style of a text is set by the stroke attributes of the text element.
- Parameters:
- {JXG.GeometryElement} element
- Any JSXGraph element.
- {String} type Optional, Default: 'stroke'
- Either fill or stroke.
- {String} targetType Optional, Default: type
- (optional) Either fill or stroke.
- Returns:
- {Boolean} If the color could be set, true is returned.
<private>
_stroke(element)
Sets color and opacity for drawing paths and lines and draws the paths and lines.
- Parameters:
- {JXG.GeometryElement} element
- An JSXGraph element with a stroke.
<private>
{Array}
_translateShape(shape, x, y)
Translates a set of points.
- Parameters:
- {Array} shape
- An array of point coordinates.
- {Number} x
- Translation in X direction.
- {Number} y
- Translation in Y direction.
- Returns:
- {Array} An array of translated point coordinates.