rbbt-rest 1.8.66 → 1.8.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 157083cd861ee7684a1f8aa8c6e467764926d330
|
4
|
+
data.tar.gz: 1d0e1ffebc9ff1a6800f639a92ae5340d50e3876
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aba24a6c098344fdae5db07e9ab514ced2c97edcfbcf710c30a3d5f534c21e5c3433f2c5d8b6e9fca770ad2d83bf34fa2bad9bb491645ac09b66df099c0b6dae
|
7
|
+
data.tar.gz: '0797a398dea30616971cf882ad50382ef827462346e869a3099213bb059f3148a545f9b79e987fb52c796e6f5878eaa39aabc1a74c73bfe6b7b4d0f5576898c5'
|
@@ -0,0 +1,70 @@
|
|
1
|
+
class RbbtGraph
|
2
|
+
attr_accessor :knowledge_base, :entities, :aesthetics, :associations, :rules
|
3
|
+
|
4
|
+
def initialize
|
5
|
+
@entities = {}
|
6
|
+
@aesthetics = {}
|
7
|
+
@associations = {}
|
8
|
+
@rules = {}
|
9
|
+
end
|
10
|
+
|
11
|
+
def add_associations(associations, type = :edge)
|
12
|
+
@associations[type] ||= []
|
13
|
+
@associations[type].concat associations.collect{|i| i }
|
14
|
+
@associations[type].uniq
|
15
|
+
if AssociationItem === associations
|
16
|
+
add_entities associations.target, associations.target_entity_type
|
17
|
+
add_entities associations.source, associations.source_entity_type
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def add_entities(entities, type = nil, entity_options = {})
|
22
|
+
type = entities.base_entity.to_s if type.nil? and AnnotatedArray === entities
|
23
|
+
raise "No type specified and entities are not Annotated, so could not guess" if type.nil?
|
24
|
+
if knowledge_base
|
25
|
+
good_entities = knowledge_base.translate(entities, type).compact.uniq
|
26
|
+
else
|
27
|
+
good_entities = entities
|
28
|
+
end
|
29
|
+
@namespace ||= entities.organism if entities.respond_to? :organism
|
30
|
+
if @entities[type].nil?
|
31
|
+
@entities[type] = good_entities
|
32
|
+
else
|
33
|
+
@entities[type].concat good_entities
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def add_aesthetic(elem, info)
|
38
|
+
@aesthetics[elem] ||= []
|
39
|
+
@aesthetics[elem] << info
|
40
|
+
end
|
41
|
+
|
42
|
+
def add_rule(elem, info)
|
43
|
+
@rules[elem] ||= []
|
44
|
+
@rules[elem] << info
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
def js_model
|
49
|
+
js_model = {:entities => {}, :associations => {}, :aes_rules => {}, :edge_aes_rules => {}, :rules => {}, :edge_rules => {}}
|
50
|
+
@entities.each do |type, codes|
|
51
|
+
info = codes.info if codes.respond_to? :info
|
52
|
+
info ||= {}
|
53
|
+
js_model[:entities][type] = {:codes => codes, :entity_type => type, :info => info}
|
54
|
+
end
|
55
|
+
@associations.each do |type, codes|
|
56
|
+
info = codes.info if codes.respond_to? :info
|
57
|
+
info ||= {}
|
58
|
+
js_model[:associations][type] = {:codes => codes, :database => type, :info => info}
|
59
|
+
end
|
60
|
+
@aesthetics.each do |type, info|
|
61
|
+
aes_rule_type = (type == :node ? :aes_rules : :edge_aes_rules)
|
62
|
+
js_model[aes_rule_type] = info
|
63
|
+
end
|
64
|
+
@rules.each do |type, info|
|
65
|
+
rule_type = (type == :node ? :rules : :edge_rules)
|
66
|
+
js_model[rule_type] = info
|
67
|
+
end
|
68
|
+
js_model
|
69
|
+
end
|
70
|
+
end
|
@@ -5,10 +5,12 @@
|
|
5
5
|
- dep_workflow ||= dep.task.workflow if dep.task
|
6
6
|
- dep_workflow ||= File.basename(File.dirname(File.dirname(dep.path)))
|
7
7
|
- str = [dep_workflow, dep.task_name, dep.name].compact * " - "
|
8
|
+
- dep_status = "done" if dep.path.exists?
|
9
|
+
- dep_status ||= dep.status
|
8
10
|
- if dep.file(:progress).exists?
|
9
|
-
- status =
|
11
|
+
- status = dep_status.to_s + " - " + dep.file(:progress).yaml[:last_percent].to_s + "%"
|
10
12
|
- else
|
11
|
-
- status =
|
13
|
+
- status = dep_status
|
12
14
|
- name = dep.name
|
13
15
|
%li
|
14
16
|
%span.workflow= dep_workflow
|
@@ -33,7 +35,7 @@
|
|
33
35
|
= name
|
34
36
|
|
35
37
|
|
36
|
-
%span.status(class="#{
|
38
|
+
%span.status(class="#{dep_status}") [#{status}]
|
37
39
|
|
38
40
|
- if dep.dependencies.any?
|
39
41
|
= partial_render('partials/dependencies', :job => dep)
|
@@ -286,7 +286,6 @@ rbbt.plots.aes.set_aes = function(list, aes_rules, type){
|
|
286
286
|
if (undefined === property && name == 'code') property = list.codes.slice()
|
287
287
|
if (undefined === property) return
|
288
288
|
|
289
|
-
console.log([property, mapper, mapper_obj])
|
290
289
|
var aes_values = rbbt.plots.aes.map_aesthetic(property, mapper, mapper_obj)
|
291
290
|
|
292
291
|
if (undefined === list.aes[aes]){
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbbt-rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.67
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -184,6 +184,7 @@ files:
|
|
184
184
|
- lib/rbbt/rest/entity/render.rb
|
185
185
|
- lib/rbbt/rest/entity/rest.rb
|
186
186
|
- lib/rbbt/rest/file_server.rb
|
187
|
+
- lib/rbbt/rest/graph.rb
|
187
188
|
- lib/rbbt/rest/helpers.rb
|
188
189
|
- lib/rbbt/rest/knowledge_base.rb
|
189
190
|
- lib/rbbt/rest/knowledge_base/helpers.rb
|