asciinurse 0.1.3 → 0.1.4

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: 97bf41adb8b186ff9bafd3c89ee1badbb63bd2af
4
- data.tar.gz: 619896f4e245f9c2a3f617d00e77c8c65798f482
3
+ metadata.gz: 6924d7f0b7929bf1a59f05156ca3d2e5a2ae2ad6
4
+ data.tar.gz: dd814acb3e544dbcbe81397d5840c6205623a23f
5
5
  SHA512:
6
- metadata.gz: 76fdcdd139564d6573ec8669073b3d3d9bf428191db5a980c655fc977d936146e72680973c7b02190bae6007296bb267f9911d544517adda3f05f656c88b3b34
7
- data.tar.gz: 39ed43de7ea4d5afda27f8ce9e4a8c85485d01a79d897be27dc03772d0622ce97383ed221d1a999efdd4b01e3e9a0f1b9d76057daa2acc9d87c5f4600c97ffbb
6
+ metadata.gz: 01ac99bb4a9d2258148b1ec2c7d3fbf39c2a2de3d4397f138941cb7733e51434d81f6765aa72a150cdf40b28eb7e3fde931e8e9c564c0453aa73d8b687cd0594
7
+ data.tar.gz: 63c795d782415bbe6aceb918ef6fbef8ed2d538cc8c0360bd3f676b4e8224e87e86dbcf0c601b6e685bb665a5eeb981ed3edd757970d6f290822599feddabd43
data/changelog.adoc CHANGED
@@ -1,5 +1,9 @@
1
1
  = CHANGELOG
2
2
 
3
+ == Version 0.1.4
4
+
5
+ - Fixes in google chart engine
6
+
3
7
  == Version 0.1.3
4
8
 
5
9
  - Use a blank title instead of the default one
@@ -15,7 +15,7 @@ charts:
15
15
  width: 100%
16
16
  height: 600px
17
17
  include:
18
- - https://www.google.com/jsapi
18
+ - https://www.gstatic.com/charts/loader.js
19
19
  - global.js
20
20
  convert:
21
21
  file: googlecharts-convert.js
@@ -1,5 +1,5 @@
1
1
  {
2
- type: google.visualization.PieChart,
2
+ type: 'google.visualization.PieChart',
3
3
  data: google.visualization.arrayToDataTable([
4
4
  ["Browser"," Brands"],
5
5
  ["Internet Explorer",56.33],
@@ -10,9 +10,7 @@
10
10
  ["Unknown",0.2]
11
11
  ]),
12
12
  options: {
13
- chart: {
14
- title: "Inline Chart"
15
- }
13
+ title: "Chart configured with JSON file"
16
14
  },
17
15
  style: {
18
16
  width: "100%",
@@ -408,17 +408,16 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
408
408
  .hide-for-print{display:none!important}
409
409
  .show-for-print{display:inherit!important}}
410
410
  </style>
411
- <script type='text/javascript' src='https://www.google.com/jsapi'></script>
411
+ <script type='text/javascript' src='https://www.gstatic.com/charts/loader.js'></script>
412
412
  <script type="text/javascript">
413
- google.load("visualization", "1.1", {packages:["corechart", "bar", "line"]});
414
- var drawChart = function(id, config) {
413
+ google.charts.load("current", {packages: ["corechart", "bar", "line"]});
414
+ var drawChart = function (id, config) {
415
415
  var div = document.getElementById(id)
416
416
  div.style.width = config['style']['width']
417
417
  div.style.height = config['style']['height']
418
- var chart = new config['type'](div);
418
+ var chart = eval("new " + config['type'] + "(div)");
419
419
  chart.draw(config['data'], config['options']);
420
420
  }
421
-
422
421
  </script>
423
422
  </head>
424
423
  <body class="article">
@@ -454,9 +453,9 @@ var drawChart = function(id, config) {
454
453
  </div>
455
454
  <div id='chart_1'></div>
456
455
  <script type="text/javascript">
457
- google.setOnLoadCallback(function () {
456
+ google.charts.setOnLoadCallback(function () {
458
457
  drawChart('chart_1', {
459
- type: google.visualization.PieChart,
458
+ type: 'google.visualization.PieChart',
460
459
  data: google.visualization.arrayToDataTable([
461
460
  ["Browser"," Brands"],
462
461
  ["Internet Explorer",56.33],
@@ -467,9 +466,7 @@ var drawChart = function(id, config) {
467
466
  ["Unknown",0.2]
468
467
  ]),
469
468
  options: {
470
- chart: {
471
- title: "Inline Chart"
472
- }
469
+ title: "Chart configured with JSON file"
473
470
  },
474
471
  style: {
475
472
  width: "100%",
@@ -491,13 +488,14 @@ chart::browsers.csv[type=pie]</code></pre>
491
488
  </div>
492
489
  <div id='chart_2'></div>
493
490
  <script type="text/javascript">
494
- google.setOnLoadCallback(function () {
491
+ google.charts.setOnLoadCallback(function () {
495
492
  drawChart('chart_2', {
496
- type: google.visualization.PieChart,
493
+ type: 'google.visualization.PieChart',
497
494
  data: google.visualization.arrayToDataTable([["Browser"," Brands"],["Internet Explorer",56.33],["Chrome",24.03],["Firefox",10.38],["Safari",4.77],["Opera",0.91],["Unknown",0.2]]),
498
495
  options: {
499
- chart: {
500
- title: "Browser market shares January, 2015 to May, 2015"
496
+ title: "Browser market shares January, 2015 to May, 2015",
497
+ legend: {
498
+ position: 'labeled'
501
499
  }
502
500
  },
503
501
  style: {
@@ -516,14 +514,12 @@ chart::indicators.csv[type=bar]</code></pre>
516
514
  </div>
517
515
  <div id='chart_3'></div>
518
516
  <script type="text/javascript">
519
- google.setOnLoadCallback(function () {
517
+ google.charts.setOnLoadCallback(function () {
520
518
  drawChart('chart_3', {
521
- type: google.charts.Bar,
519
+ type: 'google.charts.Bar',
522
520
  data: google.visualization.arrayToDataTable([["Month "," Total"],["Jan ",29.9],["Feb ",71.5],["Mar ",106.4],["Apr ",129.2],["May ",144.0],["Jun ",176.0],["Jul ",135.6],["Aug ",148.5],["Sep ",216.4],["Oct ",194.1],["Nov ",95.6],["Dec ",54.4]]),
523
521
  options: {
524
- chart: {
525
- title: "Bar Chart"
526
- },
522
+ title: "Bar Chart",
527
523
  hAxis: {
528
524
  title: "Jan ",
529
525
  minValue: 0
@@ -550,14 +546,12 @@ chart::indicators.csv[type=column]</code></pre>
550
546
  </div>
551
547
  <div id='chart_4'></div>
552
548
  <script type="text/javascript">
553
- google.setOnLoadCallback(function () {
549
+ google.charts.setOnLoadCallback(function () {
554
550
  drawChart('chart_4', {
555
- type: google.charts.Bar,
551
+ type: 'google.charts.Bar',
556
552
  data: google.visualization.arrayToDataTable([["Month "," Total"],["Jan ",29.9],["Feb ",71.5],["Mar ",106.4],["Apr ",129.2],["May ",144.0],["Jun ",176.0],["Jul ",135.6],["Aug ",148.5],["Sep ",216.4],["Oct ",194.1],["Nov ",95.6],["Dec ",54.4]]),
557
553
  options: {
558
- chart: {
559
- title: "Column Chart"
560
- },
554
+ title: "Column Chart",
561
555
  hAxis: {
562
556
  title: "Jan ",
563
557
  minValue: 0
@@ -584,14 +578,12 @@ chart::indicators.csv[type=line]</code></pre>
584
578
  </div>
585
579
  <div id='chart_5'></div>
586
580
  <script type="text/javascript">
587
- google.setOnLoadCallback(function () {
581
+ google.charts.setOnLoadCallback(function () {
588
582
  drawChart('chart_5', {
589
- type: google.charts.Line,
583
+ type: 'google.charts.Line',
590
584
  data: google.visualization.arrayToDataTable([["Month "," Total"],["Jan ",29.9],["Feb ",71.5],["Mar ",106.4],["Apr ",129.2],["May ",144.0],["Jun ",176.0],["Jul ",135.6],["Aug ",148.5],["Sep ",216.4],["Oct ",194.1],["Nov ",95.6],["Dec ",54.4]]),
591
585
  options: {
592
- chart: {
593
- title: "Line Chart"
594
- }
586
+ title: "Line Chart"
595
587
  },
596
588
  style: {
597
589
  width: "100%",
@@ -623,13 +615,14 @@ Unknown, 0.2
623
615
  </div>
624
616
  <div id='chart_6'></div>
625
617
  <script type="text/javascript">
626
- google.setOnLoadCallback(function () {
618
+ google.charts.setOnLoadCallback(function () {
627
619
  drawChart('chart_6', {
628
- type: google.visualization.PieChart,
620
+ type: 'google.visualization.PieChart',
629
621
  data: google.visualization.arrayToDataTable([["Browser"," Brands"],["Internet Explorer",56.33],["Chrome",24.03],["Firefox",10.38],["Safari",4.77],["Opera",0.91],["Unknown",0.2]]),
630
622
  options: {
631
- chart: {
632
- title: "Inline Chart"
623
+ title: "Inline Chart",
624
+ legend: {
625
+ position: 'labeled'
633
626
  }
634
627
  },
635
628
  style: {
Binary file
@@ -874,9 +874,7 @@ chart::browsers.csv[type=pie]</code></pre>
874
874
  type: 'pie'
875
875
  },
876
876
  title: {
877
-
878
877
  text: "Browser market shares January, 2015 to May, 2015"
879
-
880
878
  },
881
879
  tooltip: {
882
880
  pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
@@ -1050,9 +1048,7 @@ Unknown, 0.2
1050
1048
  type: 'pie'
1051
1049
  },
1052
1050
  title: {
1053
-
1054
1051
  text: "Inline Chart"
1055
-
1056
1052
  },
1057
1053
  tooltip: {
1058
1054
  pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
Binary file
@@ -1,3 +1,3 @@
1
1
  module Asciinurse
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
@@ -1,14 +1,14 @@
1
1
  <html>
2
2
  <head>
3
3
  <meta charset="UTF-8">
4
- <script type="text/javascript" src="https://www.google.com/jsapi"></script>
4
+ <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
5
5
  <script type="text/javascript">
6
- google.load("visualization", "1.1", {packages: ["corechart", "bar", "line"]});
6
+ google.charts.load("current", {packages: ["corechart", "bar", "line"]});
7
7
  var drawChart = function (id, config) {
8
- var div = document.getElementById(id)
9
- div.style.width = config['style']['width']
10
- div.style.height = config['style']['height']
11
- var chart = new config['type'](div);
8
+ var div = document.getElementById(id);
9
+ div.style.width = config['style']['width'];
10
+ div.style.height = config['style']['height'];
11
+ var chart = eval("new " + config['type'] + "(div)");
12
12
  chart.draw(config['data'], config['options']);
13
13
  }
14
14
  </script>
@@ -16,7 +16,7 @@
16
16
  <body>
17
17
  <div id="chart"></div>
18
18
  <script type="text/javascript">
19
- google.setOnLoadCallback(function () {
19
+ google.charts.setOnLoadCallback(function () {
20
20
  drawChart('chart', ${CONFIG})
21
21
  })
22
22
  </script>
@@ -1,8 +1,8 @@
1
- google.load("visualization", "1.1", {packages:["corechart", "bar", "line"]});
2
- var drawChart = function(id, config) {
1
+ google.charts.load("current", {packages: ["corechart", "bar", "line"]});
2
+ var drawChart = function (id, config) {
3
3
  var div = document.getElementById(id)
4
4
  div.style.width = config['style']['width']
5
5
  div.style.height = config['style']['height']
6
- var chart = new config['type'](div);
6
+ var chart = eval("new " + config['type'] + "(div)");
7
7
  chart.draw(config['data'], config['options']);
8
- }
8
+ }
@@ -1,6 +1,6 @@
1
1
  <div id='<%= id %>'></div>
2
2
  <script type="text/javascript">
3
- google.setOnLoadCallback(function () {
3
+ google.charts.setOnLoadCallback(function () {
4
4
  drawChart('<%= id %>', <%= config %>)
5
5
  })
6
6
  </script>
@@ -1,10 +1,8 @@
1
1
  {
2
- type: google.charts.Bar,
2
+ type: 'google.charts.Bar',
3
3
  data: google.visualization.arrayToDataTable(<%= @csv.to_json %>),
4
4
  options: {
5
- chart: {
6
- title: <%= @title.to_json %>
7
- },
5
+ title: <%= @title.to_json %>,
8
6
  hAxis: {
9
7
  title: <%= @header.first.to_json %>,
10
8
  minValue: 0
@@ -1,10 +1,8 @@
1
1
  {
2
- type: google.charts.Bar,
2
+ type: 'google.charts.Bar',
3
3
  data: google.visualization.arrayToDataTable(<%= @csv.to_json %>),
4
4
  options: {
5
- chart: {
6
- title: <%= @title.to_json %>
7
- },
5
+ title: <%= @title.to_json %>,
8
6
  hAxis: {
9
7
  title: <%= @header.first.to_json %>,
10
8
  minValue: 0
@@ -1,9 +1,10 @@
1
1
  {
2
- type: google.visualization.PieChart,
2
+ type: 'google.visualization.PieChart',
3
3
  data: google.visualization.arrayToDataTable(<%= @csv.to_json %>),
4
4
  options: {
5
- chart: {
6
- title: <%= @title.to_json %>
5
+ title: <%= @title.to_json %>,
6
+ legend: {
7
+ position: 'labeled'
7
8
  },
8
9
  pieHole: 0.4
9
10
  },
@@ -1,10 +1,8 @@
1
1
  {
2
- type: google.charts.Line,
2
+ type: 'google.charts.Line',
3
3
  data: google.visualization.arrayToDataTable(<%= @csv.to_json %>),
4
4
  options: {
5
- chart: {
6
- title: <%= @title.to_json %>
7
- }
5
+ title: <%= @title.to_json %>
8
6
  },
9
7
  style: {
10
8
  width: <%= @width.to_json %>,
@@ -1,9 +1,10 @@
1
1
  {
2
- type: google.visualization.PieChart,
2
+ type: 'google.visualization.PieChart',
3
3
  data: google.visualization.arrayToDataTable(<%= @csv.to_json %>),
4
4
  options: {
5
- chart: {
6
- title: <%= @title.to_json %>
5
+ title: <%= @title.to_json %>,
6
+ legend: {
7
+ position: 'labeled'
7
8
  }
8
9
  },
9
10
  style: {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciinurse
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
  - Ataxexe