Sha256: 52c226e22831276e119dd35b7515c93bf805751222020d16e2bfa7748345d62a

Contents?: true

Size: 368 Bytes

Versions: 6

Compression:

Stored size: 368 Bytes

Contents

module D3
  class << self
    # This could maybe use more OO interface in addition to this?
    # Like D3::Polygon.new(points).area etc.

    aliases_d3 %i[
      polygonArea
      polygonCentroid
      polygonContains
      polygonLength
    ]

    def polygon_hull(points)
      hull = @d3.JS.polygonHull(points)
      `hull === null ? nil : hull`
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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