plot 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/plot/mark.rb +14 -4
- 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: 52d7e627ba05b46d6406679d44e071eb63762d9bdc4a8904883b4bffa4cb23e1
|
4
|
+
data.tar.gz: a475675aad7a4930ad021ae74f748879d4cd6464142c4accff94cd52cabe7041
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 974a4403d5a7c3e4f98c63e7d85b3bfeb612671177f89080abbc912b6d1f12633754a1943e881fba6245dc89e08b984852c28ac6915f1b9cd313ae5a254b653d
|
7
|
+
data.tar.gz: 3ba284e6c02b47d58df65c476500b1673ec5a5fa316746e58e2ac6de463a731bc254f2e785e59f3855e632dc225e0b9dcad969fa7cdbbed774150b3cff83c6b3
|
data/lib/plot/mark.rb
CHANGED
@@ -6,15 +6,25 @@ class Plot::MarkProxy
|
|
6
6
|
|
7
7
|
def channel(name, value, **obj)
|
8
8
|
# TODO: add checking if option is a channel
|
9
|
-
|
10
|
-
|
9
|
+
|
10
|
+
if !obj.blank?
|
11
|
+
obj[:value] = value
|
12
|
+
@mark.add_option(name, obj)
|
13
|
+
else
|
14
|
+
@mark.add_option(name, value)
|
15
|
+
end
|
11
16
|
end
|
12
17
|
|
13
|
-
def option(name, value)
|
18
|
+
def option(name, value, wrap: false)
|
14
19
|
if(value.class == Proc || [:title, :href, :ariaLabel].include?(name)) then
|
15
20
|
raise "A channel should be used in place of option"
|
16
21
|
end
|
17
|
-
|
22
|
+
|
23
|
+
if wrap then
|
24
|
+
@mark.add_option(name, { value: value })
|
25
|
+
else
|
26
|
+
@mark.add_option(name, value )
|
27
|
+
end
|
18
28
|
end
|
19
29
|
|
20
30
|
def style(name, value)
|