Skip to content

Commit 2451669

Browse files
author
xuxin0509
committed
[all] add gitgraph/matplot/plantuml graphs
1 parent 656f6ee commit 2451669

26 files changed

+922
-0
lines changed

gitgraph.js/algoflow.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE HTML>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<title>GitGraph.js example page</title>
7+
<link rel="stylesheet" type="text/css" href="../../src/gitgraph.css" />
8+
<style>
9+
body {
10+
margin: 0;
11+
padding: 0;
12+
}
13+
</style>
14+
</head>
15+
16+
<body>
17+
<canvas id="gitGraph"></canvas>
18+
<div id="detail" class="gitgraph-detail">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sint, ducimus, qui fuga corporis veritatis doloribus iure nulla optio dolores maiores dolorum ullam alias cum libero obcaecati cupiditate sit illo aperiam possimus voluptatum similique neque explicabo quibusdam aspernatur dolorem. Quod, corrupti magni explicabo nam sequi nesciunt accusamus aliquam dolore! Cumque, quam fugiat ab veritatis. Quia, maxime quas perferendis cupiditate explicabo at atque iusto accusamus. Nesciunt veniam quidem nemo doloribus! Dolore, cupiditate, adipisci, voluptate quam nihil ipsa placeat dolor possimus minus quas nostrum eaque in dicta autem eligendi rerum facilis nesciunt sunt doloremque suscipit enim iure vitae eius voluptates tempora tenetur hic.</div>
19+
<script src="../../src/gitgraph.js"></script>
20+
<script src="algoflow.js"></script>
21+
</body>
22+
23+
</html>

gitgraph.js/algoflow.js

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
/***********************
2+
* CUSTOM TEMPLATES *
3+
***********************/
4+
5+
var oppodevelopCol = 0;
6+
var masterCol = 1;
7+
var opensourceCol = 2;
8+
9+
var graphConfig = new GitGraph.Template({
10+
colors: [ "#9993FF", "#47E8D4", "#6BDB52", "#F85BB5", "#FFA657", "#F85BB5" ],
11+
branch: {
12+
color: "#000000",
13+
lineWidth: 3,
14+
spacingX: 60,
15+
mergeStyle: "straight",
16+
showLabel: true, // display branch names on graph
17+
labelFont: "normal 12pt Arial",
18+
labelRotation: 0
19+
},
20+
commit: {
21+
spacingY: -40,
22+
dot: {
23+
size: 8,
24+
strokeColor: "#000000",
25+
strokeWidth: 4,
26+
},
27+
tag: {
28+
font: "normal 12pt Arial",
29+
color: "yellow"
30+
},
31+
message: {
32+
color: "black",
33+
font: "normal 12pt Arial",
34+
displayAuthor: false,
35+
displayBranch: true,
36+
displayHash: true,
37+
}
38+
},
39+
arrow: {
40+
size: 8,
41+
offset: 2
42+
}
43+
});
44+
45+
var config = {
46+
template: graphConfig,
47+
reverseArrow: false, // to make arrows point to ancestors, if displayed
48+
/*mode: "extended",*/
49+
orientation: "vertical"
50+
};
51+
52+
var gitGraph = new GitGraph(config);
53+
54+
/************************
55+
* BRANCHES AND COMMITS *
56+
************************/
57+
58+
var master = gitGraph.branch({
59+
name: "master",
60+
column: masterCol
61+
});
62+
63+
master.commit("Initial commit");
64+
65+
var opensourcemaster = master.branch({
66+
parentBranch: master,
67+
name: "opensourcemaster",
68+
column: opensourceCol,
69+
color: "#F00",
70+
// lineDash: [5],
71+
commitDefaultOptions: {
72+
color: "#F00"
73+
}
74+
});
75+
76+
var oppodevelop = master.branch({
77+
parentBranch: master,
78+
name: "oppodevelop",
79+
column: oppodevelopCol,
80+
color: "#deb887",
81+
// lineDash: [5],
82+
commitDefaultOptions: {
83+
color: "#deb887"
84+
}
85+
});
86+
87+
// Commit on HEAD Branch which is "master"
88+
opensourcemaster.commit("OpenSource commit 1");
89+
90+
oppodevelop.commit("oppodevelop commit 1")
91+
92+
oppodevelop.commit("oppodevelop commit 2")
93+
94+
// Add few commits on master
95+
opensourcemaster.commit("OpenSource commit 2");
96+
97+
oppodevelop.commit({
98+
lineDash: [3, 2],
99+
dotStrokeWidth: 5,
100+
dotColor: "white",
101+
messageHashDisplay: false,
102+
messageAuthorDisplay: false,
103+
message: "Current",
104+
tag: "HEAD",
105+
displayTagBox: true
106+
});

gitgraph.js/algoflow.js.cust_dev

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
/***********************
2+
* CUSTOM TEMPLATES *
3+
***********************/
4+
5+
var oppodevelopCol = 0;
6+
var feature1Col = 1;
7+
var feature2Col = 2;
8+
9+
var graphConfig = new GitGraph.Template({
10+
colors: [ "#9993FF", "#47E8D4", "#6BDB52", "#F85BB5", "#FFA657", "#F85BB5" ],
11+
branch: {
12+
color: "#000000",
13+
lineWidth: 3,
14+
spacingX: 60,
15+
mergeStyle: "straight",
16+
showLabel: true, // display branch names on graph
17+
labelFont: "normal 12pt Arial",
18+
labelRotation: 0
19+
},
20+
commit: {
21+
spacingY: -40,
22+
dot: {
23+
size: 8,
24+
strokeColor: "#000000",
25+
strokeWidth: 4,
26+
},
27+
tag: {
28+
font: "normal 12pt Arial",
29+
color: "yellow"
30+
},
31+
message: {
32+
color: "black",
33+
font: "normal 12pt Arial",
34+
displayAuthor: false,
35+
displayBranch: true,
36+
displayHash: true,
37+
}
38+
},
39+
arrow: {
40+
size: 8,
41+
offset: 2
42+
}
43+
});
44+
45+
var config = {
46+
template: graphConfig,
47+
reverseArrow: false, // to make arrows point to ancestors, if displayed
48+
/*mode: "extended",*/
49+
orientation: "vertical"
50+
};
51+
52+
var gitGraph = new GitGraph(config);
53+
54+
/************************
55+
* BRANCHES AND COMMITS *
56+
************************/
57+
58+
// Create a new "oppodevelop" branch from "master" with some custom configuration
59+
var oppodevelop = gitGraph.branch({
60+
name: "oppodevelop",
61+
column: oppodevelopCol,
62+
color: "#F00",
63+
// lineDash: [5],
64+
commitDefaultOptions: {
65+
color: "#F00"
66+
}
67+
});
68+
oppodevelop.commit("algo commit 1");
69+
70+
oppodevelop.commit("algo commit 2");
71+
72+
var algofeature1 = oppodevelop.branch({
73+
parentBranch: oppodevelop,
74+
name: "algofeature1",
75+
column: feature1Col,
76+
color: "#deb887",
77+
// lineDash: [5],
78+
commitDefaultOptions: {
79+
color: "#deb887"
80+
}
81+
});
82+
83+
algofeature1.commit("algofeature1 commit 1")
84+
algofeature1.commit("algofeature1 commit 2")
85+
86+
oppodevelop.commit("algo commit 3");
87+
88+
// algofeature2 branch
89+
var algofeature2 = oppodevelop.branch({
90+
parentBranch: oppodevelop,
91+
name: "algofeature2",
92+
column: feature2Col,
93+
color: "#5f9ea0",
94+
// lineDash: [5],
95+
commitDefaultOptions: {
96+
color: "#5f9ea0"
97+
}
98+
});
99+
100+
algofeature1.merge(oppodevelop, {
101+
message: "oppo release",
102+
tag: "v1.0"
103+
});
104+
105+
algofeature2.commit("algofeature2 commit 1")
106+
107+
algofeature2.commit("algofeature2 commit 2")
108+
109+
algofeature2.commit("algofeature2 commit 3")
110+
algofeature2.merge(oppodevelop, {
111+
message: "oppo release",
112+
tag: "v2.0"
113+
});
114+
115+
oppodevelop.commit({
116+
lineDash: [3, 2],
117+
dotStrokeWidth: 5,
118+
dotColor: "white",
119+
messageHashDisplay: false,
120+
messageAuthorDisplay: false,
121+
message: "Current",
122+
tag: "HEAD",
123+
displayTagBox: true
124+
});

gitgraph.js/algoflow.js.master

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
/***********************
2+
* CUSTOM TEMPLATES *
3+
***********************/
4+
5+
var oppodevelopCol = 0;
6+
var masterCol = 1;
7+
var opensourceCol = 2;
8+
9+
var graphConfig = new GitGraph.Template({
10+
colors: [ "#9993FF", "#47E8D4", "#6BDB52", "#F85BB5", "#FFA657", "#F85BB5" ],
11+
branch: {
12+
color: "#000000",
13+
lineWidth: 3,
14+
spacingX: 60,
15+
mergeStyle: "straight",
16+
showLabel: true, // display branch names on graph
17+
labelFont: "normal 12pt Arial",
18+
labelRotation: 0
19+
},
20+
commit: {
21+
spacingY: -40,
22+
dot: {
23+
size: 8,
24+
strokeColor: "#000000",
25+
strokeWidth: 4,
26+
},
27+
tag: {
28+
font: "normal 12pt Arial",
29+
color: "yellow"
30+
},
31+
message: {
32+
color: "black",
33+
font: "normal 12pt Arial",
34+
displayAuthor: false,
35+
displayBranch: true,
36+
displayHash: true,
37+
}
38+
},
39+
arrow: {
40+
size: 8,
41+
offset: 2
42+
}
43+
});
44+
45+
var config = {
46+
template: graphConfig,
47+
reverseArrow: false, // to make arrows point to ancestors, if displayed
48+
/*mode: "extended",*/
49+
orientation: "vertical"
50+
};
51+
52+
var gitGraph = new GitGraph(config);
53+
54+
/************************
55+
* BRANCHES AND COMMITS *
56+
************************/
57+
58+
var master = gitGraph.branch({
59+
name: "master",
60+
column: masterCol
61+
});
62+
63+
master.commit("Initial commit");
64+
65+
var opensourcemaster = master.branch({
66+
parentBranch: master,
67+
name: "opensourcemaster",
68+
column: opensourceCol,
69+
color: "#F00",
70+
// lineDash: [5],
71+
commitDefaultOptions: {
72+
color: "#F00"
73+
}
74+
});
75+
76+
var oppodevelop = master.branch({
77+
parentBranch: master,
78+
name: "oppodevelop",
79+
column: oppodevelopCol,
80+
color: "#deb887",
81+
// lineDash: [5],
82+
commitDefaultOptions: {
83+
color: "#deb887"
84+
}
85+
});
86+
87+
// Commit on HEAD Branch which is "master"
88+
opensourcemaster.commit("OpenSource commit 1");
89+
90+
oppodevelop.commit("oppodevelop commit 1")
91+
92+
oppodevelop.commit("oppodevelop commit 2")
93+
94+
// Add few commits on master
95+
opensourcemaster.commit("OpenSource commit 2");
96+
97+
oppodevelop.commit({
98+
lineDash: [3, 2],
99+
dotStrokeWidth: 5,
100+
dotColor: "white",
101+
messageHashDisplay: false,
102+
messageAuthorDisplay: false,
103+
message: "Current",
104+
tag: "HEAD",
105+
displayTagBox: true
106+
});

0 commit comments

Comments
 (0)