matplotlib 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/matplotlib/iruby.rb +22 -11
- data/lib/matplotlib/version.rb +1 -1
- 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: 16136e1e95a540d319e3bad7168e37ee5d6207ce8cdd029becc8586cdb696873
|
4
|
+
data.tar.gz: d9d5286651db26478890d6e33673b2740fb600a7f9f92190502914438486138e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf5e6af1f4683a8f547b2371779bbb9e5441f05f8a4cca3b2e5c7f16a628fa1a92e204038125bdf700bf7e922181590a357732140ca9623d30a09885f2efa345
|
7
|
+
data.tar.gz: 9f07a63560098806d0c570915daa39bde833713be2568d0bbee79fcd4cd93fa43d8670fc1386ec5b2f03471027c674efecb66cfebe26307f1e108fbe5d6508b1
|
data/lib/matplotlib/iruby.rb
CHANGED
@@ -65,13 +65,16 @@ module Matplotlib
|
|
65
65
|
@session.send(:publish, :error, content)
|
66
66
|
end
|
67
67
|
|
68
|
+
unless result.nil? || msg[:content]['silent']
|
69
|
+
@session.send(:publish, :execute_result,
|
70
|
+
data: ::IRuby::Display.display(result),
|
71
|
+
metadata: {},
|
72
|
+
execution_count: @execution_count)
|
73
|
+
end
|
74
|
+
|
68
75
|
trigger_event(:post_execute)
|
69
76
|
|
70
77
|
@session.send(:reply, :execute_reply, content)
|
71
|
-
@session.send(:publish, :execute_result,
|
72
|
-
data: ::IRuby::Display.display(result),
|
73
|
-
metadata: {},
|
74
|
-
execution_count: @execution_count) unless result.nil? || msg[:content]['silent']
|
75
78
|
end
|
76
79
|
end
|
77
80
|
|
@@ -211,13 +214,24 @@ module Matplotlib
|
|
211
214
|
# Temporally monky-patching IRuby kernel to enable flushing and closing figures.
|
212
215
|
# TODO: Make this feature a pull-request for sciruby/iruby.
|
213
216
|
kernel = ::IRuby::Kernel.instance
|
214
|
-
kernel.extend HookExtension
|
217
|
+
kernel.extend HookExtension unless kernel.respond_to?(:events)
|
215
218
|
if backend == GUI_BACKEND_MAP[:inline]
|
216
|
-
kernel.
|
219
|
+
if kernel.respond_to?(:register_event)
|
220
|
+
kernel.register_event(:post_execute, method(:flush_figures))
|
221
|
+
else
|
222
|
+
@post_execute_func = kernel.events.register(:post_execute, &method(:flush_figures))
|
223
|
+
end
|
224
|
+
|
217
225
|
# TODO: save original rcParams and overwrite rcParams with IRuby-specific configuration
|
218
226
|
new_backend_name = :inline
|
219
227
|
else
|
220
|
-
kernel.
|
228
|
+
if kernel.respond_to?(:unregister_event)
|
229
|
+
kernel.unregister_event(:post_execute, method(:flush_figures))
|
230
|
+
elsif @post_execute_func
|
231
|
+
kernel.events.unregister(:post_execute, @post_execute_func)
|
232
|
+
@post_execute_func = nil
|
233
|
+
end
|
234
|
+
|
221
235
|
# TODO: restore saved original rcParams
|
222
236
|
new_backend_name = :not_inline
|
223
237
|
end
|
@@ -242,10 +256,7 @@ module Matplotlib
|
|
242
256
|
kernel = ::IRuby::Kernel.instance
|
243
257
|
gcf.get_all_fig_managers.each do |fig_manager|
|
244
258
|
data = ::IRuby::Display.display(fig_manager.canvas.figure)
|
245
|
-
kernel.session.send(:publish, :
|
246
|
-
data: data,
|
247
|
-
metadata: {},
|
248
|
-
execution_count: kernel.instance_variable_get(:@execution_count))
|
259
|
+
kernel.session.send(:publish, :display_data, data: data, metadata: {})
|
249
260
|
end
|
250
261
|
ensure
|
251
262
|
unless gcf.get_all_fig_managers.nil?
|
data/lib/matplotlib/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
MATPLOTLIB_VERSION = "1.
|
1
|
+
MATPLOTLIB_VERSION = "1.2.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: matplotlib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenta Murata
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pycall
|
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
131
|
requirements: []
|
132
|
-
rubygems_version: 3.
|
132
|
+
rubygems_version: 3.2.3
|
133
133
|
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: matplotlib wrapper for Ruby
|