dyi 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +9 -0
- data/examples/class_diagram.rb +1 -1
- data/lib/dyi.rb +1 -1
- data/lib/dyi/chart/array_reader.rb +2 -1
- data/lib/dyi/chart/pie_chart.rb +1 -1
- data/lib/dyi/font.rb +1 -1
- data/lib/dyi/formatter/svg_formatter.rb +3 -3
- data/lib/dyi/script/ecmascript.rb +16 -14
- data/lib/dyi/script/simple_script.rb +5 -0
- metadata +8 -6
data/CHANGES
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
= DYI Changelog
|
2
2
|
|
3
|
+
== Version 1.0.3
|
4
|
+
* Bug Fixes
|
5
|
+
* DataReader is not working properly in Ruby 1.9.
|
6
|
+
* A ECMAScript function dose not work properly.
|
7
|
+
|
8
|
+
== Version 1.0.2 / 2011-09-30
|
9
|
+
* Bug Fixes
|
10
|
+
* Initialization script can not register more than one.
|
11
|
+
|
3
12
|
== Version 1.0.1 / 2011-09-28
|
4
13
|
* Bug Fixes
|
5
14
|
* A event listeners dose not work properly.
|
data/examples/class_diagram.rb
CHANGED
@@ -67,7 +67,7 @@ class ArrowPen < DYI::Drawing::Pen
|
|
67
67
|
total_length = DYI::Length.new(start_point.distance(end_point))
|
68
68
|
end_point_no_rotate = DYI::Coordinate.new(start_point.x + total_length, start_point.y)
|
69
69
|
|
70
|
-
rotate_value = Math.atan2(end_point.y - start_point.y, end_point.x - start_point.x) * 360.0 / (2*Math::PI)
|
70
|
+
rotate_value = Math.atan2((end_point.y - start_point.y).to_f, (end_point.x - start_point.x).to_f) * 360.0 / (2*Math::PI)
|
71
71
|
|
72
72
|
draw_line(canvas, start_point, end_point_no_rotate).rotate(rotate_value, start_point)
|
73
73
|
draw_polygon(canvas, end_point_no_rotate){|line|
|
data/lib/dyi.rb
CHANGED
@@ -168,7 +168,8 @@ module DYI #:nodoc:
|
|
168
168
|
# data.age_values # => [20, 25]
|
169
169
|
# @since 1.0.0
|
170
170
|
def method_missing(name, *args)
|
171
|
-
if args.size == 0 && name.to_s =~ /_values\z/ &&
|
171
|
+
if args.size == 0 && name.to_s =~ /_values\z/ &&
|
172
|
+
@schema.members.include?(RUBY_VERSION >= '1.9' ? $`.to_sym : $`)
|
172
173
|
@records.map{|r| r.__send__($`)}
|
173
174
|
else
|
174
175
|
super
|
data/lib/dyi/chart/pie_chart.rb
CHANGED
@@ -241,7 +241,7 @@ module DYI #:nodoc:
|
|
241
241
|
:duration => animation_duration,
|
242
242
|
:fill => 'freeze',
|
243
243
|
:begin_event => Event.mouseout(pie_sector))
|
244
|
-
if
|
244
|
+
if show_legend?
|
245
245
|
text.add_painting_animation(:to => {:opacity => 1},
|
246
246
|
:duration => animation_duration,
|
247
247
|
:fill => 'freeze',
|
data/lib/dyi/font.rb
CHANGED
@@ -90,11 +90,11 @@ module DYI #:nodoc:
|
|
90
90
|
content_type = script.content_type
|
91
91
|
create_cdata_node(sio, 'script',
|
92
92
|
:type => content_type) {
|
93
|
-
sio << script.
|
93
|
+
sio << script.contents
|
94
94
|
if (i += 1) < length
|
95
95
|
script = canvas.scripts[i]
|
96
96
|
while !script.has_uri_reference? && content_type == script.content_type
|
97
|
-
sio << script.
|
97
|
+
sio << script.contents
|
98
98
|
break if length <= (i += 1)
|
99
99
|
script = canvas.scripts[i]
|
100
100
|
end
|
@@ -385,7 +385,7 @@ module DYI #:nodoc:
|
|
385
385
|
:'xlink:href' => script.href,
|
386
386
|
:type => script.content_type)
|
387
387
|
else
|
388
|
-
io << script.
|
388
|
+
io << script.contents
|
389
389
|
end
|
390
390
|
end
|
391
391
|
|
@@ -48,7 +48,7 @@ module DYI
|
|
48
48
|
parts << '.addEventListener("' << event.event_name
|
49
49
|
parts << '", function(' << listener.arguments.join(', ') << ") {\n"
|
50
50
|
parts << listener.body
|
51
|
-
parts << '})'
|
51
|
+
parts << '}, false)'
|
52
52
|
parts.join
|
53
53
|
end
|
54
54
|
|
@@ -86,15 +86,17 @@ module DYI
|
|
86
86
|
parts << " var node = elm.el.childNodes.item(j);\n"
|
87
87
|
parts << " if(node.nodeName == \"text\") {\n"
|
88
88
|
parts << " var text_width = node.getComputedTextLength();\n"
|
89
|
-
parts << "
|
90
|
-
parts << "
|
91
|
-
parts << " top
|
92
|
-
parts << "
|
93
|
-
parts << " right
|
94
|
-
parts << "
|
95
|
-
parts << " bottom
|
96
|
-
parts << "
|
97
|
-
parts << " left
|
89
|
+
parts << " if(node.getNumberOfChars() > 0){\n"
|
90
|
+
parts << " var ext = node.getExtentOfChar(0);\n"
|
91
|
+
parts << " if(top == null || ext.y < top)\n"
|
92
|
+
parts << " top = ext.y;\n"
|
93
|
+
parts << " if(right == null || right < ext.x + text_width)\n"
|
94
|
+
parts << " right = ext.x + text_width;\n"
|
95
|
+
parts << " if(bottom == null || bottom < ext.y + ext.height)\n"
|
96
|
+
parts << " bottom = ext.y + ext.height;\n"
|
97
|
+
parts << " if(left == null || ext.x < left)\n"
|
98
|
+
parts << " left = ext.x;\n"
|
99
|
+
parts << " }\n"
|
98
100
|
parts << " }\n"
|
99
101
|
parts << " else if(node.nodeName == \"rect\")\n"
|
100
102
|
parts << " rect = node;\n"
|
@@ -198,8 +200,8 @@ module DYI
|
|
198
200
|
end
|
199
201
|
end
|
200
202
|
|
201
|
-
#
|
202
|
-
def
|
203
|
+
# @since 1.0.3
|
204
|
+
def contents
|
203
205
|
parts = []
|
204
206
|
parts << 'function'
|
205
207
|
parts << " #{name}" if name
|
@@ -240,8 +242,8 @@ module DYI
|
|
240
242
|
@events.delete(event)
|
241
243
|
end
|
242
244
|
|
243
|
-
#
|
244
|
-
def
|
245
|
+
# @since 1.0.3
|
246
|
+
def contents
|
245
247
|
if name
|
246
248
|
super
|
247
249
|
else
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dyi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 17
|
5
|
+
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 3
|
10
|
+
version: 1.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Yuo
|
@@ -15,7 +15,8 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-11-28 00:00:00 +09:00
|
19
|
+
default_executable:
|
19
20
|
dependencies: []
|
20
21
|
|
21
22
|
description: " DYI is a 2D graphics library, very rich and expressive.\n DYI have been optimized for SVG format, but it is also possible\n to output other format; for example, EPS.\n"
|
@@ -88,6 +89,7 @@ files:
|
|
88
89
|
- README
|
89
90
|
- test/path_command_test.rb
|
90
91
|
- test/test_length.rb
|
92
|
+
has_rdoc: true
|
91
93
|
homepage: https://sourceforge.net/projects/dyi/
|
92
94
|
licenses:
|
93
95
|
- GPL-3
|
@@ -119,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
121
|
requirements: []
|
120
122
|
|
121
123
|
rubyforge_project:
|
122
|
-
rubygems_version: 1.
|
124
|
+
rubygems_version: 1.3.7
|
123
125
|
signing_key:
|
124
126
|
specification_version: 3
|
125
127
|
summary: 2D graphics library
|