asciinurse 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 +4 -4
- data/changelog.adoc +4 -0
- data/config/asciinurse.yml +1 -1
- data/examples/charts/browsers-googlecharts.json +2 -4
- data/examples/charts/googlecharts.html +26 -33
- data/examples/charts/googlecharts.pdf +0 -0
- data/examples/charts/highcharts.html +0 -4
- data/examples/charts/highcharts.pdf +0 -0
- data/lib/asciinurse/version.rb +1 -1
- data/resources/googlecharts/converter/template.html +7 -7
- data/resources/googlecharts/javascripts/global.js +4 -4
- data/resources/googlecharts/templates/chart.html.erb +1 -1
- data/resources/googlecharts/templates/charts/bar.json.erb +2 -4
- data/resources/googlecharts/templates/charts/column.json.erb +2 -4
- data/resources/googlecharts/templates/charts/donut.json.erb +4 -3
- data/resources/googlecharts/templates/charts/line.json.erb +2 -4
- data/resources/googlecharts/templates/charts/pie.json.erb +4 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6924d7f0b7929bf1a59f05156ca3d2e5a2ae2ad6
|
4
|
+
data.tar.gz: dd814acb3e544dbcbe81397d5840c6205623a23f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01ac99bb4a9d2258148b1ec2c7d3fbf39c2a2de3d4397f138941cb7733e51434d81f6765aa72a150cdf40b28eb7e3fde931e8e9c564c0453aa73d8b687cd0594
|
7
|
+
data.tar.gz: 63c795d782415bbe6aceb918ef6fbef8ed2d538cc8c0360bd3f676b4e8224e87e86dbcf0c601b6e685bb665a5eeb981ed3edd757970d6f290822599feddabd43
|
data/changelog.adoc
CHANGED
data/config/asciinurse.yml
CHANGED
@@ -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
|
-
|
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.
|
411
|
+
<script type='text/javascript' src='https://www.gstatic.com/charts/loader.js'></script>
|
412
412
|
<script type="text/javascript">
|
413
|
-
google.load("
|
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
|
-
|
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
|
-
|
500
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
632
|
-
|
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
|
data/lib/asciinurse/version.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
<html>
|
2
2
|
<head>
|
3
3
|
<meta charset="UTF-8">
|
4
|
-
<script type="text/javascript" src="https://www.
|
4
|
+
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
|
5
5
|
<script type="text/javascript">
|
6
|
-
google.load("
|
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("
|
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,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
|
-
|
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
|
-
|
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
|
-
|
6
|
-
|
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
|
-
|
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
|
-
|
6
|
-
|
5
|
+
title: <%= @title.to_json %>,
|
6
|
+
legend: {
|
7
|
+
position: 'labeled'
|
7
8
|
}
|
8
9
|
},
|
9
10
|
style: {
|