nyaplot 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,10 @@ require 'erb'
2
2
 
3
3
  module Nyaplot
4
4
 
5
- @@dep_libraries = {d3:'http://d3js.org/d3.v3.min'}
5
+ @@dep_libraries = {
6
+ d3:'http://d3js.org/d3.v3.min',
7
+ downloadable: 'http://cdn.rawgit.com/domitry/d3-downloadable/master/d3-downloadable'
8
+ }
6
9
  @@additional_libraries = {}
7
10
  @@extension_lists = []
8
11
 
@@ -3,7 +3,14 @@
3
3
  (function(){
4
4
  var render = function(){
5
5
  var model = <%= model %>
6
- Nyaplot.core.parse(model, '#vis-<%= id %>');
6
+ var id_name = '#vis-<%= id %>';
7
+ Nyaplot.core.parse(model, id_name);
8
+
9
+ require(['downloadable'], function(downloadable){
10
+ var svg = d3.select(id_name).select("svg");
11
+ if(!svg.empty())
12
+ svg.call(downloadable().filename('fig'));
13
+ });
7
14
  };
8
15
  if(window['Nyaplot']==undefined){
9
16
  window.addEventListener('load_nyaplot', render, false);
@@ -1,3 +1,3 @@
1
1
  module Nyaplot
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nyaplot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naoki Nishida
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-23 00:00:00.000000000 Z
11
+ date: 2015-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -79,6 +79,7 @@ extensions: []
79
79
  extra_rdoc_files: []
80
80
  files:
81
81
  - ".gitignore"
82
+ - ".gitmodules"
82
83
  - ".rspec"
83
84
  - ".travis.yml"
84
85
  - Gemfile