See the dojox/gfx/utils reference documentation for more information.
Internal function that cleans up artifacts in extracted SVG content.
Parameter | Type | Description |
---|---|---|
svg | undefined |
Internal function to initialize the hidden iframe where SVG rendering will occur.
Implementation of MS's innerXML function, borrowed from dojox.xml.parser.
Parameter | Type | Description |
---|---|---|
node | Node | The node from which to generate the XML text representation. |
Internal function to call when the serializer init completed.
Takes a surface or a shape and populates it with an object produced by serialize().
Parameter | Type | Description |
---|---|---|
parent | dojox/gfx/shape.Surface | dojox/gfx/shape.Shape | The destination container for the deserialized shapes. |
object | dojox/gfx/shape.Shape | Array | The shapes to deserialize. |
Takes a shape or a surface and applies a function "f" to in the context of "o" (or global, if missing). If "shape" was a surface or a group, it applies the same function to all children recursively effectively visiting all shapes of the underlying scene graph.
Parameter | Type | Description |
---|---|---|
object | dojox/gfx/shape.Surface | dojox/gfx/shape.Shape | The gfx container to iterate. |
f | Function | String | Array | The function to apply. |
o | Object |
Optional The scope. |
Works just like deserialize() but takes a JSON representation of the object.
Parameter | Type | Description |
---|---|---|
parent | dojox/gfx/shape.Surface | dojox/gfx/shape.Shape | The destination container for the deserialized shapes. |
json | String | The shapes to deserialize. |
Takes a shape or a surface and returns an object, which describes underlying shapes.
Parameter | Type | Description |
---|---|---|
object | dojox/gfx/shape.Surface | dojox/gfx/shape.Shape | The container to serialize. |
Works just like serialize() but returns a JSON string. If prettyPrint is true, the string is pretty-printed to make it more human-readable.
Parameter | Type | Description |
---|---|---|
object | dojox/gfx/shape.Surface | dojox/gfx/shape.Shape | The container to serialize. |
prettyPrint | Boolean |
Optional Indicates whether the output string should be formatted. |
Function to serialize a GFX surface to SVG text.
Function to serialize a GFX surface to SVG text. The value of this output is that there are numerous serverside parser libraries that can render SVG into images in various formats. This provides a way that GFX objects can be captured in a known format and sent serverside for serialization into an image.
Parameter | Type | Description |
---|---|---|
surface | dojox/gfx/shape.Surface | The GFX surface to serialize. |
Deferred object that will be called when SVG serialization is complete.