Skip to content

Commit 9e7877f

Browse files
Added test cases for family diagram
1 parent a09d369 commit 9e7877f

File tree

1 file changed

+140
-1
lines changed

1 file changed

+140
-1
lines changed

samples/data/famdata.js

Lines changed: 140 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,142 @@ var matrixLayout = {
810810
]
811811
};
812812

813+
var matrixNLabelsLayout = {
814+
cursorItem: 1,
815+
enableMatrixLayout: true,
816+
annotations: [
817+
{
818+
annotationType: primitives.AnnotationType.Connector,
819+
fromItem: 10,
820+
toItem: 24,
821+
label: "<span class=\"badge bg-danger\">1</span>",
822+
labelSize: { width: 30, height: 30 }, //new primitives.Size(80, 30)
823+
connectorShapeType: primitives.ConnectorShapeType.OneWay,
824+
color: primitives.Colors.Red,
825+
offset: 5,
826+
lineWidth: 2,
827+
lineType: primitives.LineType.Dashed
828+
}
829+
],
830+
items: [
831+
{ id: 1, parents: [], title: "1", label: "1", description: "", image: "../images/photos/z.png", itemTitleColor: "#ff0000" },
832+
{ id: 2, parents: [1, 101, 102, 103], title: "2", label: "2", description: "", image: "../images/photos/a.png", itemTitleColor: "#ff0000" },
833+
{ id: 3, parents: [1, 101, 102, 103], title: "3", label: "3", description: "", image: "../images/photos/b.png", itemTitleColor: "#ff0000" },
834+
{ id: 4, parents: [1, 101, 102, 103], title: "4", label: "4", description: "", image: "../images/photos/c.png", itemTitleColor: "#ff0000" },
835+
{ id: 6, parents: [1, 101, 102, 103], title: "6", label: "6", description: "", image: "../images/photos/e.png", itemTitleColor: "#ff0000" },
836+
{ id: 7, parents: [1, 101, 102, 103], title: "7", label: "7", description: "", image: "../images/photos/f.png", itemTitleColor: "#ff0000" },
837+
{ id: 8, parents: [1, 101, 102, 103], title: "8", label: "8", description: "", image: "../images/photos/g.png", itemTitleColor: "#ff0000" },
838+
{ id: 10, parents: [1, 101, 102, 103], title: "10", label: "10", description: "", image: "../images/photos/i.png", itemTitleColor: "#ff0000" },
839+
{ id: 11, parents: [1, 101, 102, 103], title: "11", label: "11", description: "", image: "../images/photos/b.png", itemTitleColor: "#ff0000" },
840+
{ id: 12, parents: [11], title: "12", label: "12", description: "", image: "../images/photos/b.png", itemTitleColor: "#ff0000" },
841+
{ id: 33, parents: [2, 3, 4, 6, 7, 8, 10, 12], title: "33", label: "33", description: "", image: "../images/photos/m.png", itemTitleColor: "#4b0082" }
842+
],
843+
annotations: [
844+
{ annotationType: primitives.AnnotationType.Label, fromItem: 1, toItems: [2], title: "1->2" },
845+
{ annotationType: primitives.AnnotationType.Label, fromItem: 1, toItems: [3], title: "1->3" },
846+
{ annotationType: primitives.AnnotationType.Label, fromItem: 1, toItems: [4], title: "1->4" },
847+
{ annotationType: primitives.AnnotationType.Label, fromItem: 1, toItems: [6], title: "1->6" },
848+
{ annotationType: primitives.AnnotationType.Label, fromItem: 1, toItems: [7], title: "1->7" },
849+
{ annotationType: primitives.AnnotationType.Label, fromItem: 1, toItems: [8], title: "1->8" },
850+
{ annotationType: primitives.AnnotationType.Label, fromItem: 1, toItems: [10], title: "1->10" },
851+
{ annotationType: primitives.AnnotationType.Label, fromItem: 33, toItems: [2], title: "33->2" },
852+
{ annotationType: primitives.AnnotationType.Label, fromItem: 33, toItems: [3], title: "33->3" },
853+
{ annotationType: primitives.AnnotationType.Label, fromItem: 33, toItems: [4], title: "33->4" },
854+
{ annotationType: primitives.AnnotationType.Label, fromItem: 33, toItems: [6], title: "33->6" },
855+
{ annotationType: primitives.AnnotationType.Label, fromItem: 33, toItems: [7], title: "33->7" },
856+
{ annotationType: primitives.AnnotationType.Label, fromItem: 33, toItems: [8], title: "33->8" }
857+
]
858+
};
859+
860+
var matrixGroups = {
861+
cursorItem: 1,
862+
enableMatrixLayout: true,
863+
minimumMatrixSize: 3,
864+
annotations: [
865+
{
866+
annotationType: primitives.AnnotationType.Connector,
867+
fromItem: 10,
868+
toItem: 24,
869+
label: "<span class=\"badge bg-danger\">1</span>",
870+
labelSize: { width: 30, height: 30 }, //new primitives.Size(80, 30)
871+
connectorShapeType: primitives.ConnectorShapeType.OneWay,
872+
color: primitives.Colors.Red,
873+
offset: 5,
874+
lineWidth: 2,
875+
lineType: primitives.LineType.Dashed
876+
}
877+
],
878+
items: [
879+
{ id: 1, parents: [], title: "1", label: "1", description: "", image: "../images/photos/z.png", itemTitleColor: "#ff0000" },
880+
{ id: 2, parents: [1, 101, 102, 103], title: "2", label: "2", description: "", image: "../images/photos/a.png", itemTitleColor: "#ff0000" },
881+
{ id: 3, parents: [1, 101, 102, 103], title: "3", label: "3", description: "", image: "../images/photos/b.png", itemTitleColor: "#ff0000" },
882+
{ id: 4, parents: [1, 101, 102, 103], title: "4", label: "4", description: "", image: "../images/photos/c.png", itemTitleColor: "#ff0000" },
883+
{ id: 5, parents: [1, 101, 102, 103], title: "5", label: "5", description: "", image: "../images/photos/c.png", itemTitleColor: "#ff0000" },
884+
{ id: 6, parents: [1, 101, 102, 103], matrixId: "2", title: "6", label: "6", description: "", image: "../images/photos/e.png", itemTitleColor: "#ff0000" },
885+
{ id: 7, parents: [1, 101, 102, 103], matrixId: "2", title: "7", label: "7", description: "", image: "../images/photos/f.png", itemTitleColor: "#ff0000" },
886+
{ id: 8, parents: [1, 101, 102, 103], matrixId: "2", title: "8", label: "8", description: "", image: "../images/photos/g.png", itemTitleColor: "#ff0000" },
887+
{ id: 9, parents: [1, 101, 102, 103], matrixId: "2", title: "10", label: "10", description: "", image: "../images/photos/i.png", itemTitleColor: "#ff0000" },
888+
{ id: 10, parents: [1, 101, 102, 103], addToMatrix: false, title: "10", label: "10", description: "", image: "../images/photos/i.png", itemTitleColor: "#ff0000" },
889+
{ id: 33, parents: [2, 3, 4, 5, 6, 7, 8, 9, 10], title: "33", label: "33", description: "", image: "../images/photos/m.png", itemTitleColor: "#4b0082" }
890+
]
891+
};
892+
893+
var labelsSelection = {
894+
cursorItem: 1,
895+
enableMatrixLayout: false,
896+
pageFitMode: primitives.PageFitMode.SelectionOnly,
897+
neighboursSelectionMode: primitives.NeighboursSelectionMode.ParentsAndChildren,
898+
annotations: [
899+
{
900+
annotationType: primitives.AnnotationType.Connector,
901+
fromItem: 10,
902+
toItem: 24,
903+
label: "<span class=\"badge bg-danger\">1</span>",
904+
labelSize: { width: 30, height: 30 }, //new primitives.Size(80, 30)
905+
connectorShapeType: primitives.ConnectorShapeType.OneWay,
906+
color: primitives.Colors.Red,
907+
offset: 5,
908+
lineWidth: 2,
909+
lineType: primitives.LineType.Dashed
910+
}
911+
],
912+
items: [
913+
{ id: 1, parents: [], title: "1", label: "1", description: "", image: "../images/photos/a.png", itemTitleColor: "#ff0000" },
914+
{ id: 2, parents: [], title: "2", label: "2", description: "", image: "../images/photos/b.png", itemTitleColor: "#ff0000" },
915+
{ id: 3, parents: [], title: "3", label: "3", description: "", image: "../images/photos/c.png", itemTitleColor: "#ff0000" },
916+
{ id: 4, parents: [], title: "4", label: "4", description: "", image: "../images/photos/d.png", itemTitleColor: "#ff0000" },
917+
{ id: 5, parents: [], title: "5", label: "5", description: "", image: "../images/photos/e.png", itemTitleColor: "#ff0000" },
918+
919+
920+
{ id: 6, parents: [1, 2, 3], title: "6", label: "6", description: "", image: "../images/photos/f.png", itemTitleColor: "#ff0000" },
921+
{ id: 7, parents: [3, 4, 5], title: "7", label: "7", description: "", image: "../images/photos/g.png", itemTitleColor: "#ff0000" },
922+
923+
{ id: 8, parents: [6, 7], title: "8", label: "8", description: "", image: "../images/photos/h.png", itemTitleColor: "#ff0000" },
924+
925+
{ id: 9, parents: [8], title: "9", label: "9", description: "", image: "../images/photos/a.png", itemTitleColor: "#ff0000" },
926+
{ id: 10, parents: [8], title: "10", label: "10", description: "", image: "../images/photos/b.png", itemTitleColor: "#ff0000" },
927+
{ id: 11, parents: [8], title: "11", label: "11", description: "", image: "../images/photos/c.png", itemTitleColor: "#ff0000" },
928+
{ id: 12, parents: [8], title: "12", label: "12", description: "", image: "../images/photos/e.png", itemTitleColor: "#ff0000" },
929+
{ id: 13, parents: [8], title: "13", label: "13", description: "", image: "../images/photos/f.png", itemTitleColor: "#ff0000" },
930+
],
931+
annotations: [
932+
{ annotationType: primitives.AnnotationType.Label, fromItem: 6, toItems: [1], title: "48.26%" },
933+
{ annotationType: primitives.AnnotationType.Label, fromItem: 6, toItems: [2], title: "24.92%" },
934+
{ annotationType: primitives.AnnotationType.Label, fromItem: 6, toItems: [3], title: "26.81%" },
935+
{ annotationType: primitives.AnnotationType.Label, fromItem: 7, toItems: [3], title: "37.19%" },
936+
{ annotationType: primitives.AnnotationType.Label, fromItem: 7, toItems: [4], title: "69.98%" },
937+
{ annotationType: primitives.AnnotationType.Label, fromItem: 7, toItems: [5], title: "0.82%" },
938+
{ annotationType: primitives.AnnotationType.Label, fromItem: 8, toItems: [6], title: "98.14%" },
939+
{ annotationType: primitives.AnnotationType.Label, fromItem: 8, toItems: [7], title: "1.85%" },
940+
{ annotationType: primitives.AnnotationType.Label, fromItem: 9, toItems: [8], title: "100%" },
941+
{ annotationType: primitives.AnnotationType.Label, fromItem: 10, toItems: [8], title: "100%" },
942+
{ annotationType: primitives.AnnotationType.Label, fromItem: 11, toItems: [8], title: "100%" },
943+
{ annotationType: primitives.AnnotationType.Label, fromItem: 12, toItems: [8], title: "100%" },
944+
{ annotationType: primitives.AnnotationType.Label, fromItem: 13, toItems: [8], title: "100%" }
945+
]
946+
};
947+
948+
813949
var dataSetNames = {
814950
"2 Cross Relations": "crossShape",
815951
"3 Cross Relations": "famdata2",
@@ -828,7 +964,10 @@ var dataSetNames = {
828964
"W Shape Family": "wFamily",
829965
"Simple Family": "simpleFamily",
830966
"Matrix": "matrixLayout",
831-
"Lables on Loop": "famdata2NodesLoopTest"
967+
"Lables on Loop": "famdata2NodesLoopTest",
968+
"Matrix & Labels": "matrixNLabelsLayout",
969+
"Matrix Groups": "matrixGroups",
970+
"Labels Selection": "labelsSelection"
832971
};
833972

834973
var defaultDataSetName = dataSetNames["Mix"];

0 commit comments

Comments
 (0)