GoogleChartsExamples.deploy.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. smalltalk.addPackage('GoogleChartsExamples', {});
  2. smalltalk.addClass('GaugeChartExample', smalltalk.GaugeChart, [], 'GoogleChartsExamples');
  3. smalltalk.addMethod(
  4. "_makeData",
  5. smalltalk.method({
  6. selector: "makeData",
  7. fn: function (){
  8. var self=this;
  9. var $1;
  10. $1=smalltalk.send(self,"_arrayToDataTable_",[[["Label","Value"],["Memory",(80)],["CPU",(55)],["Network",(68)]]]);
  11. return $1;
  12. }
  13. }),
  14. smalltalk.GaugeChartExample);
  15. smalltalk.addMethod(
  16. "_makeOptions",
  17. smalltalk.method({
  18. selector: "makeOptions",
  19. fn: function (){
  20. var self=this;
  21. var $1;
  22. $1={width:400, heigth:120,
  23. redFrom:90,redTo:100,
  24. yellowFrom:75,yellowTo:90,
  25. minorTicks:5};
  26. ;
  27. return $1;
  28. }
  29. }),
  30. smalltalk.GaugeChartExample);
  31. smalltalk.addClass('GeoChartExample', smalltalk.GeoChart, [], 'GoogleChartsExamples');
  32. smalltalk.addMethod(
  33. "_makeData",
  34. smalltalk.method({
  35. selector: "makeData",
  36. fn: function (){
  37. var self=this;
  38. var $1;
  39. $1=smalltalk.send(self,"_arrayToDataTable_",[[["City","Population","Area"],["Rome",(2761477),(1285.31)],["Milan",(1324110),(181.76)],["Naples",(959574),(117.27)],["Turin",(907563),(130.17)],["Palermo",(655875),(158.9)],["Genoa",(607906),(243.6)],["Bologna",(380181),(140.7)],["Florence",(371282),(102.41)],["Fiumicino",(67370),(213.44)],["Anzio",(52192),(43.43)],["Ciampino",(38262),(11)]]]);
  40. return $1;
  41. }
  42. }),
  43. smalltalk.GeoChartExample);
  44. smalltalk.addMethod(
  45. "_makeOptions",
  46. smalltalk.method({
  47. selector: "makeOptions",
  48. fn: function (){
  49. var self=this;
  50. var $1;
  51. $1={
  52. region: 'IT',
  53. displayMode: 'markers',
  54. colorAxis: {colors: ['green', 'blue']}
  55. };
  56. ;
  57. return $1;
  58. }
  59. }),
  60. smalltalk.GeoChartExample);
  61. smalltalk.addClass('IndexChartApp', smalltalk.ChartApp, [], 'GoogleChartsExamples');
  62. smalltalk.addMethod(
  63. "_begin",
  64. smalltalk.method({
  65. selector: "begin",
  66. fn: function (){
  67. var self=this;
  68. var $1,$2,$3;
  69. $1=smalltalk.send((smalltalk.PieChartExample || PieChartExample),"_new",[]);
  70. smalltalk.send($1,"_chartId_",["pie_chart_div"]);
  71. $2=smalltalk.send($1,"_drawChart",[]);
  72. $3=smalltalk.send(self,"_begin",[],smalltalk.ChartApp);
  73. return $3;
  74. }
  75. }),
  76. smalltalk.IndexChartApp);
  77. smalltalk.addMethod(
  78. "_neededVisualizationPackages",
  79. smalltalk.method({
  80. selector: "neededVisualizationPackages",
  81. fn: function (){
  82. var self=this;
  83. var $1;
  84. $1=["corechart"];
  85. return $1;
  86. }
  87. }),
  88. smalltalk.IndexChartApp.klass);
  89. smalltalk.addClass('PieChartExample', smalltalk.PieChart, [], 'GoogleChartsExamples');
  90. smalltalk.addMethod(
  91. "_makeData",
  92. smalltalk.method({
  93. selector: "makeData",
  94. fn: function (){
  95. var self=this;
  96. var $1;
  97. $1=smalltalk.send(self,"_arrayToDataTable_",[[["Task","Hours per Day"],["Work",(11)],["Eat",(2)],["Commute",(2)],["Watch TV",(2)],["Snooze",(7)]]]);
  98. return $1;
  99. }
  100. }),
  101. smalltalk.PieChartExample);
  102. smalltalk.addMethod(
  103. "_makeOptions",
  104. smalltalk.method({
  105. selector: "makeOptions",
  106. fn: function (){
  107. var self=this;
  108. var $1;
  109. $1=smalltalk.HashedCollection._fromPairs_([smalltalk.send("title","__minus_gt",["My Daily Activities"])]);
  110. return $1;
  111. }
  112. }),
  113. smalltalk.PieChartExample);
  114. smalltalk.addClass('PopupChartApp', smalltalk.ChartApp, [], 'GoogleChartsExamples');
  115. smalltalk.addMethod(
  116. "_begin",
  117. smalltalk.method({
  118. selector: "begin",
  119. fn: function (){
  120. var self=this;
  121. var $1;
  122. smalltalk.send((smalltalk.ChartButton || ChartButton),"_popUpChart_atDom_",[smalltalk.send((smalltalk.PieChartExample || PieChartExample),"_chartId_",["pie_chart_div"]),"#popPieChart"]);
  123. smalltalk.send((smalltalk.ChartButton || ChartButton),"_popUpChart_atDom_",[smalltalk.send((smalltalk.ScatterChartExample || ScatterChartExample),"_chartId_",["scatter_chart_div"]),"#popScatterChart"]);
  124. smalltalk.send((smalltalk.ChartButton || ChartButton),"_popUpChart_atDom_",[smalltalk.send((smalltalk.GaugeChartExample || GaugeChartExample),"_chartId_",["gauge_chart_div"]),"#popGaugeChart"]);
  125. smalltalk.send((smalltalk.ChartButton || ChartButton),"_popUpChart_atDom_",[smalltalk.send((smalltalk.GeoChartExample || GeoChartExample),"_chartId_",["geo_markers_chart_div"]),"#popGeoMarkersChart"]);
  126. $1=smalltalk.send(self,"_begin",[],smalltalk.ChartApp);
  127. return $1;
  128. }
  129. }),
  130. smalltalk.PopupChartApp);
  131. smalltalk.addMethod(
  132. "_neededVisualizationPackages",
  133. smalltalk.method({
  134. selector: "neededVisualizationPackages",
  135. fn: function (){
  136. var self=this;
  137. var $1;
  138. $1=["corechart","gauge","geochart"];
  139. return $1;
  140. }
  141. }),
  142. smalltalk.PopupChartApp.klass);
  143. smalltalk.addClass('ScatterChartExample', smalltalk.ScatterChart, [], 'GoogleChartsExamples');
  144. smalltalk.addMethod(
  145. "_makeData",
  146. smalltalk.method({
  147. selector: "makeData",
  148. fn: function (){
  149. var self=this;
  150. var $1;
  151. $1=smalltalk.send(self,"_arrayToDataTable_",[[["Age","Weight"],[(8),(11)],[(4),(5.5)],[(11),(14)],[(4),(5)],[(3),(3)],[(6.5),(7)]]]);
  152. return $1;
  153. }
  154. }),
  155. smalltalk.ScatterChartExample);
  156. smalltalk.addMethod(
  157. "_makeOptions",
  158. smalltalk.method({
  159. selector: "makeOptions",
  160. fn: function (){
  161. var self=this;
  162. var $1;
  163. $1={
  164. title: 'Age vs. Weight comparison',
  165. hAxis: {title: 'Age', minValue: 0, maxValue: 15},
  166. vAxis: {title: 'Weight', minValue: 0, maxValue: 15},
  167. legend: 'none'
  168. };
  169. ;
  170. return $1;
  171. }
  172. }),
  173. smalltalk.ScatterChartExample);