From 11303a4d6664d9a7ff7bc408035d2ab70378a375 Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Sat, 26 Nov 2011 13:20:57 +0900 Subject: adding in support for ruby 1.9.3 release version 1.0.9 --- doc/Axlsx/Drawing.html | 734 ++++++++++++++++++++++--------------------------- 1 file changed, 322 insertions(+), 412 deletions(-) (limited to 'doc/Axlsx/Drawing.html') diff --git a/doc/Axlsx/Drawing.html b/doc/Axlsx/Drawing.html index 89318def..80d5ca01 100644 --- a/doc/Axlsx/Drawing.html +++ b/doc/Axlsx/Drawing.html @@ -6,7 +6,7 @@ Class: Axlsx::Drawing - — Documentation by YARD 0.7.3 + — AXLSX @@ -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.

@@ -162,7 +159,7 @@ in this version.
  • - - (Array) charts + - (Worksheet) worksheet @@ -178,163 +175,152 @@ in this version. -

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

    +
    +

    The worksheet that owns the drawing.

  • -
  • + + + + + + +

    + Instance Method Summary + (collapse) +

    + + - - - - - -

    - Instance Method Summary - (collapse) -

    - -
    • - - (Object) add_chart(chart_type, options = {}) + - (Relationships) relationships @@ -406,9 +374,8 @@ The worksheet that owns the drawing. -

      -Adds a chart to the drawing. -

      +
      +

      The drawing's relationships.

    • @@ -417,7 +384,7 @@ Adds a chart to the drawing.
    • - - (Object) add_image(options = {}) + - (String) rels_pn @@ -430,9 +397,8 @@ Adds a chart to the drawing. -

      -Adds an image to the chart. -

      +
      +

      The relational part name for this drawing.

    • @@ -441,14 +407,12 @@ Adds an image to the chart.
    • - - (Drawing) initialize(worksheet) + - (String) rId - constructor - @@ -456,9 +420,8 @@ Adds an image to the chart. -

      -Creates a new Drawing object. -

      +
      +

      The relation reference id for this drawing.

    • @@ -480,9 +443,8 @@ Creates a new Drawing object. -

      -Serializes the drawing. -

      +
      +

      Serializes the drawing.

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

      -

      -Creates a new Drawing object -

      + +

      Creates a new Drawing object

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

      -The worksheet that owns this drawing -

      +
      +

      The worksheet that owns this drawing

      @@ -540,23 +500,22 @@ The worksheet that owns this drawing
       
       
      -80
      -81
      -82
      -83
      -84
      -85
      +52 +53 +54 +55 +56 +57 -
      # File 'lib/axlsx/drawing/drawing.rb', line 80
      -
      -def initialize(worksheet)
      -  DataTypeValidator.validate "Drawing.worksheet", Worksheet, worksheet
      -  @worksheet = worksheet
      -  @worksheet.workbook.drawings << self
      -  @anchors = SimpleTypedList.new [TwoCellAnchor, OneCellAnchor]
      -end
      -
      +
      # 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
      @@ -579,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

      @@ -616,10 +574,9 @@ in this version
      # File 'lib/axlsx/drawing/drawing.rb', line 48
       
      -def anchors
      -  @anchors
      -end
      -
      +def anchors + @anchors +end @@ -627,19 +584,18 @@ in this version - +
      -

      +

      - - (Array) charts (readonly) + - (Worksheet) worksheet (readonly)

      -

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

      + +

      The worksheet that owns the drawing

      @@ -652,7 +608,7 @@ An array of charts that are associated with this drawing’s anchors
    • - (Array) + (Worksheet) @@ -666,59 +622,61 @@ An array of charts that are associated with this drawing’s anchors
       
       
      -52
      -53
      -54
      -55
      +43 +44 +45 -
      # File 'lib/axlsx/drawing/drawing.rb', line 52
      +      
      # File 'lib/axlsx/drawing/drawing.rb', line 43
       
      -def charts
      -  charts = @anchors.select { |a| a.object.is_a?(GraphicFrame) }
      -  charts.map { |a| a.object.chart }
      -end
      -
      +def worksheet + @worksheet +end
    • - - - -
      -

      +

      + + +
      +

      Instance Method Details

      + + +
      +

      - - (Array) images (readonly) + - (Object) add_chart(chart_type, options = {})

      -

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

      + +
      + Note: +
      +

      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.

      -

      Returns:

      -
        - -
      • - - - (Array) - - - -
      • - -
      + +

      See Also:

      +
      @@ -726,59 +684,56 @@ anchors
       
       
      -56
      -57
      -58
      -59
      +70 +71 +72 +73
      -
      # File 'lib/axlsx/drawing/drawing.rb', line 56
      +      
      # File 'lib/axlsx/drawing/drawing.rb', line 70
       
      -def images
      -  images = @anchors.select { |a| a.object.is_a?(Pic) }
      -  images.map { |a| a.object }
      -end
      -
      +def add_chart(chart_type, options={}) + TwoCellAnchor.new(self, options) + @anchors.last.add_chart(chart_type, options) +end
      - - -
      -

      +

      - - (Integer) index (readonly) + - (Object) add_image(options = {})

      -

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

      + +
      + Note: +
      +

      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

      -

      Returns:

      -
        - -
      • - - - (Integer) - - - -
      • - -
      + +

      See Also:

      +
      @@ -786,37 +741,34 @@ collection.
       
       
      -60
      -61
      -62
      +62 +63 +64 +65
      -
      # File 'lib/axlsx/drawing/drawing.rb', line 60
      +      
      # File 'lib/axlsx/drawing/drawing.rb', line 62
       
      -def index
      -  @worksheet.workbook.drawings.index(self)
      -end
      -
      +def add_image(options={}) + OneCellAnchor.new(self, options) + @anchors.last.object +end
      - - -
      -

      +

      - - (String) pn (readonly) + - (Array) charts

      -

      -The part name for this drawing -

      + +

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

      @@ -829,7 +781,7 @@ The part name for this drawing
    • - (String) + (Array) @@ -843,37 +795,34 @@ The part name for this drawing
       
       
      -68
      -69
      -70
      +77 +78 +79 +80 -
      # File 'lib/axlsx/drawing/drawing.rb', line 68
      +      
      # File 'lib/axlsx/drawing/drawing.rb', line 77
       
      -def pn
      -  "#{DRAWING_PN % (index+1)}"
      -end
      -
      +def charts + charts = @anchors.select { |a| a.object.is_a?(GraphicFrame) } + charts.map { |a| a.object.chart } +end
    • - - -
      -

      +

      - - (Relationships) relationships (readonly) + - (Array) images

      -

      -The drawing’s relationships. -

      + +

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

      @@ -886,7 +835,7 @@ The drawing’s relationships.
    • - (Relationships) + (Array) @@ -900,51 +849,34 @@ The drawing’s relationships.
       
       
      -76
      -77
      -78
      -79
      -80
      -81
      -82
      -83
       84
      -85
      +85 +86 +87 -
      # File 'lib/axlsx/drawing/drawing.rb', line 76
      -
      -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
      -
      +
      # 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
    • - - -
      -

      +

      - - (String) rels_pn (readonly) + - (Integer) index

      -

      -The relational part name for this drawing -

      + +

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

      @@ -957,7 +889,7 @@ The relational part name for this drawing
    • - (String) + (Integer) @@ -971,37 +903,32 @@ The relational part name for this drawing
       
       
      -72
      -73
      -74
      +91 +92 +93 -
      # File 'lib/axlsx/drawing/drawing.rb', line 72
      +      
      # File 'lib/axlsx/drawing/drawing.rb', line 91
       
      -def rels_pn
      -  "#{DRAWING_RELS_PN % (index+1)}"
      -end
      -
      +def index + @worksheet.workbook.drawings.index(self) +end
    • - - -
      -

      +

      - - (String) rId (readonly) + - (String) pn

      -

      -The relation reference id for this drawing -

      + +

      The part name for this drawing

      @@ -1028,37 +955,32 @@ The relation reference id for this drawing
       
       
      -64
      -65
      -66
      +103 +104 +105 -
      # File 'lib/axlsx/drawing/drawing.rb', line 64
      +      
      # File 'lib/axlsx/drawing/drawing.rb', line 103
       
      -def rId
      -  "rId#{index+1}"
      -end
      -
      +def pn + "#{DRAWING_PN % (index+1)}" +end
      - - -
      -

      +

      - - (Worksheet) worksheet (readonly) + - (Relationships) relationships

      -

      -The worksheet that owns the drawing -

      + +

      The drawing's relationships.

      @@ -1071,7 +993,7 @@ The worksheet that owns the drawing
    • - (Worksheet) + (Relationships) @@ -1085,64 +1007,65 @@ The worksheet that owns the drawing
       
       
      -43
      -44
      -45
      +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 -
      # File 'lib/axlsx/drawing/drawing.rb', line 43
      -
      -def worksheet
      -  @worksheet
      -end
      -
      +
      # 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
    • -
      - - -
      -

      Instance Method Details

      - - -
      -

      +

      +

      - - (Object) add_chart(chart_type, options = {}) + - (String) rels_pn

      -
      - Note: -

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

      +

      The relational part name for this drawing

      - -

      See Also:

      - +

      Returns:

      +
        + +
      • + + + (String) + + + +
      • + +
      @@ -1150,59 +1073,51 @@ Adds a chart to the drawing.
       
       
      -98
      -99
      -100
      -101
      +109 +110 +111
      -
      # File 'lib/axlsx/drawing/drawing.rb', line 98
      +      
      # File 'lib/axlsx/drawing/drawing.rb', line 109
       
      -def add_chart(chart_type, options={})
      -  TwoCellAnchor.new(self, options)
      -  @anchors.last.add_chart(chart_type, options)
      -end
      -
      +def rels_pn + "#{DRAWING_RELS_PN % (index+1)}" +end
      -

      +

      - - (Object) add_image(options = {}) + - (String) rId

      -
      - Note: -

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

      +

      The relation reference id for this drawing

      - -

      See Also:

      - +

      Returns:

      +
        + +
      • + + + (String) + + + +
      • + +
      @@ -1210,19 +1125,16 @@ Adds an image to the chart
       
       
      -90
      -91
      -92
      -93
      +97 +98 +99
      -
      # File 'lib/axlsx/drawing/drawing.rb', line 90
      +      
      # File 'lib/axlsx/drawing/drawing.rb', line 97
       
      -def add_image(options={})
      -  OneCellAnchor.new(self, options)
      -  @anchors.last.object
      -end
      -
      +def rId + "rId#{index+1}" +end
      @@ -1237,9 +1149,8 @@ Adds an image to the chart

      -

      -Serializes the drawing -

      + +

      Serializes the drawing

      @@ -1266,27 +1177,26 @@ Serializes the drawing
       
       
      -142
      -143
      -144
      -145
      -146
      -147
      -148
      -149
      +128 +129 +130 +131 +132 +133 +134 +135 -
      # File 'lib/axlsx/drawing/drawing.rb', line 142
      -
      -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
      -
      +
      # 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
      @@ -1297,9 +1207,9 @@ Serializes the drawing
      -- cgit v1.2.3