# File lib/scruffy/layers/base.rb, line 126 def generate_coordinates(options = {}) options[:point_distance] = width / (points.size - 1).to_f coords = (0...points.size).map do |idx| x_coord = options[:point_distance] * idx relative_percent = ((points[idx] == min_value) ? 0 : ((points[idx] - min_value) / (max_value - min_value).to_f)) y_coord = (height - (height * relative_percent)) [x_coord, y_coord] end coords end