macrocosm 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/macrocosm.rb +11 -4
- data/lib/macrocosm/template.html +1 -1
- data/lib/macrocosm/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4fcedd934d40198c6446ff36c8f09cbc29ac5c982f472a031316729373c7b25
|
4
|
+
data.tar.gz: 9d678fddefa777ca3c63424f05efc3d3db9eb7192c104a750d21ea91170603d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5552dcd4f36fe1ca2def09ad45c2692107bce174b25ed709feb53d5689982f00c570c64b363d05e248879f171eedf213367de74ebb6f6d306b979e86f703524b
|
7
|
+
data.tar.gz: 892a2ddd35c9aeffbda4306e3854fd9bc2b2f0ad9a65a3b95def4e1b9f9f6bbb889660201dbede9248bc46a507fae04ac4d001ded8756bce3e696999e581dd44
|
data/lib/macrocosm.rb
CHANGED
@@ -16,11 +16,12 @@ class Macrocosm
|
|
16
16
|
@last_curveness = Hash.new{ |h, k| h[k] = MaxCurveness.dup }
|
17
17
|
end
|
18
18
|
|
19
|
-
def add_link(source, target, relation_in_list: nil, relation_in_graph: nil)
|
19
|
+
def add_link(source, target, relation_in_list: nil, relation_in_graph: nil, line_style: {})
|
20
20
|
ends = [source, target].sort!.join
|
21
21
|
|
22
22
|
link = {
|
23
23
|
ends: ends,
|
24
|
+
lineStyle: line_style,
|
24
25
|
source: source,
|
25
26
|
target: target
|
26
27
|
}
|
@@ -33,7 +34,7 @@ class Macrocosm
|
|
33
34
|
|
34
35
|
def links
|
35
36
|
@links.map do |link|
|
36
|
-
link[:lineStyle] =
|
37
|
+
link[:lineStyle][:curveness] = calc_curveness(link)
|
37
38
|
link.delete(:ends)
|
38
39
|
link
|
39
40
|
end
|
@@ -68,8 +69,14 @@ class Macrocosm
|
|
68
69
|
}
|
69
70
|
end
|
70
71
|
|
71
|
-
def add_link(source, target, relation_in_list: nil, relation_in_graph: nil)
|
72
|
-
@links.add_link(
|
72
|
+
def add_link(source, target, relation_in_list: nil, relation_in_graph: nil, line_style: {})
|
73
|
+
@links.add_link(
|
74
|
+
source,
|
75
|
+
target,
|
76
|
+
relation_in_list: relation_in_list,
|
77
|
+
relation_in_graph: relation_in_graph,
|
78
|
+
line_style: line_style
|
79
|
+
)
|
73
80
|
end
|
74
81
|
|
75
82
|
def to_s
|
data/lib/macrocosm/template.html
CHANGED
data/lib/macrocosm/version.rb
CHANGED