See the dojox/gfx/_base reference documentation for more information.
This the graphics rendering bridge for W3C Canvas compliant browsers. Since Canvas is an immediate mode graphics api, with no object graph or eventing capabilities, use of this module alone will only add in drawing support. The additional module, canvasWithEvents extends this module with additional support for handling events on Canvas. By default, the support for events is now included however, if only drawing capabilities are needed, canvas event module can be disabled using the dojoConfig option, canvasEvents:true|false. The id of the Canvas renderer is 'canvas'. This id can be used when switch Dojo's graphics context between renderer implementations. See dojox/gfx/_base.switchRenderer API.
This the graphics rendering bridge for W3C Canvas compliant browsers which extends the basic canvas drawing renderer bridge to add additional support for graphics events on Shapes. Since Canvas is an immediate mode graphics api, with no object graph or eventing capabilities, use of the canvas module alone will only add in drawing support. This additional module, canvasWithEvents extends this module with additional support for handling events on Canvas. By default, the support for events is now included however, if only drawing capabilities are needed, canvas event module can be disabled using the dojoConfig option, canvasEvents:true|false.
An object specifying the default properties for a Font used in text operations.
An object defining the default stylistic properties used for Linear Gradient fills. Linear gradients are drawn along a virtual line, which results in appearance of a rotated pattern in a given direction/orientation.
An object specifying the default properties for a Pattern using in fill operations.
An object specifying the default properties for RadialGradients using in fills patterns.
A stroke defines stylistic properties that are used when drawing a path. This object defines the default Stroke prototype.
Defines how to fill a shape. Four types of fills can be used: solid, linear gradient, radial gradient and pattern. See dojox/gfx.LinearGradient, dojox/gfx.RadialGradient and dojox/gfx.Pattern respectively for more information about the properties supported by each type.
An object specifying the properties for a Font used in text operations.
An object defining the default stylistic properties used for Linear Gradient fills. Linear gradients are drawn along a virtual line, which results in appearance of a rotated pattern in a given direction/orientation.
This module contains the core graphics Path API. Path command format follows the W3C SVG 1.0 Path api.
a constant regular expression used to split a SVG/VML path into primitive components
An object specifying the default properties for a Pattern using in fill operations.
Specifies the properties for RadialGradients using in fills patterns.
Either the string name of a renderer (eg. 'canvas', 'svg, ...) or the renderer object to switch to.
This module contains the core graphics Shape API. Different graphics renderer implementation modules (svg, canvas, vml, silverlight, etc.) extend this basic api to provide renderer-specific implementations for each shape.
This the graphics rendering bridge for the Microsoft Silverlight plugin. Silverlight is a faster implementation on IE6-8 than the default 2d graphics, VML
A stroke defines stylistic properties that are used when drawing a path.
This the graphics rendering bridge for browsers compliant with W3C SVG1.0. This is the preferred renderer to use for interactive and accessible graphics.
This the default graphics rendering bridge for IE6-7. This renderer is very slow. For best performance on IE6-8, use Silverlight plugin. IE9+ defaults to the standard W3C SVG renderer.
Adds the specified classes to the end of the class list on the passed node.
Parameter | Type | Description |
---|---|---|
node | DomNode | |
classStr | String |
Returns whether or not the specified classes are a portion of the class list currently applied to the node.
Parameter | Type | Description |
---|---|---|
node | DomNode | |
classStr | String |
Removes classes from node.
Parameter | Type | Description |
---|---|---|
node | DomNode | |
classStr | String |
creates a surface
Parameter | Type | Description |
---|---|---|
parentNode | Node | a parent node |
width | String | Number | width of surface, e.g., "100px" or 100 |
height | String | Number | height of surface, e.g., "100px" or 100 |
newly created surface
Decompose a 2D matrix into translation, scaling, and rotation components.
This function decompose a matrix into four logical components: translation, rotation, scaling, and one more rotation using SVD. The components should be applied in following order:
[translate, rotate(angle2), scale, rotate(angle1)]
Parameter | Type | Description |
---|---|---|
matrix | dojox/gfx/matrix.Matrix2D | a 2D matrix-like object |
compares event sources, returns true if they are equal
Parameter | Type | Description |
---|---|---|
a | undefined | |
b | undefined |
converts a number to a string using a fixed notation
Parameter | Type | Description |
---|---|---|
x | Number | number to be converted |
addSpace | Boolean | whether to add a space before a positive number |
the formatted value
converts a font object to a CSS font string
Parameter | Type | Description |
---|---|---|
font | Object | font object (see dojox/gfx.defaultFont) |
copies the original object, and all copied properties from the 'update' object
Parameter | Type | Description |
---|---|---|
defaults | Object | the object to be cloned before updating |
update | Object | the object, which properties are to be cloned during updating |
new object with new and default properties
a 2D matrix object
Normalizes a 2D matrix-like object. If arrays is passed, all objects of the array are normalized and multiplied sequentially.
Parameter | Type | Description |
---|---|---|
arg | Object | a 2D matrix-like object, a number, or an array of such objects |
converts any legal color representation to normalized dojo/Color object
Parameter | Type | Description |
---|---|---|
color | dojo/Color | Array | string | Object | A color representation. |
converts any length value to pixels
Parameter | Type | Description |
---|---|---|
len | String | a length, e.g., '12pc' |
pixels
updates an existing object with properties from an 'update' object
Parameter | Type | Description |
---|---|---|
existed | Object | the target object to be updated |
update | Object | the 'update' object, whose properties will be used to update the existed object |
the target object to be updated
converts points to pixels
Parameter | Type | Description |
---|---|---|
len | Number | a value in points |
converts pixels to points
Parameter | Type | Description |
---|---|---|
len | Number | a value in pixels |
converts a CSS font string to a font object
Converts a CSS font string to a gfx font object. The CSS font string components should follow the W3C specified order (see http://www.w3.org/TR/CSS2/fonts.html#font-shorthand): style, variant, weight, size, optional line height (will be ignored), and family. Note that the Font.size attribute is limited to numeric CSS length.
Parameter | Type | Description |
---|---|---|
str | String | a CSS font string. |
object in dojox/gfx.defaultFont format
switch the graphics implementation to the specified renderer.
Parameter | Type | Description |
---|---|---|
renderer | String | Object | Either the string name of a renderer (eg. 'canvas', 'svg, ...) or the renderer object to switch to. |