From 058faf2581970fa18c314ad07f5658adeca32c69 Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Sun, 27 Nov 2011 22:08:55 +0900 Subject: update to README --- doc/Axlsx/Drawing.html | 304 +++++++++++++++++++++---------------------------- 1 file changed, 128 insertions(+), 176 deletions(-) (limited to 'doc/Axlsx/Drawing.html') diff --git a/doc/Axlsx/Drawing.html b/doc/Axlsx/Drawing.html index d0ed25f3..51c5008a 100644 --- a/doc/Axlsx/Drawing.html +++ b/doc/Axlsx/Drawing.html @@ -97,19 +97,17 @@
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.

@@ -150,10 +148,9 @@ 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.

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

-The worksheet that owns the drawing. -

+
+

The worksheet that owns the drawing.

@@ -215,9 +211,8 @@ The worksheet that owns the drawing. -

-Adds a chart to the drawing. -

+
+

Adds a chart to the drawing.

@@ -239,9 +234,8 @@ Adds a chart to the drawing. -

-Adds an image to the chart. -

+
+

Adds an image to the chart.

@@ -263,9 +257,8 @@ Adds an image to the chart. -

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

+
+

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

@@ -287,10 +280,8 @@ An array of charts that are associated with this drawing’s anchors. -

-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.

@@ -312,10 +303,8 @@ anchors. -

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

+
+

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

@@ -339,9 +328,8 @@ collection. -

-Creates a new Drawing object. -

+
+

Creates a new Drawing object.

@@ -363,9 +351,8 @@ Creates a new Drawing object. -

-The part name for this drawing. -

+
+

The part name for this drawing.

@@ -387,9 +374,8 @@ The part name for this drawing. -

-The drawing’s relationships. -

+
+

The drawing's relationships.

@@ -411,9 +397,8 @@ The drawing’s relationships. -

-The relational part name for this drawing. -

+
+

The relational part name for this drawing.

@@ -435,9 +420,8 @@ The relational part name for this drawing. -

-The relation reference id for this drawing. -

+
+

The relation reference id for this drawing.

@@ -459,9 +443,8 @@ The relation reference id for this drawing. -

-Serializes the drawing. -

+
+

Serializes the drawing.

@@ -482,9 +465,8 @@ Serializes the drawing.

-

-Creates a new Drawing object -

+ +

Creates a new Drawing object

@@ -503,9 +485,8 @@ Creates a new Drawing object — -

-The worksheet that owns this drawing -

+
+

The worksheet that owns this drawing

@@ -529,13 +510,12 @@ The worksheet that owns this drawing
# 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 @@ -558,10 +538,9 @@ The worksheet that owns this drawing

-

-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

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

-

-The worksheet that owns the drawing -

+ +

The worksheet that owns the drawing

@@ -652,10 +629,9 @@ The worksheet that owns the drawing
# File 'lib/axlsx/drawing/drawing.rb', line 43
 
-def worksheet
-  @worksheet
-end
-
+def worksheet + @worksheet +end @@ -680,16 +656,14 @@ The worksheet that owns the drawing
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.

@@ -718,11 +692,10 @@ Adds a chart to the drawing.
# 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 @@ -740,16 +713,14 @@ Adds a chart to the drawing.
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

@@ -778,11 +749,10 @@ Adds an image to the chart
# 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 @@ -797,9 +767,8 @@ Adds an image to the chart

-

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

+ +

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

@@ -834,11 +803,10 @@ An array of charts that are associated with this drawing’s anchors
# 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 @@ -853,10 +821,8 @@ An array of charts that are associated with this drawing’s anchors

-

-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

@@ -891,11 +857,10 @@ anchors
# 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 @@ -910,10 +875,8 @@ anchors

-

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

+ +

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

@@ -947,10 +910,9 @@ collection.
# File 'lib/axlsx/drawing/drawing.rb', line 91
 
-def index
-  @worksheet.workbook.drawings.index(self)
-end
-
+def index + @worksheet.workbook.drawings.index(self) +end @@ -965,9 +927,8 @@ collection.

-

-The part name for this drawing -

+ +

The part name for this drawing

@@ -1001,10 +962,9 @@ The part name for this drawing
# File 'lib/axlsx/drawing/drawing.rb', line 103
 
-def pn
-  "#{DRAWING_PN % (index+1)}"
-end
-
+def pn + "#{DRAWING_PN % (index+1)}" +end @@ -1019,9 +979,8 @@ The part name for this drawing

-

-The drawing’s relationships. -

+ +

The drawing's relationships.

@@ -1062,17 +1021,16 @@ The drawing’s relationships.
# 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 @@ -1087,9 +1045,8 @@ The drawing’s relationships.

-

-The relational part name for this drawing -

+ +

The relational part name for this drawing

@@ -1123,10 +1080,9 @@ The relational part name for this drawing
# 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 @@ -1141,9 +1097,8 @@ The relational part name for this drawing

-

-The relation reference id for this drawing -

+ +

The relation reference id for this drawing

@@ -1177,10 +1132,9 @@ The relation reference id for this drawing
# File 'lib/axlsx/drawing/drawing.rb', line 97
 
-def rId
-  "rId#{index+1}"
-end
-
+def rId + "rId#{index+1}" +end @@ -1195,9 +1149,8 @@ The relation reference id for this drawing

-

-Serializes the drawing -

+ +

Serializes the drawing

@@ -1236,15 +1189,14 @@ Serializes the drawing
# 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 @@ -1255,9 +1207,9 @@ Serializes the drawing
-- cgit v1.2.3