def initialize(length, opts = {})
@length = length
opts = {
:width => DEFAULT_PANEL_WIDTH,
:display_range => Range.new(0,@length),
:vertical => false,
:clickable => false,
:format => :png
}.merge(opts)
@width = opts[:width].to_i
@display_range = opts[:display_range]
@display_start = [0, @display_range.lend].max
@display_stop = [@length,@display_range.rend].min
if @display_stop <= @display_start
raise "[ERROR] Start coordinate to be displayed has to be smaller than stop coordinate."
end
@display_range = Range.new(@display_start,@display_stop)
@vertical = opts[:vertical]
@clickable = opts[:clickable]
@format = opts[:format]
if ! [:png, :svg, :pdf, :ps].include?(@format)
raise "[ERROR] Format has to be one of :png, :svg, :pdf or :ps."
end
@tracks = Array.new
@number_of_feature_rows = 0
@image_map = ImageMap.new
@rescale_factor = (@display_stop - @display_start).to_f / @width
@final_panel_destination = nil
end