plotlyjs-ruby 0.1.3 → 0.1.4

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: 6dfeaaac593a469ac699cab7c40f1eb814a22aebfd65f16860e658f9128b1c25
4
- data.tar.gz: ae108f8493c8593d2b3f7d4a7b54e5203a6080abb934c21355bdd781e5023724
3
+ metadata.gz: 11eedef03cecfbf3bf36ace58ada3970b107617d5dd717fdda477775acfa8e37
4
+ data.tar.gz: bb3256dd8147a96913323821de39b4ce6a57e9c7451b9a1ec69193927c3fb451
5
5
  SHA512:
6
- metadata.gz: 602e28c90c17073db1c2ac9c335483459ae2bcc045e04b1ebf0d735e8f7aed789c081770aa4b13bbceb5da21052647f5fce20a590dbf820c654a07d3b1d486c4
7
- data.tar.gz: fbd2e219e402f681b6282b7e573942e99645a61d100777ded72d48022c29dd79949a6fc91a322f6af2ddd84c6010598acf58c18a7ee9d67aa4d5041ec3f229ff
6
+ metadata.gz: 57aec7e1bbd4157074252372607272f5bcf458311c43e2484a9289dbee948d707fdc11caf558c7e5f4d617b404c02c93416b25ad7644a922a044850709e899ed
7
+ data.tar.gz: e0a1021c304196f097009cfbad65eb65d65c1a5650971bff7e2cd1485ea1aba783b3babcd2deb650b11f48c4925214cf386d5ac02c860b9bb9b35a090b632fbd
@@ -1,3 +1,3 @@
1
1
  module Plotlyjs
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
data/lib/plotlyjs-ruby.rb CHANGED
@@ -33,9 +33,15 @@ module Plotlyjs
33
33
  html = <<~HTML
34
34
  <div id="#{element_id}"></div>
35
35
  <script>
36
- if ("Plotly" in window) {
37
- #{createjs}
38
- }
36
+ (function() {
37
+ var createChart = function() { #{createjs} };
38
+
39
+ if ("Plotly" in window) {
40
+ createChart();
41
+ } else {
42
+ window.addEventListener('load', createChart);
43
+ };
44
+ })();
39
45
  </script>
40
46
  HTML
41
47
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plotlyjs-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - nightswinger
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-28 00:00:00.000000000 Z
11
+ date: 2024-12-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A lightweight and straightforward Ruby wrapper for Plotly.js, enabling
14
14
  developers to create interactive, high-quality data visualizations effortlessly.