Sha256: d11d8029e78e0ee77641409a2aa1a9a8f87eee24c4385196dd9a8da33984e931

Contents?: true

Size: 775 Bytes

Versions: 2

Compression:

Stored size: 775 Bytes

Contents

require 'initializer/category'
require 'initializer/dataframe'
require 'initializer/vector'
require 'daru'

module Daru::Plotly::Initializer
  [:plot, :generate_data].each do |method_name|
    define_method method_name do |data, opts|
      warn "[DEPRECATION] This gem has been renamed to daru-plotly and will no longer be supported. Please switch to daru-plotly as soon as possible."

      if data.is_a? Daru::DataFrame
        Daru::Plotly::Initializer::DataFrame.send(method_name ,data, opts)
      elsif data.is_a? Daru::Vector
        Daru::Plotly::Initializer::Vector.send(method_name, data, opts)
      else
        raise ArgumentError, 'first argument should be Daru::DataFrame or Daru::Vector.'
      end
    end
  end

  module_function :plot, :generate_data
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
daru_plotly-0.1.2 lib/daru_plotly.rb
daru_plotly-0.1.1 lib/daru_plotly.rb