society 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bf10b2b3ca6d703eac82233c0c76e0d006a34af
|
4
|
+
data.tar.gz: fc3e16c005df1ee298ea8db6dfc86b8972398b40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccc9574d8d3a56c884596e5c941625f592896b6efe39dec3066b62a6231d87e1da78b2dd2f73b7dfe9ac78ab603d64d6a80f5a9ccd75372273e97120189e81b3
|
7
|
+
data.tar.gz: 8ba05a8c714a02d65895b364d5b1113ee2116f6e74a8676cc1c63020c7787826223a82bf4d1ae0f21a0893a8f45833aaf19fbe00ec604dd56945441c0dd0a427
|
@@ -21,6 +21,7 @@
|
|
21
21
|
this.element = element;
|
22
22
|
this.data = this.transformData(data);
|
23
23
|
this.includeIsolatedNodes = true;
|
24
|
+
this.depsFiltered = false;
|
24
25
|
};
|
25
26
|
|
26
27
|
NetworkGraph.prototype.transformData = function(data) {
|
@@ -130,6 +131,38 @@
|
|
130
131
|
.classed("society-node--source", false);
|
131
132
|
};
|
132
133
|
|
134
|
+
var toggleFilterOnlyDeps = function(d) {
|
135
|
+
if (this.depsFiltered == false) {
|
136
|
+
nodeAnchor.selectAll(".society-node--faded")
|
137
|
+
.style("visibility", "hidden");
|
138
|
+
linkAnchor.selectAll(".society-link")
|
139
|
+
.filter(":not(.society-link--source)")
|
140
|
+
.filter(":not(.society-link--target)")
|
141
|
+
.style("visibility", "hidden");
|
142
|
+
this.depsFiltered = true;
|
143
|
+
} else {
|
144
|
+
d3
|
145
|
+
.selectAll(".society-node")
|
146
|
+
.style("visibility", "visible");
|
147
|
+
d3
|
148
|
+
.selectAll(".society-link")
|
149
|
+
.style("visibility", "visible");
|
150
|
+
this.depsFiltered = false;
|
151
|
+
}
|
152
|
+
};
|
153
|
+
|
154
|
+
document.onkeydown = function(evt) {
|
155
|
+
evt = evt || window.event;
|
156
|
+
if (evt.keyCode == 27) {
|
157
|
+
d3
|
158
|
+
.selectAll(".society-node")
|
159
|
+
.style("visibility", "visible");
|
160
|
+
d3
|
161
|
+
.selectAll(".society-link")
|
162
|
+
.style("visibility", "visible");
|
163
|
+
}
|
164
|
+
};
|
165
|
+
|
133
166
|
var newNodes = node.enter().append("text")
|
134
167
|
.attr("opacity", 0)
|
135
168
|
.attr("transform", function(d) { return "rotate(" + (d.x - 90) + ")translate(" + (d.y + 64) + ",0)" + (d.x < 180 ? "" : "rotate(180)"); })
|
@@ -138,7 +171,8 @@
|
|
138
171
|
.attr("dy", ".31em")
|
139
172
|
.text(function(d) { return d.key; })
|
140
173
|
.on("mouseover", mouseovered)
|
141
|
-
.on("mouseout", mouseouted)
|
174
|
+
.on("mouseout", mouseouted)
|
175
|
+
.on("click", toggleFilterOnlyDeps);
|
142
176
|
|
143
177
|
link.enter().append("path")
|
144
178
|
.attr("opacity", 0)
|
data/lib/society/version.rb
CHANGED