ctioga2 0.0 → 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog +25 -1
- data/lib/ctioga2/commands/commands.rb +13 -2
- data/lib/ctioga2/commands/doc/doc.rb +13 -17
- data/lib/ctioga2/commands/doc/documentation-commands.rb +14 -1
- data/lib/ctioga2/commands/doc/help.rb +136 -25
- data/lib/ctioga2/commands/doc/html.rb +56 -4
- data/lib/ctioga2/commands/doc/introspection.rb +45 -9
- data/lib/ctioga2/commands/doc/man.rb +7 -5
- data/lib/ctioga2/commands/doc/markup.rb +39 -12
- data/lib/ctioga2/commands/doc/wordwrap.rb +70 -0
- data/lib/ctioga2/commands/general-commands.rb +7 -4
- data/lib/ctioga2/commands/general-types.rb +27 -12
- data/lib/ctioga2/commands/interpreter.rb +2 -2
- data/lib/ctioga2/commands/parsers/command-line.rb +9 -5
- data/lib/ctioga2/commands/parsers/file.rb +5 -3
- data/lib/ctioga2/commands/type.rb +10 -3
- data/lib/ctioga2/commands/variables.rb +2 -2
- data/lib/ctioga2/data/backends/backend.rb +17 -15
- data/lib/ctioga2/data/backends/backends.rb +2 -2
- data/lib/ctioga2/data/backends/backends/gnuplot.rb +20 -5
- data/lib/ctioga2/data/backends/backends/math.rb +2 -2
- data/lib/ctioga2/data/backends/backends/text.rb +112 -17
- data/lib/ctioga2/data/backends/description.rb +10 -11
- data/lib/ctioga2/data/datacolumn.rb +73 -14
- data/lib/ctioga2/data/dataset.rb +305 -9
- data/lib/ctioga2/data/filters.rb +49 -1
- data/lib/ctioga2/data/indexed-dtable.rb +137 -0
- data/lib/ctioga2/data/point.rb +98 -7
- data/lib/ctioga2/data/stack.rb +98 -21
- data/lib/ctioga2/graphics/coordinates.rb +19 -2
- data/lib/ctioga2/graphics/elements.rb +12 -2
- data/lib/ctioga2/graphics/elements/containers.rb +14 -2
- data/lib/ctioga2/graphics/elements/contour.rb +67 -0
- data/lib/ctioga2/graphics/elements/curve2d.rb +103 -42
- data/lib/ctioga2/graphics/elements/element.rb +12 -2
- data/lib/ctioga2/graphics/elements/gradient-region.rb +94 -0
- data/lib/ctioga2/graphics/elements/parametric2d.rb +172 -0
- data/lib/ctioga2/graphics/elements/primitive.rb +37 -21
- data/lib/ctioga2/graphics/elements/region.rb +143 -0
- data/lib/ctioga2/graphics/elements/subplot.rb +92 -32
- data/lib/ctioga2/graphics/elements/tangent.rb +99 -0
- data/lib/ctioga2/graphics/elements/xyz-map.rb +126 -0
- data/lib/ctioga2/graphics/generator.rb +91 -6
- data/lib/ctioga2/graphics/legends.rb +26 -21
- data/lib/ctioga2/graphics/legends/area.rb +8 -8
- data/lib/ctioga2/graphics/legends/items.rb +5 -5
- data/lib/ctioga2/graphics/legends/storage.rb +4 -2
- data/lib/ctioga2/graphics/root.rb +24 -2
- data/lib/ctioga2/graphics/styles.rb +8 -0
- data/lib/ctioga2/graphics/styles/axes.rb +49 -23
- data/lib/ctioga2/graphics/styles/base.rb +2 -2
- data/lib/ctioga2/graphics/styles/carrays.rb +9 -2
- data/lib/ctioga2/graphics/styles/colormap.rb +272 -0
- data/lib/ctioga2/graphics/styles/curve.rb +64 -4
- data/lib/ctioga2/graphics/styles/drawable.rb +68 -9
- data/lib/ctioga2/graphics/styles/errorbar.rb +73 -0
- data/lib/ctioga2/graphics/styles/factory.rb +133 -17
- data/lib/ctioga2/graphics/styles/gradients.rb +60 -0
- data/lib/ctioga2/graphics/styles/location.rb +64 -0
- data/lib/ctioga2/graphics/styles/map-axes.rb +164 -0
- data/lib/ctioga2/graphics/styles/plot.rb +165 -62
- data/lib/ctioga2/graphics/styles/sets.rb +14 -1
- data/lib/ctioga2/graphics/styles/texts.rb +44 -34
- data/lib/ctioga2/graphics/subplot-commands.rb +94 -6
- data/lib/ctioga2/graphics/types.rb +113 -35
- data/lib/ctioga2/graphics/types/bijection.rb +3 -3
- data/lib/ctioga2/graphics/types/boundaries.rb +120 -1
- data/lib/ctioga2/graphics/types/dimensions.rb +8 -1
- data/lib/ctioga2/graphics/types/grid.rb +196 -0
- data/lib/ctioga2/graphics/types/location.rb +228 -0
- data/lib/ctioga2/graphics/types/point.rb +2 -2
- data/lib/ctioga2/log.rb +18 -18
- data/lib/ctioga2/metabuilder/type.rb +15 -3
- data/lib/ctioga2/metabuilder/types.rb +2 -2
- data/lib/ctioga2/metabuilder/types/coordinates.rb +13 -1
- data/lib/ctioga2/metabuilder/types/data.rb +50 -0
- data/lib/ctioga2/metabuilder/types/generic.rb +60 -0
- data/lib/ctioga2/metabuilder/types/lists.rb +53 -16
- data/lib/ctioga2/metabuilder/types/styles.rb +26 -45
- data/lib/ctioga2/plotmaker.rb +91 -20
- data/lib/ctioga2/postprocess.rb +8 -8
- data/lib/ctioga2/utils.rb +23 -4
- metadata +107 -75
- data/lib/ctioga2/data/merge.rb +0 -43
@@ -19,7 +19,7 @@ require 'ctioga2/graphics/legends/provider'
|
|
19
19
|
|
20
20
|
module CTioga2
|
21
21
|
|
22
|
-
Version::register_svn_info('$Revision:
|
22
|
+
Version::register_svn_info('$Revision: 244 $', '$Date: 2011-01-23 23:36:02 +0100 (Sun, 23 Jan 2011) $')
|
23
23
|
|
24
24
|
module Graphics
|
25
25
|
|
@@ -37,8 +37,8 @@ EOD
|
|
37
37
|
|
38
38
|
NextLegendCommand.describe("Sets the legend for the next dataset",
|
39
39
|
<<EOH, LegendGroup)
|
40
|
-
Sets the legend for the next dataset. Overridden by the legend
|
41
|
-
to the plot command.
|
40
|
+
Sets the legend for the next dataset. Overridden by the @legend@ option
|
41
|
+
to the {command: plot} command.
|
42
42
|
EOH
|
43
43
|
|
44
44
|
LegendLineCommand =
|
@@ -52,21 +52,6 @@ EOH
|
|
52
52
|
LegendLineCommand.describe("Adds a pure text line to the legend",
|
53
53
|
<<EOH, LegendGroup)
|
54
54
|
Adds a line of text unrelated to any curve to the legend.
|
55
|
-
EOH
|
56
|
-
|
57
|
-
LegendInsideCommand =
|
58
|
-
Cmd.new("legend-inside", nil, "--legend-inside",
|
59
|
-
[ CmdArg.new('aligned-point')]) do |plotmaker, point|
|
60
|
-
l = Legends::LegendArea.new(:inside)
|
61
|
-
l.legend_position = point
|
62
|
-
plotmaker.root_object.current_plot.legend_area = l
|
63
|
-
end
|
64
|
-
|
65
|
-
LegendInsideCommand.describe("Draw legends inside the current plot",
|
66
|
-
<<EOH, LegendGroup)
|
67
|
-
When this option is in effect, all legends for the current plot (and
|
68
|
-
possibly subplots) are drawn inside the current plot, at the specified
|
69
|
-
position.
|
70
55
|
EOH
|
71
56
|
|
72
57
|
AutoLegendCommand =
|
@@ -99,10 +84,30 @@ EOH
|
|
99
84
|
<<EOH, LegendGroup)
|
100
85
|
Sets the various aspects of the style of the legends throught
|
101
86
|
its options:
|
102
|
-
* dy
|
103
|
-
* scale
|
104
|
-
* text_scale
|
87
|
+
* @dy@: the spacing between consecutive lines
|
88
|
+
* @scale@: the overall scale of the legends
|
89
|
+
* @text_scale@: the scale of the text (and the markers) inside the legends
|
90
|
+
EOH
|
91
|
+
|
92
|
+
LegendInsideCommand =
|
93
|
+
Cmd.new("legend-inside", nil, "--legend-inside",
|
94
|
+
[ CmdArg.new('aligned-point')],
|
95
|
+
LegendStyleOptions) do |plotmaker, point, options|
|
96
|
+
l = Legends::LegendArea.new(:inside)
|
97
|
+
l.legend_position = point
|
98
|
+
plotmaker.root_object.current_plot.legend_area = l
|
99
|
+
l.legend_style.set_from_hash(options)
|
100
|
+
end
|
101
|
+
|
102
|
+
LegendInsideCommand.describe("Draw legends inside the current plot",
|
103
|
+
<<EOH, LegendGroup)
|
104
|
+
Using this command sets the position of the legends for the current
|
105
|
+
(sub)plot inside it, at the precise location given.
|
106
|
+
|
107
|
+
As a shortcut, {command: legend-inside} also takes all the options that
|
108
|
+
{command: legend-style} takes, with the same effect.
|
105
109
|
EOH
|
106
110
|
|
111
|
+
|
107
112
|
end
|
108
113
|
end
|
@@ -16,7 +16,7 @@ require 'ctioga2/log'
|
|
16
16
|
|
17
17
|
module CTioga2
|
18
18
|
|
19
|
-
Version::register_svn_info('$Revision:
|
19
|
+
Version::register_svn_info('$Revision: 155 $', '$Date: 2010-06-21 21:41:32 +0200 (Mon, 21 Jun 2010) $')
|
20
20
|
|
21
21
|
module Graphics
|
22
22
|
|
@@ -25,7 +25,7 @@ module CTioga2
|
|
25
25
|
|
26
26
|
# This class holds a series of legends for curves.
|
27
27
|
#
|
28
|
-
#
|
28
|
+
# \todo
|
29
29
|
#
|
30
30
|
# * a legend can be plotted either inside a plot or outside the
|
31
31
|
# root object
|
@@ -44,7 +44,7 @@ module CTioga2
|
|
44
44
|
# @legend_area for the current Elements::Container, with the
|
45
45
|
# given position.
|
46
46
|
#
|
47
|
-
#
|
47
|
+
# \todo make a subclass for a top-level area ????
|
48
48
|
class LegendArea
|
49
49
|
|
50
50
|
# The style of the LegendStorage, a Styles::LegendStorageStyle
|
@@ -70,7 +70,7 @@ module CTioga2
|
|
70
70
|
# subobjects. It assumes that the frames have been set
|
71
71
|
# according to the return value of #partition_frame
|
72
72
|
#
|
73
|
-
#
|
73
|
+
# \todo
|
74
74
|
#
|
75
75
|
# * customization of the x and y of origin (y should match the
|
76
76
|
# top of the corresponding graph, if applicable)
|
@@ -86,10 +86,10 @@ module CTioga2
|
|
86
86
|
|
87
87
|
# We make figure coordinates frame coordinates
|
88
88
|
t.set_bounds([0, 1, 1, 0])
|
89
|
-
#
|
89
|
+
# \todo customize this !
|
90
90
|
x, y = initial_xy(t, container)
|
91
91
|
for item in items
|
92
|
-
#
|
92
|
+
# \todo transform the 0.0 for x into a negative
|
93
93
|
# user-specifiable stuff.
|
94
94
|
item.draw(t, @legend_style, x , y)
|
95
95
|
y -= @legend_style.dy.to_figure(t,:y)
|
@@ -176,12 +176,12 @@ module CTioga2
|
|
176
176
|
def initial_xy(t, container)
|
177
177
|
case @legend_type
|
178
178
|
when :right
|
179
|
-
l,r,t,b = container.
|
179
|
+
l,r,t,b = container.actual_subframe(t).to_frame_margins(t)
|
180
180
|
# Here, we take profit from the fact that frame
|
181
181
|
# coordinates are also figure coordinates within the
|
182
182
|
# legend.
|
183
183
|
|
184
|
-
#
|
184
|
+
# \todo that won't work in the case of labels on the
|
185
185
|
# right-hand-side.
|
186
186
|
return [- l/2, 1.0 - t]
|
187
187
|
when :inside
|
@@ -18,7 +18,7 @@ require 'ctioga2/graphics/styles'
|
|
18
18
|
|
19
19
|
module CTioga2
|
20
20
|
|
21
|
-
Version::register_svn_info('$Revision:
|
21
|
+
Version::register_svn_info('$Revision: 155 $', '$Date: 2010-06-21 21:41:32 +0200 (Mon, 21 Jun 2010) $')
|
22
22
|
|
23
23
|
module Graphics
|
24
24
|
|
@@ -116,7 +116,7 @@ module CTioga2
|
|
116
116
|
# The legend of a curve object, or rather, the legend
|
117
117
|
# corresponding to a given
|
118
118
|
#
|
119
|
-
#
|
119
|
+
# \todo finish to adapt: use FullTextStyle to draw the objects.
|
120
120
|
class CurveLegend < LegendItem
|
121
121
|
|
122
122
|
include CTioga2::Log
|
@@ -130,9 +130,9 @@ module CTioga2
|
|
130
130
|
|
131
131
|
# Draw one single text line
|
132
132
|
#
|
133
|
-
#
|
133
|
+
# \todo adapt here !
|
134
134
|
#
|
135
|
-
#
|
135
|
+
# \todo _x_ and _y_ are not taken into account the way they should be.
|
136
136
|
def draw(t, legend_style, x, y)
|
137
137
|
y = get_baseline_y(t, legend_style, y)
|
138
138
|
t.context do
|
@@ -142,7 +142,7 @@ module CTioga2
|
|
142
142
|
'bottom' => y,
|
143
143
|
'top' => 1 - y - legend_style.picto_height.to_figure(t)
|
144
144
|
}
|
145
|
-
debug "Legend margins for '#{@curve_style.legend}' : #{margin_specs.inspect}"
|
145
|
+
debug { "Legend margins for '#{@curve_style.legend}' : #{margin_specs.inspect}" }
|
146
146
|
t.subfigure(margin_specs) do
|
147
147
|
# We make the markers slightly smaller than the text
|
148
148
|
# around.
|
@@ -16,7 +16,7 @@ require 'ctioga2/log'
|
|
16
16
|
|
17
17
|
module CTioga2
|
18
18
|
|
19
|
-
Version::register_svn_info('$Revision:
|
19
|
+
Version::register_svn_info('$Revision: 139 $', '$Date: 2010-01-22 00:12:17 +0100 (Fri, 22 Jan 2010) $')
|
20
20
|
|
21
21
|
module Graphics
|
22
22
|
|
@@ -50,7 +50,9 @@ module CTioga2
|
|
50
50
|
retval << el
|
51
51
|
elsif el.is_a? Elements::Container and
|
52
52
|
(not el.legend_area)
|
53
|
-
|
53
|
+
if el.legend_storage
|
54
|
+
retval.concat(el.legend_storage.harvest_contents)
|
55
|
+
end
|
54
56
|
end
|
55
57
|
end
|
56
58
|
return retval
|
@@ -21,7 +21,7 @@ require 'ctioga2/graphics/subplot-commands'
|
|
21
21
|
|
22
22
|
module CTioga2
|
23
23
|
|
24
|
-
Version::register_svn_info('$Revision:
|
24
|
+
Version::register_svn_info('$Revision: 155 $', '$Date: 2010-06-21 21:41:32 +0200 (Mon, 21 Jun 2010) $')
|
25
25
|
|
26
26
|
# This module contains all graphical elements of CTioga2
|
27
27
|
module Graphics
|
@@ -127,7 +127,7 @@ module CTioga2
|
|
127
127
|
t.title_scale = 1
|
128
128
|
t.xlabel_scale = 1
|
129
129
|
t.ylabel_scale = 1
|
130
|
-
#
|
130
|
+
# \todo I think this is mostly useless. Check.
|
131
131
|
end
|
132
132
|
|
133
133
|
# Creates a subplot of the current plot. If @current_container
|
@@ -146,6 +146,28 @@ module CTioga2
|
|
146
146
|
return subplot
|
147
147
|
end
|
148
148
|
|
149
|
+
# This function is the companion of #subplot, but for Region
|
150
|
+
# objects. Returns the newly created Region.
|
151
|
+
def enter_region
|
152
|
+
if ! @current_container
|
153
|
+
subplot
|
154
|
+
end
|
155
|
+
region = Elements::Region.new(@current_container, self)
|
156
|
+
enter_subobject(region)
|
157
|
+
return region
|
158
|
+
end
|
159
|
+
|
160
|
+
# This function is the companion of #subplot, but for GradientRegion
|
161
|
+
# objects. Returns the newly created GradientRegion
|
162
|
+
def enter_gradient
|
163
|
+
if ! @current_container
|
164
|
+
subplot
|
165
|
+
end
|
166
|
+
region = Elements::GradientRegion.new(@current_container, self)
|
167
|
+
enter_subobject(region)
|
168
|
+
return region
|
169
|
+
end
|
170
|
+
|
149
171
|
# Returns true if not a single drawable object has been pushed
|
150
172
|
# unto the RootObject yet.
|
151
173
|
def empty?
|
@@ -14,13 +14,21 @@
|
|
14
14
|
require 'ctioga2/graphics/styles/base'
|
15
15
|
|
16
16
|
require 'ctioga2/graphics/styles/drawable'
|
17
|
+
require 'ctioga2/graphics/styles/location'
|
17
18
|
require 'ctioga2/graphics/styles/texts'
|
18
19
|
require 'ctioga2/graphics/styles/carrays'
|
19
20
|
require 'ctioga2/graphics/styles/curve'
|
20
21
|
|
22
|
+
require 'ctioga2/graphics/styles/gradients'
|
23
|
+
require 'ctioga2/graphics/styles/colormap'
|
24
|
+
|
25
|
+
|
26
|
+
require 'ctioga2/graphics/styles/errorbar'
|
27
|
+
|
21
28
|
require 'ctioga2/graphics/styles/sets'
|
22
29
|
|
23
30
|
require 'ctioga2/graphics/styles/axes'
|
31
|
+
require 'ctioga2/graphics/styles/map-axes'
|
24
32
|
require 'ctioga2/graphics/styles/background'
|
25
33
|
require 'ctioga2/graphics/styles/plot'
|
26
34
|
|
@@ -17,7 +17,7 @@ require 'ctioga2/log'
|
|
17
17
|
# This module contains all the classes used by ctioga
|
18
18
|
module CTioga2
|
19
19
|
|
20
|
-
Version::register_svn_info('$Revision:
|
20
|
+
Version::register_svn_info('$Revision: 202 $', '$Date: 2010-11-30 22:21:17 +0100 (Tue, 30 Nov 2010) $')
|
21
21
|
|
22
22
|
module Graphics
|
23
23
|
|
@@ -68,7 +68,7 @@ module CTioga2
|
|
68
68
|
# Creates a new AxisStyle object at the given location with
|
69
69
|
# the given style.
|
70
70
|
def initialize(location = nil, decoration = nil, label = nil)
|
71
|
-
@location = location
|
71
|
+
@location = Types::PlotLocation.new(location)
|
72
72
|
@decoration = decoration
|
73
73
|
|
74
74
|
@tick_label_style = FullTextStyle.new
|
@@ -80,7 +80,7 @@ module CTioga2
|
|
80
80
|
# current plot boundaries. Also draw the #axis_label, if there
|
81
81
|
# is one.
|
82
82
|
#
|
83
|
-
#
|
83
|
+
# \todo
|
84
84
|
# * the offset mechanism, to place the axis away from the place
|
85
85
|
# where it should be...
|
86
86
|
# * non-linear axes (or linear, for that matter, but with
|
@@ -93,11 +93,31 @@ module CTioga2
|
|
93
93
|
spec['stroke_color'] = @stroke_color
|
94
94
|
end
|
95
95
|
t.show_axis(spec)
|
96
|
-
@axis_label.loc =
|
96
|
+
@axis_label.loc = @location
|
97
97
|
default = vertical? ? 'ylabel' : 'xlabel'
|
98
98
|
@axis_label.draw(t, default)
|
99
99
|
end
|
100
100
|
|
101
|
+
# Sets the current boundaries of the _t_ object to the _range_
|
102
|
+
# SimpleRange object for the direction handled by the
|
103
|
+
# AxisStyle, without touching the rest.
|
104
|
+
def set_bounds_for_axis(t, range = nil)
|
105
|
+
if ! range
|
106
|
+
return
|
107
|
+
end
|
108
|
+
l,r,top,b = t.bounds_left, t.bounds_right,
|
109
|
+
t.bounds_top, t.bounds_bottom
|
110
|
+
|
111
|
+
if self.vertical?
|
112
|
+
b = range.first
|
113
|
+
top = range.last
|
114
|
+
else
|
115
|
+
l = range.first
|
116
|
+
r = range.last
|
117
|
+
end
|
118
|
+
t.set_bounds([l,r,top,b])
|
119
|
+
end
|
120
|
+
|
101
121
|
# Draw the axis background lines:
|
102
122
|
def draw_background_lines(t)
|
103
123
|
if @background_lines
|
@@ -132,16 +152,12 @@ module CTioga2
|
|
132
152
|
get_axis_style(spec)
|
133
153
|
end
|
134
154
|
|
135
|
-
# Returns the
|
136
|
-
#
|
137
|
-
# text height (at scale = current text scale when drawing
|
138
|
-
# axes).
|
139
|
-
#
|
140
|
-
# _style_ is a PlotStyle object containing the style
|
141
|
-
# information for the target plot.
|
155
|
+
# Returns the part of the #extension only due to the labels
|
156
|
+
# (ticks and standard label).
|
142
157
|
#
|
143
|
-
#
|
144
|
-
|
158
|
+
# For now, it returns the same value as #extension, but that
|
159
|
+
# might change
|
160
|
+
def labels_only_extension(t, style = nil)
|
145
161
|
ticks_shift, ticks_scale = *get_ticks_parameters(t)
|
146
162
|
default = vertical? ? 'ylabel' : 'xlabel'
|
147
163
|
le = @axis_label.label_extension(t, default, @location)
|
@@ -157,19 +173,31 @@ module CTioga2
|
|
157
173
|
(style ? style.text_scale || 1 : 1)
|
158
174
|
end
|
159
175
|
|
176
|
+
# Returns the extension of the axis (including tick labels and
|
177
|
+
# labels if applicable) perpendicular to itself, in units of
|
178
|
+
# text height (at scale = current text scale when drawing
|
179
|
+
# axes).
|
180
|
+
#
|
181
|
+
# _style_ is a PlotStyle object containing the style
|
182
|
+
# information for the target plot.
|
183
|
+
#
|
184
|
+
# \todo handle offset axes when that is implemented.
|
185
|
+
def extension(t, style = nil)
|
186
|
+
return labels_only_extension(t, style)
|
187
|
+
end
|
188
|
+
|
160
189
|
protected
|
161
190
|
|
162
191
|
# Whether the axis is vertical or not
|
163
192
|
def vertical?
|
164
|
-
return
|
193
|
+
return @location.vertical?
|
165
194
|
end
|
166
195
|
|
167
196
|
# Returns: _ticks_shift_, _ticks_scale_ for the axis.
|
168
197
|
#
|
169
|
-
#
|
198
|
+
# \todo try something clever with the angles ?
|
170
199
|
def get_ticks_parameters(t)
|
171
|
-
i = t.axis_information({'location' =>
|
172
|
-
LocationToTiogaLocation[@location]})
|
200
|
+
i = t.axis_information({'location' => @location.tioga_location})
|
173
201
|
retval = []
|
174
202
|
retval << (@tick_label_style.shift || i['shift'])
|
175
203
|
retval << (@tick_label_style.scale || i['scale'])
|
@@ -193,8 +221,7 @@ module CTioga2
|
|
193
221
|
raise YetUnimplemented, "This has not been implemented yet"
|
194
222
|
else
|
195
223
|
retval.
|
196
|
-
update({'location' =>
|
197
|
-
LocationToTiogaLocation[@location],
|
224
|
+
update({'location' => @location.tioga_location,
|
198
225
|
'type' => @decoration, 'log' => @log})
|
199
226
|
return retval
|
200
227
|
end
|
@@ -204,8 +231,7 @@ module CTioga2
|
|
204
231
|
def compute_coordinate_transforms(t)
|
205
232
|
return unless @transform
|
206
233
|
# We'll proceed by steps...
|
207
|
-
i = t.axis_information({'location' =>
|
208
|
-
LocationToTiogaLocation[@location]})
|
234
|
+
i = t.axis_information({'location' => @location.tioga_location})
|
209
235
|
t.context do
|
210
236
|
if i['vertical']
|
211
237
|
top,b = @transform.convert_to([t.bounds_top, t.bounds_bottom])
|
@@ -215,8 +241,7 @@ module CTioga2
|
|
215
241
|
l,r = @transform.convert_to([t.bounds_left, t.bounds_right])
|
216
242
|
end
|
217
243
|
t.set_bounds([l,r,top,b])
|
218
|
-
i = t.axis_information({'location' =>
|
219
|
-
LocationToTiogaLocation[@location]})
|
244
|
+
i = t.axis_information({'location' => @location.tioga_location})
|
220
245
|
# Now, we have the location of everything we need.
|
221
246
|
end
|
222
247
|
# In the following, the || are because of a fix in Tioga
|
@@ -235,6 +260,7 @@ module CTioga2
|
|
235
260
|
|
236
261
|
PartialAxisStyle = {
|
237
262
|
'transform' => CmdArg.new('bijection'),
|
263
|
+
'location' => CmdArg.new('location'),
|
238
264
|
'stroke_color' => CmdArg.new('color')
|
239
265
|
}
|
240
266
|
|
@@ -16,7 +16,7 @@ require 'ctioga2/log'
|
|
16
16
|
# This module contains all the classes used by ctioga
|
17
17
|
module CTioga2
|
18
18
|
|
19
|
-
Version::register_svn_info('$Revision:
|
19
|
+
Version::register_svn_info('$Revision: 155 $', '$Date: 2010-06-21 21:41:32 +0200 (Mon, 21 Jun 2010) $')
|
20
20
|
|
21
21
|
module Graphics
|
22
22
|
|
@@ -27,7 +27,7 @@ module CTioga2
|
|
27
27
|
# share one common feature: all their attributes can be set
|
28
28
|
# using the set_from_hash function.
|
29
29
|
#
|
30
|
-
#
|
30
|
+
# \todo maybe a basic MetaBuilder::Type should be associated to
|
31
31
|
# each attribute ???
|
32
32
|
class BasicStyle
|
33
33
|
|
@@ -17,7 +17,7 @@ require 'ctioga2/log'
|
|
17
17
|
# This module contains all the classes used by ctioga
|
18
18
|
module CTioga2
|
19
19
|
|
20
|
-
Version::register_svn_info('$Revision:
|
20
|
+
Version::register_svn_info('$Revision: 105 $', '$Date: 2009-09-17 22:17:16 +0200 (Thu, 17 Sep 2009) $')
|
21
21
|
|
22
22
|
module Graphics
|
23
23
|
|
@@ -29,7 +29,14 @@ module CTioga2
|
|
29
29
|
class CircularArray
|
30
30
|
|
31
31
|
# The set through which we go
|
32
|
-
|
32
|
+
attr_reader :set
|
33
|
+
|
34
|
+
# Defines the set of elements we'll be circling through and
|
35
|
+
# resets the index.
|
36
|
+
def set=(s)
|
37
|
+
@set = s
|
38
|
+
@value = 0
|
39
|
+
end
|
33
40
|
|
34
41
|
def initialize(set)
|
35
42
|
@set = set
|