iruby-plotly 1.0.0 → 1.0.1
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.
- checksums.yaml +4 -4
- data/{Readme.md → README.md} +0 -0
- data/lib/iruby-plotly.rb +12 -12
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c78a19d1f2ee3930828c96338828d5cd819936ffcca66aeb7909f515363bcc16
|
4
|
+
data.tar.gz: 5f785b8356a49cf902bbc4e92c056ffdbc7f17c210ccb67ccb7f62fb031e5f32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3fdfae49fb3dd003d9ed39492bc51b1e1b7229b8d77b2790edaacdb6a8d7faf05abf17024157b26e32b0a6e9f1eeb1c73b857e2a9f888c4ff42218c675f56ae
|
7
|
+
data.tar.gz: 005ef80c109775047a518a1ae654c981bb7731f8fe8c86b5647b1813bbdc6483063ed247617dfad7dbad3793baf72f00c2fd576051d39c659aa6a3574fcf827f
|
data/{Readme.md → README.md}
RENAMED
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
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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
|
-
|
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.
|
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
|
+
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
|
-
-
|
20
|
+
- README.md
|
21
21
|
- lib/iruby-plotly.rb
|
22
22
|
homepage: https://github.com/zach-capalbo/irub-plotly
|
23
23
|
licenses:
|