Sha256: 6cf3f0d9e818d6168566dc8738574f379d18e2689a6a4dc4a8c59cbf9c5a5a02

Contents?: true

Size: 1.08 KB

Versions: 6

Compression:

Stored size: 1.08 KB

Contents

module D3
  class RadialAreaGenerator
    include D3::Native

    def call(*args)
      result = @native.call(*args)
      `result === null ? nil : result`
    end

    attributes_d3_block %i[
      angle
      startAngle
      endAngle
      radius
      innerRadius
      outerRadius
      defined
    ]

    def curve(new_value=`undefined`)
      if `new_value === undefined`
        D3::Curve.new @native.JS.curve
      else
        @native.JS.curve(new_value.to_n)
        self
      end
    end

    def line_start_angle
      D3::RadialLineGenerator.new @native.JS.lineStartAngle
    end

    def line_end_angle
      D3::RadialLineGenerator.new @native.JS.lineEndAngle
    end

    def line_inner_radius
      D3::RadialLineGenerator.new @native.JS.lineInnerRadius
    end

    def line_outer_radius
      D3::RadialLineGenerator.new @native.JS.lineOuterRadius
    end
  end

  class << self
    def radial_area(data = nil)
      if data
        D3::RadialAreaGenerator.new @d3.JS.radialArea(data.to_n)
      else
        D3::RadialAreaGenerator.new @d3.JS.radialArea
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
hyper-d3-1.0.0.lap28 lib/d3/radial_area.rb
hyper-d3-1.0.0.lap27 lib/d3/radial_area.rb
hyper-d3-1.0.0.lap26 lib/d3/radial_area.rb
hyper-d3-1.0.0.lap25 lib/d3/radial_area.rb
hyper-d3-1.0.0.lap24 lib/d3/radial_area.rb
hyper-d3-1.0.0.lap23 lib/d3/radial_area.rb