Sha256: cf25368062ba37699cc7dfbbe257ca26b1b8b2a4d2aca18594afa044ce9d84a7

Contents?: true

Size: 712 Bytes

Versions: 4

Compression:

Stored size: 712 Bytes

Contents

# stdlib
require "erb"
require "json"
require "securerandom"

# modules
require "vega/method_helpers"
require "vega/base_chart"
require "vega/chart"
require "vega/lite_chart"
require "vega/spec"
require "vega/helper"
require "vega/version"

# integrations
require "vega/engine" if defined?(Rails)

module Vega
  class << self
    # save chart method for now
    def start
      Chart.new
    end

    def lite
      LiteChart.new
    end

    def render(spec, nonce: nil)
      Spec.new(spec).to_html(nonce: nonce)
    end

    def display(spec)
      IRuby.display(Spec.new(spec))
    end
  end
end

if defined?(ActiveSupport.on_load)
  ActiveSupport.on_load(:action_view) do
    include Vega::Helper
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vega-0.3.1 lib/vega.rb
vega-0.3.0 lib/vega.rb
vega-0.2.7 lib/vega.rb
vega-0.2.6 lib/vega.rb