initialData
The initialData object contains the following properties:
| Name | Type | Default |
|---|---|---|
version | string | undefined | undefined |
title | string | undefined | undefined |
description | string | undefined | undefined |
icons | Icon[] | [] |
colors | Color[] | [] |
items | Item[] | [] |
views | View[] | [] |
fitToScreen | boolean | false |
Example payload
An example payload can be found here on CodeSandbox (opens in a new tab).
Icon
{
id: string;
name: string;
url: string;
collection?: string;
isIsometric?: boolean;
}Notes on Icons:
collectionis an optional property that can be used to group icons together in the icon picker. All icons with the samecollectionwill be grouped together under the collection's name.- If you are using a non-isometric icon image, you can set
isIsometrictofalseto render it with an isometric perpective and help it blend into the scene.
Color
{
id: string;
value: string;
}Notes on Colors:
The value property accepts any color value in a CSS acceptable format (e.g. a hex value like #000000, a string value for example black or an rgba value for example rgba(0, 0, 0, 1)).
Item
{
id: string;
name: string;
description?: string;
icon: string;
}Notes on Items:
- The
descriptionproperty can accept markdown. - The
iconproperty accepts theidof anIcon.
View
{
id: string;
name: string;
description?: string;
items: ViewItem[];
rectangles?: Rectangle[];
connectors?: Connector[];
textBoxes?: TextBox[];
}Notes on Views:
- The
descriptionproperty can accept markdown.
ViewItem
{
id: string;
labelHeight?: number;
tile: {
x: number;
y: number;
}
}Notes on ViewItems:
- The
idproperty accepts theidof anItem(defined at root level).
Connector
{
id: string;
description?: string;
color?: string;
width?: number;
style?: 'SOLID' | 'DOTTED' | 'DASHED';
anchors: ConnectorAnchor[];
}Notes on connectors:
- The
colorproperty accepts anidof aColor(defined at root level). - A connector needs a minimum of 2 anchors to determine where it starts and ends. If you want more control over the connector's path you can specify additional anchors that the connector will pass through.
ConnectorAnchor
id: string;
ref:
| {
tile: {
x: number;
y: number;
}
}
| {
item: string;
}Notes on ConnectorAnchors
- Connector anchors can reference either a
tileor anitem. If the reference is to anitem, the anchor is dynamic and will be tied to the item's position. - When anchoring a connector to an
item, you must specify theidof the of the item being referred to.
Rectangle
{
id: string;
color?: string;
from: {
x: number;
y: number;
};
to: {
x: number;
y: number;
};
}TextBox
{
id: string;
tile: {
x: number;
y: number;
};
content: string;
fontSize?: number;
orientation?: 'X' | 'Y';
}Validation
The initialData object is validated before Isoflow renders the scene, and an error is thrown if invalid data is detected.
Examples of common errors are as follows:
- A
ConnectorAnchorreferences anItemthat does not exist. - An
Itemreferences anIconthat does not exist. - A
Rectanglehas afrombut not atoproperty. - A
Connectorhas less than 2 anchors.
