ctioga2 0.4 → 0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog +16 -0
- data/lib/ctioga2/commands/arguments.rb +5 -2
- data/lib/ctioga2/commands/commands.rb +45 -13
- data/lib/ctioga2/commands/context.rb +9 -1
- data/lib/ctioga2/commands/doc/help.rb +2 -2
- data/lib/ctioga2/commands/doc/html.rb +8 -8
- data/lib/ctioga2/commands/doc/introspection.rb +7 -5
- data/lib/ctioga2/commands/parsers/file.rb +123 -120
- data/lib/ctioga2/commands/parsers/old-file.rb +191 -0
- data/lib/ctioga2/commands/strings.rb +2 -2
- data/lib/ctioga2/data/datacolumn.rb +5 -2
- data/lib/ctioga2/data/dataset.rb +3 -13
- data/lib/ctioga2/data/indexed-dtable.rb +43 -11
- data/lib/ctioga2/data/stack.rb +65 -8
- data/lib/ctioga2/graphics/elements.rb +2 -1
- data/lib/ctioga2/graphics/elements/containers.rb +22 -3
- data/lib/ctioga2/graphics/elements/primitive.rb +5 -5
- data/lib/ctioga2/graphics/elements/xyz-contour.rb +123 -0
- data/lib/ctioga2/graphics/generator.rb +31 -5
- data/lib/ctioga2/graphics/legends.rb +44 -3
- data/lib/ctioga2/graphics/legends/area.rb +28 -9
- data/lib/ctioga2/graphics/legends/items.rb +34 -23
- data/lib/ctioga2/graphics/legends/multicols.rb +132 -0
- data/lib/ctioga2/graphics/styles.rb +3 -1
- data/lib/ctioga2/graphics/styles/axes.rb +10 -4
- data/lib/ctioga2/graphics/styles/base.rb +65 -11
- data/lib/ctioga2/graphics/styles/colormap.rb +2 -1
- data/lib/ctioga2/graphics/styles/contour.rb +141 -0
- data/lib/ctioga2/graphics/styles/curve.rb +49 -67
- data/lib/ctioga2/graphics/styles/drawable.rb +17 -8
- data/lib/ctioga2/graphics/styles/factory.rb +79 -38
- data/lib/ctioga2/graphics/styles/legend.rb +49 -6
- data/lib/ctioga2/graphics/styles/plot.rb +10 -9
- data/lib/ctioga2/graphics/styles/sheet.rb +11 -11
- data/lib/ctioga2/graphics/styles/texts.rb +38 -9
- data/lib/ctioga2/graphics/types.rb +20 -1
- data/lib/ctioga2/graphics/types/dimensions.rb +7 -1
- data/lib/ctioga2/metabuilder/types/lists.rb +4 -4
- data/lib/ctioga2/metabuilder/types/numbers.rb +3 -3
- data/lib/ctioga2/metabuilder/types/styles.rb +2 -2
- data/lib/ctioga2/plotmaker.rb +12 -1
- data/lib/ctioga2/utils.rb +27 -3
- metadata +8 -4
data/lib/ctioga2/utils.rb
CHANGED
@@ -34,7 +34,7 @@ module CTioga2
|
|
34
34
|
# arguments and have the Date and Revision svn:keyword:. Use this
|
35
35
|
# way:
|
36
36
|
#
|
37
|
-
# Version::register_svn_info('$Revision:
|
37
|
+
# Version::register_svn_info('$Revision: 424 $', '$Date: 2013-08-23 10:16:34 +0200 (Fri, 23 Aug 2013) $')
|
38
38
|
#
|
39
39
|
# To set the correct properties, the following command-line can be
|
40
40
|
# used:
|
@@ -74,7 +74,7 @@ module CTioga2
|
|
74
74
|
}
|
75
75
|
|
76
76
|
# The position of the URL, used for getting the version
|
77
|
-
SVN_URL = '$HeadURL: svn+ssh://rubyforge.org/var/svn/ctioga2/releases/ctioga2-0.
|
77
|
+
SVN_URL = '$HeadURL: svn+ssh://rubyforge.org/var/svn/ctioga2/releases/ctioga2-0.5/lib/ctioga2/utils.rb $'
|
78
78
|
|
79
79
|
# The version of ctioga2
|
80
80
|
CTIOGA_VERSION = if SVN_URL =~ /releases\/ctioga2-([^\/]+)/
|
@@ -83,7 +83,7 @@ module CTioga2
|
|
83
83
|
"SVN version"
|
84
84
|
end
|
85
85
|
|
86
|
-
register_svn_info('$Revision:
|
86
|
+
register_svn_info('$Revision: 424 $', '$Date: 2013-08-23 10:16:34 +0200 (Fri, 23 Aug 2013) $')
|
87
87
|
|
88
88
|
end
|
89
89
|
|
@@ -161,6 +161,30 @@ module CTioga2
|
|
161
161
|
end
|
162
162
|
return formula
|
163
163
|
end
|
164
|
+
|
165
|
+
NaturalSubdivisions = [1.0, 2.0, 5.0, 10.0]
|
166
|
+
|
167
|
+
# Returns the closest element of the correct power of ten of
|
168
|
+
# NaturalSubdivisions above or below the given number
|
169
|
+
def self.closest_subdivision(x, below = true)
|
170
|
+
fact = 10**(Math.log10(x).floor)
|
171
|
+
|
172
|
+
normed_x = x/fact
|
173
|
+
(NaturalSubdivisions.size()-1).times do |i|
|
174
|
+
if normed_x == NaturalSubdivisions[i]
|
175
|
+
return x
|
176
|
+
end
|
177
|
+
if (normed_x > NaturalSubdivisions[i]) &&
|
178
|
+
(normed_x < NaturalSubdivisions[i+1])
|
179
|
+
if below
|
180
|
+
return NaturalSubdivisions[i]*fact
|
181
|
+
else
|
182
|
+
return NaturalSubdivisions[i+1]*fact
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
186
|
+
raise "Should not reach this !"
|
187
|
+
end
|
164
188
|
|
165
189
|
|
166
190
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ctioga2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.5'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-08-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: tioga
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '1.
|
21
|
+
version: '1.16'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '1.
|
29
|
+
version: '1.16'
|
30
30
|
description: ! 'ctioga2 is a command-driven plotting program that produces
|
31
31
|
|
32
32
|
high quality PDF files. It can be used both from the command-line
|
@@ -75,6 +75,7 @@ files:
|
|
75
75
|
- lib/ctioga2/commands/variables.rb
|
76
76
|
- lib/ctioga2/commands/parsers/file.rb
|
77
77
|
- lib/ctioga2/commands/parsers/command-line.rb
|
78
|
+
- lib/ctioga2/commands/parsers/old-file.rb
|
78
79
|
- lib/ctioga2/commands/context.rb
|
79
80
|
- lib/ctioga2/commands/groups.rb
|
80
81
|
- lib/ctioga2/commands/interpreter.rb
|
@@ -96,6 +97,7 @@ files:
|
|
96
97
|
- lib/ctioga2/graphics/styles/base.rb
|
97
98
|
- lib/ctioga2/graphics/styles/sets.rb
|
98
99
|
- lib/ctioga2/graphics/styles/plot.rb
|
100
|
+
- lib/ctioga2/graphics/styles/contour.rb
|
99
101
|
- lib/ctioga2/graphics/styles/colormap.rb
|
100
102
|
- lib/ctioga2/graphics/styles/texts.rb
|
101
103
|
- lib/ctioga2/graphics/styles/legend.rb
|
@@ -105,6 +107,7 @@ files:
|
|
105
107
|
- lib/ctioga2/graphics/legends/area.rb
|
106
108
|
- lib/ctioga2/graphics/legends/items.rb
|
107
109
|
- lib/ctioga2/graphics/legends/storage.rb
|
110
|
+
- lib/ctioga2/graphics/legends/multicols.rb
|
108
111
|
- lib/ctioga2/graphics/legends/provider.rb
|
109
112
|
- lib/ctioga2/graphics/types.rb
|
110
113
|
- lib/ctioga2/graphics/elements/subplot.rb
|
@@ -115,6 +118,7 @@ files:
|
|
115
118
|
- lib/ctioga2/graphics/elements/curve2d.rb
|
116
119
|
- lib/ctioga2/graphics/elements/containers.rb
|
117
120
|
- lib/ctioga2/graphics/elements/tangent.rb
|
121
|
+
- lib/ctioga2/graphics/elements/xyz-contour.rb
|
118
122
|
- lib/ctioga2/graphics/elements/xyz-map.rb
|
119
123
|
- lib/ctioga2/graphics/elements/contour.rb
|
120
124
|
- lib/ctioga2/graphics/elements/gradient-region.rb
|