-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathOrgDiagram.js
More file actions
49 lines (47 loc) · 2.13 KB
/
OrgDiagram.js
File metadata and controls
49 lines (47 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import AnnotationLabelTemplate from './templates/html/AnnotationLabelTemplate';
import EndPointTemplate from './templates/html/EndPointTemplate';
import ButtonsTemplate from './templates/html/ButtonsTemplate';
import CustomRenderTemplate from './templates/html/CustomRenderTemplate';
import CheckBoxTemplate from './templates/html/CheckBoxTemplate';
import CursorTemplate from './templates/html/CursorTemplate';
import DotHighlightTemplate from './templates/html/DotHighlightTemplate';
import GroupTitleTemplate from './templates/html/GroupTitleTemplate';
import HighlightTemplate from './templates/html/HighlightTemplate';
import ItemTemplate from './templates/html/ItemTemplate';
import UserTemplate from './templates/html/UserTemplate';
import LabelAnnotationTemplate from './templates/html/LabelAnnotationTemplate';
import LevelTitleTemplate from './templates/html/LevelTitleTemplate';
import LevelBackgroundTemplate from './templates/html/LevelBackgroundTemplate';
import OrgTaskManagerFactory from './OrgTaskManagerFactory';
import OrgEventArgsFactory from './OrgEventArgsFactory';
import BaseControl from './BaseControl';
/**
* Creates JavaScript Organizational Chart Control
* @class Control
* @param {object} element Reference to placeholder `div` element in the DOM. The control renders diagram content
* inside of that div element and adds events listeners.
* @param {OrgConfig} options Organizational Chart Configuration object
*
* @returns {OrgDiagram} Returns reference to Organizational Chart control. Since control adds event listeners bound
* to its contents, call `destroy` method to clean up everything.
*/
export default function OrgDiagram(element, options, templates) {
return BaseControl(element, options, OrgTaskManagerFactory, OrgEventArgsFactory, {
AnnotationLabelTemplate,
EndPointTemplate,
ButtonsTemplate,
CustomRenderTemplate,
CheckBoxTemplate,
CursorTemplate,
DotHighlightTemplate,
GroupTitleTemplate,
HighlightTemplate,
ItemTemplate,
UserTemplate,
LevelTitleTemplate,
LevelBackgroundTemplate,
/* FamDiagram specific templates */
LabelAnnotationTemplate,
...templates
});
};