Skip to main content

typeConfig

info

The property does not work in the Editor

Description

Optional. An object which defines the direction of the shapes in the mindmap mode of Diagram

If you don't apply the typeConfig property, the child shapes will be arranged automatically according to the main algorithm

Usage

typeConfig?: {
direction?: "left" | "right";
}

//or
typeConfig?: {
side?: {
left?: string[],
right?: string[],
}
}

Parameters

The typeConfig object can include one of two parameters:

  • direction - (optional) sets the direction of the graph:
    • "left" - puts child shapes of the graph to the left of the root shape
    • "right" - puts child shapes of the graph to the right of the root shape
  • side - (optional) an object which sets the mandatory direction for the specified child shapes. The object contains a set of key:value pairs where key is the direction of the shapes (left, right) and value is an array with the ids of the shapes
tip

You can use either the direction attribute or the side one. Don't use both of them at the same time!

Example

const diagram = new dhx.Diagram("diagram_container", { 
type: "mindmap",
typeConfig: {
direction: "right",
},
});

or

const diagram = new dhx.Diagram("diagram_container", { 
type: "mindmap",
typeConfig: {
side: {
left: ["2", "3"],
right: ["4", "5"],
}
}
});

The other child shapes that are not set in the side option will be arranged automatically according to the main algorithm.

Change log: Added in v3.1.

Related articles: Arrangement of shapes in the mindmap mode of Diagram

Related samples: