Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Daru::View::Plot can be usable as df.plot(..) #61

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/daru/view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
# Rails Helper
require 'daru/view/app/rails/railtie.rb' if defined?(Rails)

# monkeys
require 'daru/view/monkeys'

module Daru
module View
# default Nyaplot library is used.
Expand Down
13 changes: 13 additions & 0 deletions lib/daru/view/monkeys.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module Daru
class DataFrame
# @example
#
# df = Daru::DataFrame.new([1, 2, 3, 4, 5])
# df.plot_view(adapter: :googlecharts)
#
# Note: `options` can take options same as Daru::View::Plot(df, options)
def plot_view(options={})
Daru::View::Plot.new(self, options)
end
end
end
42 changes: 24 additions & 18 deletions spec/dummy_iruby/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
GIT
remote: https://github.com/SciRuby/daru.git
revision: 9f304c1b7fe41f610bc1269a01deb693ba313134
revision: 0127dd5e2cb62d8a4a6550ef9cfb177ae387cd5e
specs:
daru (0.1.5)
daru (0.1.6)
backports
packable (~> 1.3.9)

GIT
remote: https://github.com/SciRuby/nyaplot.git
Expand All @@ -13,25 +14,31 @@ GIT

GIT
remote: https://github.com/Shekharrajak/data_tables.git
revision: 5765938137c522a8b4537a1ca1a4010a2dbd21f4
revision: b2418905faeaec927736354cfb470f7250fd8c8d
specs:
data_tables (0.1.0)

PATH
remote: ../..
specs:
daru-view (0.1.0)
actionview
daru
data_tables
google_visualr
lazy_high_charts
nyaplot

GEM
remote: http://rubygems.org/
specs:
actionview (5.1.2)
activesupport (= 5.1.2)
actionview (5.1.3)
activesupport (= 5.1.3)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activesupport (5.1.2)
activesupport (5.1.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
minitest (~> 5.1)
Expand All @@ -40,7 +47,7 @@ GEM
backports (3.8.0)
bond (0.5.1)
builder (3.2.3)
byebug (9.0.6)
byebug (9.1.0)
coderay (1.1.1)
concurrent-ruby (1.0.5)
data_uri (0.1.0)
Expand Down Expand Up @@ -69,20 +76,22 @@ GEM
method_source (0.8.2)
mimemagic (0.3.2)
mini_portile2 (2.2.0)
minitest (5.10.2)
minitest (5.10.3)
multi_json (1.12.1)
nokogiri (1.8.0)
mini_portile2 (~> 2.2.0)
parallel (1.11.2)
packable (1.3.9)
backports
parallel (1.12.0)
parser (2.4.0.0)
ast (~> 2.2)
powerpack (0.1.1)
pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
pry-byebug (3.4.2)
byebug (~> 9.0)
pry-byebug (3.5.0)
byebug (~> 9.1)
pry (~> 0.10)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
Expand All @@ -91,7 +100,7 @@ GEM
loofah (~> 2.0)
rainbow (2.2.2)
rake
rake (10.5.0)
rake (12.0.0)
rbczmq (1.7.9)
rspec (3.6.0)
rspec-core (~> 3.6.0)
Expand All @@ -114,11 +123,11 @@ GEM
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.8.1)
simplecov (0.14.1)
simplecov (0.15.0)
docile (~> 1.1.0)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.1)
simplecov-html (0.10.2)
slop (3.6.0)
thread_safe (0.3.6)
tzinfo (1.2.3)
Expand All @@ -129,20 +138,17 @@ PLATFORMS
ruby

DEPENDENCIES
actionview
bundler (~> 1.14)
daru!
daru-view!
data_tables!
distribution
ffi-rzmq
google_visualr
iruby
lazy_high_charts
nyaplot!
pry (~> 0.10)
pry-byebug
rake (~> 10.0)
rake
rbczmq
rspec (~> 3.4)
rubocop
Expand Down