Skip to content

Commit e16aadc

Browse files
Merge pull request #41 from BasicPrimitives/showframe
Added showFrame property
2 parents 87d9222 + a86700a commit e16aadc

File tree

66 files changed

+2606
-216
lines changed

Some content is hidden

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

66 files changed

+2606
-216
lines changed

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#### Version 5.9.0
2+
* Add `showFrame`, `fameInnerPadding`, `frameOuterPadding` properties to `primitives.orgdiagram.Config` & `primitives.famdiagram.Config`
3+
* Modified callout annotation palacement for minimized nodes placed outside view port.
4+
* Fixed exception when `selectedItems` collection contains non existing items.
5+
* Fixed center on cursor in AutoSize mode
16
#### Version 5.8.2
27
* Fixed `selectionPathMode` in Family Diagram.
38
#### Version 5.8.1

index.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,13 @@
265265
jquery: "samples/jquery.widgets/CaseSelectedItems.html"
266266
}
267267
},
268+
{
269+
label: "Frame",
270+
frameworks: {
271+
javascript: "samples/javascript.controls/CaseShowFrame.html",
272+
jquery: "samples/jquery.widgets/CaseShowFrame.html"
273+
}
274+
},
268275
{
269276
label: "Buttons panel",
270277
frameworks: {

min/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "basicprimitives",
3-
"version": "5.8.2",
3+
"version": "5.9.0",
44
"description": "Basic Primitives Diagrams for JavaScript - data visualization components library that implements organizational chart and multi-parent dependency diagrams, contains implementations of JavaScript Controls and PDF rendering plugins.",
55
"main": "primitives.latest.js",
66
"scripts": {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"license": "SEE LICENSE IN license.pdf",
55
"scripts": {
66
"src.primitives.merge": "node merge.js src.primitives\\src.primitives.json",
7-
"src.primitives.compile": "npx google-closure-compiler --js=min\\primitives.latest.js --js_output_file=min\\primitives.min.js",
7+
"src.primitives.compile": "npx google-closure-compiler --platform=windows --js=min\\primitives.latest.js --js_output_file=min\\primitives.min.js",
88
"src.primitives.jquery.merge": "node merge.js src.primitives.jquery\\src.primitives.jquery.json",
9-
"src.primitives.jquery.compile": "npx google-closure-compiler --js=min\\primitives.jquery.latest.js --js_output_file=min\\primitives.jquery.min.js",
9+
"src.primitives.jquery.compile": "npx google-closure-compiler --platform=windows --js=min\\primitives.jquery.latest.js --js_output_file=min\\primitives.jquery.min.js",
1010
"src.tests.merge": "node merge.js src.tests\\src.tests.json",
1111
"merge": "yarn src.primitives.merge && yarn src.primitives.compile && yarn src.primitives.jquery.merge && yarn src.primitives.jquery.compile && yarn src.tests.merge",
1212
"apireference": "node apireference.js apireference.json",

samples/javascript.controls/CaseAutoSize.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"640*480": new primitives.common.Size(640, 480),
1515
"800*600": new primitives.common.Size(800, 600),
1616
"1024*768": new primitives.common.Size(1024, 768),
17-
"1280*1024": new primitives.common.Size(1280, 1024)
17+
"1280*1024": new primitives.common.Size(1280, 1024),
18+
"Unlimited": new primitives.common.Size(100000, 100000)
1819
}
1920

2021
document.addEventListener('DOMContentLoaded', function () {
@@ -55,15 +56,18 @@
5556
options.pageFitMode = primitives.common.PageFitMode.AutoSize;
5657
options.autoSizeMinimum = sizes[getRadioValue("autoSizeMinimum")];
5758
options.autoSizeMaximum = sizes[getRadioValue("autoSizeMaximum")];
59+
options.showFrame = false;
5860
control = primitives.orgdiagram.Control(document.getElementById("diagram"), options);
5961
});
6062

6163
function Update() {
6264
var autoSizeMinimum = sizes[getRadioValue("autoSizeMinimum")];
6365
var autoSizeMaximum = sizes[getRadioValue("autoSizeMaximum")];
66+
var showFrame = (getRadioValue("showFrame") == "1" ? true : false);
6467
control.setOptions({
6568
autoSizeMinimum: autoSizeMinimum,
66-
autoSizeMaximum: autoSizeMaximum
69+
autoSizeMaximum: autoSizeMaximum,
70+
showFrame: showFrame
6771
});
6872
control.update(primitives.common.UpdateMode.Refresh);
6973
}
@@ -80,6 +84,11 @@
8084
</script>
8185
</head>
8286
<body>
87+
<p>
88+
Show Selected Items on the frame:
89+
<label><input onclick="Update()" name="showFrame" type="radio" value="1">Yes</label>
90+
<label><input onclick="Update()" name="showFrame" type="radio" value="0" checked="">No</label>
91+
</p>
8392
<p id="autoSizeMinimum">Minimum Auto Size:
8493
<br><label><input onclick="Update()" name="autoSizeMinimum" type="radio" value="640*480" checked="">640*480</label>
8594
<label><input onclick="Update()" name="autoSizeMinimum" type="radio" value="800*600">800*600</label>
@@ -91,6 +100,7 @@
91100
<label><input onclick="Update()" name="autoSizeMaximum" type="radio" value="800*600" checked="">800*600</label>
92101
<label><input onclick="Update()" name="autoSizeMaximum" type="radio" value="1024*768">1024*768</label>
93102
<label><input onclick="Update()" name="autoSizeMaximum" type="radio" value="1280*1024">1280*1024</label>
103+
<label><input onclick="Update()" name="autoSizeMaximum" type="radio" value="Unlimited">Unlimited</label>
94104
</p>
95105
<div id="diagram" style="border-style: dotted; border-width: 1px;"></div>
96106
</body>

samples/javascript.controls/CaseSelectedItems.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
options.items = items;
4949
options.cursorItem = 0;
50-
options.hasSelectorCheckbox = primitives.common.Enabled.True
50+
options.hasSelectorCheckbox = primitives.common.Enabled.True;
5151
options.onSelectionChanged = onSelectionChanged;
5252

5353
control = primitives.orgdiagram.Control(document.getElementById("basicdiagram"), options);
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5+
<title>Selected Items Frame</title>
6+
7+
<!-- # include file="../../src.primitives/src.primitives.html"-->
8+
<script type="text/javascript" src="../../min/primitives.min.js?5100"></script>
9+
<link href="../../min/primitives.latest.css?2106" media="screen" rel="stylesheet" type="text/css" />
10+
11+
<script type="text/javascript">
12+
var control,
13+
minimizedItemShapeTypes = [
14+
primitives.common.ShapeType.Rectangle,
15+
primitives.common.ShapeType.Oval,
16+
primitives.common.ShapeType.Triangle,
17+
primitives.common.ShapeType.CrossOut,
18+
primitives.common.ShapeType.Circle,
19+
primitives.common.ShapeType.Rhombus,
20+
primitives.common.ShapeType.Wedge,
21+
primitives.common.ShapeType.FramedOval,
22+
primitives.common.ShapeType.FramedTriangle,
23+
primitives.common.ShapeType.FramedWedge,
24+
primitives.common.ShapeType.FramedRhombus
25+
],
26+
shapeIndex = 0,
27+
itemTitleColors = [
28+
primitives.common.Colors.Red,
29+
primitives.common.Colors.Green,
30+
primitives.common.Colors.Navy,
31+
primitives.common.Colors.Cyan
32+
],
33+
colorIndex = 0;
34+
35+
function getNextShapeType() {
36+
var result = minimizedItemShapeTypes[shapeIndex];
37+
shapeIndex+=1;
38+
if(shapeIndex == minimizedItemShapeTypes.length) {
39+
shapeIndex = 0;
40+
}
41+
return result;
42+
}
43+
44+
function getNextColor() {
45+
var result = itemTitleColors[colorIndex];
46+
colorIndex+=1;
47+
if(colorIndex == itemTitleColors.length) {
48+
colorIndex = 0;
49+
}
50+
return result;
51+
}
52+
53+
function getMarkerTemplate() {
54+
var result = new primitives.orgdiagram.TemplateConfig();
55+
result.name = "MarkerTemplate";
56+
result.minimizedItemSize = new primitives.common.Size(8, 8);
57+
result.highlightPadding = new primitives.common.Thickness(4, 4, 4, 4);
58+
return result;
59+
}
60+
61+
document.addEventListener('DOMContentLoaded', function () {
62+
var options = new primitives.orgdiagram.Config();
63+
64+
var rootItem = {
65+
id: 0,
66+
parent: null,
67+
title: "Title 0",
68+
description: "Description",
69+
image: "../images/photos/a.png",
70+
minimizedItemShapeType: (getNextShapeType()),
71+
itemTitleColor: (getNextColor())
72+
};
73+
var levelItems = [rootItem];
74+
var items = [rootItem];
75+
var id = 1;
76+
for(var levelIndex = 0; levelIndex < 4; levelIndex+=1) {
77+
var newLevelItems = [];
78+
for(var index = 0; index < levelItems.length; index+=1) {
79+
var parent = levelItems[index];
80+
for (var index2 = 0; index2 < 2; index2++) {
81+
var newItem = {
82+
id: ++id,
83+
parent: parent.id,
84+
title: id.toString() + " Title",
85+
description: id.toString() + " Description",
86+
image: "../images/photos/b.png",
87+
minimizedItemShapeType: (getNextShapeType()),
88+
itemTitleColor: (getNextColor())
89+
};
90+
items.push(newItem);
91+
newLevelItems.push(newItem);
92+
}
93+
}
94+
levelItems = newLevelItems;
95+
}
96+
97+
/* collect all ids */
98+
var selectedItems = [];
99+
for(var index = 0; index < items.length; index+=1) {
100+
selectedItems.push(items[index].id);
101+
}
102+
103+
options.items = items;
104+
options.cursorItem = 0;
105+
options.showFrame = true;
106+
options.frameInnerPadding = 4;
107+
options.frameOuterPadding = 4;
108+
options.templates = [getMarkerTemplate()];
109+
options.defaultTemplateName = "MarkerTemplate";
110+
options.hasSelectorCheckbox = primitives.common.Enabled.True;
111+
options.pageFitMode = primitives.common.PageFitMode.None;
112+
options.selectedItems = selectedItems;
113+
control = primitives.orgdiagram.Control(document.getElementById("diagram"), options);
114+
});
115+
</script>
116+
</head>
117+
<body>
118+
<div id="diagram" style="width: 640px; height: 480px; border-style: dotted; border-width: 1px;"></div>
119+
</body>
120+
</html>

samples/javascript.controls/DemoCrossTeamGroup.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,12 @@
115115

116116
/* Graphics */
117117
graphicsType: primitives.common.GraphicsType.SVG,
118+
scale: 1.0,
118119

119-
scale: 1.0
120+
/* Frame */
121+
showFrame: true,
122+
frameInnerPadding: 4,
123+
frameOuterPadding: 4
120124
},
121125
/* On property change event handler */
122126
function () {
@@ -455,9 +459,10 @@
455459
<div id="westpanel" style="padding: 5px; margin: 5px; font: normal 12px verdana, areal;">
456460
<h2>Cross Functional Team</h2>
457461
<p>This Organization Chart shows members of cross functional team "General Audit" and their mutual positions in
458-
organization over general view of hierarchy.</p>
462+
the organization over general view of hierarchy.</p>
459463
<p>Organization Chart provides options to show or hide items between root and cross team group members.</p>
460464
<p>Chart demonstrates rotation of chart to the left side and labels options for minimized items as well.</p>
465+
<p>At the bottom you should see markers of selected nodes placed outside view area visible to end user.</p>
461466
</div>
462467
</div>
463468
<div id="centerpanel"

samples/javascript.controls/DemoDependencies.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,12 @@
132132

133133
/* Graphics */
134134
graphicsType: primitives.common.GraphicsType.SVG,
135+
scale: 1.0,
135136

136-
scale: 1.0
137+
/* Frame */
138+
showFrame: false,
139+
frameInnerPadding: 2,
140+
frameOuterPadding: 2
137141
},
138142
/* On property change event handler */
139143
function () {

samples/javascript.controls/DemoDynamicLoading.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,12 @@
153153

154154
/* Graphics */
155155
graphicsType: primitives.common.GraphicsType.SVG,
156-
157-
scale: 1.0
156+
scale: 1.0,
157+
158+
/* Frame */
159+
showFrame: false,
160+
frameInnerPadding: 2,
161+
frameOuterPadding: 2
158162
},
159163
/* On property change event handler */
160164
function () {

0 commit comments

Comments
 (0)