charty 0.1.5.dev → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -5
- data/README.md +1 -1
- data/charty.gemspec +6 -0
- data/examples/sample_bokeh.ipynb +156 -0
- data/examples/sample_google_chart.ipynb +229 -68
- data/examples/sample_images/bar_bokeh.html +85 -0
- data/examples/sample_images/barh_bokeh.html +85 -0
- data/examples/sample_images/box_plot_bokeh.html +85 -0
- data/examples/sample_images/curve_bokeh.html +85 -0
- data/examples/sample_images/curve_with_function_bokeh.html +85 -0
- data/examples/sample_images/scatter_bokeh.html +85 -0
- data/lib/charty.rb +2 -1
- data/lib/charty/backends.rb +55 -0
- data/lib/charty/backends/bokeh.rb +61 -55
- data/lib/charty/backends/google_chart.rb +187 -129
- data/lib/charty/backends/gruff.rb +91 -83
- data/lib/charty/backends/plotly.rb +109 -0
- data/lib/charty/backends/pyplot.rb +96 -88
- data/lib/charty/backends/rubyplot.rb +82 -74
- data/lib/charty/plotter.rb +41 -33
- data/lib/charty/table.rb +44 -3
- data/lib/charty/table_adapters.rb +23 -0
- data/lib/charty/table_adapters/active_record_adapter.rb +55 -0
- data/lib/charty/table_adapters/daru_adapter.rb +34 -0
- data/lib/charty/table_adapters/datasets_adapter.rb +41 -0
- data/lib/charty/table_adapters/hash_adapter.rb +108 -0
- data/lib/charty/table_adapters/narray_adapter.rb +57 -0
- data/lib/charty/table_adapters/nmatrix_adapter.rb +57 -0
- data/lib/charty/version.rb +1 -1
- metadata +104 -5
- data/lib/charty/plotter_adapter.rb +0 -17
@@ -1,17 +0,0 @@
|
|
1
|
-
module Charty
|
2
|
-
class AdapterNotLoadedError < RuntimeError; end
|
3
|
-
|
4
|
-
class PlotterAdapter
|
5
|
-
def self.inherited(adapter_class)
|
6
|
-
@adapters ||= []
|
7
|
-
@adapters << adapter_class
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.create(adapter_name)
|
11
|
-
require "charty/backends/#{adapter_name}"
|
12
|
-
adapter = @adapters.find {|adapter| adapter::Name.to_s == adapter_name.to_s }
|
13
|
-
raise AdapterNotLoadedError.new("Adapter for '#{adapter_name}' is not found.") unless adapter
|
14
|
-
adapter.new
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|