Optional
backgroundA valid CSS color to replace the default (transparent) canvas background. Any padding area is also colored.
Optional
callbackThe function to call when an image is finished creation.
It has one argument, which is of the type specified by the value of the ImageRendererOptions.returnType or SVG DOM.
If provided, call the callback when finished instead of returning immediately. This can be useful if you need to wait for image assets to load.
This also respects the callbackTimeout.
This argument is necessary if the ImageRendererOptions.returnType is "blob"
, however a callback can be used with any ImageRendererOptions.returnType.
See the Minimal Image Blob Download sample for an example usage,
which also demonstrates downloading an image file without involving a web server.
Optional
callbackIf a callback is specified, the additional amount of time in milliseconds a call will wait before completeing. Right now, it will only wait if image assets in the Diagram are not yet loaded. Default is 300 (milliseconds).
Optional
documentAn HTML Document, defaulting to window.document
(or the root object in other contexts)
This may be useful to set if you intend your Image or SVG to be opened in a new window.
Optional
maxThe maximum size of the created image, as a Size.
The default value is (Infinity, Infinity)
for SVG and (2000, 2000)
for images.
This is typically used when scale is specified and helps prevent accidental excessive memory usage,
which is especially needed in limited-memory environments.
You cannot use Infinity when providing a maximum size for an image -- consider calling Diagram.makeSvg instead.
Optional
paddingA Margin (or number) to pad the image with. If a size is specified,
the padding will not increase the image size, it will only offset the Diagram contents within the image.
The default value is a padding of 1
.
Optional
partsAn iterator of GraphObjects, typically Parts, such as one from Diagram.selection or Layer.parts. If GraphObjects are specified their containing Part will be drawn. By default all Parts are drawn except temporary parts (see showTemporary).
Optional
positionThe position of the diagram, as a Point. By default this is the position of Diagram.documentBounds with the Diagram.padding removed. If a specific parts collection is used, by default this is the top-left diagram position of their collective bounds. If you set a position, you should also set a size.
Optional
scaleThe scale of the diagram. If scale is specified and size is not, the resulting image will be sized to uniformly
fit the space needed for the given scale.
Can be constrained by the maxSize property. A scale value of NaN
will
automatically scale to fit within the maxSize, but may be smaller, with a maximum computed scale of 1.
Optional
showA boolean value, defaulting to the value of showTemporary, that determines whether or not the Grid Layer (containing Diagram.grid) is included in the image regardless of the value of showTemporary. This is useful if you want to include the grid but not adornments, or vice versa.
Optional
showA boolean value, defaulting to false, that determines whether or not temporary objects such as adornments are included in the image.
Optional
size
Used for the options arguments to Diagram.makeImage, Diagram.makeImageData, and Diagram.makeSvg.