Class: Tuftify::Panel

Inherits:
Object
  • Object
show all
Defined in:
lib/tuftify/panel.rb

Direct Known Subclasses

CategoryAxis, GraphAreaPanel, TitlePanel

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, y, width, height, canvas, options = {}) ⇒ Panel

Returns a new instance of Panel.



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/tuftify/panel.rb', line 10

def initialize(x, y, width, height, canvas, options = {})
  @x, @y = x, y
  @width, @height = width, height
  @canvas = canvas
  @options = options.clone

  @drawing = Magick::Draw.new
  @drawing.font_family = @options[:font_family]
  @drawing.fill = @options[:fill]
  @drawing.pointsize = @options[:pointsize]
  @drawing.gravity = @options[:gravity]
end

Instance Attribute Details

#canvasObject

Returns the value of attribute canvas.



8
9
10
# File 'lib/tuftify/panel.rb', line 8

def canvas
  @canvas
end

#heightObject

Returns the value of attribute height.



7
8
9
# File 'lib/tuftify/panel.rb', line 7

def height
  @height
end

#widthObject

Returns the value of attribute width.



7
8
9
# File 'lib/tuftify/panel.rb', line 7

def width
  @width
end

#xObject

Returns the value of attribute x.



6
7
8
# File 'lib/tuftify/panel.rb', line 6

def x
  @x
end

#yObject

Returns the value of attribute y.



6
7
8
# File 'lib/tuftify/panel.rb', line 6

def y
  @y
end

Instance Method Details

#drawObject



23
24
25
# File 'lib/tuftify/panel.rb', line 23

def draw
  
end