diagram

Syntax

[#diagram attributes] expression [/#diagram]

where:

Description

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:

Picture size

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:

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.

Insertion mode

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:

Examples

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]