Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
feat(githut): Highlight all related lines.
Browse files Browse the repository at this point in the history
- Highlights related lines/data that share the same
  columns data.

Closes #548
  • Loading branch information
Matthew Schranz committed Apr 1, 2015
1 parent 3791a80 commit d633416
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions app/scripts/components/githut/githut.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ module ngApp.components.githut.controllers {

if (options.dimensions.indexOf(d) === -1) {
__a = (a.values[use] / ((options.dimensions.indexOf(use) > -1) ? 1 : a.values[options.ref]));
__b = (b.values[use] / ((options.dimensions.indexOf(use) > -1) ? 1 : b.values[options.ref]))
__b = (b.values[use] / ((options.dimensions.indexOf(use) > -1) ? 1 : b.values[options.ref]));
}

return sorting(__a, __b);
Expand Down Expand Up @@ -715,6 +715,30 @@ module ngApp.components.githut.controllers {
return l.values.primary_site == d.value;
});
});

// Mouseover trigger for highlighting all paths that cross through
// a label that isn't primary site or project id
labels
.filter(function(d) {
return d.column !== "primary_site" && d.column !== "project_id";
})
.on("mouseover", function(d) {
labels_group
.selectAll(".labels")
.classed("hover", function(l) {
var ret = l.values[d.column] === d.value;

// Don't forget to ensure the connecting lines themselves
// are highlighted
if (ret) {
languages_group
.selectAll("g.lang[rel='" + l.key + "']")
.classed("hover", true);
}

return ret;
});
});
}

function createLangLabel(lang_label) {
Expand Down Expand Up @@ -890,7 +914,7 @@ module ngApp.components.githut.controllers {
})
.on("mouseover",function(d){
d3.select(this)
.classed("hover",true);
.classed("hover", true);

languages_group
.selectAll("g.lang[rel='" + d.key + "']")
Expand Down

0 comments on commit d633416

Please sign in to comment.