dojox/gfx/utils (version 1.10)

See the dojox/gfx/utils reference documentation for more information.

Property Summary

Method Summary

  • _cleanSvg(svg) Internal function that cleans up artifacts in extracted SVG content.
  • _initSvgSerializer() Internal function to initialize the hidden iframe where SVG rendering will occur.
  • _innerXML(node) Implementation of MS's innerXML function, borrowed from dojox.xml.parser.
  • _svgSerializerInitialized() Internal function to call when the serializer init completed.
  • deserialize(parent,object) Takes a surface or a shape and populates it with an object produced by serialize().
  • forEach(object,f,o) Takes a shape or a surface and applies a function "f" to in the context of "o" (or global, if missing).
  • fromJson(parent,json) Works just like deserialize() but takes a JSON representation of the object.
  • serialize(object) Takes a shape or a surface and returns an object, which describes underlying shapes.
  • toJson(object,prettyPrint) Works just like serialize() but returns a JSON string.
  • toSvg(surface) Function to serialize a GFX surface to SVG text.

Properties

_gfxSvgProxy
Defined by: dojox/gfx/utils
_initSvgSerializerDeferred
Defined by: dojox/gfx/utils

Methods

_cleanSvg(svg)
Defined by dojox/gfx/utils

Internal function that cleans up artifacts in extracted SVG content.

Parameter Type Description
svg undefined
Returns:undefined
_initSvgSerializer()
Defined by dojox/gfx/utils

Internal function to initialize the hidden iframe where SVG rendering will occur.

_innerXML(node)
Defined by dojox/gfx/utils

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.

Returns:undefined | null
_svgSerializerInitialized()
Defined by dojox/gfx/utils

Internal function to call when the serializer init completed.

deserialize(parent,object)
Defined by dojox/gfx/utils

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.

Returns:undefined
forEach(object,f,o)
Defined by dojox/gfx/utils

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.

fromJson(parent,json)
Defined by dojox/gfx/utils

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.

Returns:undefined
serialize(object)
Defined by dojox/gfx/utils

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.

Returns:undefined | object
toJson(object,prettyPrint)
Defined by dojox/gfx/utils

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.

Returns:String | undefined
toSvg(surface)
Defined by dojox/gfx/utils

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.

Returns:any | instance

Deferred object that will be called when SVG serialization is complete.

Error in the documentation? Can’t find what you are looking for? Let us know!