Skip to content

Commit

Permalink
feat(frequency): make it works
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Feb 19, 2021
1 parent 69eba62 commit 163a2f7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 6 deletions.
8 changes: 4 additions & 4 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@
}

.code-frequency .addition {
fill: #2cbe4e;
fill-opacity: 1;
/*fill: #2cbe4e;*/
/*fill-opacity: 1;*/
}
.code-frequency .deletion {
fill: #cb2431;
fill-opacity: 1;
/*fill: #cb2431;*/
/*fill-opacity: 1;*/
}
</style>
</head>
Expand Down
34 changes: 32 additions & 2 deletions web/public/js/graph/git/team-code-frequency.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ function renderTeamFrequency(data) {
svg.append("path")
.attr("class", "addition")
.datum(data)
.attr("stroke-width", 1)
.attr("stroke-width", 2)
.attr("fill", "none")
.attr("d", d3.line()
.x(function (d) {
return x(d.date);
Expand All @@ -51,10 +52,25 @@ function renderTeamFrequency(data) {
})
);

svg.append("path")
.attr("class", "addition")
.datum(data)
.attr("fill", "#2cbe4e")
.attr("d", d3.area()
.x(function (d) {
return x(d.date);
})
.y1(function (d) {
return y1(d.added);
})
.y0(height / 2)
);

svg.append("path")
.attr("class", "deletion")
.datum(data)
.attr("stroke-width", 1)
.attr("stroke-width", 2)
.attr("fill", "none")
.attr("d", d3.line()
.x(function (d) {
return x(d.date);
Expand All @@ -64,6 +80,20 @@ function renderTeamFrequency(data) {
})
);

svg.append("path")
.attr("class", "deletion")
.datum(data)
.attr("fill", "#cb2431")
.attr("d", d3.area()
.x(function (d) {
return x(d.date);
})
.y0(height / 2)
.y1(function (d) {
return y2(-d.deleted);
})
);

svg.append("circle").attr("cx", 290).attr("cy", 30).attr("r", 6).style("fill", "#2cbe4e")
svg.append("circle").attr("cx", 290).attr("cy", 60).attr("r", 6).style("fill", "#cb2431")
svg.append("text")
Expand Down

0 comments on commit 163a2f7

Please sign in to comment.