Class: CTioga2::Graphics::Styles::LegendStorageStyle

Inherits:
BasicStyle
  • Object
show all
Defined in:
lib/ctioga2/graphics/styles/legend.rb

Overview

Style of a given Legends::LegendStorage object.

Constant Summary

Constants inherited from BasicStyle

BasicStyle::OldAttrAccessor

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BasicStyle

attr_accessor, attributes, from_hash, #instance_variable_defined?, #set_from_hash, #to_hash, #update_from_other

Constructor Details

#initializeLegendStorageStyle

Returns a new instance of LegendStorageStyle.



48
49
50
51
52
53
54
55
56
57
58
# File 'lib/ctioga2/graphics/styles/legend.rb', line 48

def initialize
  @dy = Types::Dimension.new(:dy, 1.6, :y)

  @picto_width = Types::Dimension.new(:dy, 1.6, :x)
  @picto_height = Types::Dimension.new(:dy, 0.6, :y)

  @picto_to_text = Types::Dimension.new(:dy, 0.3, :x)

  @scale = 0.8
  @text_scale = 0.82
end

Instance Attribute Details

#dyObject

The distance between two lines, a Types::Dimension object.



30
31
32
# File 'lib/ctioga2/graphics/styles/legend.rb', line 30

def dy
  @dy
end

#picto_heightObject

The height of the legend pictogram, a Types::Dimension object.



36
37
38
# File 'lib/ctioga2/graphics/styles/legend.rb', line 36

def picto_height
  @picto_height
end

#picto_to_textObject

The distance between the legend pictogram and the text



39
40
41
# File 'lib/ctioga2/graphics/styles/legend.rb', line 39

def picto_to_text
  @picto_to_text
end

#picto_widthObject

The width of the legend pictogram, a Types::Dimension object.



33
34
35
# File 'lib/ctioga2/graphics/styles/legend.rb', line 33

def picto_width
  @picto_width
end

#scaleObject

The scale of the legend



42
43
44
# File 'lib/ctioga2/graphics/styles/legend.rb', line 42

def scale
  @scale
end

#text_scaleObject

The scale of the legend text – relative to the overall scale.



46
47
48
# File 'lib/ctioga2/graphics/styles/legend.rb', line 46

def text_scale
  @text_scale
end