rbplotly 0.1.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +64 -0
  3. data/LICENSE.txt +1 -1
  4. data/README.md +177 -39
  5. data/lib/plotly/assets/plotly.min.js +3620 -0
  6. data/lib/plotly/attributes.rb +221 -0
  7. data/lib/plotly/figure.rb +236 -0
  8. data/lib/plotly/html.rb +150 -0
  9. data/lib/plotly/plot.rb +11 -40
  10. data/lib/plotly/schema/plot-schema.json +57234 -0
  11. data/lib/plotly/schema.rb +96 -0
  12. data/lib/plotly/serializer.rb +49 -0
  13. data/lib/plotly/subplots.rb +118 -0
  14. data/lib/plotly/version.rb +7 -1
  15. data/lib/plotly.rb +21 -0
  16. data/lib/rbplotly.rb +3 -4
  17. metadata +34 -162
  18. data/.gitignore +0 -11
  19. data/.rspec +0 -2
  20. data/.rubocop.yml +0 -22
  21. data/.travis.yml +0 -6
  22. data/CODE_OF_CONDUCT.md +0 -49
  23. data/Gemfile +0 -4
  24. data/Guardfile +0 -12
  25. data/Rakefile +0 -9
  26. data/bin/console +0 -14
  27. data/bin/setup +0 -8
  28. data/docs/images/line_chart.png +0 -0
  29. data/examples/basic_bar_chart.ipynb +0 -82
  30. data/examples/basic_histogram.ipynb +0 -78
  31. data/examples/basic_pie_chart.ipynb +0 -84
  32. data/examples/grouped_bar_chart.ipynb +0 -89
  33. data/examples/heatmaps.ipynb +0 -89
  34. data/examples/line_and_scatter_plots.ipynb +0 -227
  35. data/examples/stacked_bar_chart.ipynb +0 -89
  36. data/lib/plotly/axis.rb +0 -15
  37. data/lib/plotly/castable.rb +0 -20
  38. data/lib/plotly/client.rb +0 -40
  39. data/lib/plotly/data.rb +0 -22
  40. data/lib/plotly/exportable.rb +0 -23
  41. data/lib/plotly/layout.rb +0 -33
  42. data/lib/plotly/offline/exportable.rb +0 -31
  43. data/lib/plotly/offline/html.rb +0 -46
  44. data/lib/plotly/offline/plotly.min.js +0 -59
  45. data/lib/plotly/offline/templates/body.erb +0 -26
  46. data/lib/plotly/offline/templates/plot.erb +0 -12
  47. data/lib/plotly/util.rb +0 -11
  48. data/rbplotly.gemspec +0 -31
@@ -1,26 +0,0 @@
1
- <% if @embedded %>
2
- <script>
3
- requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min'] }})
4
- </script>
5
- <% else %>
6
- <script>
7
- <%= LOCAL_PLOTLY_JS %>
8
- </script>
9
- <% end %>
10
-
11
- <div id="<%= @id %>" style="height: 100%; width: 100%;"></div>
12
-
13
- <script>
14
- <% if @embedded %> require(['plotly'], function(Plotly) { <% end %>
15
- Plotly.newPlot(
16
- <%= "'#{@id}'" %>,
17
- <%= @data.to_json %>,
18
- <%= @layout.to_json %>,
19
- <%= @config.to_json %>
20
- )
21
-
22
- window.addEventListener('resize', function() {
23
- Plotly.Plots.resize(document.getElementById('<%= @id %>'))
24
- })
25
- <% if @embedded %> }) <% end %>
26
- </script>
@@ -1,12 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>Created with Plot.ly</title>
6
- </head>
7
- <body>
8
-
9
- <%= ERB.new(template_for(:body)).result(binding) %>
10
-
11
- </body>
12
- </html>
data/lib/plotly/util.rb DELETED
@@ -1,11 +0,0 @@
1
- class Object
2
- def convert_to(clazz)
3
- if is_a?(Hash)
4
- clazz.new(self)
5
- elsif !is_a?(clazz)
6
- raise # @todo raise type error
7
- else
8
- self
9
- end
10
- end
11
- end
data/rbplotly.gemspec DELETED
@@ -1,31 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'plotly/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = 'rbplotly'
8
- spec.version = Plotly::VERSION
9
- spec.authors = ['y4ashida']
10
- spec.email = ['y4ashida@gmail.com']
11
-
12
- spec.summary = 'Plot.ly API client and Interface to plotly.js.'
13
- spec.homepage = 'https://github.com/y4ashida/rbplotly'
14
- spec.license = 'MIT'
15
-
16
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec)/}) }
17
- spec.bindir = 'exe'
18
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
- spec.require_paths = ['lib']
20
-
21
- spec.add_dependency 'faraday', '~> 0.9'
22
- spec.add_dependency 'uuidtools', '~> 2.1'
23
- spec.add_dependency 'launchy', '~> 2.4'
24
-
25
- spec.add_development_dependency 'bundler', '~> 1.12'
26
- spec.add_development_dependency 'rake', '~> 10.0'
27
- spec.add_development_dependency 'rspec', '~> 3.5'
28
- spec.add_development_dependency 'guard-rspec', '~> 4.7'
29
- spec.add_development_dependency 'guard-rubocop', '~> 1.2'
30
- spec.add_development_dependency 'yard', '~> 0.9'
31
- end