Skip to content

Commit dd7ba62

Browse files
Added loops layout optimization
1 parent 9daebd8 commit dd7ba62

File tree

25 files changed

+2244
-1729
lines changed

25 files changed

+2244
-1729
lines changed

samples/data/famdata.js

Lines changed: 106 additions & 109 deletions
Large diffs are not rendered by default.

samples/javascript.controls/DemoFamily.html

Lines changed: 126 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
77

88
<!-- header -->
9-
<!-- # include file="../../src.primitives/src.primitives.html"-->
9+
<!-- #include file="../../src.primitives/src.primitives.html"-->
1010
<link href="../../min/primitives.latest.css?5100" media="screen" rel="stylesheet" type="text/css" />
11-
<script type="text/javascript" src="../../min/primitives.min.js?5100"></script>
11+
<!-- <script type="text/javascript" src="../../min/primitives.min.js?5100"></script> -->
1212
<script type="text/javascript" src="common/helpers.js"></script>
1313
<script type="text/javascript" src="../data/famdata.js"></script>
1414

@@ -25,130 +25,130 @@
2525
new primitives.helpers.controls.RadioBoxConfig("dataSet", defaultDataSetName, "Select Data Set", dataSetNames, primitives.helpers.controls.ValueType.String, onUpdate)
2626
])
2727
], {
28-
/* Data Sets */
29-
dataSet: defaultDataSetName,
30-
31-
/* Family Diagram Specific Options */
32-
neighboursSelectionMode: primitives.common.NeighboursSelectionMode.ParentsChildrenSiblingsAndSpouses,
33-
groupByType: primitives.common.GroupByType.Children,
34-
alignBylevels: "true",
35-
hideGrandParentsConnectors: "false",
36-
enableMatrixLayout: "false",
37-
minimumMatrixSize: 2,
38-
maximumColumnsInMatrix: 6,
39-
40-
/* On-screen annotations specific options */
41-
AnnotationOptions: {
42-
connectorPlacementType: primitives.common.ConnectorPlacementType.Offbeat,
43-
connectorShapeType: primitives.common.ConnectorShapeType.OneWay,
44-
labelPlacementType: primitives.common.ConnectorLabelPlacementType.Between,
45-
lineWidth: 2,
46-
lineType: primitives.common.LineType.Dashed,
47-
color: primitives.common.Colors.Red,
48-
offset: 5,
49-
zOrderType: primitives.common.ZOrderType.Auto
50-
},
51-
/* Layout */
52-
pageFitMode: primitives.common.PageFitMode.FitToPage,
53-
orientationType: primitives.common.OrientationType.Top,
54-
verticalAlignment: primitives.common.VerticalAlignmentType.Middle,
55-
horizontalAlignment: primitives.common.HorizontalAlignmentType.Center,
56-
childrenPlacementType: primitives.common.ChildrenPlacementType.Horizontal,
57-
leavesPlacementType: primitives.common.ChildrenPlacementType.Horizontal,
58-
maximumColumnsInMatrix: 6,
59-
minimalVisibility: primitives.common.Visibility.Dot,
60-
selectionPathMode: primitives.common.SelectionPathMode.None,
61-
62-
hasButtons: primitives.common.Enabled.Auto,
63-
hasSelectorCheckbox: primitives.common.Enabled.True,
64-
selectCheckBoxLabel: "Selected",
65-
itemTitleFirstFontColor: primitives.common.Colors.White,
66-
itemTitleSecondFontColor: primitives.common.Colors.White,
67-
buttonsPanelSize: 28,
68-
groupTitlePanelSize: 24,
69-
checkBoxPanelSize: 24,
70-
71-
/* group title options */
72-
groupTitlePlacementType: primitives.common.AdviserPlacementType.Left,
73-
groupTitleOrientation: primitives.text.TextOrientationType.RotateRight,
74-
groupTitleVerticalAlignment: primitives.common.VerticalAlignmentType.Middle,
75-
groupTitleHorizontalAlignment: primitives.common.HorizontalAlignmentType.Center,
76-
groupTitleFontSize: "12px",
77-
groupTitleFontFamily: "Arial",
78-
groupTitleColor: primitives.common.Colors.RoyalBlue,
79-
groupTitleFontWeight: "normal",
80-
groupTitleFontStyle: "normal",
81-
82-
/* Template */
83-
DefaultTemplateOptions: {
84-
minimizedItemCornerRadius: 12,
85-
minimizedItemSize: new primitives.common.Size(16, 16),
86-
highlightPadding: 4,
87-
minimizedItemShapeType: primitives.common.ShapeType.None,
88-
minimizedItemLineWidth: 1,
89-
minimizedItemLineType: primitives.common.LineType.Solid,
90-
minimizedItemBorderColor: null,
91-
minimizedItemFillColor: null,
92-
minimizedItemOpacity: 1.0
93-
},
94-
95-
/* Intervals */
96-
normalLevelShift: 20,
97-
dotLevelShift: 20,
98-
lineLevelShift: 20,
99-
100-
normalItemsInterval: 20,
101-
dotItemsInterval: 10,
102-
lineItemsInterval: 10,
103-
104-
cousinsIntervalMultiplier: 0,
105-
106-
/* Connectors */
107-
arrowsDirection: primitives.common.GroupByType.Parents,
108-
showExtraArrows: true,
109-
extraArrowsMinimumSpace: 30,
110-
connectorType: primitives.common.ConnectorType.Squared,
111-
elbowType: primitives.common.ElbowType.Round,
112-
bevelSize: 4,
113-
elbowDotSize: 4,
114-
linesType: primitives.common.LineType.Solid,
115-
linesColor: primitives.common.Colors.Black,
116-
linesWidth: 1,
117-
118-
/* Labels */
119-
showLabels: primitives.common.Enabled.Auto,
120-
labelSize: new primitives.common.Size(60, 40),
121-
labelOrientation: primitives.text.TextOrientationType.Horizontal,
122-
labelPlacement: primitives.common.PlacementType.Top,
123-
labelOffset: 1,
124-
labelFontSize: "10px",
125-
labelFontFamily: "Arial",
126-
labelColor: primitives.common.Colors.Black,
127-
labelFontWeight: "normal",
128-
labelFontStyle: "normal",
129-
130-
/* Callout */
131-
calloutMaximumVisibility: primitives.common.Visibility.Dot,
132-
showCallout: "true",
133-
calloutPlacementOffset: 100,
134-
calloutfillColor: "#000000",
135-
calloutBorderColor: null,
136-
calloutOffset: 4,
137-
calloutCornerRadius: 4,
138-
calloutPointerWidth: "10%",
139-
calloutLineWidth: 1,
140-
calloutOpacity: 0.2,
141-
142-
/* Interactivity */
143-
navigationMode: primitives.common.NavigationMode.Default,
144-
highlightGravityRadius: 40,
145-
enablePanning: true,
146-
147-
/* Graphics */
148-
graphicsType: primitives.common.GraphicsType.SVG,
149-
150-
scale: 1.0
28+
/* Data Sets */
29+
dataSet: defaultDataSetName,
30+
31+
/* Family Diagram Specific Options */
32+
neighboursSelectionMode: primitives.common.NeighboursSelectionMode.ParentsChildrenSiblingsAndSpouses,
33+
groupByType: primitives.common.GroupByType.Children,
34+
alignBylevels: "true",
35+
hideGrandParentsConnectors: "false",
36+
enableMatrixLayout: "false",
37+
minimumMatrixSize: 2,
38+
maximumColumnsInMatrix: 6,
39+
40+
/* On-screen annotations specific options */
41+
AnnotationOptions: {
42+
connectorPlacementType: primitives.common.ConnectorPlacementType.Offbeat,
43+
connectorShapeType: primitives.common.ConnectorShapeType.OneWay,
44+
labelPlacementType: primitives.common.ConnectorLabelPlacementType.Between,
45+
lineWidth: 2,
46+
lineType: primitives.common.LineType.Dashed,
47+
color: primitives.common.Colors.Red,
48+
offset: 5,
49+
zOrderType: primitives.common.ZOrderType.Auto
15150
},
51+
/* Layout */
52+
pageFitMode: primitives.common.PageFitMode.FitToPage,
53+
orientationType: primitives.common.OrientationType.Top,
54+
verticalAlignment: primitives.common.VerticalAlignmentType.Middle,
55+
horizontalAlignment: primitives.common.HorizontalAlignmentType.Center,
56+
childrenPlacementType: primitives.common.ChildrenPlacementType.Horizontal,
57+
leavesPlacementType: primitives.common.ChildrenPlacementType.Horizontal,
58+
maximumColumnsInMatrix: 6,
59+
minimalVisibility: primitives.common.Visibility.Dot,
60+
selectionPathMode: primitives.common.SelectionPathMode.None,
61+
62+
hasButtons: primitives.common.Enabled.Auto,
63+
hasSelectorCheckbox: primitives.common.Enabled.True,
64+
selectCheckBoxLabel: "Selected",
65+
itemTitleFirstFontColor: primitives.common.Colors.White,
66+
itemTitleSecondFontColor: primitives.common.Colors.White,
67+
buttonsPanelSize: 28,
68+
groupTitlePanelSize: 24,
69+
checkBoxPanelSize: 24,
70+
71+
/* group title options */
72+
groupTitlePlacementType: primitives.common.AdviserPlacementType.Left,
73+
groupTitleOrientation: primitives.text.TextOrientationType.RotateRight,
74+
groupTitleVerticalAlignment: primitives.common.VerticalAlignmentType.Middle,
75+
groupTitleHorizontalAlignment: primitives.common.HorizontalAlignmentType.Center,
76+
groupTitleFontSize: "12px",
77+
groupTitleFontFamily: "Arial",
78+
groupTitleColor: primitives.common.Colors.RoyalBlue,
79+
groupTitleFontWeight: "normal",
80+
groupTitleFontStyle: "normal",
81+
82+
/* Template */
83+
DefaultTemplateOptions: {
84+
minimizedItemCornerRadius: 12,
85+
minimizedItemSize: new primitives.common.Size(16, 16),
86+
highlightPadding: 4,
87+
minimizedItemShapeType: primitives.common.ShapeType.None,
88+
minimizedItemLineWidth: 1,
89+
minimizedItemLineType: primitives.common.LineType.Solid,
90+
minimizedItemBorderColor: null,
91+
minimizedItemFillColor: null,
92+
minimizedItemOpacity: 1.0
93+
},
94+
95+
/* Intervals */
96+
normalLevelShift: 20,
97+
dotLevelShift: 20,
98+
lineLevelShift: 20,
99+
100+
normalItemsInterval: 20,
101+
dotItemsInterval: 10,
102+
lineItemsInterval: 10,
103+
104+
cousinsIntervalMultiplier: 0,
105+
106+
/* Connectors */
107+
arrowsDirection: primitives.common.GroupByType.Parents,
108+
showExtraArrows: true,
109+
extraArrowsMinimumSpace: 30,
110+
connectorType: primitives.common.ConnectorType.Squared,
111+
elbowType: primitives.common.ElbowType.Round,
112+
bevelSize: 4,
113+
elbowDotSize: 4,
114+
linesType: primitives.common.LineType.Solid,
115+
linesColor: primitives.common.Colors.Black,
116+
linesWidth: 1,
117+
118+
/* Labels */
119+
showLabels: primitives.common.Enabled.Auto,
120+
labelSize: new primitives.common.Size(60, 40),
121+
labelOrientation: primitives.text.TextOrientationType.Horizontal,
122+
labelPlacement: primitives.common.PlacementType.Top,
123+
labelOffset: 1,
124+
labelFontSize: "10px",
125+
labelFontFamily: "Arial",
126+
labelColor: primitives.common.Colors.Black,
127+
labelFontWeight: "normal",
128+
labelFontStyle: "normal",
129+
130+
/* Callout */
131+
calloutMaximumVisibility: primitives.common.Visibility.Dot,
132+
showCallout: "true",
133+
calloutPlacementOffset: 100,
134+
calloutfillColor: "#000000",
135+
calloutBorderColor: null,
136+
calloutOffset: 4,
137+
calloutCornerRadius: 4,
138+
calloutPointerWidth: "10%",
139+
calloutLineWidth: 1,
140+
calloutOpacity: 0.2,
141+
142+
/* Interactivity */
143+
navigationMode: primitives.common.NavigationMode.Default,
144+
highlightGravityRadius: 40,
145+
enablePanning: true,
146+
147+
/* Graphics */
148+
graphicsType: primitives.common.GraphicsType.SVG,
149+
150+
scale: 1.0
151+
},
152152
/* On property change event handler */
153153
onUpdate
154154
);
@@ -322,7 +322,7 @@
322322
}
323323

324324
function updateHighlightPathAnnotations(data) {
325-
var annotations = control.getOption("annotations");
325+
var annotations = control.getOption("annotations") || [];
326326

327327
var newAnnotations = [];
328328
for (var index = 0, len = annotations.length; index < len; index += 1) {

src.primitives/Controls/FamDiagram/TaskManagerFactory.js

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)