Skip to content

Commit

Permalink
feat(explorer): make show commits
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Mar 5, 2021
1 parent c5160ab commit 39691d4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/infrastructure/git/git_file_history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ pub struct Stats {
pub name: PathBuf,
}

#[allow(unused_assignments)]
fn parse_file(filename: &Path) -> Result<LanguageLocData, Error> {
let config = Config::default();
let mut language_name = None;
Expand Down
12 changes: 9 additions & 3 deletions web/public/js/graph/git/file-explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,16 @@ function renderCodeExplorer(freedom, data, elementId) {
.attr("stroke", "#F5F5F2")
.on("mouseover", function (event, d) {
d3.select(this).attr("opacity", "0.5")
let commits = 0;
if (d.data.data && d.data.data.git) {
commits = d.data.data.git.details.length;
}
tooltip
.style("opacity", 1)
.html(`<h1>${d.data.name}</h1>
<h2>${d.data.path}</h2>
.html(`<h2>${d.data.name}</h2>
<h4>${d.data.path}</h4>
<h4>line: ${d.data.value}</h4>
<h4>commits: ${commits}</h4>
`)
})
.on("mouseleave", function (event, d) {
Expand Down Expand Up @@ -106,7 +112,7 @@ function renderCodeExplorer(freedom, data, elementId) {
return "translate(" + [d.data.layout.center[0], d.data.layout.center[1] + 6] + ")"
})
.text(d => {
if (d.data.data) {
if (d.data.data && d.data.data.git) {
return d.data.name + ":" + d.data.data.git.details.length
}
return d.data.name;
Expand Down
2 changes: 1 addition & 1 deletion web/public/js/plugins/d3-voronoi-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -865,4 +865,4 @@

Object.defineProperty(exports, '__esModule', { value: true });

}));
}));

0 comments on commit 39691d4

Please sign in to comment.