Skip to end of metadata
Go to start of metadata

Core Objects

ObjectAllowed PropertiesDescriptionExample
DiagramType
  • Flowchart
  • Mindmap
  • Orgchart
  • Decisiontree
Type of diagram SDON will create. Sets the behavior of lines and shapes.
“DiagramType”: "Flowchart"
SignatureString

All SDON files have a signature property and its case sensitive.

"Signature":"SmartDrawSDON"
VersionStringSet a version string for the diagram.
"Version": "1.1"

RootShape

Initial shape for diagram, required for every SDON fileAll Shape Properties
{
  "ShapeConnector": [
    {}
  ]
}
ShapeConnectorShape Connector Properties Array of shapes arrays, at least one is required off RootShape to form diagram.
"ShapeConnector": [
    {
      "Shapes": [
        {},
        {}
      ]
    }
  ]
ShapesArray of shapes
"Shapes": [
  {},
  {}
]
Shape

Shape Properties


{
"Shape": {
	}
}


Full Example - Core Objects
{
  "Label": "Root",
  "ShapeConnector": [
    {
      "Shapes": [
        {
          "Label": "Shape 1"
        },
        {
          "Label": "Shape 2"
        }
      ]
    }
  ]
}


Shape Properties

Shape Properties apply to Shape and RootShape objects. Properties will use their default value if omitted.

AttributeAllowed ValuesDescriptionExample

Label

String

The text label inside the shape."Label": "Shape 1"
TextHyperlinkStringThe new field “TextHyperlink”: {“url”:”value”} assigns a hyperlink to the label in the shape or cell.

"TextHyperlink": 

{
"url": "value"
}

TextBold

BooleanMake the text label bold with a value of 1, not bold with 0, otherwise, if omitted, boldness follows the template default.

“TextBold”:”1”

TextItalic

BooleanMake the text label italic with a value of 1, not italic with 0, otherwise, if omitted, italic follows the template default.

“TextItalic”:”1”

TextUnderline

BooleanMake the text label underlined with a value of 1, not underlined with 0, otherwise, if omitted, underlined follows the template default.

“TextUnderline”:”1”

TextSize

IntegerMake the point size of the text label the specified value. Otherwise the text size is the default for the template.

“TextSize”:”12”

TextFont

StringMake the font of the text label the specified value. Otherwise the font is the default for the template. Any font can be defined, but will fall back to system default if font is unavailable

“TextFont”:”Baskerville”

TextColor

RGB color in HexadecimalMake the color of the text label the specified RGB value . Otherwise the color is the default for the template.

“TextColor”:”#FF00FF”

TextAlignH

  • Left
  • Center
  • Right
Align the text label to the left, right or centered in the shape . Otherwise the alignment is the default for the template. 

“TextAlignH”:”Left”

TextAlignV

  • Top
  • Middle
  • Bottom
Align the text label to the top, bottom or middle in the shape . Otherwise the alignment is the default for the template.

“TextAlignV”:”Top”

TextTruncateInteger

The field “TextTruncate”: defines the number of characters to allow in a shape or cell before the remaining text is truncated. By default nothing is truncated. Defining TextTruncate to “-1” turns it off if on by default.

"TextTruncate": "-1"
TextGrow
  • Proportional
  • Vertical
  • Horizontal

By default the way shapes grow as more text is added is determined by the template. Flowchart shapes are set to grow in proportion to their original size in both directions. Org chart shapes grow vertically.

The TextGrow property can override this. There are three values that you can specify: Proportional, Vertical and Horizontal.

"TextTruncate": "Proportional"
MinWidthInteger

Specifies the initial width of a shape in 1/100" before any text is added. Adding more text than will fit into the shape will grow it according to the TextGrow value.The default value for MinWidth is 150.

"MinWidth": "100"
MinHeightIntegerSpecifies the initial height of a shape in 1/100" before any text is added. Adding more text than will fit into the shape will grow it according to the TextGrow value.The default value for MinHeight is 75."MinHeight": "100"

FillColor

RGB color in HexadecimalMake the fill color of the shape the specified RGB value . Otherwise the color is the default for the template.

“FillColor”:”#FF00FF”

LineColor

RGB color in HexadecimalMake the border color of the shape the specified RGB value . Otherwise the color is the default for the template.

“LineColor”:”#FF00FF”

LineThick

IntegerMake the border thickness of the shape the specified value in 1/100”. Otherwise the thickness is the default for the template.

“LineThick”:”2”

ShapeType

  • RRect – Rounded Rectangle
  • Oval
  • Circle
  • Square
  • Diamond

Change the shape from a rectangle to another shape. 

“ShapeType”:”Oval”

SymbolsArrayAn SDON script can now specify any of the symbols included in SmartDraw. Symbols are defined as an array of symbol objects. Once a symbol is named, it becomes a valid ShapeType.

"Symbols":[

{

"Name":"Cloud",

"ID":"368d31f5-f374-48fe-8b29-11e1a43e4c8a"

},

{

"Name":"Folder",

"ID":"468d31f5-f374-48fe-8b29-22e1a46e4c8a"

}

]

ID

IntegerAssign an ID to this shape. ID’s are used to specify the paths of Return lines (see below). ID’s are arbitrary but should be unique.

“ID”:”2”

StringAdd 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.

“Hyperlink”:{“url”:”urlstring”}

Table


Table is a complex object that divides a shape up into rows and columns. It is described in detail below.

Table

LineLabel

StringThis is a text label on the connector line segment that touches the shape. Only Applies to Shape

“LineLabel”=”string value”

ShapeConnector Properties

A ShapeConnector (previously ShapeList) contains an array of shapes that are connected to it by an automatic connector. A ShapeList defines an automatic connector. 

AttributeAllowed ValuesDescriptionExample
ShapesArray of Shape objects

Required

Any ShapeList without at least one shape in the Shapes array is ignored. The order of the shapes in the Shapes array is the order in which they are attached to the connector.

Shapes:[{}]

LineThick

IntegerThe thickness of the line in 1/100”. Otherwise the thickness is the default for the template.

“LineThick”:”2”

LineColor


Make the line color of the connector the specified RGB value . Otherwise the color is the default for the template.

“LineColor”:”#FF00FF”

Direction

  • Left
  • Right
  • Up
  • Down

The direction of the connector from the parent shape.

For Mind Maps this can be Left or Right for the ShapeLists connected to the root shape. All other uses are ignored. The default is “Right”. Mind Maps ignore any more than two ShapeLists for the root shape and  any more than one for other shapes.

For Org Charts (trees) the first ShapeList connected to the root shape can be in any direction and this sets the direction of the tree. The default is “Down”. All other values are ignored. Org charts ignore any more than one ShapeList per shape.

For Flow Charts any shape can have multiple ShapeLists in any direction. If two or more ShapeLists attached to a single shape have the same direction, they are shown as a split path. The default direction for a ShapeList is “Right”.

“Direction”:”Right”

Collapse

BooleanThe connector is collapsed initially. This applies only to tree-like diagrams (not flowcharts).

“Collapse”:”1”

ShapeConnectorType
  • Flowchart
  • Decisiontree
  • Mindmap
  • OrgChart
This is a parameter of the root shape of a ShapeConnector and defines the way the shapeconnector will be formatted. Default is Orgchart"ShapeConnectorType":"Flowchart"
Shape Connector Example
  "ShapeConnector": [
    {
      "Shapes": [
        {
          "Label": "Shape 1"
        },
        {
          "Label": "Shape 2"
        }
      ]
    }
  ]


ShapeArray

A ShapeArray defines a list of shapes arranged in a matrix.

AttributeAllowed ValuesDescriptionExample

Shapes

{}an array of Shapes

"Shapes":[

  {},

  {},

]

Arrangement

  • Square
  • Row
  • Column
has one of the these three values. Default - Square"Arrangement":{}

Wrap

IntegerThis is the maximum number of rows for a "Row" arrangement before it wraps to a new row, or the maximum number of columns for a Column arrangement before it wraps to a new column."Wrap": "7"

VerticalSpacing

IntegerSpacing between columns in 1/100" - Default is 50. This is inherited by Child Shape arrays."VerticalSpacing": "25"

HorizontalSpacing

IntegerSpacing between rows in 1/100" - Default is 50. This is inherited by Child Shape arrays."HorizontalSpacing": "25"

ArrayAlignH

  • left
  • right
  • center
This controls the positioning of a shape in a column of shapes. The default is center."ArrayAlignH": "left"

ArrayAlignV

  • top
  • bottom
  • middle
This controls the positioning of a shape in a row of shapes. The default is top."ArrayAlignV": "top"

Hide

BooleanIf set for the the parent shape of a ShapeArray the parent will be deleted after the layout is achieved. It is ignored if there is no ShapArray."Hide"="true"


Shape Array Example
"ShapeArray":
  {
    "Shapes":[],
    "Arrangement":{},
    "VerticalSpacing":"50",
    "HorizontalSpacing":"50"
  }


Returns

A return is a segmented line that links two shapes. These are defined by a array of returns at the top level of the SDON file.


AttributeAllowed ValuesDescriptionExample

StartID

Integer

Required

The ID defined for the starting shape by its “ID” property (see above).


“StartID”:”2”

EndID

Integer

Required

The ID defined for the ending shape by its “ID” property (see above).

The starting and ending shapes define the direction of the line as far as any arrowhead is concerned, The arrowhead touches the ending shape.

“EndID”:”3”

StartDirection

  • Top
  • Bottom
  • Left
  • Right

The direction the connector leaves the parent shape. The default is Bottom.

“StartDirection”:”Top”

EndDirection

  • Top
  • Bottom
  • Left
  • Right
The direction the line takes out of the ending shape (Top, Bottom, Left, Right). The default is Bottom.

“EndDirection”:”Top”

StartArrow

Integer

By default returns have no arrowhead touching the start shape. To specify a starting arrow by using "1" or any of the other arrowhead settings as the value..

The arrowhead number increases across the rows in this diagram:


“StartArrow”:”1”

EndArrow

Integer

By default returns have an arrowhead touching the end shape. The property can turn this off by using “0” as the value, or it can change the arrowhead from the default.

The arrowhead number increases across the rows in this diagram:


“EndArrow”:”0”

LinePattern

  • Solid
  • Dotted
  • Dashed
Normally the pattern of the line is solid. You can make a return a dotted line with this property.

“LinePattern”:”Dotted”

LineThick

IntegerThe thickness of the line in 1/100”. Otherwise the thickness is the default for the template.

“LineThick”:”2”

LineColor

RGB color in HexadecimalMake the line color of the connector the specified RGB value . Otherwise the color is the default for the template.

“LineColor”:”#FF00FF”

CurvedBooleanWhen set to true this creates a curved return.Curved":"True"

Label

StringPlace a text label on the line.

“Label”=”string value”


Returns Example
{
“DiagramType”:”Mindmap”,
“RootShape”:[{“Label”:”Hello World”,
          ”ShapeList”:
[{”Shapes”:[{“Label:”:”Child 1”},{“Label”:”Child 2”}]}]
           },
           {}],
“Returns”:[{“StartID”:”2”,”EndID”:”3”}]
}


Title

The Title property generates a title string centered over the diagram ½” above it. It appears after the RootShape property.

Example
“Title”: {
    "Label": "Project Ownership for the web app saga"
}


Title Properties

AttributeAllowed ValuesDescriptionExample

Label

string

Required

The text label inside the shape.

You can use “/n” to create multi-line titles.

"Label": "Shape 1"



Table

A table property divides a shape up into a table of N rows by M columns. It is a property of a Shape or RootShape.

Example:

"Table": {
  "Rows":"5",
  "Columns":"2"
}

// With Join

"Table": {
    "Rows":"4",
    "Columns":"2",
    "Join": [
      {
        "Row": "1",
        "Column": "1",
        "N": "1",
        "Down": "1"
      }
    ]
  }

Table Properties

AttributeAllowed ValuesDescriptionExample

Rows

Integer

Required

The number of rows in the table. This can be omitted for a default of 1 if there are columns defined. If neither the number of  rows or columns is defined, the Table object is ignored.

“Rows”:”5”

Columns

Integer

Required

The number of columns in the table. This can be omitted for a default of 1 if there are rows defined. If neither the number of  rows or columns is defined, the Table object is ignored.

“Columns”:”2”

Join

Array

The Join property is an array of Join objects. A Join object defines a range of table cells to join into one cell. Join has the following properties.

“Join”=[{}]

Row

Integer

Required for Join

The row of the first cell to be joined to others to the right or below it. Note that the first row is row 1 not row 0.

“Row”:”2”

Column

Integer

Required for Join

The column of the first cell to be joined to others to the right or below it. Note that the first column is column 1 not column 0.

“Column”:”1”

ColumnWidthIntegerThis is part of a table definition and sets the width of all columns to a minimum of the value given in 1/100.
RowWidthIntegerThis is part of a table definition and sets the height of all rows to a minimum of the value given in 1/100.

N

IntegerThe number of cells to join to the first cell. If this exceeds the number of cells available within a row or column the number is reduced to the maximum possible. The default value is 1. Used in Join

“N”:”2”

Down

IntegerBy default, joins happen in rows. Adding this parameter with a non zero value makes the  join happen down the column. Used in Join 

“Down”:”1”

Cells

ArrayThe Cells property is an array of Cell objects. A Cell object defines specific properties for a cell in the table.

“Cell”:[]

AlternateRowsHex ColorsThe new "AlternateRows" attribute of Tables makes them have alternating colors for each row. Any color set for a specific cell overrides the alternating row colors.

"AlternateRows":

{

"Color1":"#FF0000",

"Color2":"#00FF00"

}




Cell Properties

Shares many properties with Shape

AttributeAllowed ValuesDescriptionExample

Row

Integer

Required

The row of the cell in question. Note that the first row is row 1 not row 0.

“Row”:”2”

Column

Integer

Required

The column of the cell in question. Note that the first column is column 1 not column 0.

“Column”:”1”

Label

StringThe text label inside the cell..

“Label”=”string value”

TextBold

BooleanMake the text label bold with a value of 1, not bold with 0, otherwise, if omitted, boldness follows the template default.

“TextBold”:”1”

TextItalic

BooleanMake the text label italic with a value of 1, not italic with 0, otherwise, if omitted, italic follows the template default.

“TextItalic”:”1”

TextUnderline

BooleanMake the text label underlined with a value of 1, not underlined with 0, otherwise, if omitted, underlined follows the template default.

“TextUnderline”:”1”

TextSize

IntegerMake the point size of the text label the specified value. Otherwise the text size is the default for the template.

“TextSize”:”12”

TextFont

Any font nameMake the font of the text label the specified value. Otherwise the font is the default for the template.

“TextFont”:”Baskerville”

TextColor

RGB color in HexadecimalMake the color of the text label the specified RGB value . Otherwise the color is the default for the template.

“TextColor”:”#FF00FF”

TextAlignH

  • left
  • center
  • right
Align the text label to the left, right or centered in the cell . Otherwise the alignment is the default for the template. Note that the allowed values are lower case.

“TextAlignH”:”left”

TextAlignV

  • top
  • middle
  • bottom
Align the text label to the top, bottom or middle in the cell . Otherwise the alignment is the default for the template. Note that the allowed values are lower case: “top”, ”middle” and “bottom”.

“TextAlignV”:”top”

FillColor

RGB color in HexadecimalMake the fill color of the cell the specified RGB value . Otherwise the color is the default for the template.

“FillColor”:”#FF00FF”

Hyperlink

StringAdd a hyperlink to a cell. 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.

“Hyperlink”:{“url”:”urlstring”}

ImageURL

This defines the url to the image to be shown in the cell.

“ImageURL”: {“url”:”urlstring”}



Row & Column Properties

The RowProperties property is an array of RowProperty objects. The RowProperty object defines specific properties for a row in the table. The ColumnProperties property is an array of ColumnProperty objects. The ColumnProperty object defines specific properties for a row in the table.

// Row Properties
  “RowProperties”:[
    {

    }
  ]

// Column Properties
  “ColumnProperties”:[
    {

    }
  ]
AttributeAllowed ValuesDescriptionExample

Row

Integer

Required

The row in question. Note that the first row is row 1 not row 0.

“Row”:”2”

Height

IntegerThe minimum height of the row in 1/100”. The text in cells in the row may force the row to be taller than this height.

“Height”=”50”

Column

IntegerThe column in question. Note that the first column is column 1 not column 0.

“Column”:”2”

Width

IntegerThe desired width of the column in 1/100”. Note any change n column N’s width reduces the width of column N+1 by the same amount.

“Width”=”50”

LineThick

IntegerThe thickness of the line in 1/100”. Otherwise the thickness is the default for the template.

“LineThick”:”2”

LineColor

RGB color in HexadecimalMake the line color of the connector the specified RGB value . Otherwise the color is the default for the template.

“LineColor”:”#FF00FF”





  • No labels