[#diagram attributes] expression [/#diagram]
where:
MDWObject.The diagram tag can be used to insert the picture of a model diagram.
The expression evaluation must return an MDWObject.
This tag can be used to insert two types of diagrams:
MDWorkbench inserts pictures using their original size (width and height). In some cases, pictures may be too large in the output document.
You can limit the size of the picture to insert using the following attributes:
maxWidth: determine the maximum width of the picture.maxHeight: determine the maximum height of the picture.The attribute maxWidth and maxHeight must be positive integers (pixel unit).
A picture is resized (both width and height to maintain the ratio) to fit these maximum values, if necessary.
For example, if a picture is 800 pixel long and maxWidth is set to 600,
the picture is resized to be 600 pixel long.
By default, MDWorkbench will embed the picture directly inside the generated document. That way, you have one document with no external reference.
However you may want to insert only a link to pictures in some cases
(to optimize document weight when multiple documents reference the same diagrams,
or to be able to update pictures without touching the document).
You can control the insertion mode using the attribute
insert.
The insert attribute can have the following values:
embedded: this is the default value. The picture is directly embedded in the document.link: the generated document just keeps a link to the original picture, somewhere in the file system.
If the picture or the document is moved, then the reference will be invalid.linkLocalCopy: the original picture is copied in the generated document directory,
and the document just keeps a link to this copy. The original file can then be deleted without impacting the document.This code will output a diagram for a model element and will scale it to be 600 pixels long at most:
[#diagram maxWidth="600"]myElement[/#diagram]