Skip to content

Commit 1f13982

Browse files
Added screenshots to samples markdowns
1 parent 21ecf64 commit 1f13982

File tree

78 files changed

+1059
-678
lines changed

Some content is hidden

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

78 files changed

+1059
-678
lines changed

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@
99
"src.primitives.jquery.compile": "compiler.jar --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",
12-
"apireference": "node apireference.js apireference.json"
12+
"apireference": "node apireference.js apireference.json",
13+
"screnshots": "node screenshots.js"
1314
},
1415
"dependencies": {
15-
"eslint": "^5.15.1"
16+
"eslint": "^5.15.1",
17+
"puppeteer": "^1.20.0"
1618
},
1719
"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.",
1820
"repository": {
1921
"type": "git",
2022
"url": "https://github.com/BasicPrimitives/javascript"
2123
}
22-
}
24+
}

samples/AdviserAndAssistantItemTypes.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,15 @@ Use `ItemConfig.adviserPlacementType` option to place adviser or assistant on th
2323
[JavaScript](javascript.controls/CaseAdviserAndAssistantItemTypes.html)
2424
[JQuery](jquery.widgets/CaseAdviserAndAssistantItemTypes.html)
2525

26+
![Screenshot](images/screenshots/CaseAdviserAndAssistantItemTypes.png)
27+
2628
## Sub Adviser & Sub Assistant item types
2729

2830
Sub Adviser & Sub Assistant item types are variations of regular Adviser & Assistant types. The only difference is they are shift down one level relative to their parents, so they are connected by their top side to the hierarchy.
2931

3032
Use `ItemConfig.adviserPlacementType` option to place them on the left or right side of parent's hierarchy as well.
3133

3234
[JavaScript](javascript.controls/CaseSubAdviserAndSubAssistantItemTypes.html)
33-
[JQuery](jquery.widgets/CaseSubAdviserAndSubAssistantItemTypes.html)
35+
[JQuery](jquery.widgets/CaseSubAdviserAndSubAssistantItemTypes.html)
36+
37+
![Screenshot](images/screenshots/CaseSubAdviserAndSubAssistantItemTypes.png)

samples/Buttons.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ Organizational chart provides simple API to create custom user buttons. They are
55
Buttons can be customized per item template. See Item template example in this section.
66

77
[JavaScript](javascript.controls/CaseButtonsPanel.html)
8-
[JQuery](jquery.widgets/CaseButtonsPanel.html)
8+
[JQuery](jquery.widgets/CaseButtonsPanel.html)
9+
10+
![Screenshot](images/screenshots/CaseButtonsPanel.png)

samples/ChildrenLayout.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ Children Placement Layout can be defined individually per item or globally for a
66
* maximumColumnsInMatrix - by default children in matrix are shaped into square, in order to form them into rectangular shape you have to limit maximum number of columns in matrix, so rectangular shape would grow vertically.
77

88
[JavaScript](javascript.controls/CaseChildrenPlacementType.html)
9-
[JQuery](jquery.widgets/CaseChildrenPlacementType.html)
9+
[JQuery](jquery.widgets/CaseChildrenPlacementType.html)
10+
11+
![Screenshot](images/screenshots/CaseChildrenPlacementType.png)

samples/ConnectorAnnotation.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
Connector annotation is on screen direct connection line between two nodes of diagram. It supports simple conflict resolution, if multiple connections defined between the same pair of nodes, control offsets them and draws them in parallel. The following sample demonstrates connection annotation drawn in offbeat style, this way connection annotation should not overlap diagrams base connection lines:
44

55
[JavaScript](javascript.controls/CaseConnectorAnnotation.html)
6-
[JQuery](jquery.widgets/CaseConnectorAnnotation.html)
6+
[JQuery](jquery.widgets/CaseConnectorAnnotation.html)
7+
8+
![Screenshot](images/screenshots/CaseConnectorAnnotation.png)

samples/CursorTemplate.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ The following example demonstrates how to create Bootstrap vertical buttons grou
1313

1414
[JavaScript](bootstrap.styles/CaseCursorTemplateAndTwitterBootstrap.html)
1515

16+
![Screenshot](images/screenshots/CaseCursorTemplateAndTwitterBootstrap.png)
17+
1618
## Custom cursor template border
1719
This example demonstrates how to create custom cursor border color and tag element.
1820

@@ -23,9 +25,13 @@ The following example demonstrates how to create custom cursor template:
2325
[JavaScript](javascript.controls/CaseCursorTemplate.html)
2426
[JQuery](jquery.widgets/CaseCursorTemplate.html)
2527

28+
![Screenshot](images/screenshots/CaseCursorTemplate.png)
29+
2630
## Cursor template having item specific context buttons
2731

2832
This example demonstrates how to create item specific context buttons using cursor template. Ideally we have to create individual template for every item type and render buttons depending on template name, for simplicity we added an extra property called buttonsType to every item and use it to render different sets of buttons in cursor. This case is really rare and means that display collection of buttons depends on large set of items options.
2933

3034
[JavaScript](javascript.controls/CaseButtonsInCursorTemplate.html)
31-
[JQuery](jquery.widgets/CaseButtonsInCursorTemplate.html)
35+
[JQuery](jquery.widgets/CaseButtonsInCursorTemplate.html)
36+
37+
![Screenshot](images/screenshots/CaseButtonsInCursorTemplate.png)

samples/CustomLayoutWithInvisibleItems.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ See custom item types, children layout and inactive items samples as well.
88
[JavaScript](javascript.controls/CaseCustomLayoutWithInvisibleItems.html)
99
[JQuery](jquery.widgets/CaseCustomLayoutWithInvisibleItems.html)
1010

11+
![Screenshot](images/screenshots/CaseCustomLayoutWithInvisibleItems.png)
12+
1113
## Skipped Levels
1214

1315
Invisible items can be used to skip levels in organizational chart. This is actually workaround, invisible items occupy space, so they can be used to shift children items down one level relative to their parents. See primitives.orgdiagram.ItemConfig.isVisible option.
1416

1517
[JavaScript](javascript.controls/CaseSkippedLevels.html)
1618
[JQuery](jquery.widgets/CaseSkippedLevels.html)
19+
20+
![Screenshot](images/screenshots/CaseSkippedLevels.png)

samples/DiagramSizing.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@ In order to place diagram inside page article and make it auto expand to accommo
2222

2323
Use following options to constrain widget auto size:
2424

25-
* autoSizeMinimum - it limits minimal size of diagram, so if it is empty then you are going to see empty area of this size.
26-
* autoSizeMaximum - does not allow to grow widget beyond this size. Set maximum size to some value if you need to avoid humongous diagram on your page.
25+
* `autoSizeMinimum` - it limits minimal size of diagram, so if it is empty then you are going to see empty area of this size.
26+
* `autoSizeMaximum` - does not allow to grow widget beyond this size. Set maximum size to some value if you need to avoid humongous diagram on your page.
2727

28-
for example in order to set widget minimal size: autoSizeMinimum = new primitives.common.Size(800, 600);
28+
for example following code sets widget's minimal size:
29+
30+
``` JavaScript
31+
autoSizeMinimum = new primitives.common.Size(800, 600);
32+
```
2933

3034
[JavaScript](javascript.controls/CaseAutoSize.html)
31-
[JQuery](jquery.widgets/CaseAutoSize.html)
35+
[JQuery](jquery.widgets/CaseAutoSize.html)

samples/FamilyChartItemsOrdering.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ Family Items Ordering Sample
1515

1616
[JavaScript](javascript.controls/CaseFamilyChartItemsOrdering.html)
1717

18+
![Screenshot](images/screenshots/CaseFamilyChartItemsOrdering.png)
19+
1820
## Multiple Families Ordering Sample
1921

20-
[JavaScript](javascript.controls/CaseMultipleFamiliesOrdering.html)
22+
[JavaScript](javascript.controls/CaseMultipleFamiliesOrdering.html)
23+
24+
![Screenshot](images/screenshots/CaseMultipleFamiliesOrdering.png)

samples/FamilyConnectorsVisualization.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,26 @@ This is definitely extreme example of family relations, but the fact that famDia
77

88
[JavaScript](javascript.controls/CaseFamilyChartRelations.html)
99

10+
![Screenshot](images/screenshots/CaseFamilyChartRelations.png)
11+
1012
This visualization is better, but it shows another problem. The big number of parent and children elements does not let to see them together, so in order to make diagram more compact widget API supports clustering of nodes into matrix, so that way they occupy least space possible. In order to enable this layout option set `enableMatrixLayout` to `true`.
1113

1214
[JavaScript](javascript.controls/CaseFamilyChartMatrixLayout.html)
1315
[PDFKit](pdfkit.plugins/FamilyMatrix.html)
1416

17+
![Screenshot](images/screenshots/CaseFamilyChartMatrixLayout.png)
18+
1519
Another typical problem in connectors visualization is excessive grand parents relations. It is situation when item has direct relation to parent, grand parent and grand grand parent. Usually when we draw family diagram we are more interested to show order of dependencies over actual relations. We know that the great-grandparent precedes the grandparent, the grandparent precedes the parent, the parent precedes the child node. So this precedence defines the indirect relation between child node and grand-grandparent. So direct relation visualization between child node and its grand parents can be omitted out of diagram and replaced with dynamic annotations. Look at the following example where every child references all preceding parents:
1620

1721
[JavaScript](javascript.controls/CaseFamilyChartGrandParentsRelations.html)
1822

23+
![Screenshot](images/screenshots/CaseFamilyChartGrandParentsRelations.png)
24+
1925
As you may see control already eliminated a lot of connections via making bundles, so we don't see every connection between nodes, but still this diagram has a lot of connections to trace. In order to hide direct connections to grand parents set option `hideGrandParentsConnectors` to `true` and get following layout:
2026

2127
[JavaScript](javascript.controls/CaseFamilyChartHiddenGrandParentsRelations.html)
2228
[PDFKit](pdfkit.plugins/HideGrandParentsConnectors.html)
2329

30+
![Screenshot](images/screenshots/CaseFamilyChartHiddenGrandParentsRelations.png)
31+
2432
So we got quite clean relations diagram between nodes. We still have all relations in place, the only difference is that grand parents connections go through actual parents, so we need to visualize them dynamically, as we navigate around our diagram we can highlight all current node immediate parents and children with Connector Path Annotations and set dynamically custom Item Template for them.

0 commit comments

Comments
 (0)