lib/gruff/ldata_mixin.rb
# Compute a dash pattern for linedata
Compute a dash pattern for linedata
Compute a dash pattern for linedata
def style_to_dasharray(style,line_width)
    case style
    when Array
      [ style[0] ? style[0].to_f : line_width, 
        style[1] ? style[1].to_f : line_width ]
    when /dash/
      [ line_width * 2.5, line_width * 0.5 ]
    when /dot/
      [ line_width * 1.5, line_width * 1.5 ]
    when /^([0-9.]+)(\s*,\s*|\s+)([0-9.]+)$/
      [ $1.to_f, $3.to_f ]
    else
      [] 
    end
  end
def style_to_dasharray ( style , line_width ) case style when Array [ style [ 0 ] ? style [ 0 ] . to_f : line_width , style [ 1 ] ? style [ 1 ] . to_f : line_width ] when / dash / [ line_width * 2.5 , line_width * 0.5 ] when / dot / [ line_width * 1.5 , line_width * 1.5 ] when / ^([0-9.]+)( \s *, \s *| \s +)([0-9.]+)$ / [ $1 . to_f , $3 . to_f ] else [ ] end end
Compute a dash pattern for linedata
Compute a dash pattern for linedata
# solid
style
<not_specific>
line_width
<not_specific>