society 1.5.2 → 1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/society/formatter/report/templates/components/society-assets/society.css +1 -1
- data/lib/society/formatter/report/templates/components/society-assets/society.js +46 -2
- data/lib/society/formatter/report/templates/index.htm.haml +4 -0
- data/lib/society/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5405b409b32bc4c1fbcdcd16045f6e89f914dc0
|
4
|
+
data.tar.gz: 37a9b9232cb5ad32076b44b93a79d23d8dfbecaf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16e7aa59852b0fc41fe030d3d65794cb9db6d9f1ff14897ea6f2e2cc08402456c30921b99acaf7931f978eba1d5427d79d3585724455fda8d184722a3a343109
|
7
|
+
data.tar.gz: fbb2a78386bbc8642fdc036e6a216430814c3df7052afb9ab8e5b6042224d58153737ed04e3f02eb449f55a474f2822e5e46cde94140d14e107619b9ff8c0179
|
data/README.md
CHANGED
@@ -51,6 +51,7 @@
|
|
51
51
|
.attr('transform', 'translate(' + this.radius + ',' + this.radius + ')');
|
52
52
|
this.linkAnchor = this.svg.append('g');
|
53
53
|
this.nodeAnchor = this.svg.append('g');
|
54
|
+
$("#class-names").on('keydown', this.toggleFilteredNodes.bind(this));
|
54
55
|
this.render();
|
55
56
|
d3.select(self.frameElement).style('height', this.diameter + 'px');
|
56
57
|
};
|
@@ -60,6 +61,10 @@
|
|
60
61
|
this.render();
|
61
62
|
};
|
62
63
|
|
64
|
+
NetworkGraph.prototype.toggleFilteredNodes = function () {
|
65
|
+
this.render();
|
66
|
+
};
|
67
|
+
|
63
68
|
NetworkGraph.prototype.hideIsolatedNodes = function() {
|
64
69
|
this.includeIsolatedNodes = false;
|
65
70
|
this.render();
|
@@ -72,9 +77,9 @@
|
|
72
77
|
|
73
78
|
NetworkGraph.prototype.getData = function() {
|
74
79
|
if (this.includeIsolatedNodes) {
|
75
|
-
return this.data;
|
80
|
+
return filterByAutocomplete(this.data);
|
76
81
|
} else {
|
77
|
-
return filterIsolatedNodes(this.data);
|
82
|
+
return filterByAutocomplete(filterIsolatedNodes(this.data));
|
78
83
|
}
|
79
84
|
};
|
80
85
|
|
@@ -233,6 +238,45 @@
|
|
233
238
|
return map[""];
|
234
239
|
};
|
235
240
|
|
241
|
+
function filterByAutocomplete(data) {
|
242
|
+
filter = $('#class-names').val()
|
243
|
+
if (filter === "") {
|
244
|
+
return data;
|
245
|
+
};
|
246
|
+
|
247
|
+
var json = data.slice();
|
248
|
+
var filtered = [];
|
249
|
+
var names = json.map(function(klass) {
|
250
|
+
return klass.name;
|
251
|
+
});
|
252
|
+
|
253
|
+
json.forEach(function(klass) {
|
254
|
+
klass.relations.forEach(function(edge) {
|
255
|
+
if (klass.name === edge) return;
|
256
|
+
json[names.indexOf(edge)]._HAS_INCOMING_ = true;
|
257
|
+
});
|
258
|
+
});
|
259
|
+
|
260
|
+
json.forEach(function(klass) {
|
261
|
+
var re = new RegExp(filter, "i");
|
262
|
+
if (klass.name.search(re) !== -1) {
|
263
|
+
filtered.push(klass);
|
264
|
+
klass.relations.forEach(function(edge) {
|
265
|
+
filtered.push(
|
266
|
+
{
|
267
|
+
"name": edge,
|
268
|
+
"relations": [ klass.name ]
|
269
|
+
}
|
270
|
+
);
|
271
|
+
});
|
272
|
+
};
|
273
|
+
});
|
274
|
+
if (filtered.length > 0) {
|
275
|
+
return filtered;
|
276
|
+
} else {
|
277
|
+
return data;
|
278
|
+
}
|
279
|
+
};
|
236
280
|
|
237
281
|
function filterIsolatedNodes(data) {
|
238
282
|
var json = data.slice();
|
@@ -34,6 +34,10 @@
|
|
34
34
|
%span.key-red outgoing references
|
35
35
|
Double-click on a class name to enter
|
36
36
|
focus mode. Press ESC to return to the full view.
|
37
|
+
%div
|
38
|
+
%label Filter by class name:
|
39
|
+
%input#class-names{:type => "text"}/
|
40
|
+
%br
|
37
41
|
#network{:style => "height: 100%; width: 100%;"}
|
38
42
|
#tabs-2
|
39
43
|
%div
|
data/lib/society/version.rb
CHANGED