module Nyaplot

Constants

VERSION

Public Class Methods

add_additional_library(name, url) click to toggle source

Load extension library to IRuby notebook before Nyaplotjs is loaded

# File lib/nyaplot/core.rb, line 28
def self.add_additional_library(name, url)
  @@additional_libraries[name]=url
end
add_dependency(name, url) click to toggle source

Load extension library to IRuby notebook after Nyaplotjs is loaded

# File lib/nyaplot/core.rb, line 23
def self.add_dependency(name, url)
  @@dep_libraries[name]=url;
end
add_extension(name) click to toggle source

Tell JavaScript back-end library to load some extension libraries @param [String] name The name of JavaScript extension library to load

# File lib/nyaplot/core.rb, line 18
def self.add_extension(name)
  @@extension_lists.push(name)
end
extension_lists() click to toggle source
# File lib/nyaplot/core.rb, line 12
def self.extension_lists
  @@extension_lists
end
generate_init_code() click to toggle source

generate initializing code

# File lib/nyaplot/core.rb, line 33
def self.generate_init_code
  path = File.expand_path("../templates/init.js.erb", __FILE__)
  template = File.read(path)
  dep_libraries = @@dep_libraries
  additional_libraries = @@additional_libraries
  js = ERB.new(template).result(binding)
  js
end
init_iruby() click to toggle source

Enable to show plots on IRuby notebook

# File lib/nyaplot/core.rb, line 43
def self.init_iruby
  js = self.generate_init_code
  IRuby.display(IRuby.javascript(js))
end