@@ -63,36 +63,40 @@ def properties
63
63
64
64
def enter ( &block )
65
65
process_from
66
+ data = @from [ :data ] if @from
66
67
@properties . merge! (
67
68
{ enter : ::Plotrb ::Mark ::MarkProperty .
68
- new ( @type , @from [ : data] , &block ) }
69
+ new ( @type , data , &block ) }
69
70
)
70
71
self
71
72
end
72
73
73
74
def exit ( &block )
74
75
process_from
76
+ data = @from [ :data ] if @from
75
77
@properties . merge! (
76
78
{ exit : ::Plotrb ::Mark ::MarkProperty .
77
- new ( @type , @from [ : data] , &block ) }
79
+ new ( @type , data , &block ) }
78
80
)
79
81
self
80
82
end
81
83
82
84
def update ( &block )
83
85
process_from
86
+ data = @from [ :data ] if @from
84
87
@properties . merge! (
85
88
{ update : ::Plotrb ::Mark ::MarkProperty .
86
- new ( @type , @from [ : data] , &block ) }
89
+ new ( @type , data , &block ) }
87
90
)
88
91
self
89
92
end
90
93
91
94
def hover ( &block )
92
95
process_from
96
+ data = @from [ :data ] if @from
93
97
@properties . merge! (
94
98
{ hover : ::Plotrb ::Mark ::MarkProperty .
95
- new ( @type , @from [ : data] , &block ) }
99
+ new ( @type , data , &block ) }
96
100
)
97
101
self
98
102
end
@@ -139,17 +143,17 @@ def process_from
139
143
def process_group
140
144
return unless @scales
141
145
unless @scales . all? { |s | s . is_a? ( ::Plotrb ::Scale ) }
142
- raise ArgumentError , 'Invalid scales fro group mark'
146
+ raise ArgumentError , 'Invalid scales for group mark'
143
147
end
144
148
145
149
return unless @axes
146
150
unless @axes . all? { |s | s . is_a? ( ::Plotrb ::Axis ) }
147
- raise ArgumentError , 'Invalid axes fro group mark'
151
+ raise ArgumentError , 'Invalid axes for group mark'
148
152
end
149
153
150
154
return unless @marks
151
155
unless @marks . all? { |s | s . is_a? ( ::Plotrb ::Mark ) }
152
- raise ArgumentError , 'Invalid marks fro group mark'
156
+ raise ArgumentError , 'Invalid marks for group mark'
153
157
end
154
158
end
155
159
@@ -195,7 +199,7 @@ class MarkProperty
195
199
add_attributes *VISUAL_PROPERTIES
196
200
attr_reader :data
197
201
198
- def initialize ( type , data , &block )
202
+ def initialize ( type , data = nil , &block )
199
203
define_single_val_attributes *VISUAL_PROPERTIES
200
204
self . singleton_class . class_eval {
201
205
alias_method :x_start , :x
@@ -222,6 +226,10 @@ def rect
222
226
# no additional attributes
223
227
end
224
228
229
+ def group
230
+ # no additional attributes
231
+ end
232
+
225
233
def symbol
226
234
# @!attribute size
227
235
# @return [ValueRef] the pixel area of the symbol
0 commit comments