OptionalbackgroundA valid CSS color to replace the default (transparent) canvas background. Any padding area is also colored.
OptionalcallbackThe 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.
OptionalcallbackIf 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).
OptionaldetailsThe optional details to pass to the HTMLCanvasElement's toDataURL function.
If the type is "image/jpeg" then this can be a number from 0 to 1, inclusive, describing the desired jpeg quality.
OptionaldocumentAn 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.
OptionalmaxThe maximum size of the created image, as a Size.
The default value is (4000, 4000) 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.
OptionalpaddingA 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.
OptionalpartsAn 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).
OptionalpositionThe 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.
OptionalreturnThe optional return type of the image data. Valid values are "ImageData", "Image", "string", and "blob".
The "string" option returns a base64 string representation of the image.
The "ImageData" option returns an ImageData object representation of the image.
The "Image" option returns an HTMLImageElement using ImageData as the HTMLImageElement.src.
The "blob" option requires that the callback property is also defined.
The default value is "string", and unrecognized values will return a string.
OptionalscaleThe 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.
OptionalshowA 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.
OptionalshowA boolean value, defaulting to false, that determines whether or not temporary objects such as adornments are included in the image.
OptionalsizeOptionaltypeThe optional MIME type of the image. Valid values are typically "image/png" and "image/jpeg".
Some browsers allow "image/webp". The default value is "image/png", and unrecognized values will defer to the default.
Used for the options argument to Diagram.makeImage and Diagram.makeImageData.