Skip to content

Commit 451ef89

Browse files
Added api annotations org chart config
1 parent 5bc8301 commit 451ef89

File tree

2 files changed

+65
-66
lines changed

2 files changed

+65
-66
lines changed

src.primitives/Controls/FamDiagram/configs/Config.js

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
1-
/*
2-
Class: primitives.famdiagram.Config
3-
famDiagram options class. Multi-parent hierarchical chart configuration.
4-
5-
*/
1+
/**
2+
* @class Config
3+
* @classdesc Family Chart configuration object. Use this object as a reference
4+
* for available properties and their default values.
5+
*
6+
* @param {string} name
7+
*/
68
primitives.famdiagram.Config = function (name) {
79
this.name = (name !== undefined) ? name : "FamDiagram";
810
this.classPrefix = "famdiagram";
911

10-
/*
11-
Property: navigationMode
12-
Defines control navigation mode. By default control replicates interactivity of regular Tree control.
13-
It has highlight for mouse over feedback and it has cursor for showing currently selected single node in diagram.
14-
In order to avoid creation of plus/minus buttons for children nodes folding and unfolding,
15-
this functionality is done automatically for current cursor item. This is especially true for family diagram,
16-
because it has no logical root, so cursor plays vital role for unfolding of nodes
17-
and zooming into area of user interest in diagram.
18-
Use this option to disable highlight which does not make sense on touch devices or make control inactive completly.
19-
20-
See Also:
21-
<primitives.common.NavigationMode>
22-
Default:
23-
<primitives.common.NavigationMode.Default>
24-
*/
12+
/**
13+
* Sets control navigation mode.
14+
*
15+
* By default control replicates interactivity of regular collection control. It has cursor to select single
16+
* item in the collection. So user can click and select any node in the diagram. The control has highlight for mouse over feedback.
17+
* So user can move mouse and see highlight frame and callout callback annotation for node under cursor.
18+
*
19+
* By `Default` the control has both cursor and highlight. If they are disabled then control is rendered as a static image.
20+
*
21+
* @type {NavigationMode}
22+
*/
2523
this.navigationMode = primitives.common.NavigationMode.Default;
2624

2725
/*

src.primitives/Controls/OrgDiagram/Configs/Config.js

Lines changed: 47 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
/*
2-
Class: primitives.orgdiagram.Config
3-
jQuery orgDiagram Widget options class. Organizational chart configuration object.
4-
5-
*/
1+
/**
2+
* @class Config
3+
* @classdesc Organizational Chart configuration object. Use this object as a reference
4+
* for available properties and their default values.
5+
*
6+
* @param {string} name
7+
*/
68
primitives.orgdiagram.Config = function (name) {
79
this.name = (name !== undefined) ? name : "OrgDiagram";
810
this.classPrefix = "orgdiagram";
@@ -14,7 +16,7 @@ primitives.orgdiagram.Config = function (name) {
1416
* item in the collection. So user can click and select any node in the diagram. The control has highlight for mouse over feedback.
1517
* So user can move mouse and see highlight frame and callout callback annotation for node under cursor.
1618
*
17-
* By `Default` the control has both cursor and highlight. If they are disabled then control is rendered as static image.
19+
* By `Default` the control has both cursor and highlight. If they are disabled then control is rendered as a static image.
1820
*
1921
* @type {NavigationMode}
2022
*/
@@ -136,54 +138,53 @@ primitives.orgdiagram.Config = function (name) {
136138
*/
137139
this.emptyDiagramMessage = "Diagram is empty.";
138140

139-
/*
140-
Property: items
141-
This is chart items collection. It is regular array of items of type ItemConfig. Items reference each other via parent property.
142-
So every item may have only one parent in chart. If parent set to null then item displayed at root of chart.
143-
Chart can have multiple root items simultaniously. If item references missing item, then it is ignored.
144-
If items loop each other they are ignored as well. It is applications responsiblity to avoid such issues.
145-
146-
See Also:
147-
<primitives.orgdiagram.ItemConfig>
148-
<primitives.orgdiagram.ItemConfig.id>
149-
<primitives.orgdiagram.ItemConfig.parent>
150-
*/
141+
/**
142+
* Items collection. Ths property defines data we render in the diagram.
143+
*
144+
* Every items should have unique `id` property set. They are used to create relations
145+
* between items in the diagram and for rendering various UI elements bound to nodes.
146+
*
147+
* @type {ItemConfig[]}
148+
*/
151149
this.items = [];
152150

153-
/*
154-
Property: annotations
155-
Array of annotaion objects. Chart supports several types of annotations. By default they are drawn on top of chart items and they block mouse events of UI elements placed in item templates.
156-
The design assumes only few of them being displayed simultanuosly in other words chart does not resolve mutual overlaps of annotations, so don't over use them.
157-
This is especially true for connectors and background annotations.
158-
159-
See also:
160-
<primitives.orgdiagram.ConnectorAnnotationConfig>
161-
<primitives.orgdiagram.ShapeAnnotationConfig>
162-
<primitives.orgdiagram.BackgroundAnnotationConfig>
163-
<primitives.orgdiagram.HighlightPathAnnotationConfig>
164-
*/
151+
/**
152+
* Annotations. Annotations are API elements that are attached to the diagram nodes.
153+
* We draw our annotations either in front of the nodes or in the background. The annotations
154+
* don't affect the nodes placement in any way. As a result the control redraws them
155+
* instantaneously without rerendering or recalculating the actual diagram layout.
156+
*
157+
* @type {Array.<(ShapeAnnotationConfig | BackgroundAnnotationConfig | ConnectorAnnotationConfig | HighlightPathAnnotationConfig)>}
158+
*/
165159
this.annotations = [];
166160

167-
/*
168-
Property: cursorItem
169-
Cursor item id - it is single item selection mode, user selects new cursor item on mouse click.
170-
Cursor defines current local zoom placement or in other words current navigation item in the chart,
171-
all items relative to cursor always shoun in full size. So user can see all possible items around cursor in full size
172-
and can continue navigation around chart. So when user navigates from one item to another clicking on thems and changing cursor item
173-
in chart, chart minimizes items going out of cursor scope and shows in full size items relative to new cursor position.
174-
If it is null then no cursor shown on diagram.
175-
176-
See Also:
177-
<primitives.orgdiagram.ItemConfig.id>
178-
<primitives.orgdiagram.Config.onCursorChanging>
179-
<primitives.orgdiagram.Config.onCursorChanged>
180-
*/
161+
/**
162+
* Cursor item. Organization Chart control has API options equivalent to regular UI controls.
163+
* The cursor item is used to select single item in the hierarchy with mouse click,
164+
* highlight item provides visual feed back on mouse over. Selected items collection
165+
* is equivalent to checked items in ListView or TreeView controls.
166+
*
167+
* Chart navigation depends on current cursor item, chart shows cursor and its neighbours
168+
* in full size regardless of enabled page fit mode. So cursor item plays a role of local
169+
* zoom in the chart hierarchy. User navigates around chart via clicking and moving
170+
* cursor item around and zooming into data around new cursor item.
171+
*
172+
* The control notifies about this property chnges with `onHighlightChanging` and `onHighlightChanged` events.
173+
*
174+
* If `null` then no cursor item selected in the diagram.
175+
*
176+
* @type {string}
177+
*/
181178
this.cursorItem = null;
182179

183180
/**
184181
* Highlighted item. Shows highlight and callout annotation for given item id. It does not trigger diagram
185182
* layout or scrolling so it can be used to syncronize mouse over feedback of the diagram nodes with other
186-
* collection controls or UI elements. If it is `null` then no highlight shown on the diagram.
183+
* collection controls or UI elements.
184+
*
185+
* The control notifies about this property chnges with `onHighlightChanging` and `onHighlightChanged` events.
186+
*
187+
* If `null` then no highlight shown on the diagram.
187188
*
188189
* @type {string}
189190
*/
@@ -205,7 +206,7 @@ primitives.orgdiagram.Config = function (name) {
205206
* Selected items collection. Selected items is a collection of items ids having checked their check boxes.
206207
* The control always shows selected items in the full size form, regardless of enabled page fit mode.
207208
*
208-
* The control notifies about use made changes in this collection with `onSelectionChanging` and `onSelectionChanged` events.
209+
* The control notifies about user made changes in this collection with `onSelectionChanging` and `onSelectionChanged` events.
209210
*
210211
* @type {string[]}
211212
*/

0 commit comments

Comments
 (0)