dyi 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +6 -0
- data/lib/dyi.rb +1 -1
- data/lib/dyi/chart/line_chart.rb +1 -1
- data/lib/dyi/drawing/pen.rb +5 -1
- data/lib/dyi/formatter/svg_formatter.rb +10 -6
- data/lib/dyi/length.rb +1 -1
- metadata +51 -66
data/CHANGES
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
= DYI Changelog
|
2
2
|
|
3
|
+
== Version 1.2.1 / 2012-05-01
|
4
|
+
* Bug Fixes
|
5
|
+
* A name of marker-option of LineChart is wrong.
|
6
|
+
* A create option name of Text is wrong.
|
7
|
+
* An operation of the link element.
|
8
|
+
|
3
9
|
== Version 1.2.0 / 2012-04-02
|
4
10
|
* Minor Enhancement
|
5
11
|
* Marker support.
|
data/lib/dyi.rb
CHANGED
data/lib/dyi/chart/line_chart.rb
CHANGED
@@ -31,7 +31,7 @@ module DYI
|
|
31
31
|
CHART_TYPES = [:line, :area, :bar, :stackedbar]
|
32
32
|
|
33
33
|
# @since 1.2.0
|
34
|
-
DEFAULT_MARKERS = [:circle, :square, :
|
34
|
+
DEFAULT_MARKERS = [:circle, :square, :triangle, :pentagon, :rhombus, :inverted_triangle]
|
35
35
|
|
36
36
|
attr_reader :axis_back_canvas, :chart_back_canvas, :scale_canvas, :chart_front_canvas, :axis_front_canvas, :legend_canvas
|
37
37
|
# @since 1.2.0
|
data/lib/dyi/drawing/pen.rb
CHANGED
@@ -469,7 +469,7 @@ module DYI
|
|
469
469
|
# text relative to _point_ argument. specifies one of the following
|
470
470
|
# vlaues: <tt>"start"</tt>, <tt>"middle"</tt>, <tt>"end"</tt>
|
471
471
|
# @option options [Length] :text_length the length of the displayed text
|
472
|
-
# @option options [String] :
|
472
|
+
# @option options [String] :length_adjust the way of adjustments to make the
|
473
473
|
# rendered length of the text match _text_length_ option. specifies one
|
474
474
|
# of the following vlaues: <tt>"spacing"</tt>, <tt>"spacingAndGlyphs"</tt>
|
475
475
|
# @option options [String] :text_decoration the decorations that are
|
@@ -484,6 +484,10 @@ module DYI
|
|
484
484
|
# @option options [Length] :border_rx the x-axis radius of the ellipse
|
485
485
|
# used to round off the corners of the rectangle when the rounded border
|
486
486
|
# is shown
|
487
|
+
# @option options [Length] :vertical_padding the interval of vertical
|
488
|
+
# border line and text area
|
489
|
+
# @option options [Length] :horizontal_padding the interval of horizontal
|
490
|
+
# border line and text area
|
487
491
|
# @option options [Length] :border_ry the y-axis radius of the ellipse
|
488
492
|
# used to round off the corners of the rectangle when the rounded border
|
489
493
|
# is shown
|
@@ -244,6 +244,7 @@ module DYI
|
|
244
244
|
|
245
245
|
def write_text(shape, io)
|
246
246
|
attrs = common_attributes(shape)
|
247
|
+
txt_attrs = {}
|
247
248
|
if shape.attributes[:text_decoration]
|
248
249
|
attrs[:"text-decoration"] = shape.attributes[:text_decoration]
|
249
250
|
end
|
@@ -253,11 +254,11 @@ module DYI
|
|
253
254
|
if shape.attributes[:writing_mode]
|
254
255
|
attrs[:"writing-mode"] = shape.attributes[:writing_mode]
|
255
256
|
end
|
256
|
-
if shape.attributes[:
|
257
|
-
|
257
|
+
if shape.attributes[:text_length]
|
258
|
+
txt_attrs[:textLength] = shape.attributes[:text_length]
|
258
259
|
end
|
259
|
-
if shape.attributes[:
|
260
|
-
|
260
|
+
if shape.attributes[:length_adjust]
|
261
|
+
txt_attrs[:lengthAdjust] = shape.attributes[:length_adjust]
|
261
262
|
end
|
262
263
|
|
263
264
|
text = shape.formated_text
|
@@ -267,7 +268,7 @@ module DYI
|
|
267
268
|
create_node(io, tag_name, attrs) {
|
268
269
|
create_border_node(shape, io)
|
269
270
|
line_number = 0
|
270
|
-
txt_attrs
|
271
|
+
txt_attrs.merge!(:x => shape.point.x, :y => shape.point.y)
|
271
272
|
# FIXME: Implementation of baseline attribute are not suitable
|
272
273
|
case shape.attributes[:alignment_baseline]
|
273
274
|
when 'top' then txt_attrs[:y] += shape.font_height * 0.85
|
@@ -289,6 +290,7 @@ module DYI
|
|
289
290
|
if shape.anchor_href
|
290
291
|
attrs[:'xlink:href'] = shape.anchor_href
|
291
292
|
attrs[:target] = shape.anchor_target if shape.anchor_target
|
293
|
+
attrs[:'pointer-events'] = 'visiblePainted'
|
292
294
|
create_text_group.call('a', attrs)
|
293
295
|
else
|
294
296
|
create_text_group.call('g', attrs)
|
@@ -302,11 +304,12 @@ module DYI
|
|
302
304
|
when 'middle' then attrs[:y] += shape.font_height * 0.35
|
303
305
|
when 'bottom' then attrs[:y] -= shape.font_height * 0.15
|
304
306
|
end
|
305
|
-
create_leaf_node(io, 'text', text, attrs)
|
307
|
+
create_leaf_node(io, 'text', text, attrs.merge(txt_attrs))
|
306
308
|
}
|
307
309
|
if shape.anchor_href
|
308
310
|
link_attrs = {:'xlink:href' => shape.anchor_href}
|
309
311
|
link_attrs[:target] = shape.anchor_target if shape.anchor_target
|
312
|
+
link_attrs[:'pointer-events'] = 'visiblePainted'
|
310
313
|
create_node(io, 'a', link_attrs) {
|
311
314
|
create_text_group.call
|
312
315
|
}
|
@@ -451,6 +454,7 @@ module DYI
|
|
451
454
|
if shape.anchor_href
|
452
455
|
link_attrs = {:'xlink:href' => shape.anchor_href}
|
453
456
|
link_attrs[:target] = shape.anchor_target if shape.anchor_target
|
457
|
+
link_attrs[:'pointer-events'] = 'visiblePainted'
|
454
458
|
create_node(io, 'a', link_attrs) {
|
455
459
|
write_shape_node(shape, io, attrs, tag_name, &create_child_node)
|
456
460
|
}
|
data/lib/dyi/length.rb
CHANGED
@@ -336,7 +336,7 @@ module DYI
|
|
336
336
|
def to_s(format=nil)
|
337
337
|
fmts = (format || @@default_format).split('\\\\')
|
338
338
|
fmts = fmts.map do |fmt|
|
339
|
-
fmt.gsub(/(?!\\U)(.|\G)U/, '\\1' + @unit.to_s).gsub(/(?!\\u)(.|\G)u/, '\\1' + unit)
|
339
|
+
fmt.gsub(/(?!\\U)(.|\G)U/, '\\1' + (@unit == '%' ? '\\%' : @unit.to_s)).gsub(/(?!\\u)(.|\G)u/, '\\1' + (@unit == '%' ? '\\%' : unit))
|
340
340
|
end
|
341
341
|
@value.strfnum(fmts.join('\\\\'))
|
342
342
|
end
|
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dyi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 2
|
9
|
-
- 0
|
10
|
-
version: 1.2.0
|
4
|
+
prerelease:
|
5
|
+
version: 1.2.1
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- Mamoru Yuo
|
@@ -15,8 +10,7 @@ autorequire:
|
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
12
|
|
18
|
-
date: 2012-
|
19
|
-
default_executable:
|
13
|
+
date: 2012-05-01 00:00:00 Z
|
20
14
|
dependencies: []
|
21
15
|
|
22
16
|
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"
|
@@ -28,70 +22,69 @@ extensions: []
|
|
28
22
|
extra_rdoc_files: []
|
29
23
|
|
30
24
|
files:
|
31
|
-
-
|
25
|
+
- CHANGES
|
26
|
+
- COPYING
|
27
|
+
- examples/animation.rb
|
28
|
+
- examples/class_diagram.rb
|
29
|
+
- examples/css.rb
|
30
|
+
- examples/data/03311056.xlsx
|
31
|
+
- examples/data/currency.xlsx
|
32
|
+
- examples/data/money.csv
|
33
|
+
- examples/line_and_bar.rb
|
34
|
+
- examples/line_chart.rb
|
35
|
+
- examples/logo.rb
|
36
|
+
- examples/pie_chart.rb
|
37
|
+
- examples/simple_shapes.rb
|
38
|
+
- lib/dyi/animation.rb
|
32
39
|
- lib/dyi/canvas.rb
|
40
|
+
- lib/dyi/chart/array_reader.rb
|
41
|
+
- lib/dyi/chart/axis_util.rb
|
42
|
+
- lib/dyi/chart/base.rb
|
43
|
+
- lib/dyi/chart/csv_reader.rb
|
44
|
+
- lib/dyi/chart/excel_reader.rb
|
45
|
+
- lib/dyi/chart/legend.rb
|
46
|
+
- lib/dyi/chart/line_chart.rb
|
47
|
+
- lib/dyi/chart/pie_chart.rb
|
48
|
+
- lib/dyi/chart/table.rb
|
33
49
|
- lib/dyi/chart.rb
|
34
|
-
- lib/dyi/
|
35
|
-
- lib/dyi/
|
50
|
+
- lib/dyi/color.rb
|
51
|
+
- lib/dyi/coordinate.rb
|
36
52
|
- lib/dyi/drawing/clipping.rb
|
37
|
-
- lib/dyi/drawing/filter.rb
|
38
53
|
- lib/dyi/drawing/color_effect.rb
|
39
|
-
- lib/dyi/drawing/
|
54
|
+
- lib/dyi/drawing/filter.rb
|
40
55
|
- lib/dyi/drawing/pen.rb
|
41
|
-
- lib/dyi/
|
42
|
-
- lib/dyi/
|
43
|
-
- lib/dyi/color.rb
|
56
|
+
- lib/dyi/drawing/pen_3d.rb
|
57
|
+
- lib/dyi/drawing.rb
|
44
58
|
- lib/dyi/element.rb
|
45
|
-
- lib/dyi/
|
46
|
-
- lib/dyi/
|
47
|
-
- lib/dyi/
|
59
|
+
- lib/dyi/event.rb
|
60
|
+
- lib/dyi/font.rb
|
61
|
+
- lib/dyi/formatter/base.rb
|
48
62
|
- lib/dyi/formatter/emf_formatter.rb
|
63
|
+
- lib/dyi/formatter/eps_formatter.rb
|
64
|
+
- lib/dyi/formatter/svg_formatter.rb
|
49
65
|
- lib/dyi/formatter/svg_reader.rb
|
50
66
|
- lib/dyi/formatter/xaml_formatter.rb
|
51
|
-
- lib/dyi/formatter
|
52
|
-
- lib/dyi/
|
53
|
-
- lib/dyi/formatter/eps_formatter.rb
|
54
|
-
- lib/dyi/script.rb
|
55
|
-
- lib/dyi/drawing.rb
|
56
|
-
- lib/dyi/animation.rb
|
67
|
+
- lib/dyi/formatter.rb
|
68
|
+
- lib/dyi/length.rb
|
57
69
|
- lib/dyi/matrix.rb
|
58
|
-
- lib/dyi/coordinate.rb
|
59
|
-
- lib/dyi/chart/array_reader.rb
|
60
|
-
- lib/dyi/chart/csv_reader.rb
|
61
|
-
- lib/dyi/chart/table.rb
|
62
|
-
- lib/dyi/chart/line_chart.rb
|
63
|
-
- lib/dyi/chart/pie_chart.rb
|
64
|
-
- lib/dyi/chart/legend.rb
|
65
|
-
- lib/dyi/chart/base.rb
|
66
|
-
- lib/dyi/chart/axis_util.rb
|
67
|
-
- lib/dyi/chart/excel_reader.rb
|
68
|
-
- lib/dyi/shape.rb
|
69
|
-
- lib/dyi/util.rb
|
70
70
|
- lib/dyi/painting.rb
|
71
|
-
- lib/dyi/
|
72
|
-
- lib/dyi/
|
73
|
-
- lib/dyi/
|
74
|
-
- lib/dyi/
|
71
|
+
- lib/dyi/script/ecmascript.rb
|
72
|
+
- lib/dyi/script/simple_script.rb
|
73
|
+
- lib/dyi/script.rb
|
74
|
+
- lib/dyi/shape/base.rb
|
75
|
+
- lib/dyi/shape/marker.rb
|
76
|
+
- lib/dyi/shape/path.rb
|
77
|
+
- lib/dyi/shape.rb
|
78
|
+
- lib/dyi/stylesheet.rb
|
75
79
|
- lib/dyi/svg_element.rb
|
80
|
+
- lib/dyi/type.rb
|
81
|
+
- lib/dyi/util.rb
|
76
82
|
- lib/dyi.rb
|
83
|
+
- lib/ironruby.rb
|
77
84
|
- lib/util.rb
|
78
|
-
-
|
85
|
+
- README
|
79
86
|
- test/path_command_test.rb
|
80
87
|
- test/test_length.rb
|
81
|
-
- examples/class_diagram.rb
|
82
|
-
- examples/line_and_bar.rb
|
83
|
-
- examples/line_chart.rb
|
84
|
-
- examples/data/money.csv
|
85
|
-
- examples/data/currency.xlsx
|
86
|
-
- examples/data/03311056.xlsx
|
87
|
-
- examples/simple_shapes.rb
|
88
|
-
- examples/pie_chart.rb
|
89
|
-
- examples/animation.rb
|
90
|
-
- examples/css.rb
|
91
|
-
- examples/logo.rb
|
92
|
-
- README
|
93
|
-
- COPYING
|
94
|
-
has_rdoc: true
|
95
88
|
homepage: https://sourceforge.net/projects/dyi/
|
96
89
|
licenses:
|
97
90
|
- GPL-3
|
@@ -105,25 +98,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
105
98
|
requirements:
|
106
99
|
- - ">="
|
107
100
|
- !ruby/object:Gem::Version
|
108
|
-
hash: 57
|
109
|
-
segments:
|
110
|
-
- 1
|
111
|
-
- 8
|
112
|
-
- 7
|
113
101
|
version: 1.8.7
|
114
102
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
103
|
none: false
|
116
104
|
requirements:
|
117
105
|
- - ">="
|
118
106
|
- !ruby/object:Gem::Version
|
119
|
-
hash: 3
|
120
|
-
segments:
|
121
|
-
- 0
|
122
107
|
version: "0"
|
123
108
|
requirements: []
|
124
109
|
|
125
110
|
rubyforge_project:
|
126
|
-
rubygems_version: 1.
|
111
|
+
rubygems_version: 1.8.10
|
127
112
|
signing_key:
|
128
113
|
specification_version: 3
|
129
114
|
summary: 2D graphics library
|