From 4d16bfc43780e5d3f7368625700b583e3e98217a Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Sun, 27 Nov 2011 18:11:42 +0900 Subject: adding in row_style and col_style methods to worksheet and active record 'acts_as_axlsx' to provide to_xlsx. --- doc/Axlsx/Drawing.html | 304 ++++++++++++++++++++++++++++--------------------- 1 file changed, 176 insertions(+), 128 deletions(-) (limited to 'doc/Axlsx/Drawing.html') diff --git a/doc/Axlsx/Drawing.html b/doc/Axlsx/Drawing.html index 80d5ca01..48fc3412 100644 --- a/doc/Axlsx/Drawing.html +++ b/doc/Axlsx/Drawing.html @@ -97,17 +97,19 @@
Note: -
-

The recommended way to manage drawings is to use the Worksheet.add_chart -method.

+

+The recommended way to manage drawings is to use the Worksheet.add_chart +method. +

- -

A Drawing is a canvas for charts. Each worksheet has a single drawing that +

+A Drawing is a canvas for charts. Each worksheet has a single drawing that manages anchors. The anchors reference the charts via graphical frames. This is not a trivial relationship so please do follow the advice in the -note. see README for an example of how to create a chart.

+note. see README for an example of how to create a chart. +

@@ -148,9 +150,10 @@ note. see README for an example of how to create a chart.

-
-

A collection of anchors for this drawing only TwoCellAnchors are supported -in this version.

+

+A collection of anchors for this drawing only TwoCellAnchors are supported +in this version. +

@@ -175,8 +178,9 @@ in this version.

-
-

The worksheet that owns the drawing.

+

+The worksheet that owns the drawing. +

@@ -211,8 +215,9 @@ in this version.

-
-

Adds a chart to the drawing.

+

+Adds a chart to the drawing. +

@@ -234,8 +239,9 @@ in this version.

-
-

Adds an image to the chart.

+

+Adds an image to the chart. +

@@ -257,8 +263,9 @@ in this version.

-
-

An array of charts that are associated with this drawing's anchors.

+

+An array of charts that are associated with this drawing’s anchors. +

@@ -280,8 +287,10 @@ in this version.

-
-

An array of image objects that are associated with this drawing's anchors.

+

+An array of image objects that are associated with this drawing’s +anchors. +

@@ -303,8 +312,10 @@ in this version.

-
-

The index of this drawing in the owning workbooks's drawings collection.

+

+The index of this drawing in the owning workbooks’s drawings +collection. +

@@ -328,8 +339,9 @@ in this version.

-
-

Creates a new Drawing object.

+

+Creates a new Drawing object. +

@@ -351,8 +363,9 @@ in this version.

-
-

The part name for this drawing.

+

+The part name for this drawing. +

@@ -374,8 +387,9 @@ in this version.

-
-

The drawing's relationships.

+

+The drawing’s relationships. +

@@ -397,8 +411,9 @@ in this version.

-
-

The relational part name for this drawing.

+

+The relational part name for this drawing. +

@@ -420,8 +435,9 @@ in this version.

-
-

The relation reference id for this drawing.

+

+The relation reference id for this drawing. +

@@ -443,8 +459,9 @@ in this version.

-
-

Serializes the drawing.

+

+Serializes the drawing. +

@@ -465,8 +482,9 @@ in this version.

- -

Creates a new Drawing object

+

+Creates a new Drawing object +

@@ -485,8 +503,9 @@ in this version.

— -
-

The worksheet that owns this drawing

+

+The worksheet that owns this drawing +

@@ -510,12 +529,13 @@ in this version.

# File 'lib/axlsx/drawing/drawing.rb', line 52
 
-def initialize(worksheet)
-  DataTypeValidator.validate "Drawing.worksheet", Worksheet, worksheet
-  @worksheet = worksheet
-  @worksheet.workbook.drawings << self
-  @anchors = SimpleTypedList.new [TwoCellAnchor, OneCellAnchor]
-end
+def initialize(worksheet) + DataTypeValidator.validate "Drawing.worksheet", Worksheet, worksheet + @worksheet = worksheet + @worksheet.workbook.drawings << self + @anchors = SimpleTypedList.new [TwoCellAnchor, OneCellAnchor] +end + @@ -538,9 +558,10 @@ in this version.

- -

A collection of anchors for this drawing only TwoCellAnchors are supported -in this version

+

+A collection of anchors for this drawing only TwoCellAnchors are supported +in this version +

@@ -574,9 +595,10 @@ in this version

# File 'lib/axlsx/drawing/drawing.rb', line 48
 
-def anchors
-  @anchors
-end
+def anchors + @anchors +end + @@ -594,8 +616,9 @@ in this version

- -

The worksheet that owns the drawing

+

+The worksheet that owns the drawing +

@@ -629,9 +652,10 @@ in this version

# File 'lib/axlsx/drawing/drawing.rb', line 43
 
-def worksheet
-  @worksheet
-end
+def worksheet + @worksheet +end + @@ -656,14 +680,16 @@ in this version

Note: -
-

The recommended way to manage charts is to use Worksheet.add_chart. Please -refer to that method for documentation.

+

+The recommended way to manage charts is to use Worksheet.add_chart. Please +refer to that method for documentation. +

- -

Adds a chart to the drawing.

+

+Adds a chart to the drawing. +

@@ -692,10 +718,11 @@ refer to that method for documentation.

# File 'lib/axlsx/drawing/drawing.rb', line 70
 
-def add_chart(chart_type, options={})
-  TwoCellAnchor.new(self, options)
-  @anchors.last.add_chart(chart_type, options)
-end
+def add_chart(chart_type, options={}) + TwoCellAnchor.new(self, options) + @anchors.last.add_chart(chart_type, options) +end + @@ -713,14 +740,16 @@ refer to that method for documentation.

Note: -
-

The recommended way to manage images is to use Worksheet.add_image. Please -refer to that method for documentation.

+

+The recommended way to manage images is to use Worksheet.add_image. Please +refer to that method for documentation. +

- -

Adds an image to the chart

+

+Adds an image to the chart +

@@ -749,10 +778,11 @@ refer to that method for documentation.

# File 'lib/axlsx/drawing/drawing.rb', line 62
 
-def add_image(options={})
-  OneCellAnchor.new(self, options)
-  @anchors.last.object
-end
+def add_image(options={}) + OneCellAnchor.new(self, options) + @anchors.last.object +end + @@ -767,8 +797,9 @@ refer to that method for documentation.

- -

An array of charts that are associated with this drawing's anchors

+

+An array of charts that are associated with this drawing’s anchors +

@@ -803,10 +834,11 @@ refer to that method for documentation.

# File 'lib/axlsx/drawing/drawing.rb', line 77
 
-def charts
-  charts = @anchors.select { |a| a.object.is_a?(GraphicFrame) }
-  charts.map { |a| a.object.chart }
-end
+def charts + charts = @anchors.select { |a| a.object.is_a?(GraphicFrame) } + charts.map { |a| a.object.chart } +end + @@ -821,8 +853,10 @@ refer to that method for documentation.

- -

An array of image objects that are associated with this drawing's anchors

+

+An array of image objects that are associated with this drawing’s +anchors +

@@ -857,10 +891,11 @@ refer to that method for documentation.

# File 'lib/axlsx/drawing/drawing.rb', line 84
 
-def images
-  images = @anchors.select { |a| a.object.is_a?(Pic) }
-  images.map { |a| a.object }
-end
+def images + images = @anchors.select { |a| a.object.is_a?(Pic) } + images.map { |a| a.object } +end + @@ -875,8 +910,10 @@ refer to that method for documentation.

- -

The index of this drawing in the owning workbooks's drawings collection.

+

+The index of this drawing in the owning workbooks’s drawings +collection. +

@@ -910,9 +947,10 @@ refer to that method for documentation.

# File 'lib/axlsx/drawing/drawing.rb', line 91
 
-def index
-  @worksheet.workbook.drawings.index(self)
-end
+def index + @worksheet.workbook.drawings.index(self) +end + @@ -927,8 +965,9 @@ refer to that method for documentation.

- -

The part name for this drawing

+

+The part name for this drawing +

@@ -962,9 +1001,10 @@ refer to that method for documentation.

# File 'lib/axlsx/drawing/drawing.rb', line 103
 
-def pn
-  "#{DRAWING_PN % (index+1)}"
-end
+def pn + "#{DRAWING_PN % (index+1)}" +end + @@ -979,8 +1019,9 @@ refer to that method for documentation.

- -

The drawing's relationships.

+

+The drawing’s relationships. +

@@ -1021,16 +1062,17 @@ refer to that method for documentation.

# File 'lib/axlsx/drawing/drawing.rb', line 115
 
-def relationships
-  r = Relationships.new
-  charts.each do |chart|
-    r << Relationship.new(CHART_R, "../#{chart.pn}")
-  end
-  images.each do |image|
-    r << Relationship.new(IMAGE_R, "../#{image.pn}")
-  end
-  r
-end
+def relationships + r = Relationships.new + charts.each do |chart| + r << Relationship.new(CHART_R, "../#{chart.pn}") + end + images.each do |image| + r << Relationship.new(IMAGE_R, "../#{image.pn}") + end + r +end + @@ -1045,8 +1087,9 @@ refer to that method for documentation.

- -

The relational part name for this drawing

+

+The relational part name for this drawing +

@@ -1080,9 +1123,10 @@ refer to that method for documentation.

# File 'lib/axlsx/drawing/drawing.rb', line 109
 
-def rels_pn
-  "#{DRAWING_RELS_PN % (index+1)}"
-end
+def rels_pn + "#{DRAWING_RELS_PN % (index+1)}" +end + @@ -1097,8 +1141,9 @@ refer to that method for documentation.

- -

The relation reference id for this drawing

+

+The relation reference id for this drawing +

@@ -1132,9 +1177,10 @@ refer to that method for documentation.

# File 'lib/axlsx/drawing/drawing.rb', line 97
 
-def rId
-  "rId#{index+1}"
-end
+def rId + "rId#{index+1}" +end + @@ -1149,8 +1195,9 @@ refer to that method for documentation.

- -

Serializes the drawing

+

+Serializes the drawing +

@@ -1189,14 +1236,15 @@ refer to that method for documentation.

# File 'lib/axlsx/drawing/drawing.rb', line 128
 
-def to_xml
-  builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|
-    xml.send('xdr:wsDr', :xmlns:xdr'=>XML_NS_XDR, :xmlns:a'=>XML_NS_A) {
-      anchors.each {|anchor| anchor.to_xml(xml) }
-    }        
-  end
-  builder.to_xml
-end
+def to_xml + builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml| + xml.send('xdr:wsDr', :'xmlns:xdr'=>XML_NS_XDR, :'xmlns:a'=>XML_NS_A) { + anchors.each {|anchor| anchor.to_xml(xml) } + } + end + builder.to_xml +end + @@ -1207,9 +1255,9 @@ refer to that method for documentation.

-- cgit v1.2.3