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: ece134a594e56a7b6bd70a7cdfdbcdce5b9b205b
4
- data.tar.gz: 3df24ffefa92ae84882b0f33c22b82af9296f3d9
3
+ metadata.gz: 0bf10b2b3ca6d703eac82233c0c76e0d006a34af
4
+ data.tar.gz: fc3e16c005df1ee298ea8db6dfc86b8972398b40
5
5
  SHA512:
6
- metadata.gz: ba596e1e5a19570378e3e23a830a5abed5ec6e529a7a141c4fa1d53e9cbb442c880a73122d43a2c391f81bfcffeea40faf603d6330d86f71c94bb1e440fac29a
7
- data.tar.gz: 8b19a6a857b89de29129a65301ab726ebf5e2a1fe0144b48436ddde868ed789d8ff647ad2cf471238552444c2146eb01408c3adbd5716be19a90aad60a63be55
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)
@@ -1,3 +1,3 @@
1
1
  module Society
2
- VERSION = "1.3.0"
2
+ VERSION = "1.4.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: society
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Coraline Ada Ehmke