canvas_exporting 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b38fac7f2c28df5b99e5343bd8c8bc8162caad44
4
- data.tar.gz: 7c995d80dc80924432fbe90276de2668631c775f
3
+ metadata.gz: 79b33d4267f595dd29c93e9dc297d1a824bbaf81
4
+ data.tar.gz: 2f7412402f798bac834e00c4f1319917c5cc9c0b
5
5
  SHA512:
6
- metadata.gz: e39d4ac6ee367d8114898400725b855d484a2ad754d5512fc3a8a8e79c0a2eff4a781bfe823eac95fae34c0db07c299b2e655e28ddb3ef3be64cae5f3fc7eaf5
7
- data.tar.gz: 9adf5d7149a4133e0167d1aaaf46dfc0e9abcd754d5b610565da5d36e3da5d515eb51a12ffa7ce7ac1afca4d3762d17dc3df7bdffec0bef49507455963a2322a
6
+ metadata.gz: ed87a6458cef3875b96a6992615b090802a38902a821960b8bacb4196c5462a56e9c00dc696677b875cc2462552bdd101414cca057289751abdfa08025dee55e
7
+ data.tar.gz: 6599b85233978a33b6fb9ef7415cdff8fca5e1cde67b2eb0fa55ff344ed1da4dcbf31d67181ce4cd9275cd4788699fe16ba0f2172b6cedc5b493788f806b9fcd
@@ -30,7 +30,7 @@ module CanvasExporting
30
30
  @output_file = output_path + filename
31
31
 
32
32
  scale = params[:scale] || 2
33
- width = params[:width]
33
+ width = params[:width] || 400
34
34
  constr = params[:constr] || 'Chart'
35
35
 
36
36
  convert_args = convert_args({infile: @infile_tmp_file.path,
@@ -1,3 +1,3 @@
1
1
  module CanvasExporting
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -121,7 +121,7 @@
121
121
  exitCallback(result);
122
122
  };
123
123
 
124
- loadChart = function( string_in, outputType ) {
124
+ loadChart = function( string_in, outputType, width ) {
125
125
 
126
126
  try {
127
127
 
@@ -133,24 +133,20 @@
133
133
 
134
134
  container = $('<div>').appendTo(document.body);
135
135
  container.attr('id', 'chartContainer' );
136
- // var sizing = 'width: ' + width + 'px;';
137
- // $container.attr('style', sizing );
138
- //console.log(" json_in: " + JSON.parse(json_in) );
136
+
137
+ var sizing = 'width: ' + width + 'px;';
138
+ $("#chartContainer").attr('style', sizing)
139
+
139
140
  var json_in = JSON.parse(string_in);
140
- //json_in = JSON.parse(json_in);
141
141
  json_in["animationEnabled"] = false;
142
142
 
143
- //console.log ("just before canvas rendering");
144
-
145
143
  var chartTest = new CanvasJS.Chart("chartContainer", json_in );
146
- console.log ("complete the object create");
147
144
 
148
145
  var rs = chartTest.render();
149
- console.log ("completed the rendering");
150
146
 
151
147
  var htmlout = $('.canvasjs-chart-canvas')[0];
152
- //var imageData = htmlout.toDataURL(outType, 0.92 );
153
- var imageData = htmlout.toDataURL('image/'+outputType, 0.92 );
148
+ var imageData = htmlout.toDataURL(outputType, 0.92 );
149
+ //var imageData = htmlout.toDataURL('image/'+outputType, 0.92 );
154
150
  } catch (e) {
155
151
  console.log('ERROR: Cannot create CanvasJS object.');
156
152
  console.log('Error message: ' + e.number + " - " + e.message)
@@ -199,7 +195,7 @@
199
195
  }
200
196
  }
201
197
 
202
- var rs = page.evaluate(loadChart, input, outType );
198
+ var rs = page.evaluate(loadChart, input, outType, width );
203
199
 
204
200
  try {
205
201
  var result = rs["html"].split(",")
@@ -258,9 +254,6 @@
258
254
 
259
255
  args = mapCLArguments();
260
256
 
261
- //console.log("made it past the args mapper")
262
- //console.log("arguments: " + JSON.stringify(args));
263
- // set tmpDir, for output temporary files.
264
257
  if (args.tmpdir === undefined) {
265
258
  config.tmpDir = fs.workingDirectory + '/tmp';
266
259
  } else {
@@ -281,7 +274,6 @@
281
274
  startServer(args.host, args.port);
282
275
  } else {
283
276
  // presume commandline usage
284
- //console.log("calling the renderer");
285
277
  render(args, function (msg) {
286
278
  console.log(msg);
287
279
  phantom.exit();
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canvas_exporting
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - jeffolen4