Every SDON script has the following structure:
Where <shape properties> define the properties of a shape. The Reference below specifies all the properties supported but two key ones are:
A ShapeList is an automatic connector line plus the shapes connected to it. Flowcharts can have more than one connector per shape, so the ShapeList property is an array of ShapeList objects. A ShapeList object consists of properties that describe the connector line (like "Direction" and "LineColor" plus an array of Shape objects.
Because Shapes in a ShapeList are the same as any other Shape, they too can have child ShapeLists as one of their properties.
This structure is recursive and leads to tree-like structures.
Here's an example of a tree (using a DiagramType of OrgChart):
Here's a simple flowchart:
Note than Shape 3 has two ShapeLists: One down and one up. The shapes to the right are part of the same ShapeList as Shape 1, Shape 2 and Shape 3.
Virtually all object properties are optional. Without specific properties individual objects use default properties. Here is the same tree with only the required properties for a three level chart.
Note that the default Direction is Down for an Orgchart. The default label for the top position is "Manager". Note also that the positions, color and sizes of the boxes are all defaulted.
A line that connects two arbitrary shapes is called a Return. (A line that "returns" to a previous step in a flowchart).
Returns are specified by an array of Return objects after the RootShape array.
Return have the following required properties:
Shapes may have optional ID's. To draw a return line between two shapes they must have an ID property. In the flowchart example above, this return draws a line between "Down 2" and "Shape 2".
Where these two shapes are defined with these ID's.
This creates a chart like this with a line connecting "Down 2" to "Shape 2".
You can add return lines to any type of chart. The optional properties for a return line include the side of the shape it touches, its thickness, line pattern and color. These are listed in the reference.
Any diagram may have a title that appears centered above the whole diagram ½" above it. The title is specified with a Title object specified after the RootShape.
The Title object currently supports just a Label property that defines the string used in the title. The text format follows the default for the template except for the point size, which is 14 by default. Eventually all of the normal text formatting properties will be supported.
You can make a multi-line title by inserting a CR as "/n" into the string.
The appearance of lines and shapes conform to the default settings of the SmartDraw template unless modified with optional properties.
Shapes may have specific
Here is one of the shapes from the tree example using some of these attributes:
Lines (returns and connectors) may have specific:
Text labels appear with just one size, font, color and style but this can be controlled for each label:
Here is another shape with some of these properties for the label.
The automatic connector line segments that touch a shape can have their own text labels. The line label is added to the Shape object in a ShapeList.
Adding "LineLabel":"Yes" to the Down 1 shape in our flowchart creates this:
Returns can also have labels. Adding "Label":"Loop Again" to the return definition in our flowchart creates:
Trees (Org Chart, Mind maps and Decision Trees) have collapsible connectors. The + and – controls collapse and expand the tree attached to a shape. It can be useful to create a tree in a collapsed state so that the diagram is simpler when first viewed. The user can then expand the nodes he wants.
Adding "Collapse":"1" to a ShapeList object puts it into the collapsed state. This SDON file:
Makes this chart:
Clicking on the + opens the connector:
The shape property:
Adds a hyperlink to a shape. The Hyperlink property is an object and not just a string because in a future version the object will also support a property "Page":"N" where N is a page number. This defines a link between the current page and other page in the same document.
A Shape can contain a table. A table is an arrangement of rows and columns in a shape.
At its simplest level a shape can be divided into NxM rows and columns using the Table Shape Property:
By default the number of rows and columns is 1. Hence
creates a single column table with one column.
Creates a two column table with one row. A 1x1 table is ignored.
This example in our tree creates the following shape:
Notice that the label for the shape is placed in the first cell of the table.
You can specify labels (and other properties) for each of the ten cells in the table by including an array of cell objects in the table object:
You can also join cells both vertically and horizontally by adding a "Join" array to the table definition.
You can also change the colors and other attributes of each cell just like Shapes:
You can also add hyperlinks to cells with the same Hyperlink property as shapes: