Sha256: 9f19939b073f91ec2a0a2440501b3d8ce5efe9a45e790792477071693e21f374

Contents?: true

Size: 411 Bytes

Versions: 11

Compression:

Stored size: 411 Bytes

Contents

module Squid
  class AxisLabel
    def self.for(axis, height:, align:)
      height.step(0, -height/(axis.labels.size-1).to_f).map.with_index do |y, i|
        new y: y, label: axis.labels[i], align: align, width: axis.width
      end
    end

    attr_reader :label, :y, :align, :width

    def initialize(label:, y:, align:, width:)
      @label, @y, @align, @width = label, y, align, width
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
squid-1.4.1 lib/squid/axis_label.rb
squid-1.4.0 lib/squid/axis_label.rb
squid-1.3.0 lib/squid/axis_label.rb
squid-1.2.0 lib/squid/axis_label.rb
squid-1.1.0 lib/squid/axis_label.rb
squid-1.0.1 lib/squid/axis_label.rb
squid-1.0.0 lib/squid/axis_label.rb
squid-1.0.0.beta4 lib/squid/axis_label.rb
squid-1.0.0.beta3 lib/squid/axis_label.rb
squid-1.0.0.beta2 lib/squid/axis_label.rb
squid-1.0.0.beta1 lib/squid/axis_label.rb