ctioga2 0.7 → 0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. data/Changelog +8 -0
  2. data/lib/ctioga2/commands/arguments.rb +0 -2
  3. data/lib/ctioga2/commands/commands.rb +0 -2
  4. data/lib/ctioga2/commands/context.rb +0 -2
  5. data/lib/ctioga2/commands/doc/doc.rb +0 -2
  6. data/lib/ctioga2/commands/doc/documentation-commands.rb +0 -2
  7. data/lib/ctioga2/commands/doc/help.rb +0 -2
  8. data/lib/ctioga2/commands/doc/html.rb +0 -2
  9. data/lib/ctioga2/commands/doc/introspection.rb +0 -2
  10. data/lib/ctioga2/commands/doc/man.rb +0 -2
  11. data/lib/ctioga2/commands/doc/markup.rb +0 -2
  12. data/lib/ctioga2/commands/doc/wordwrap.rb +0 -2
  13. data/lib/ctioga2/commands/general-commands.rb +0 -2
  14. data/lib/ctioga2/commands/general-types.rb +0 -2
  15. data/lib/ctioga2/commands/groups.rb +0 -2
  16. data/lib/ctioga2/commands/interpreter.rb +0 -2
  17. data/lib/ctioga2/commands/parsers/command-line.rb +0 -2
  18. data/lib/ctioga2/commands/parsers/file.rb +0 -2
  19. data/lib/ctioga2/commands/parsers/old-file.rb +0 -2
  20. data/lib/ctioga2/commands/strings.rb +0 -2
  21. data/lib/ctioga2/commands/type.rb +0 -2
  22. data/lib/ctioga2/commands/variables.rb +0 -2
  23. data/lib/ctioga2/data/backends/backend.rb +0 -3
  24. data/lib/ctioga2/data/backends/backends/direct.rb +0 -3
  25. data/lib/ctioga2/data/backends/backends/gnuplot.rb +0 -3
  26. data/lib/ctioga2/data/backends/backends/math.rb +0 -2
  27. data/lib/ctioga2/data/backends/backends/text.rb +0 -3
  28. data/lib/ctioga2/data/backends/description.rb +0 -3
  29. data/lib/ctioga2/data/backends/factory.rb +18 -2
  30. data/lib/ctioga2/data/backends/parameter.rb +0 -2
  31. data/lib/ctioga2/data/datacolumn.rb +0 -2
  32. data/lib/ctioga2/data/dataset.rb +5 -3
  33. data/lib/ctioga2/data/filters.rb +0 -3
  34. data/lib/ctioga2/data/indexed-dtable.rb +0 -3
  35. data/lib/ctioga2/data/point.rb +0 -3
  36. data/lib/ctioga2/data/stack.rb +2 -4
  37. data/lib/ctioga2/graphics/coordinates.rb +0 -2
  38. data/lib/ctioga2/graphics/elements.rb +1 -2
  39. data/lib/ctioga2/graphics/elements/containers.rb +32 -2
  40. data/lib/ctioga2/graphics/elements/contour.rb +0 -2
  41. data/lib/ctioga2/graphics/elements/curve2d.rb +0 -2
  42. data/lib/ctioga2/graphics/elements/element.rb +4 -2
  43. data/lib/ctioga2/graphics/elements/gradient-region.rb +0 -2
  44. data/lib/ctioga2/graphics/elements/histogram.rb +298 -0
  45. data/lib/ctioga2/graphics/elements/parametric2d.rb +7 -3
  46. data/lib/ctioga2/graphics/elements/primitive.rb +0 -2
  47. data/lib/ctioga2/graphics/elements/redirecting-container.rb +21 -2
  48. data/lib/ctioga2/graphics/elements/region.rb +0 -2
  49. data/lib/ctioga2/graphics/elements/subplot.rb +0 -2
  50. data/lib/ctioga2/graphics/elements/tangent.rb +0 -2
  51. data/lib/ctioga2/graphics/elements/xyz-contour.rb +0 -2
  52. data/lib/ctioga2/graphics/elements/xyz-map.rb +0 -2
  53. data/lib/ctioga2/graphics/generator.rb +47 -42
  54. data/lib/ctioga2/graphics/legends.rb +0 -2
  55. data/lib/ctioga2/graphics/legends/area.rb +0 -2
  56. data/lib/ctioga2/graphics/legends/items.rb +0 -2
  57. data/lib/ctioga2/graphics/legends/multicols.rb +0 -2
  58. data/lib/ctioga2/graphics/legends/provider.rb +0 -2
  59. data/lib/ctioga2/graphics/legends/storage.rb +0 -2
  60. data/lib/ctioga2/graphics/root.rb +0 -2
  61. data/lib/ctioga2/graphics/styles/arrows.rb +0 -2
  62. data/lib/ctioga2/graphics/styles/axes.rb +0 -2
  63. data/lib/ctioga2/graphics/styles/background.rb +0 -2
  64. data/lib/ctioga2/graphics/styles/base.rb +4 -2
  65. data/lib/ctioga2/graphics/styles/box.rb +0 -2
  66. data/lib/ctioga2/graphics/styles/carrays.rb +0 -2
  67. data/lib/ctioga2/graphics/styles/colormap.rb +0 -2
  68. data/lib/ctioga2/graphics/styles/contour.rb +0 -2
  69. data/lib/ctioga2/graphics/styles/curve.rb +0 -2
  70. data/lib/ctioga2/graphics/styles/drawable.rb +0 -2
  71. data/lib/ctioga2/graphics/styles/errorbar.rb +0 -2
  72. data/lib/ctioga2/graphics/styles/factory.rb +0 -2
  73. data/lib/ctioga2/graphics/styles/gradients.rb +0 -2
  74. data/lib/ctioga2/graphics/styles/legend.rb +0 -2
  75. data/lib/ctioga2/graphics/styles/location.rb +0 -2
  76. data/lib/ctioga2/graphics/styles/map-axes.rb +0 -2
  77. data/lib/ctioga2/graphics/styles/plot-types.rb +51 -3
  78. data/lib/ctioga2/graphics/styles/plot.rb +0 -2
  79. data/lib/ctioga2/graphics/styles/sets.rb +0 -2
  80. data/lib/ctioga2/graphics/styles/sheet.rb +0 -2
  81. data/lib/ctioga2/graphics/styles/texts.rb +0 -2
  82. data/lib/ctioga2/graphics/styles/ticks.rb +0 -2
  83. data/lib/ctioga2/graphics/subplot-commands.rb +0 -2
  84. data/lib/ctioga2/graphics/types.rb +11 -4
  85. data/lib/ctioga2/graphics/types/bijection.rb +0 -2
  86. data/lib/ctioga2/graphics/types/boundaries.rb +0 -2
  87. data/lib/ctioga2/graphics/types/boxes.rb +0 -2
  88. data/lib/ctioga2/graphics/types/dimensions.rb +0 -2
  89. data/lib/ctioga2/graphics/types/fill.rb +27 -15
  90. data/lib/ctioga2/graphics/types/grid.rb +0 -2
  91. data/lib/ctioga2/graphics/types/location.rb +0 -2
  92. data/lib/ctioga2/graphics/types/point.rb +0 -2
  93. data/lib/ctioga2/log.rb +0 -2
  94. data/lib/ctioga2/metabuilder/type.rb +0 -2
  95. data/lib/ctioga2/metabuilder/types/coordinates.rb +0 -2
  96. data/lib/ctioga2/metabuilder/types/data.rb +0 -2
  97. data/lib/ctioga2/metabuilder/types/dates.rb +0 -1
  98. data/lib/ctioga2/metabuilder/types/generic.rb +0 -3
  99. data/lib/ctioga2/metabuilder/types/lists.rb +25 -3
  100. data/lib/ctioga2/metabuilder/types/numbers.rb +0 -2
  101. data/lib/ctioga2/metabuilder/types/strings.rb +0 -3
  102. data/lib/ctioga2/metabuilder/types/styles.rb +0 -2
  103. data/lib/ctioga2/plotmaker.rb +2 -4
  104. data/lib/ctioga2/postprocess.rb +0 -2
  105. data/lib/ctioga2/utils.rb +6 -64
  106. data/lib/ctioga2/version.rb +8 -0
  107. metadata +6 -4
@@ -22,8 +22,6 @@ require 'shellwords'
22
22
  # This module contains all the classes used by ctioga
23
23
  module CTioga2
24
24
 
25
- Version::register_svn_info('$Revision: 531 $', '$Date: 2013-09-29 00:07:44 +0200 (Sun, 29 Sep 2013) $')
26
-
27
25
  module Graphics
28
26
 
29
27
  module Elements
@@ -17,8 +17,6 @@ require 'ctioga2/log'
17
17
 
18
18
  module CTioga2
19
19
 
20
- Version::register_svn_info('$Revision$', '$Date$')
21
-
22
20
  module Graphics
23
21
 
24
22
  module Elements
@@ -46,6 +44,27 @@ module CTioga2
46
44
  return parent.legend_area = l
47
45
  end
48
46
 
47
+ undef :gp_cache, :gp_cache=
48
+
49
+ def gp_cache
50
+ return parent.gp_cache
51
+ end
52
+
53
+ def gp_cache=(c)
54
+ return parent.gp_cache = c
55
+ end
56
+
57
+ def each_item(leaf_only = true, recursive = false, tl = true, &blk)
58
+ if tl
59
+ parent.each_item(leaf_only, recursive, tl, &blk)
60
+ else
61
+ if @elements
62
+ super(leaf_only, recursive, true, &blk)
63
+ end
64
+ end
65
+ end
66
+
67
+
49
68
  end
50
69
  end
51
70
  end
@@ -17,8 +17,6 @@ require 'ctioga2/log'
17
17
 
18
18
  module CTioga2
19
19
 
20
- Version::register_svn_info('$Revision: 474 $', '$Date: 2013-08-31 15:05:39 +0200 (Sat, 31 Aug 2013) $')
21
-
22
20
  module Graphics
23
21
 
24
22
  module Elements
@@ -16,8 +16,6 @@ require 'ctioga2/log'
16
16
 
17
17
  module CTioga2
18
18
 
19
- Version::register_svn_info('$Revision: 540 $', '$Date: 2013-10-04 00:05:23 +0200 (Fri, 04 Oct 2013) $')
20
-
21
19
  module Graphics
22
20
 
23
21
  module Elements
@@ -17,8 +17,6 @@ require 'ctioga2/graphics/elements/primitive'
17
17
  # This module contains all the classes used by ctioga
18
18
  module CTioga2
19
19
 
20
- Version::register_svn_info('$Revision: 171 $', '$Date: 2010-10-22 17:07:52 +0200 (Fri, 22 Oct 2010) $')
21
-
22
20
  module Graphics
23
21
 
24
22
  module Elements
@@ -19,8 +19,6 @@ require 'Dobjects/Function'
19
19
 
20
20
  module CTioga2
21
21
 
22
- Version::register_svn_info('$Revision$', '$Date$')
23
-
24
22
  module Graphics
25
23
 
26
24
  module Elements
@@ -19,8 +19,6 @@ require 'Dobjects/Function'
19
19
 
20
20
  module CTioga2
21
21
 
22
- Version::register_svn_info('$Revision: 535 $', '$Date: 2013-10-02 20:31:21 +0200 (Wed, 02 Oct 2013) $')
23
-
24
22
  module Graphics
25
23
 
26
24
  module Elements
@@ -21,8 +21,6 @@ require 'ctioga2/graphics/styles/plot-types'
21
21
 
22
22
  module CTioga2
23
23
 
24
- Version::register_svn_info('$Revision: 513 $', '$Date: 2013-09-19 00:43:28 +0200 (Thu, 19 Sep 2013) $')
25
-
26
24
  module Graphics
27
25
 
28
26
 
@@ -53,6 +51,11 @@ module CTioga2
53
51
  # parametric plots.
54
52
  attr_accessor :xy_parametric_parameters
55
53
 
54
+
55
+ # Style of histograms
56
+ attr_accessor :histogram_parameters
57
+
58
+
56
59
  # Creates a CurveGenerator object.
57
60
  def initialize
58
61
  @legend_provider = Legends::LegendProvider.new
@@ -60,6 +63,7 @@ module CTioga2
60
63
  @current_curves = :xy_plot
61
64
 
62
65
  @xy_parametric_parameters = Styles::ParametricPlotStyle.new
66
+ @histogram_parameters = Styles::HistogramStyle.new
63
67
  end
64
68
 
65
69
  PlotOptions = {
@@ -87,8 +91,16 @@ module CTioga2
87
91
  CurveStyleFactory::PlotCommandOptions.key?(k)
88
92
  }
89
93
 
90
- curve = send(@current_curves, plot, dataset, options)
91
- curve.curve_style.target = curve
94
+ begin
95
+ legend = @legend_provider.dataset_legend(dataset)
96
+ style = @style_factory.next(options)
97
+ style.legend ||= legend # The legend specified as option to
98
+ # the --plot command has precedence
99
+ # over the one specified by
100
+ # --legend.
101
+ curve = send(@current_curves, dataset, style)
102
+ curve.curve_style.target = curve
103
+ end
92
104
  return curve
93
105
  end
94
106
 
@@ -96,56 +108,36 @@ module CTioga2
96
108
 
97
109
  ## \name Available kinds of curves
98
110
  ##
99
- ## @todo All these are completely identical, there probably
100
- ## isn't need for separate code ?
101
- #
102
- # @{
103
- #
111
+ ## @{
112
+
113
+
104
114
  # The "classical" 2D plots.
105
- def xy_plot(plot, dataset, options = {})
106
- legend = @legend_provider.dataset_legend(dataset)
107
- style = @style_factory.next(options)
108
- style.legend ||= legend # The legend specified as option to
109
- # the --plot command has precedence
110
- # over the one specified by --legend.
111
- curve = Graphics::Elements::Curve2D.new(dataset, style)
112
- return curve
115
+ def xy_plot(dataset, style)
116
+ return Graphics::Elements::Curve2D.new(dataset, style)
117
+ end
118
+
119
+ # The "classical" 2D plots.
120
+ def histogram(dataset, style)
121
+ return Graphics::Elements::Histogram.new(dataset, style,
122
+ @histogram_parameters.dup)
113
123
  end
114
124
 
115
125
  # XYZ plots formerly known as "parametric plots"
116
- def xy_parametric(plot, dataset, options = {})
117
- legend = @legend_provider.dataset_legend(dataset)
118
- style = @style_factory.next(options)
119
- style.legend ||= legend # The legend specified as option to
120
- # the --plot command has precedence
121
- # over the one specified by --legend.
122
- curve = Graphics::Elements::Parametric2D.
126
+ def xy_parametric(dataset, style)
127
+ return Graphics::Elements::Parametric2D.
123
128
  new(dataset, style, @xy_parametric_parameters.dup)
124
- return curve
125
129
  end
126
130
 
127
131
  # XYZ maps
128
- def xyz_map(plot, dataset, options = {})
129
- legend = @legend_provider.dataset_legend(dataset)
130
- style = @style_factory.next(options)
131
- style.legend ||= legend # The legend specified as option to
132
- # the --plot command has precedence
133
- # over the one specified by --legend.
132
+ def xyz_map(dataset, style)
134
133
  style.legend = false # No legend for XYZ maps
135
- curve = Graphics::Elements::XYZMap.new(dataset, style)
136
- return curve
134
+ return Graphics::Elements::XYZMap.new(dataset, style)
137
135
  end
138
136
 
139
137
  # XYZ maps
140
- def xyz_contour(plot, dataset, options = {})
141
- legend = @legend_provider.dataset_legend(dataset)
142
- style = @style_factory.next(options)
143
- style.legend ||= legend # The legend specified as option to
144
- # the --plot command has precedence
145
- # over the one specified by --legend.
146
- style.legend = false # No legend for XYZ maps
147
- curve = Graphics::Elements::XYZContour.new(dataset, style)
148
- return curve
138
+ def xyz_contour(dataset, style)
139
+ style.legend = false # No legend for XYZ contours
140
+ return Graphics::Elements::XYZContour.new(dataset, style)
149
141
  end
150
142
 
151
143
 
@@ -174,6 +166,19 @@ module CTioga2
174
166
  Switch to XY parametric plots, that is standard XY plots whose appearance
175
167
  (such as color, marker color, and, potentially, marker kinds and more)
176
168
  are governed by one (or more ?) Z values.
169
+ EOH
170
+
171
+ HistogramPlotCommand =
172
+ Cmd.new("histogram",nil,"--histogram",
173
+ [], Styles::HistogramStyle.options_hash) do |plotmaker, opts|
174
+ plotmaker.curve_generator.current_curves = :histogram
175
+ plotmaker.curve_generator.
176
+ histogram_parameters.set_from_hash(opts)
177
+ end
178
+
179
+ HistogramPlotCommand.describe('select histogram plots',
180
+ <<EOH, PlotTypesGroup)
181
+ Switch to drawing histograms.
177
182
  EOH
178
183
 
179
184
  ContourPlotCommand =
@@ -20,8 +20,6 @@ require 'ctioga2/graphics/legends/multicols'
20
20
 
21
21
  module CTioga2
22
22
 
23
- Version::register_svn_info('$Revision: 432 $', '$Date: 2013-08-23 19:06:36 +0200 (Fri, 23 Aug 2013) $')
24
-
25
23
  module Graphics
26
24
 
27
25
  # Now, various commands pertaining to legends
@@ -16,8 +16,6 @@ require 'ctioga2/log'
16
16
 
17
17
  module CTioga2
18
18
 
19
- Version::register_svn_info('$Revision: 386 $', '$Date: 2013-03-11 22:57:16 +0100 (Mon, 11 Mar 2013) $')
20
-
21
19
  module Graphics
22
20
 
23
21
  # This module holds all the classes dealing with legends
@@ -18,8 +18,6 @@ require 'ctioga2/graphics/styles'
18
18
 
19
19
  module CTioga2
20
20
 
21
- Version::register_svn_info('$Revision: 386 $', '$Date: 2013-03-11 22:57:16 +0100 (Mon, 11 Mar 2013) $')
22
-
23
21
  module Graphics
24
22
 
25
23
  module Legends
@@ -18,8 +18,6 @@ require 'ctioga2/graphics/styles'
18
18
 
19
19
  module CTioga2
20
20
 
21
- Version::register_svn_info('$Revision$', '$Date$')
22
-
23
21
  module Graphics
24
22
 
25
23
  module Legends
@@ -16,8 +16,6 @@ require 'ctioga2/log'
16
16
 
17
17
  module CTioga2
18
18
 
19
- Version::register_svn_info('$Revision: 471 $', '$Date: 2013-08-31 14:11:01 +0200 (Sat, 31 Aug 2013) $')
20
-
21
19
  module Graphics
22
20
 
23
21
  module Legends
@@ -16,8 +16,6 @@ require 'ctioga2/log'
16
16
 
17
17
  module CTioga2
18
18
 
19
- Version::register_svn_info('$Revision: 139 $', '$Date: 2010-01-22 00:12:17 +0100 (Fri, 22 Jan 2010) $')
20
-
21
19
  module Graphics
22
20
 
23
21
  # This module holds all the classes dealing with legends
@@ -21,8 +21,6 @@ require 'ctioga2/graphics/subplot-commands'
21
21
 
22
22
  module CTioga2
23
23
 
24
- Version::register_svn_info('$Revision: 155 $', '$Date: 2010-06-21 21:41:32 +0200 (Mon, 21 Jun 2010) $')
25
-
26
24
  # This module contains all graphical elements of CTioga2
27
25
  module Graphics
28
26
 
@@ -17,8 +17,6 @@ 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$', '$Date$')
21
-
22
20
  module Graphics
23
21
 
24
22
  # All the styles
@@ -17,8 +17,6 @@ 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: 483 $', '$Date: 2013-09-02 22:10:14 +0200 (Mon, 02 Sep 2013) $')
21
-
22
20
  module Graphics
23
21
 
24
22
  module Styles
@@ -16,8 +16,6 @@ require 'ctioga2/log'
16
16
 
17
17
  module CTioga2
18
18
 
19
- Version::register_svn_info('$Revision: 342 $', '$Date: 2012-12-23 21:34:48 +0100 (Sun, 23 Dec 2012) $')
20
-
21
19
  module Graphics
22
20
 
23
21
  module Styles
@@ -16,8 +16,6 @@ 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: 433 $', '$Date: 2013-08-26 22:03:14 +0200 (Mon, 26 Aug 2013) $')
20
-
21
19
  module Graphics
22
20
 
23
21
  # All the styles
@@ -40,6 +38,10 @@ module CTioga2
40
38
  # names of the attributes, while still showing them up
41
39
  # properly documented in rdoc.
42
40
  def self.attr_accessor(symbol)
41
+ cal = caller
42
+ # if ! (caller[0] =~ /typed_attribute/)
43
+ # puts "Deprecated use at #{caller[0]}"
44
+ # end
43
45
  @attributes ||= []
44
46
  @attributes << symbol
45
47
  OldAttrAccessor.call(symbol)
@@ -17,8 +17,6 @@ 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$', '$Date$')
21
-
22
20
  module Graphics
23
21
 
24
22
  # All the styles
@@ -17,8 +17,6 @@ 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: 105 $', '$Date: 2009-09-17 22:17:16 +0200 (Thu, 17 Sep 2009) $')
21
-
22
20
  module Graphics
23
21
 
24
22
  module Styles
@@ -17,8 +17,6 @@ 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: 540 $', '$Date: 2013-10-04 00:05:23 +0200 (Fri, 04 Oct 2013) $')
21
-
22
20
  module Graphics
23
21
 
24
22
  module Styles
@@ -18,8 +18,6 @@ require 'ctioga2/log'
18
18
  # This module contains all the classes used by ctioga
19
19
  module CTioga2
20
20
 
21
- Version::register_svn_info('$Revision$', '$Date$')
22
-
23
21
  module Graphics
24
22
 
25
23
  module Styles
@@ -17,8 +17,6 @@ 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: 531 $', '$Date: 2013-09-29 00:07:44 +0200 (Sun, 29 Sep 2013) $')
21
-
22
20
  module Graphics
23
21
 
24
22
  module Styles
@@ -17,8 +17,6 @@ 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: 466 $', '$Date: 2013-08-31 13:10:38 +0200 (Sat, 31 Aug 2013) $')
21
-
22
20
  module Graphics
23
21
 
24
22
  # All the styles
@@ -18,8 +18,6 @@ require 'ctioga2/log'
18
18
  # This module contains all the classes used by ctioga
19
19
  module CTioga2
20
20
 
21
- Version::register_svn_info('$Revision: 123 $', '$Date: 2010-01-10 02:45:47 +0100 (Sun, 10 Jan 2010) $')
22
-
23
21
  module Graphics
24
22
 
25
23
  # All the styles
@@ -17,8 +17,6 @@ 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: 531 $', '$Date: 2013-09-29 00:07:44 +0200 (Sun, 29 Sep 2013) $')
21
-
22
20
  module Graphics
23
21
 
24
22
  module Styles
@@ -19,8 +19,6 @@ require 'ctioga2/graphics/coordinates'
19
19
  # This module contains all the classes used by ctioga
20
20
  module CTioga2
21
21
 
22
- Version::register_svn_info('$Revision: 335 $', '$Date: 2012-12-23 00:29:44 +0100 (Sun, 23 Dec 2012) $')
23
-
24
22
  module Graphics
25
23
 
26
24
  module Styles