nvd3-rails 0.0.1 → 0.0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +3 -0
  3. data/README.md +7 -71
  4. data/lib/nvd3/rails/version.rb +1 -1
  5. data/nvd3-rails.gemspec +3 -3
  6. metadata +8 -111
  7. data/vendor/assets/javascripts/nvd3/.git.sample/HEAD +0 -1
  8. data/vendor/assets/javascripts/nvd3/.git.sample/config +0 -13
  9. data/vendor/assets/javascripts/nvd3/.git.sample/description +0 -1
  10. data/vendor/assets/javascripts/nvd3/.git.sample/hooks/applypatch-msg.sample +0 -15
  11. data/vendor/assets/javascripts/nvd3/.git.sample/hooks/commit-msg.sample +0 -24
  12. data/vendor/assets/javascripts/nvd3/.git.sample/hooks/post-update.sample +0 -8
  13. data/vendor/assets/javascripts/nvd3/.git.sample/hooks/pre-applypatch.sample +0 -14
  14. data/vendor/assets/javascripts/nvd3/.git.sample/hooks/pre-commit.sample +0 -50
  15. data/vendor/assets/javascripts/nvd3/.git.sample/hooks/pre-push.sample +0 -53
  16. data/vendor/assets/javascripts/nvd3/.git.sample/hooks/pre-rebase.sample +0 -169
  17. data/vendor/assets/javascripts/nvd3/.git.sample/hooks/prepare-commit-msg.sample +0 -36
  18. data/vendor/assets/javascripts/nvd3/.git.sample/hooks/update.sample +0 -128
  19. data/vendor/assets/javascripts/nvd3/.git.sample/index +0 -0
  20. data/vendor/assets/javascripts/nvd3/.git.sample/info/exclude +0 -6
  21. data/vendor/assets/javascripts/nvd3/.git.sample/logs/HEAD +0 -1
  22. data/vendor/assets/javascripts/nvd3/.git.sample/logs/refs/heads/master +0 -1
  23. data/vendor/assets/javascripts/nvd3/.git.sample/logs/refs/remotes/origin/HEAD +0 -1
  24. data/vendor/assets/javascripts/nvd3/.git.sample/objects/pack/pack-babbb312d58dd7f03870b530a1b9a84c80918be3.idx +0 -0
  25. data/vendor/assets/javascripts/nvd3/.git.sample/objects/pack/pack-babbb312d58dd7f03870b530a1b9a84c80918be3.pack +0 -0
  26. data/vendor/assets/javascripts/nvd3/.git.sample/packed-refs +0 -5
  27. data/vendor/assets/javascripts/nvd3/.git.sample/refs/heads/master +0 -1
  28. data/vendor/assets/javascripts/nvd3/.git.sample/refs/remotes/origin/HEAD +0 -1
  29. data/vendor/assets/javascripts/nvd3/build.bat +0 -6
  30. data/vendor/assets/javascripts/nvd3/deprecated/bar.html +0 -198
  31. data/vendor/assets/javascripts/nvd3/deprecated/bar.js +0 -250
  32. data/vendor/assets/javascripts/nvd3/deprecated/charts/cumulativeLineChart.js +0 -174
  33. data/vendor/assets/javascripts/nvd3/deprecated/charts/discreteBarChart.js +0 -157
  34. data/vendor/assets/javascripts/nvd3/deprecated/charts/lineChart.js +0 -159
  35. data/vendor/assets/javascripts/nvd3/deprecated/charts/lineChartDaily.js +0 -168
  36. data/vendor/assets/javascripts/nvd3/deprecated/charts/stackedAreaChart.js +0 -177
  37. data/vendor/assets/javascripts/nvd3/deprecated/cumulativeLine.html +0 -171
  38. data/vendor/assets/javascripts/nvd3/deprecated/cumulativeLine.js +0 -334
  39. data/vendor/assets/javascripts/nvd3/deprecated/discreteBarChartWithEnabledTooltip.html +0 -129
  40. data/vendor/assets/javascripts/nvd3/deprecated/discreteBarChartWithEnabledTooltip.js +0 -222
  41. data/vendor/assets/javascripts/nvd3/deprecated/discreteBarWithAxes.html +0 -172
  42. data/vendor/assets/javascripts/nvd3/deprecated/discreteBarWithAxes.js +0 -152
  43. data/vendor/assets/javascripts/nvd3/deprecated/lineChart-old.html +0 -83
  44. data/vendor/assets/javascripts/nvd3/deprecated/lineChartDaily.html +0 -109
  45. data/vendor/assets/javascripts/nvd3/deprecated/linePlusBar.html +0 -173
  46. data/vendor/assets/javascripts/nvd3/deprecated/linePlusBar.js +0 -250
  47. data/vendor/assets/javascripts/nvd3/deprecated/lineWithFocus.html +0 -137
  48. data/vendor/assets/javascripts/nvd3/deprecated/lineWithFocus.js +0 -354
  49. data/vendor/assets/javascripts/nvd3/deprecated/lineWithFourAxes.html +0 -144
  50. data/vendor/assets/javascripts/nvd3/deprecated/lineWithFourAxes.js +0 -218
  51. data/vendor/assets/javascripts/nvd3/deprecated/lineWithLegend.html +0 -142
  52. data/vendor/assets/javascripts/nvd3/deprecated/lineWithLegend.js +0 -176
  53. data/vendor/assets/javascripts/nvd3/deprecated/monthendAxis.html +0 -99
  54. data/vendor/assets/javascripts/nvd3/deprecated/multiBarHorizontalWithLegend.html +0 -258
  55. data/vendor/assets/javascripts/nvd3/deprecated/multiBarHorizontalWithLegend.js +0 -226
  56. data/vendor/assets/javascripts/nvd3/deprecated/multiBarWithLegend.html +0 -162
  57. data/vendor/assets/javascripts/nvd3/deprecated/multiBarWithLegend.js +0 -249
  58. data/vendor/assets/javascripts/nvd3/deprecated/pie.js +0 -263
  59. data/vendor/assets/javascripts/nvd3/deprecated/scatterChart.html +0 -110
  60. data/vendor/assets/javascripts/nvd3/deprecated/scatterChart.js +0 -294
  61. data/vendor/assets/javascripts/nvd3/deprecated/scatterFisheyeChart.js +0 -418
  62. data/vendor/assets/javascripts/nvd3/deprecated/scatterWithLegend.html +0 -167
  63. data/vendor/assets/javascripts/nvd3/deprecated/scatterWithLegend.js +0 -261
  64. data/vendor/assets/javascripts/nvd3/deprecated/stackedArea.js +0 -286
  65. data/vendor/assets/javascripts/nvd3/deprecated/stackedAreaChart.html +0 -183
  66. data/vendor/assets/javascripts/nvd3/deprecated/stackedAreaChart_old.html +0 -137
  67. data/vendor/assets/javascripts/nvd3/deprecated/stackedAreaWithLegend.html +0 -222
  68. data/vendor/assets/javascripts/nvd3/deprecated/stackedAreaWithLegend.js +0 -297
  69. data/vendor/assets/javascripts/nvd3/examples/bullet.html +0 -96
  70. data/vendor/assets/javascripts/nvd3/examples/bulletChart.html +0 -94
  71. data/vendor/assets/javascripts/nvd3/examples/crossfilter.html +0 -167
  72. data/vendor/assets/javascripts/nvd3/examples/crossfilterWithDimentions.html +0 -180
  73. data/vendor/assets/javascripts/nvd3/examples/crossfilterWithTables.html +0 -288
  74. data/vendor/assets/javascripts/nvd3/examples/cumulativeLineChart.html +0 -155
  75. data/vendor/assets/javascripts/nvd3/examples/discreteBarChart.html +0 -116
  76. data/vendor/assets/javascripts/nvd3/examples/dynamicTimeSeries.html +0 -148
  77. data/vendor/assets/javascripts/nvd3/examples/historicalBar.html +0 -157
  78. data/vendor/assets/javascripts/nvd3/examples/horizon.html +0 -163
  79. data/vendor/assets/javascripts/nvd3/examples/images/grey-minus.png +0 -0
  80. data/vendor/assets/javascripts/nvd3/examples/images/grey-plus.png +0 -0
  81. data/vendor/assets/javascripts/nvd3/examples/indentedtree.html +0 -126
  82. data/vendor/assets/javascripts/nvd3/examples/legend.html +0 -75
  83. data/vendor/assets/javascripts/nvd3/examples/line.html +0 -95
  84. data/vendor/assets/javascripts/nvd3/examples/lineChart.html +0 -112
  85. data/vendor/assets/javascripts/nvd3/examples/lineChartSVGResize.html +0 -151
  86. data/vendor/assets/javascripts/nvd3/examples/linePlusBarChart.html +0 -114
  87. data/vendor/assets/javascripts/nvd3/examples/linePlusBarWithFocusChart.html +0 -128
  88. data/vendor/assets/javascripts/nvd3/examples/lineTimeSeries.html +0 -142
  89. data/vendor/assets/javascripts/nvd3/examples/lineWithFisheyeChart.html +0 -101
  90. data/vendor/assets/javascripts/nvd3/examples/lineWithFocusChart.html +0 -87
  91. data/vendor/assets/javascripts/nvd3/examples/multiBar.html +0 -92
  92. data/vendor/assets/javascripts/nvd3/examples/multiBarChart.html +0 -93
  93. data/vendor/assets/javascripts/nvd3/examples/multiBarHorizontalChart.html +0 -388
  94. data/vendor/assets/javascripts/nvd3/examples/multiChart.html +0 -93
  95. data/vendor/assets/javascripts/nvd3/examples/nations.json +0 -1
  96. data/vendor/assets/javascripts/nvd3/examples/pie.html +0 -93
  97. data/vendor/assets/javascripts/nvd3/examples/pieChart.html +0 -114
  98. data/vendor/assets/javascripts/nvd3/examples/scatter.html +0 -95
  99. data/vendor/assets/javascripts/nvd3/examples/scatterChart.html +0 -115
  100. data/vendor/assets/javascripts/nvd3/examples/scatterPlusLineChart.html +0 -116
  101. data/vendor/assets/javascripts/nvd3/examples/sparkline.html +0 -62
  102. data/vendor/assets/javascripts/nvd3/examples/sparklinePlus.html +0 -67
  103. data/vendor/assets/javascripts/nvd3/examples/stackedArea.html +0 -155
  104. data/vendor/assets/javascripts/nvd3/examples/stackedAreaChart.html +0 -245
  105. data/vendor/assets/javascripts/nvd3/examples/stream_layers.js +0 -35
  106. data/vendor/assets/javascripts/nvd3/src/models/backup/bullet.js +0 -250
  107. data/vendor/assets/javascripts/nvd3/src/models/backup/bulletChart.js +0 -349
@@ -1,142 +0,0 @@
1
- <!DOCTYPE html>
2
- <meta charset="utf-8">
3
-
4
- <link href="../src/nv.d3.css" rel="stylesheet" type="text/css">
5
-
6
- <style>
7
-
8
- body {
9
- overflow-y:scroll;
10
- }
11
-
12
- text {
13
- font: 12px sans-serif;
14
- }
15
-
16
- svg {
17
- display: block;
18
- border: grey dotted 1px;
19
- }
20
-
21
- #chart1 svg {
22
- height: 500px;
23
- min-width: 100px;
24
- min-height: 100px;
25
- /*
26
- margin: 50px;
27
- Minimum height and width is a good idea to prevent negative SVG dimensions...
28
- For example width should be =< margin.left + margin.right + 1,
29
- of course 1 pixel for the entire chart would not be very useful, BUT should not have errors
30
- */
31
- }
32
-
33
- .nvd3 .nv-groups .nv-point {
34
- transition: stroke-width 100ms linear, stroke-opacity 100ms linear;
35
- -moz-transition: stroke-width 100ms linear, stroke-opacity 100ms linear;
36
- -webkit-transition: stroke-width 100ms linear, stroke-opacity 100ms linear;
37
- }
38
-
39
- .nvtooltip {
40
- transition: opacity 100ms linear;
41
- -moz-transition: opacity 100ms linear;
42
- -webkit-transition: opacity 100ms linear;
43
-
44
- transition-delay: 100ms;
45
- -moz-transition-delay: 100ms;
46
- -webkit-transition-delay: 100ms;
47
-
48
- padding: 2px;
49
- -moz-box-shadow: 2px 2px 4px rgba(0,0,0,.5);
50
- -webkit-box-shadow: 2px 2px 4px rgba(0,0,0,.5);
51
- box-shadow: 2px 2px 4px rgba(0,0,0,.5);
52
- -moz-border-radius: 2px;
53
- border-radius: 2px;
54
- }
55
- .nvtooltip h3 {
56
- font-size: 10pt;
57
- }
58
- .nvtooltip p {
59
- font-size: 10pt;
60
- }
61
-
62
- </style>
63
- <body>
64
-
65
- <div id="chart1">
66
- <svg style="height: 240px; width:500px;"></svg>
67
- </div>
68
-
69
- <script src="../lib/d3.v2.js"></script>
70
- <script src="../nv.d3.js"></script>
71
- <script src="../src/tooltip.js"></script>
72
- <script src="../src/utils.js"></script>
73
- <script src="../src/models/legend.js"></script>
74
- <script src="../src/models/axis.js"></script>
75
- <script src="../src/models/scatter.js"></script>
76
- <script src="../src/models/line.js"></script>
77
- <script src="../src/models/lineTimeSeriesChart.js"></script>
78
- <script>
79
-
80
-
81
-
82
-
83
- // Wrapping in nv.addGraph allows for '0 timeout render', stors rendered charts in nv.graphs, and may do more in the future... it's NOT required
84
- nv.addGraph(function() {
85
- var chart = nv.models.lineTimeSeriesChart();
86
-
87
- // chart
88
- // .x(function(d,i) { return i })
89
-
90
-
91
- // chart.xAxis // chart sub-models (ie. xAxis, yAxis, etc) when accessed directly, return themselves, not the partent chart, so need to chain separately
92
- // .tickFormat(d3.format(',.1f'));
93
-
94
- chart.yAxis
95
- .axisLabel('Voltage (v)')
96
- .tickFormat(d3.format(',.2f'));
97
-
98
- d3.select('#chart1 svg')
99
- //.datum([]) //for testing noData
100
- .datum(sinAndCos())
101
- .transition().duration(500)
102
- .call(chart);
103
-
104
- //TODO: Figure out a good way to do this automatically
105
- nv.utils.windowResize(chart.update);
106
- //nv.utils.windowResize(function() { d3.select('#chart1 svg').call(chart) });
107
-
108
- return chart;
109
- });
110
-
111
- (new Date).getTime()
112
-
113
- function sinAndCos() {
114
- var sin = [],
115
- cos = [];
116
-
117
- var now = Math.round((new Date).getTime()),
118
- dur = 24 * 3600 * 1000,
119
- step = dur / 100;
120
-
121
- for (var i = now - dur, j = 1; i < now; i += step, j += 1) {
122
- sin.push({x: i, y: j%10==0 ? null : Math.sin(i/(10*step)) }); //the nulls are to show how defined works
123
- cos.push({x: i, y: .5 * Math.cos(i/(10*step))});
124
- }
125
-
126
- return [
127
- {
128
- area: true,
129
- values: sin,
130
- key: "Sine Wave",
131
- color: "#ff7f0e"
132
- },
133
- {
134
- values: cos,
135
- key: "Cosine Wave",
136
- color: "#2ca02c"
137
- }
138
- ];
139
- }
140
-
141
-
142
- </script>
@@ -1,101 +0,0 @@
1
- <!DOCTYPE html>
2
- <meta charset="utf-8">
3
-
4
- <link href="../src/nv.d3.css" rel="stylesheet" type="text/css">
5
-
6
- <style>
7
-
8
- body {
9
- overflow-y:scroll;
10
- }
11
-
12
- text {
13
- font: 12px sans-serif;
14
- }
15
-
16
- svg {
17
- display: block;
18
- }
19
-
20
- #chart1 svg {
21
- height: 500px;
22
- min-width: 100px;
23
- min-height: 100px;
24
- /*
25
- margin: 50px;
26
- Minimum height and width is a good idea to prevent negative SVG dimensions...
27
- For example width should be =< margin.left + margin.right + 1,
28
- of course 1 pixel for the entire chart would not be very useful, BUT should not have errors
29
- */
30
- }
31
-
32
- </style>
33
- <body>
34
-
35
- <div id="chart1">
36
- <svg style="height: 500px;"></svg>
37
- </div>
38
-
39
- <script src="../lib/d3.v2.js"></script>
40
- <script src="../lib/fisheye.js"></script>
41
- <script src="../nv.d3.js"></script>
42
- <script src="../src/tooltip.js"></script>
43
- <script src="../src/utils.js"></script>
44
- <script src="../src/models/legend.js"></script>
45
- <script src="../src/models/axis.js"></script>
46
- <script src="../src/models/scatter.js"></script>
47
- <script src="../src/models/lineWithFisheye.js"></script>
48
- <script src="../src/models/lineWithFisheyeChart.js"></script>
49
- <script>
50
-
51
-
52
- // Wrapping in nv.addGraph allows for '0 timeout render', stors rendered charts in nv.graphs, and may do more in the future... it's NOT required
53
- nv.addGraph(function() {
54
- var chart = nv.models.lineChart();
55
-
56
- chart.xAxis // chart sub-models (ie. xAxis, yAxis, etc) when accessed directly, return themselves, not the parent chart, so need to chain separately
57
- .tickFormat(d3.format(',r'));
58
-
59
- chart.yAxis
60
- .axisLabel('Voltage (v)')
61
- .tickFormat(d3.format(',.2f'));
62
-
63
- d3.select('#chart1 svg')
64
- .datum(sinAndCos())
65
- .transition().duration(500)
66
- .call(chart);
67
-
68
- //TODO: Figure out a good way to do this automatically
69
- nv.utils.windowResize(chart.update);
70
- //nv.utils.windowResize(function() { d3.select('#chart1 svg').call(chart) });
71
-
72
- return chart;
73
- });
74
-
75
-
76
-
77
- function sinAndCos() {
78
- var sin = [],
79
- cos = [];
80
-
81
- for (var i = 0; i < 200; i++) {
82
- sin.push({x: i, y: Math.sin(i/2)});
83
- cos.push({x: i, y: .5 * Math.cos(i)});
84
- }
85
-
86
- return [
87
- {
88
- values: sin,
89
- key: "Sine Wave",
90
- color: "#ff7f0e"
91
- },
92
- {
93
- values: cos,
94
- key: "Cosine Wave",
95
- color: "#2ca02c"
96
- }
97
- ];
98
- }
99
-
100
-
101
- </script>
@@ -1,87 +0,0 @@
1
- <!DOCTYPE html>
2
- <meta charset="utf-8">
3
-
4
- <link href="../src/nv.d3.css" rel="stylesheet" type="text/css">
5
-
6
- <style>
7
-
8
- body {
9
- overflow-y:scroll;
10
- }
11
-
12
- text {
13
- font: 12px sans-serif;
14
- }
15
-
16
- svg {
17
- display: block;
18
- }
19
-
20
- #chart1 svg {
21
- height: 500px;
22
- min-width: 100px;
23
- min-height: 100px;
24
- /*
25
- margin: 50px;
26
- Minimum height and width is a good idea to prevent negative SVG dimensions...
27
- For example width should be =< margin.left + margin.right + 1,
28
- of course 1 pixel for the entire chart would not be very useful, BUT should not have errors
29
- */
30
- }
31
-
32
- </style>
33
- <body>
34
-
35
- <div id="chart">
36
- <svg style="height: 500px;"></svg>
37
- </div>
38
-
39
- <script src="../lib/d3.v2.js"></script>
40
- <script src="../nv.d3.js"></script>
41
- <script src="../src/tooltip.js"></script>
42
- <script src="../src/utils.js"></script>
43
- <script src="../src/models/legend.js"></script>
44
- <script src="../src/models/axis.js"></script>
45
- <script src="../src/models/scatter.js"></script>
46
- <script src="../src/models/line.js"></script>
47
- <script src="../src/models/lineWithFocusChart.js"></script>
48
- <script src="stream_layers.js"></script>
49
- <script>
50
-
51
-
52
- nv.addGraph(function() {
53
- var chart = nv.models.lineWithFocusChart();
54
-
55
- chart.xAxis
56
- .tickFormat(d3.format(',f'));
57
- chart.x2Axis
58
- .tickFormat(d3.format(',f'));
59
-
60
- chart.yAxis
61
- .tickFormat(d3.format(',.2f'));
62
- chart.y2Axis
63
- .tickFormat(d3.format(',.2f'));
64
-
65
- d3.select('#chart svg')
66
- .datum(testData())
67
- .transition().duration(500)
68
- .call(chart);
69
-
70
- nv.utils.windowResize(chart.update);
71
-
72
- return chart;
73
- });
74
-
75
-
76
-
77
- function testData() {
78
- return stream_layers(3,128,.1).map(function(data, i) {
79
- return {
80
- key: 'Stream' + i,
81
- values: data
82
- };
83
- });
84
- }
85
-
86
-
87
- </script>
@@ -1,92 +0,0 @@
1
- <!DOCTYPE html>
2
- <meta charset="utf-8">
3
-
4
- <link href="../src/nv.d3.css" rel="stylesheet" type="text/css">
5
-
6
- <style>
7
-
8
-
9
- body {
10
- overflow-y:scroll;
11
- }
12
-
13
- text {
14
- font: 12px sans-serif;
15
- }
16
-
17
- </style>
18
- <body>
19
-
20
- <div id="test1">
21
- <svg></svg>
22
- </div>
23
-
24
- <script src="../lib/d3.v2.js"></script>
25
- <script src="../nv.d3.js"></script>
26
- <script src="../src/tooltip.js"></script>
27
- <script src="../src/models/legend.js"></script>
28
- <script src="../src/models/axis.js"></script>
29
- <script src="../src/models/multiBar.js"></script>
30
- <script src="stream_layers.js"></script>
31
- <script>
32
-
33
- //var test_data = stream_layers(3,128,.1).map(function(data, i) {
34
- var test_data = stream_layers(3,128,.1).map(function(data, i) {
35
- return {
36
- key: 'Stream' + i,
37
- values: data
38
- };
39
- });
40
-
41
- nv.addGraph({
42
- generate: function() {
43
- var width = nv.utils.windowSize().width - 40,
44
- height = nv.utils.windowSize().height - 40;
45
-
46
- var chart = nv.models.multiBar()
47
- .width(width)
48
- .height(height)
49
- .stacked(true)
50
-
51
-
52
- var svg = d3.select('#test1 svg')
53
- .attr('width', width)
54
- .attr('height', height)
55
- .datum(test_data);
56
-
57
- svg.transition().duration(500).call(chart);
58
-
59
- return chart;
60
- },
61
- callback: function(graph) {
62
-
63
-
64
- window.onresize = function() {
65
- var width = nv.utils.windowSize().width - 40,
66
- height = nv.utils.windowSize().height - 40,
67
- margin = graph.margin();
68
-
69
-
70
- if (width < margin.left + margin.right + 20)
71
- width = margin.left + margin.right + 20;
72
-
73
- if (height < margin.top + margin.bottom + 20)
74
- height = margin.top + margin.bottom + 20;
75
-
76
-
77
- graph
78
- .width(width)
79
- .height(height);
80
-
81
- d3.select('#test1 svg')
82
- .attr('width', width)
83
- .attr('height', height)
84
- .call(graph);
85
-
86
- };
87
- }
88
- });
89
-
90
-
91
-
92
- </script>
@@ -1,93 +0,0 @@
1
- <!DOCTYPE html>
2
- <meta charset="utf-8">
3
-
4
- <link href="../src/nv.d3.css" rel="stylesheet" type="text/css">
5
-
6
- <style>
7
-
8
- body {
9
- overflow-y:scroll;
10
- }
11
-
12
- text {
13
- font: 12px sans-serif;
14
- }
15
-
16
- #chart1 {
17
- height: 500px;
18
- margin: 10px;
19
- min-width: 100px;
20
- min-height: 100px;
21
- /*
22
- Minimum height and width is a good idea to prevent negative SVG dimensions...
23
- For example width should be =< margin.left + margin.right + 1,
24
- of course 1 pixel for the entire chart would not be very useful, BUT should not have errors
25
- */
26
- }
27
-
28
- </style>
29
- <body>
30
-
31
- <div id="chart1">
32
- <svg></svg>
33
- </div>
34
-
35
- <script src="../lib/d3.v2.js"></script>
36
- <script src="../nv.d3.js"></script>
37
- <script src="../src/tooltip.js"></script>
38
- <script src="../src/utils.js"></script>
39
- <script src="../src/models/legend.js"></script>
40
- <script src="../src/models/axis.js"></script>
41
- <script src="../src/models/multiBar.js"></script>
42
- <script src="../src/models/multiBarChart.js"></script>
43
- <script src="stream_layers.js"></script>
44
- <script>
45
-
46
- var test_data = stream_layers(3,10+Math.random()*100,.1).map(function(data, i) {
47
- //var test_data = stream_layers(3,1,.1).map(function(data, i) { //for testing single data point
48
- return {
49
- key: 'Stream' + i,
50
- values: data
51
- };
52
- });
53
-
54
- console.log('td',test_data);
55
-
56
- var negative_test_data = new d3.range(0,3).map(function(d,i) { return {
57
- key: 'Stream' + i,
58
- values: new d3.range(0,10).map( function(f,j) {
59
- return {
60
- y: 10 + Math.random()*100 * (Math.floor(Math.random()*100)%2 ? 1 : -1),
61
- x: j
62
- }
63
- })
64
- };
65
- });
66
-
67
- var chart;
68
- nv.addGraph(function() {
69
- chart = nv.models.multiBarChart()
70
- .barColor(d3.scale.category20().range());
71
-
72
- chart.xAxis
73
- .showMaxMin(true)
74
- .tickFormat(d3.format(',f'));
75
-
76
- chart.yAxis
77
- .tickFormat(d3.format(',.1f'));
78
-
79
- d3.select('#chart1 svg')
80
- .datum(negative_test_data)
81
- .transition().duration(500).call(chart);
82
-
83
- nv.utils.windowResize(chart.update);
84
-
85
- chart.dispatch.on('stateChange', function(e) { nv.log('New State:', JSON.stringify(e)); });
86
-
87
- return chart;
88
- });
89
-
90
-
91
-
92
-
93
- </script>