PageRenderTime 51ms CodeModel.GetById 27ms RepoModel.GetById 1ms app.codeStats 0ms

/plugins/visualize/public/index.html

http://github.com/jspears/bobamo
HTML | 113 lines | 109 code | 4 blank | 0 comment | 0 complexity | a521c61e388725060436a1e920698593 MD5 | raw file
Possible License(s): Apache-2.0
  1. <!html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Test Visualization Plugin</title>
  6. <link rel="stylesheet" href="/bobamo/visualize/examples/style.css" type="text/css" />
  7. <link href="/bobamo/visualize/examples/colorbrewer.css" rel="stylesheet"/>
  8. <style>
  9. body {
  10. padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
  11. }
  12. </style>
  13. <script>
  14. //a stub for IE.
  15. if (!window.console) {
  16. window.console = {
  17. log:function () {
  18. },
  19. error:function () {
  20. },
  21. warn:function () {
  22. }
  23. }
  24. }
  25. window.useAuthentication = false;
  26. </script>
  27. <link rel="stylesheet" href="../less/">
  28. <link rel="stylesheet" href="../css/styles.css">
  29. <link rel="stylesheet" href="../js/libs/table/jquery.sorter.css">
  30. <link rel="stylesheet" href="../js/libs/backbone-forms/src/backbone-forms.css">
  31. <link rel="stylesheet" href="../js/libs/backbone-forms/test/lib/jquery-ui/flick/jquery-ui-1.8.14.custom.css">
  32. <link rel="stylesheet" href="../js/libs/jquery-miniColors/jquery.miniColors.css">
  33. <link href="/bobamo//favicon.ico" rel="shortcut icon">
  34. <script type="text/javascript" src="../js/libs/require/require-jquery.js"></script>
  35. <script type="text/javascript">
  36. require.config({
  37. baseUrl:'/bobamo/js',
  38. paths:{
  39. loader:'libs/backbone/loader',
  40. underscore:'libs/underscore/underscore-1.3.1-amd',
  41. Backbone:'libs/backbone/backbone-0.9.1-amd',
  42. 'jquery-ui':'libs/backbone-forms/test/lib/jquery-ui/jquery-ui-1.8.14.custom.min',
  43. 'Backbone.Form':'libs/backbone-forms/src/backbone-forms',
  44. 'jquery-editors':'libs/backbone-forms/src/jquery-ui-editors',
  45. 'bootstrap':'libs/bootstrap/js',
  46. templates:'../templates',
  47. session:'/bobamo/session',
  48. static:'/bobamo/static',
  49. imageupload:'/bobamo/imageupload',
  50. appeditor:'/bobamo/appeditor',
  51. modeleditor:'/bobamo/modeleditor',
  52. less:'/bobamo/less',
  53. generator:'/bobamo/generator',
  54. rest:'/bobamo/rest',
  55. mongoose:'/bobamo/mongoose',
  56. package:'/bobamo/package',
  57. tpl:'../tpl',
  58. visualize:'/bobamo/visualize/js',
  59. d3:'/bobamo/visualize/js/backbone-d3/d3',
  60. 'Backbone.d3':'/bobamo/visualize/js/backbone-d3/backbone-d3'
  61. }
  62. });
  63. </script>
  64. <style>
  65. #chart {
  66. font: 10px sans-serif;
  67. shape-rendering: crispEdges;
  68. }
  69. .day {
  70. fill: #fff;
  71. stroke: #ccc;
  72. }
  73. .month {
  74. fill: none;
  75. stroke: #000;
  76. stroke-width: 2px;
  77. }
  78. </style>
  79. </head>
  80. <body>
  81. <h3>Test Visualization</h3>
  82. <button id="values">click</button>
  83. <div id="chart"></div>
  84. <script type="text/javascript">
  85. require(['jquery', 'Backbone', 'visualize/backbone-d3/backbone-d3', 'visualize/backbone-d3/visualisations/calendar' ], function ($, Backbone,B3d, Calendar) {
  86. var UserCalendar = Calendar.Collection.extend({
  87. // url:'/bobamo/visualize/examples/calendar.json'
  88. url:'/bobamo/visualize/data/user',
  89. parse:function (resp) {
  90. return resp.payload
  91. }
  92. });
  93. var series1 = new UserCalendar()
  94. var cal = new Calendar.View(series1, {div:'#chart'});
  95. $('#values').on('click', function () {
  96. series1.fetch();
  97. });
  98. });
  99. // series4.reset([
  100. // new DataPoint({x:1, y:5, id:1}),
  101. // new DataPoint({x:2, y:4, id:2}),
  102. // new DataPoint({x:3, y:3, id:3}),
  103. // new DataPoint({x:4, y:2, id:4}),
  104. // new DataPoint({x:5, y:1, id:5})
  105. // ]);
  106. // })
  107. </script>
  108. </body>
  109. </html>