Skip to content

Commit 4e0f4d5

Browse files
authored
Merge pull request #65 from DHTMLX/next
Docs updates for v6.1
2 parents 19af65b + 0b1ffa3 commit 4e0f4d5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+3155
-1396
lines changed

docs/api/data_collection/parse_method.md

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,39 @@ description: You can learn about the parse method of data collection in the docu
88

99
### Description
1010

11-
@short: Loads data from a local data source
11+
@short: Loads data from a local data source into a diagram and processes them
1212

1313
### Usage
1414

1515
~~~jsx
1616
parse(
17-
data: array | string,
17+
data: object[] | { data: object[]; links: object[] } | string,
1818
driver?: object | string
1919
): void;
2020
~~~
2121

2222
### Parameters
2323

24-
- `data` - (required) the data to load. You can load data in any supported data format
24+
- `data: object[] | { data: object[]; links: object[] } | string` - (required) the data to load. You can load data in any supported data format. The data structure depends on the diagram mode:
25+
- for the default, org chart and mindmap Diagram modes it is set as an array that contains a set of data objects
26+
~~~jsx
27+
data: object[]; // an array of all shapes and connections
28+
~~~
29+
- for the PERT Diagram mode it is an object with:
30+
- the `data` array (for shapes: "task", "milestone", "project")
31+
- the `links` array (for connections between shapes)
32+
~~~jsx
33+
{
34+
data: object[]; // an array of shapes (tasks, milestones, projects)
35+
links: object[] // an array of connections between the shapes
36+
};
37+
~~~
2538
- `driver` - (optional) DataDriver or type of data ("json", "csv", "xml"), "json" by default
2639

2740
### Example
2841

42+
- for the org chart mode of diagram:
43+
2944
~~~jsx
3045
const data = [
3146
{
@@ -50,10 +65,40 @@ const data = [
5065
{ id: "1-3", from: "1", to: "3", type: "line" }
5166
];
5267

53-
const diagram = new dhx.Diagram("diagram_container", { type: "org" });
68+
const diagram = new dhx.Diagram("diagram_container", {
69+
type: "org"
70+
});
71+
5472
diagram.data.parse(data);
5573
~~~
5674

75+
- for the PERT mode of diagram:
76+
77+
~~~jsx
78+
const dataset = {
79+
data: [
80+
{ id: "1", text: "Project #1", type: "project", parent: null },
81+
{ id: "1.1", text: "Task #1", parent: "1", type: "task", start_date: new Date(2026, 0, 1), duration: 10 },
82+
{ id: "1.2", text: "Task #2", parent: "1", type: "task", start_date: new Date(2026, 0, 1), duration: 10 },
83+
{ id: "2.1", text: "Task #3", parent: null, type: "task", start_date: new Date(2026, 0, 1), duration: 10 },
84+
{ id: "2.2", text: "Task #4", parent: null, type: "task", start_date: new Date(2026, 0, 1), duration: 10 },
85+
],
86+
links: [
87+
{ id: "line-1", source: "1.1", target: "1.2" },
88+
{ id: "line-2", source: "1.2", target: "2.1" },
89+
{ id: "line-3", source: "2.1", target: "2.2" },
90+
]
91+
};
92+
93+
const diagram = new dhx.Diagram("diagram_container", {
94+
type: "pert"
95+
});
96+
97+
diagram.data.parse(dataset);
98+
~~~
99+
57100
**Related articles**: [Loading and storing data](../../../guides/loading_data/)
58101

59-
**Related sample**: [Diagram. Org chart mode. Basic initialization](https://snippet.dhtmlx.com/5ign6fyy)
102+
**Related samples**:
103+
- [Diagram. Org chart mode. Basic initialization](https://snippet.dhtmlx.com/5ign6fyy)
104+
- [Diagram. PERT chart. Initialization](https://snippet.dhtmlx.com/4h5fi7xd)

docs/api/data_collection/serialize_method.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,47 @@ description: You can learn about the serialize method of data collection in the
88

99
### Description
1010

11-
@short: Serializes the diagram data into an array of JSON objects
11+
@short: Exports the current diagram data
1212

1313
### Usage
1414

1515
~~~jsx
16-
serialize(): array;
16+
serialize(): object[] | { data: object[]; links: object[] };
1717
~~~
1818

1919
### Returns
2020

21-
The method returns an array of JSON objects for each item and link from Diagram
21+
Depending on the diagram mode, the method returns:
22+
23+
- `object[]` - (for the default, org chart and mindmap Diagram modes) an array of objects for each item and link from Diagram
24+
- `{ data: object[]; links: object[] }` - (for the PERT Diagram mode) an object with:
25+
- the `data` array of objects (for shapes: "task", "milestone", "project")
26+
- the `links` array of objects (for connections between shapes)
2227

2328
### Example
2429

30+
- for the default diagram mode
31+
2532
~~~jsx {6}
2633
const diagram = new dhx.Diagram("diagram_container", {
2734
type: "default"
2835
});
2936
diagram.data.parse(data);
3037

31-
const data = diagram.data.serialize();
38+
const data = diagram.data.serialize(); // -> [{...}, {...}, {...}, {...}]
39+
~~~
40+
41+
- for the PERT diagram mode
42+
43+
~~~jsx {6}
44+
const diagram = new dhx.Diagram("diagram_container", {
45+
type: "pert"
46+
});
47+
diagram.data.parse(dataset);
48+
49+
const dataset = diagram.data.serialize(); // -> { data: [...], links: [...] };
3250
~~~
3351

52+
Note that for the PERT Diagram mode the *links* objects in the exported data object will have [the same types as in the DHTMLX Gantt chart](https://docs.dhtmlx.com/gantt/desktop__link_properties.html). It means that if the type of a link in the Diagram data coincides with some of the Gantt links types, it will remain the same during serialization. If the link type isn't specified or set differently (for example, `type: "line"`), it will be converted into `type: "0"`.
53+
3454
**Related articles**: [Saving and restoring state](../../../guides/loading_data/#saving-and-restoring-state)

docs/api/diagram/defaultshapetype_property.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ description: You can learn about the defaultShapeType property in the documentat
1111
@short: Optional. The default type of a shape
1212

1313
The value is applied, if the shape object doesn't contain the "type" property
14+
1415
### Usage
1516

1617
~~~jsx
@@ -37,6 +38,12 @@ defaultShapeType: "card"
3738
defaultShapeType: "topic"
3839
~~~
3940

41+
- In the **PERT** mode of Diagram (type: "pert")
42+
43+
~~~jsx
44+
defaultShapeType: "task"
45+
~~~
46+
4047
### Example
4148

4249
~~~jsx

docs/api/diagram/lineconfig_property.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,46 @@ description: You can learn about the lineConfig property in the documentation of
1515
~~~jsx
1616
lineConfig?: {
1717
lineType?: "dash" | "line",
18-
lineGap?: number
18+
lineGap?: number,
19+
connectType?: "elbow" | "straight" | "curved" // the "curved" type is used only in the mindmap mode
1920
};
2021
~~~
2122

2223
### Parameters
2324

24-
The **lineConfig** object contains the following parameter:
25+
The **lineConfig** object contains the following parameters:
2526

2627
- `lineType` - (optional) the default type of a connector line. The value is applied, if the line object doesn't contain the "type" property
2728
- `lineGap` - (optional) sets the distance to the right-angled bend of a connector line
29+
- `connectType` - (optional) sets the connection type of the lines: `"elbow"` | `"straight"` | `"curved"` (the "curved" type is used only in the mindmap Diagram mode). The value is applied, if the line object doesn't contain the "connectType" property
2830

2931
:::info
30-
The value of the **lineType** setting will be applied, if the line object doesn't contain the identical one
32+
The values of the **lineType** and **connectType** settings will be applied, if the line object doesn't contain the identical ones.
3133
:::
3234

3335
### Default config
3436

3537
~~~jsx
3638
lineConfig: {
37-
lineType: "line",
38-
lineGap: 10
39+
lineType: "line",
40+
lineGap: 10
3941
}
4042
~~~
4143

44+
The `connectType` parameter has the following default values:
45+
46+
- "elbow" - for the default and org chart Diagram modes
47+
- "curved" - for the mindmap Diagram mode (this type is used only in the mindmap Diagram mode)
48+
4249
### Example
4350

44-
~~~jsx {2-5}
51+
~~~jsx {2-7}
4552
const diagram = new dhx.Diagram("diagram_container", {
4653
type: "default",
4754
lineConfig: {
4855
lineType: "dash",
49-
lineGap: 50
56+
lineGap: 50,
57+
connectType: "straight"
5058
},
5159
// other config parameters
5260
});
@@ -60,7 +68,8 @@ The result of applying the **lineGap** property is shown in the image below:
6068

6169
**Change log**:
6270

63-
- The **lineGap** parameter is added in v5.0 (check the Migration article)
71+
- The `connectType` parameter is added in v6.1
72+
- The `lineGap` parameter is added in v5.0 (check the [Migration article](diagram/migration.md/#42---50))
6473
- Added in v4.2
6574

6675
**Related articles**: [Setting connections between shapes](../../../lines/#setting-connections-between-shapes)

docs/api/diagram/type_property.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,41 @@ description: You can learn about the type property in the documentation of the D
1313
### Usage
1414

1515
~~~jsx
16-
type: "default" | "org" | "mindmap";
16+
type: "default" | "org" | "mindmap" | "pert";
1717
~~~
1818

19-
### Details
19+
### Example
2020

21-
DHTMLX Diagram can be initialized in one of three modes:
21+
~~~jsx
22+
const diagram = new dhx.Diagram("diagram_container", {
23+
type: "default" // "org" | "mindmap" | "pert"
24+
});
25+
~~~
26+
27+
### Diagram modes
28+
29+
DHTMLX Diagram can be initialized in one of the following modes: "default", "org", "mindmap" or "pert". To apply the necessary mode, specify the corresponding value of the **type** property:
2230

2331
- **type:"default"** is used to visualize relations between some entities
2432

2533
<iframe src="https://snippet.dhtmlx.com/f3uekgjw?mode=result" frameborder="0" class="snippet_iframe" width="100%" height="600"></iframe>
2634

2735
- **type:"org"** is used to show the structure of a group of people by presenting their relations in a hierarchical order
2836

29-
<iframe src="https://snippet.dhtmlx.com/5ign6fyy?mode=js" frameborder="0" class="snippet_iframe" width="100%" height="600"></iframe>
37+
<iframe src="https://snippet.dhtmlx.com/5ign6fyy?mode=result" frameborder="0" class="snippet_iframe" width="100%" height="600"></iframe>
3038

3139
- **type:"mindmap"** is used to arrange information on some topic by representing the main concept surrounded by associated ideas
3240

3341
<iframe src="https://snippet.dhtmlx.com/twd25ww1?mode=result" frameborder="0" class="snippet_iframe" width="100%" height="600"></iframe>
3442

43+
- **type:"pert"** is used to show the sequences of tasks and projects, and visualize connections between them. This type of diagram is also useful in estimating the critical path and project planning
44+
45+
<iframe src="https://snippet.dhtmlx.com/4h5fi7xd?mode=result" frameborder="0" class="snippet_iframe" width="100%" height="600"></iframe>
46+
47+
**Change log**:
48+
49+
- The **"pert"** type was added in v6.1
50+
3551
**Related articles**:
3652

3753
- [Overview](../../../)

docs/api/diagram/typeconfig_property.md

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ The property does not work in the Editor
1212

1313
### Description
1414

15-
@short: Optional. An object which defines the direction of the shapes in the mindmap mode of Diagram
15+
@short: Optional. An object which provides configuration settings for Diagram in the mindmap and PERT modes
1616

17-
If you don't apply the **typeConfig** property, the child shapes will be arranged automatically according to the main algorithm
17+
For Diagram in the mindmap mode, the `typeConfig` property defines the direction of the shapes. If the property isn't applied, the child shapes will be arranged automatically according to the main algorithm.
18+
19+
For Diagram in the PERT mode, the `typeConfig` property allows setting the format of rendering dates in the task shapes.
1820

1921
### Usage
2022

23+
- for the mindmap mode
24+
2125
~~~jsx
2226
typeConfig?: {
2327
direction?: "left" | "right";
@@ -29,24 +33,37 @@ typeConfig?: {
2933
left?: string[],
3034
right?: string[]
3135
}
32-
}
36+
}
37+
~~~
38+
39+
- for the PERT mode
40+
41+
~~~jsx
42+
typeConfig?: {
43+
dateFormat?: string; // %d-%m-%Y by default
44+
}
3345
~~~
3446

3547
### Parameters
3648

37-
The **typeConfig** object can include one of two parameters:
49+
The `typeConfig` object can include one of the following parameters:
3850

39-
- `direction` - (optional) sets the direction of the graph:
40-
- *"left"* - puts child shapes of the graph to the left of the root shape
41-
- *"right"* - puts child shapes of the graph to the right of the root shape
42-
- `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
51+
- for the mindmap mode:
52+
- `direction` - (optional) sets the direction of the graph:
53+
- *"left"* - puts child shapes of the graph to the left of the root shape
54+
- *"right"* - puts child shapes of the graph to the right of the root shape
55+
- `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
56+
- for the PERT mode:
57+
- `dateFormat` - (optional) sets the format of rendering dates in the shapes of the **task** type. Affects rendering of dates in the user interface
4358

4459
:::tip
45-
You can use either the **direction** attribute or the **side** one. Don't use both of them at the same time!
60+
You can use either the `direction` attribute or the `side` one for the diagram in the mindmap mode. Don't use both of them at the same time!
4661
:::
4762

4863
### Example
4964

65+
- for the mindmap mode:
66+
5067
~~~jsx {3-5}
5168
const diagram = new dhx.Diagram("diagram_container", {
5269
type: "mindmap",
@@ -70,13 +87,28 @@ const diagram = new dhx.Diagram("diagram_container", {
7087
});
7188
~~~
7289

73-
The other child shapes that are not set in the **side** option will be arranged automatically according to the main algorithm.
90+
Note that the other child shapes that are not set in the `side` option will be arranged automatically according to the main algorithm.
91+
92+
- for the PERT mode:
93+
94+
~~~jsx {3-5}
95+
const diagram = new dhx.Diagram("diagram_container", {
96+
type: "pert",
97+
typeConfig: {
98+
dateFormat: "%d/%m/%Y"
99+
}
100+
});
101+
~~~
102+
103+
**Change log**:
74104

75-
**Change log**: Added in v3.1.
105+
- The `dateFormat` property for the PERT mode was added in v6.1
106+
- Added in v3.1.
76107

77108
**Related articles**: [Arrangement of shapes in the mindmap mode of Diagram](../../../guides/diagram/configuration/#arranging-shapes-in-the-mindmap-mode-of-diagram)
78109

79110
**Related samples**:
80111

81112
- [Diagram. Mindmap mode. Direction ("left" | "right")](https://snippet.dhtmlx.com/pzllujx3)
82113
- [Diagram. Mindmap mode. Custom sides](https://snippet.dhtmlx.com/atto9ckg)
114+
- [Diagram and Gantt. PERT chart. Full integration](https://snippet.dhtmlx.com/gcnx4a9h)

docs/api/diagram_editor/editbar/basic_controls/combo.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ description: You can explore the Combo control of Editbar in the documentation o
2727
padding?: string | number,
2828

2929
filter?: (item: any, input: string) => boolean,
30+
eventHandlers?: {
31+
[eventName: string]: {
32+
[className: string]: (event: Event, id: string | number) => void | boolean;
33+
};
34+
},
3035
itemHeight?: number | string, // 32 by default
3136
itemsCount?: boolean | ((count: number) => string),
3237
listHeight?: number | string, // 224 by default
@@ -75,7 +80,8 @@ Option configuration object inside Combo:
7580
- `height` - (optional) the height of a control. *"content"* by default
7681
- `width` - (optional) the width of a control. *"content"* by default
7782
- `padding` - (optional) sets padding between a cell and a border of a Combo control
78-
- `filter` - (optional) sets a custom function for filtering Combo options. [Check the details](https://docs.dhtmlx.com/suite/combobox/customization/#custom-filter-for-options).
83+
- `filter` - (optional) sets a custom function for filtering Combo options. [Check the details](https://docs.dhtmlx.com/suite/combobox/customization/#custom-filter-for-options)
84+
- `eventHandlers` - (optional) adds event handlers to HTML elements of a custom template of Combo items. [Check the details](https://docs.dhtmlx.com/suite/combobox/api/combobox_eventhandlers_config/)
7985
- `itemHeight` - (optional) sets the height of a cell in the list of options. *32* by default
8086
- `itemsCount` - (optional) shows the total number of selected options
8187
- `listHeight` - (optional) sets the height of the list of options. *224* by default

docs/api/diagram_editor/editbar/config/properties_property.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ description: You can learn about the properties property of Editbar in the docum
1212

1313
:::info
1414
The `properties` config allows you to do the following:
15-
- modify Editbar controls for all or individual Diaram elements base on [**Basic controls**](api/diagram_editor/editbar/basic_controls_overview.md) and/or [**Complex controls**](api/diagram_editor/editbar/complex_controls_overview.md)
15+
- modify Editbar controls for all or individual Diagram elements based on [**Basic controls**](api/diagram_editor/editbar/basic_controls_overview.md) and/or [**Complex controls**](api/diagram_editor/editbar/complex_controls_overview.md)
1616
- apply custom Editbar control(s) defined via the [`controls`](api/diagram_editor/editbar/config/controls_property.md) property to Diagram elements
1717
- specify conditions for applying an Editbar control (custom or default) to Diagram elements
1818

0 commit comments

Comments
 (0)