iruby-plotly 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 39e21b7352c532c23c7586e559e752584932b310a07bf9f62ab7cbec141af0ec
4
- data.tar.gz: 2fea50df0c43deba80f85c1fb33fda74957cc441c2571b613eed9a9b89bc503b
3
+ metadata.gz: c78a19d1f2ee3930828c96338828d5cd819936ffcca66aeb7909f515363bcc16
4
+ data.tar.gz: 5f785b8356a49cf902bbc4e92c056ffdbc7f17c210ccb67ccb7f62fb031e5f32
5
5
  SHA512:
6
- metadata.gz: 55afce27d77044f5ccdc4eb358b485f14a90466c782edbc7ad4263071b00ab2f93d01811581367baee1e0162878c728f2c78ce99b202a9b3be69f4ba1c15b820
7
- data.tar.gz: 980506987c4b727d395125c99cf357c87516b0402f4b493cb8aeb58556ef219d74af14831881fb26cbfee404546e4e78d855fd17c5c734d386d5118e5831e197
6
+ metadata.gz: f3fdfae49fb3dd003d9ed39492bc51b1e1b7229b8d77b2790edaacdb6a8d7faf05abf17024157b26e32b0a6e9f1eeb1c73b857e2a9f888c4ff42218c675f56ae
7
+ data.tar.gz: 005ef80c109775047a518a1ae654c981bb7731f8fe8c86b5647b1813bbdc6483063ed247617dfad7dbad3793baf72f00c2fd576051d39c659aa6a3574fcf827f
File without changes
data/lib/iruby-plotly.rb CHANGED
@@ -10,19 +10,19 @@ module IRuby
10
10
  end
11
11
 
12
12
  def self.plot(data, options = {})
13
- if data.respond_to?(:keys)
14
- options = options.merge(data)
15
- if data.include?(:xy) then
16
- data = data.clone
17
- data[:x] = data[:xy].map(&:first)
18
- data[:y] = data[:xy].map(&:last)
19
- data.delete(:xy)
20
- end
21
- data = [data]
22
- elsif not data.first.respond_to?(:keys)
23
- data = [{y:data, x:(1..data.size).to_a}.merge(options)]
13
+ if data.respond_to?(:keys)
14
+ options = options.merge(data)
15
+ if data.include?(:xy) then
16
+ data = data.clone
17
+ data[:x] = data[:xy].map(&:first)
18
+ data[:y] = data[:xy].map(&:last)
19
+ data.delete(:xy)
24
20
  end
25
- IRuby.convert({data: data, layout: options.merge({height: DEFAULT_PLOT_HEIGHT})}, mime: "application/vnd.plotly.v1+json")
21
+ data = [data]
22
+ elsif not data.first.respond_to?(:keys)
23
+ data = [{y:data, x:(1..data.size).to_a}.merge(options)]
24
+ end
25
+ IRuby.convert({data: data, layout: {height: DEFAULT_PLOT_HEIGHT}.merge(options)}, mime: "application/vnd.plotly.v1+json")
26
26
  end
27
27
 
28
28
  def self.plotly(data, layout = {})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iruby-plotly
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zach Capalbo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-11 00:00:00.000000000 Z
11
+ date: 2019-05-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Plot with IRuby
14
14
  email: zach.geek@gmail.com
@@ -17,7 +17,7 @@ extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
19
  - LICENSE
20
- - Readme.md
20
+ - README.md
21
21
  - lib/iruby-plotly.rb
22
22
  homepage: https://github.com/zach-capalbo/irub-plotly
23
23
  licenses: