postrest 0.0.3 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (234) hide show
  1. checksums.yaml +4 -4
  2. data/lib/app.rb +1 -1
  3. data/public/index.htm +116 -0
  4. data/public/node_modules/pivottable/CONTRIBUTING.md +19 -0
  5. data/public/node_modules/pivottable/LICENSE.md +9 -0
  6. data/public/node_modules/pivottable/ReadMe.md +155 -0
  7. data/public/node_modules/pivottable/bower.json +31 -0
  8. data/public/node_modules/pivottable/c3_renderers.coffee +155 -0
  9. data/public/node_modules/pivottable/d3_renderers.coffee +73 -0
  10. data/public/node_modules/pivottable/dist/c3_renderers.js +256 -0
  11. data/public/node_modules/pivottable/dist/c3_renderers.js.map +1 -0
  12. data/public/node_modules/pivottable/dist/c3_renderers.min.js +2 -0
  13. data/public/node_modules/pivottable/dist/c3_renderers.min.js.map +1 -0
  14. data/public/node_modules/pivottable/dist/d3_renderers.js +105 -0
  15. data/public/node_modules/pivottable/dist/d3_renderers.js.map +1 -0
  16. data/public/node_modules/pivottable/dist/d3_renderers.min.js +2 -0
  17. data/public/node_modules/pivottable/dist/d3_renderers.min.js.map +1 -0
  18. data/public/node_modules/pivottable/dist/export_renderers.js +80 -0
  19. data/public/node_modules/pivottable/dist/export_renderers.js.map +1 -0
  20. data/public/node_modules/pivottable/dist/export_renderers.min.js +2 -0
  21. data/public/node_modules/pivottable/dist/export_renderers.min.js.map +1 -0
  22. data/public/node_modules/pivottable/dist/gchart_renderers.js +183 -0
  23. data/public/node_modules/pivottable/dist/gchart_renderers.js.map +1 -0
  24. data/public/node_modules/pivottable/dist/gchart_renderers.min.js +2 -0
  25. data/public/node_modules/pivottable/dist/gchart_renderers.min.js.map +1 -0
  26. data/public/node_modules/pivottable/dist/pivot.css +97 -0
  27. data/public/node_modules/pivottable/dist/pivot.es.js +78 -0
  28. data/public/node_modules/pivottable/dist/pivot.es.js.map +1 -0
  29. data/public/node_modules/pivottable/dist/pivot.es.min.js +2 -0
  30. data/public/node_modules/pivottable/dist/pivot.es.min.js.map +1 -0
  31. data/public/node_modules/pivottable/dist/pivot.fr.js +78 -0
  32. data/public/node_modules/pivottable/dist/pivot.fr.js.map +1 -0
  33. data/public/node_modules/pivottable/dist/pivot.fr.min.js +2 -0
  34. data/public/node_modules/pivottable/dist/pivot.fr.min.js.map +1 -0
  35. data/public/node_modules/pivottable/dist/pivot.js +1511 -0
  36. data/public/node_modules/pivottable/dist/pivot.js.map +1 -0
  37. data/public/node_modules/pivottable/dist/pivot.min.css +1 -0
  38. data/public/node_modules/pivottable/dist/pivot.min.js +2 -0
  39. data/public/node_modules/pivottable/dist/pivot.min.js.map +1 -0
  40. data/public/node_modules/pivottable/dist/pivot.nl.js +78 -0
  41. data/public/node_modules/pivottable/dist/pivot.nl.js.map +1 -0
  42. data/public/node_modules/pivottable/dist/pivot.nl.min.js +2 -0
  43. data/public/node_modules/pivottable/dist/pivot.nl.min.js.map +1 -0
  44. data/public/node_modules/pivottable/dist/pivot.pt.js +104 -0
  45. data/public/node_modules/pivottable/dist/pivot.pt.js.map +1 -0
  46. data/public/node_modules/pivottable/dist/pivot.pt.min.js +2 -0
  47. data/public/node_modules/pivottable/dist/pivot.pt.min.js.map +1 -0
  48. data/public/node_modules/pivottable/dist/pivot.ru.js +78 -0
  49. data/public/node_modules/pivottable/dist/pivot.ru.js.map +1 -0
  50. data/public/node_modules/pivottable/dist/pivot.ru.min.js +2 -0
  51. data/public/node_modules/pivottable/dist/pivot.ru.min.js.map +1 -0
  52. data/public/node_modules/pivottable/dist/pivot.tr.js +104 -0
  53. data/public/node_modules/pivottable/dist/pivot.tr.js.map +1 -0
  54. data/public/node_modules/pivottable/dist/pivot.tr.min.js +2 -0
  55. data/public/node_modules/pivottable/dist/pivot.tr.min.js.map +1 -0
  56. data/public/node_modules/pivottable/dist/tips_data.min.js +247 -0
  57. data/public/node_modules/pivottable/examples/c3.html +61 -0
  58. data/public/node_modules/pivottable/examples/d3.html +49 -0
  59. data/public/node_modules/pivottable/examples/fully_loaded.html +80 -0
  60. data/public/node_modules/pivottable/examples/gchart.html +53 -0
  61. data/public/node_modules/pivottable/examples/gh-fork-ribbon.css +140 -0
  62. data/public/node_modules/pivottable/examples/gh-fork-ribbon.ie.css +78 -0
  63. data/public/node_modules/pivottable/examples/index.html +85 -0
  64. data/public/node_modules/pivottable/examples/local.html +74 -0
  65. data/public/node_modules/pivottable/examples/montreal_2014.csv +366 -0
  66. data/public/node_modules/pivottable/examples/montreal_2014.html +106 -0
  67. data/public/node_modules/pivottable/examples/mps.csv +309 -0
  68. data/public/node_modules/pivottable/examples/mps.html +45 -0
  69. data/public/node_modules/pivottable/examples/mps.json +1 -0
  70. data/public/node_modules/pivottable/examples/mps_agg.html +44 -0
  71. data/public/node_modules/pivottable/examples/mps_csv.html +42 -0
  72. data/public/node_modules/pivottable/examples/mps_export.html +44 -0
  73. data/public/node_modules/pivottable/examples/mps_fr.html +40 -0
  74. data/public/node_modules/pivottable/examples/mps_prepop.html +42 -0
  75. data/public/node_modules/pivottable/examples/onrefresh.html +52 -0
  76. data/public/node_modules/pivottable/examples/rcsvs.html +87 -0
  77. data/public/node_modules/pivottable/examples/scatter.html +53 -0
  78. data/public/node_modules/pivottable/examples/show_code.js +17 -0
  79. data/public/node_modules/pivottable/examples/simple.html +41 -0
  80. data/public/node_modules/pivottable/examples/simple_agg.html +51 -0
  81. data/public/node_modules/pivottable/examples/simple_function.html +57 -0
  82. data/public/node_modules/pivottable/examples/simple_ui.html +42 -0
  83. data/public/node_modules/pivottable/examples/simple_ui_from_table.html +60 -0
  84. data/public/node_modules/pivottable/export_renderers.coffee +57 -0
  85. data/public/node_modules/pivottable/gchart_renderers.coffee +111 -0
  86. data/public/node_modules/pivottable/gulpFile.js +95 -0
  87. data/public/node_modules/pivottable/images/animation.gif +0 -0
  88. data/public/node_modules/pivottable/images/filters.png +0 -0
  89. data/public/node_modules/pivottable/images/gender_age_bins.png +0 -0
  90. data/public/node_modules/pivottable/images/gender_imbalance.png +0 -0
  91. data/public/node_modules/pivottable/images/gender_imbalance_instructions.png +0 -0
  92. data/public/node_modules/pivottable/images/initial_state.png +0 -0
  93. data/public/node_modules/pivottable/images/province_x_party_heatmap.png +0 -0
  94. data/public/node_modules/pivottable/images/province_x_party_heatmap_instructions.png +0 -0
  95. data/public/node_modules/pivottable/images/simple.png +0 -0
  96. data/public/node_modules/pivottable/images/simple_ui.png +0 -0
  97. data/public/node_modules/pivottable/images/whats_what.png +0 -0
  98. data/public/node_modules/pivottable/index.html +14 -0
  99. data/public/node_modules/pivottable/node_modules/jquery/AUTHORS.txt +278 -0
  100. data/public/node_modules/pivottable/node_modules/jquery/LICENSE.txt +36 -0
  101. data/public/node_modules/pivottable/node_modules/jquery/README.md +65 -0
  102. data/public/node_modules/pivottable/node_modules/jquery/bower.json +14 -0
  103. data/public/node_modules/pivottable/node_modules/jquery/dist/jquery.js +9842 -0
  104. data/public/node_modules/pivottable/node_modules/jquery/dist/jquery.min.js +4 -0
  105. data/public/node_modules/pivottable/node_modules/jquery/dist/jquery.min.map +1 -0
  106. data/public/node_modules/pivottable/node_modules/jquery/dist/jquery.slim.js +7877 -0
  107. data/public/node_modules/pivottable/node_modules/jquery/dist/jquery.slim.min.js +4 -0
  108. data/public/node_modules/pivottable/node_modules/jquery/dist/jquery.slim.min.map +1 -0
  109. data/public/node_modules/pivottable/node_modules/jquery/package.json +122 -0
  110. data/public/node_modules/pivottable/node_modules/jquery/sizzle/LICENSE.txt +36 -0
  111. data/public/node_modules/pivottable/node_modules/jquery/sizzle/dist/sizzle.js +2143 -0
  112. data/public/node_modules/pivottable/node_modules/jquery/sizzle/dist/sizzle.min.js +3 -0
  113. data/public/node_modules/pivottable/node_modules/jquery/sizzle/dist/sizzle.min.map +1 -0
  114. data/public/node_modules/pivottable/node_modules/jquery/src/ajax.js +845 -0
  115. data/public/node_modules/pivottable/node_modules/jquery/src/ajax/jsonp.js +100 -0
  116. data/public/node_modules/pivottable/node_modules/jquery/src/ajax/load.js +83 -0
  117. data/public/node_modules/pivottable/node_modules/jquery/src/ajax/parseJSON.js +13 -0
  118. data/public/node_modules/pivottable/node_modules/jquery/src/ajax/parseXML.js +27 -0
  119. data/public/node_modules/pivottable/node_modules/jquery/src/ajax/script.js +68 -0
  120. data/public/node_modules/pivottable/node_modules/jquery/src/ajax/var/location.js +3 -0
  121. data/public/node_modules/pivottable/node_modules/jquery/src/ajax/var/nonce.js +5 -0
  122. data/public/node_modules/pivottable/node_modules/jquery/src/ajax/var/rquery.js +3 -0
  123. data/public/node_modules/pivottable/node_modules/jquery/src/ajax/xhr.js +167 -0
  124. data/public/node_modules/pivottable/node_modules/jquery/src/attributes.js +11 -0
  125. data/public/node_modules/pivottable/node_modules/jquery/src/attributes/attr.js +142 -0
  126. data/public/node_modules/pivottable/node_modules/jquery/src/attributes/classes.js +177 -0
  127. data/public/node_modules/pivottable/node_modules/jquery/src/attributes/prop.js +125 -0
  128. data/public/node_modules/pivottable/node_modules/jquery/src/attributes/support.js +36 -0
  129. data/public/node_modules/pivottable/node_modules/jquery/src/attributes/val.js +177 -0
  130. data/public/node_modules/pivottable/node_modules/jquery/src/callbacks.js +232 -0
  131. data/public/node_modules/pivottable/node_modules/jquery/src/core.js +494 -0
  132. data/public/node_modules/pivottable/node_modules/jquery/src/core/DOMEval.js +14 -0
  133. data/public/node_modules/pivottable/node_modules/jquery/src/core/access.js +65 -0
  134. data/public/node_modules/pivottable/node_modules/jquery/src/core/init.js +134 -0
  135. data/public/node_modules/pivottable/node_modules/jquery/src/core/parseHTML.js +41 -0
  136. data/public/node_modules/pivottable/node_modules/jquery/src/core/ready.js +103 -0
  137. data/public/node_modules/pivottable/node_modules/jquery/src/core/support.js +18 -0
  138. data/public/node_modules/pivottable/node_modules/jquery/src/core/var/rsingleTag.js +5 -0
  139. data/public/node_modules/pivottable/node_modules/jquery/src/css.js +515 -0
  140. data/public/node_modules/pivottable/node_modules/jquery/src/css/addGetHookIf.js +24 -0
  141. data/public/node_modules/pivottable/node_modules/jquery/src/css/adjustCSS.js +65 -0
  142. data/public/node_modules/pivottable/node_modules/jquery/src/css/curCSS.js +60 -0
  143. data/public/node_modules/pivottable/node_modules/jquery/src/css/defaultDisplay.js +72 -0
  144. data/public/node_modules/pivottable/node_modules/jquery/src/css/hiddenVisibleSelectors.js +18 -0
  145. data/public/node_modules/pivottable/node_modules/jquery/src/css/showHide.js +48 -0
  146. data/public/node_modules/pivottable/node_modules/jquery/src/css/support.js +121 -0
  147. data/public/node_modules/pivottable/node_modules/jquery/src/css/var/cssExpand.js +3 -0
  148. data/public/node_modules/pivottable/node_modules/jquery/src/css/var/getStyles.js +15 -0
  149. data/public/node_modules/pivottable/node_modules/jquery/src/css/var/isHidden.js +16 -0
  150. data/public/node_modules/pivottable/node_modules/jquery/src/css/var/rmargin.js +3 -0
  151. data/public/node_modules/pivottable/node_modules/jquery/src/css/var/rnumnonpx.js +5 -0
  152. data/public/node_modules/pivottable/node_modules/jquery/src/css/var/swap.js +24 -0
  153. data/public/node_modules/pivottable/node_modules/jquery/src/data.js +187 -0
  154. data/public/node_modules/pivottable/node_modules/jquery/src/data/Data.js +200 -0
  155. data/public/node_modules/pivottable/node_modules/jquery/src/data/accepts.js +20 -0
  156. data/public/node_modules/pivottable/node_modules/jquery/src/data/support.js +23 -0
  157. data/public/node_modules/pivottable/node_modules/jquery/src/data/var/acceptData.js +18 -0
  158. data/public/node_modules/pivottable/node_modules/jquery/src/data/var/dataPriv.js +5 -0
  159. data/public/node_modules/pivottable/node_modules/jquery/src/data/var/dataUser.js +5 -0
  160. data/public/node_modules/pivottable/node_modules/jquery/src/deferred.js +158 -0
  161. data/public/node_modules/pivottable/node_modules/jquery/src/deferred/exceptionHook.js +19 -0
  162. data/public/node_modules/pivottable/node_modules/jquery/src/deprecated.js +32 -0
  163. data/public/node_modules/pivottable/node_modules/jquery/src/dimensions.js +54 -0
  164. data/public/node_modules/pivottable/node_modules/jquery/src/effects.js +629 -0
  165. data/public/node_modules/pivottable/node_modules/jquery/src/effects/Tween.js +121 -0
  166. data/public/node_modules/pivottable/node_modules/jquery/src/effects/animatedSelector.js +13 -0
  167. data/public/node_modules/pivottable/node_modules/jquery/src/effects/support.js +58 -0
  168. data/public/node_modules/pivottable/node_modules/jquery/src/event.js +710 -0
  169. data/public/node_modules/pivottable/node_modules/jquery/src/event/ajax.js +20 -0
  170. data/public/node_modules/pivottable/node_modules/jquery/src/event/alias.js +27 -0
  171. data/public/node_modules/pivottable/node_modules/jquery/src/event/focusin.js +53 -0
  172. data/public/node_modules/pivottable/node_modules/jquery/src/event/support.js +9 -0
  173. data/public/node_modules/pivottable/node_modules/jquery/src/event/trigger.js +199 -0
  174. data/public/node_modules/pivottable/node_modules/jquery/src/exports/amd.js +24 -0
  175. data/public/node_modules/pivottable/node_modules/jquery/src/exports/global.js +26 -0
  176. data/public/node_modules/pivottable/node_modules/jquery/src/intro.js +44 -0
  177. data/public/node_modules/pivottable/node_modules/jquery/src/jquery.js +37 -0
  178. data/public/node_modules/pivottable/node_modules/jquery/src/manipulation.js +481 -0
  179. data/public/node_modules/pivottable/node_modules/jquery/src/manipulation/_evalUrl.js +20 -0
  180. data/public/node_modules/pivottable/node_modules/jquery/src/manipulation/buildFragment.js +102 -0
  181. data/public/node_modules/pivottable/node_modules/jquery/src/manipulation/createSafeFragment.js +20 -0
  182. data/public/node_modules/pivottable/node_modules/jquery/src/manipulation/getAll.js +21 -0
  183. data/public/node_modules/pivottable/node_modules/jquery/src/manipulation/setGlobalEval.js +20 -0
  184. data/public/node_modules/pivottable/node_modules/jquery/src/manipulation/support.js +33 -0
  185. data/public/node_modules/pivottable/node_modules/jquery/src/manipulation/var/nodeNames.js +5 -0
  186. data/public/node_modules/pivottable/node_modules/jquery/src/manipulation/var/rcheckableType.js +3 -0
  187. data/public/node_modules/pivottable/node_modules/jquery/src/manipulation/var/rleadingWhitespace.js +3 -0
  188. data/public/node_modules/pivottable/node_modules/jquery/src/manipulation/var/rscriptType.js +3 -0
  189. data/public/node_modules/pivottable/node_modules/jquery/src/manipulation/var/rtagName.js +3 -0
  190. data/public/node_modules/pivottable/node_modules/jquery/src/manipulation/wrapMap.js +27 -0
  191. data/public/node_modules/pivottable/node_modules/jquery/src/offset.js +218 -0
  192. data/public/node_modules/pivottable/node_modules/jquery/src/outro.js +2 -0
  193. data/public/node_modules/pivottable/node_modules/jquery/src/queue.js +143 -0
  194. data/public/node_modules/pivottable/node_modules/jquery/src/queue/delay.js +22 -0
  195. data/public/node_modules/pivottable/node_modules/jquery/src/selector-native.js +211 -0
  196. data/public/node_modules/pivottable/node_modules/jquery/src/selector-sizzle.js +14 -0
  197. data/public/node_modules/pivottable/node_modules/jquery/src/selector.js +1 -0
  198. data/public/node_modules/pivottable/node_modules/jquery/src/serialize.js +125 -0
  199. data/public/node_modules/pivottable/node_modules/jquery/src/support.js +63 -0
  200. data/public/node_modules/pivottable/node_modules/jquery/src/traversing.js +175 -0
  201. data/public/node_modules/pivottable/node_modules/jquery/src/traversing/findFilter.js +100 -0
  202. data/public/node_modules/pivottable/node_modules/jquery/src/traversing/var/dir.js +20 -0
  203. data/public/node_modules/pivottable/node_modules/jquery/src/traversing/var/rneedsContext.js +6 -0
  204. data/public/node_modules/pivottable/node_modules/jquery/src/traversing/var/siblings.js +15 -0
  205. data/public/node_modules/pivottable/node_modules/jquery/src/var/arr.js +3 -0
  206. data/public/node_modules/pivottable/node_modules/jquery/src/var/class2type.js +5 -0
  207. data/public/node_modules/pivottable/node_modules/jquery/src/var/concat.js +5 -0
  208. data/public/node_modules/pivottable/node_modules/jquery/src/var/deletedIds.js +3 -0
  209. data/public/node_modules/pivottable/node_modules/jquery/src/var/document.js +3 -0
  210. data/public/node_modules/pivottable/node_modules/jquery/src/var/documentElement.js +5 -0
  211. data/public/node_modules/pivottable/node_modules/jquery/src/var/hasOwn.js +5 -0
  212. data/public/node_modules/pivottable/node_modules/jquery/src/var/indexOf.js +5 -0
  213. data/public/node_modules/pivottable/node_modules/jquery/src/var/pnum.js +3 -0
  214. data/public/node_modules/pivottable/node_modules/jquery/src/var/push.js +5 -0
  215. data/public/node_modules/pivottable/node_modules/jquery/src/var/rcssNum.js +7 -0
  216. data/public/node_modules/pivottable/node_modules/jquery/src/var/rnotwhite.js +3 -0
  217. data/public/node_modules/pivottable/node_modules/jquery/src/var/slice.js +5 -0
  218. data/public/node_modules/pivottable/node_modules/jquery/src/var/support.js +5 -0
  219. data/public/node_modules/pivottable/node_modules/jquery/src/var/toString.js +5 -0
  220. data/public/node_modules/pivottable/node_modules/jquery/src/wrap.js +79 -0
  221. data/public/node_modules/pivottable/package.json +70 -0
  222. data/public/node_modules/pivottable/pivot.coffee +957 -0
  223. data/public/node_modules/pivottable/pivot.es.coffee +57 -0
  224. data/public/node_modules/pivottable/pivot.fr.coffee +57 -0
  225. data/public/node_modules/pivottable/pivot.nl.coffee +55 -0
  226. data/public/node_modules/pivottable/pivot.pt.coffee +80 -0
  227. data/public/node_modules/pivottable/pivot.ru.coffee +56 -0
  228. data/public/node_modules/pivottable/pivot.tr.coffee +80 -0
  229. data/public/node_modules/pivottable/pivottable.jquery.json +33 -0
  230. data/public/node_modules/pivottable/tests/boot.js +152 -0
  231. data/public/node_modules/pivottable/tests/index.html +35 -0
  232. data/public/node_modules/pivottable/tests/pivot_spec.coffee +458 -0
  233. data/public/vendor.js +5 -0
  234. metadata +232 -1
@@ -0,0 +1,51 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Pivot Demo</title>
5
+ <!-- external libs from cdnjs -->
6
+ <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
7
+ <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
8
+
9
+ <!-- PivotTable.js libs from ../dist -->
10
+ <link rel="stylesheet" type="text/css" href="../dist/pivot.css">
11
+ <script type="text/javascript" src="../dist/pivot.js"></script>
12
+ <style>
13
+ body {font-family: Verdana;}
14
+ </style>
15
+
16
+ <!-- for examples only! script to show code to user -->
17
+ <script type="text/javascript" src="show_code.js"></script>
18
+ </head>
19
+ <body>
20
+ <script type="text/javascript">
21
+ // This example shows pivot() with a sum() aggregator
22
+ // with custom formatting (no digits after decimal)
23
+
24
+ $(function(){
25
+
26
+ var sum = $.pivotUtilities.aggregatorTemplates.sum;
27
+ var numberFormat = $.pivotUtilities.numberFormat;
28
+ var intFormat = numberFormat({digitsAfterDecimal: 0});
29
+
30
+ $("#output").pivot(
31
+ [
32
+ {color: "blue", shape: "circle", value: 1},
33
+ {color: "red", shape: "triangle", value: 2},
34
+ {color: "blue", shape: "circle", value: 3},
35
+ {color: "red", shape: "triangle", value: 4}
36
+ ],
37
+ {
38
+ rows: ["color"],
39
+ cols: ["shape"],
40
+ aggregator: sum(intFormat)(["value"])
41
+ }
42
+ );
43
+ });
44
+ </script>
45
+
46
+ <p><a href="index.html">&laquo; back to examples</a></p>
47
+
48
+ <div id="output" style="margin: 30px;"></div>
49
+
50
+ </body>
51
+ </html>
@@ -0,0 +1,57 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <title>Pivot Demo</title>
6
+ <!-- external libs from cdnjs -->
7
+ <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
8
+ <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
9
+
10
+ <!-- PivotTable.js libs from ../dist -->
11
+ <link rel="stylesheet" type="text/css" href="../dist/pivot.css">
12
+ <script type="text/javascript" src="../dist/pivot.js"></script>
13
+ <style>
14
+ body {font-family: Verdana;}
15
+ </style>
16
+
17
+ <!-- for examples only! script to show code to user -->
18
+ <script type="text/javascript" src="show_code.js"></script>
19
+ </head>
20
+
21
+ <body>
22
+ <script type="text/javascript">
23
+ // This example uses a function to provide the input values to pivot()
24
+
25
+ $(function () {
26
+ var lookupColour = ["blue", "yellow"];
27
+ var rawData = [
28
+ { color: 0, shape: "circle"},
29
+ { color: 1, shape: "circle"},
30
+ { color: 1, shape: "circle"},
31
+ { color: 0, shape: "triangle"},
32
+ { color: 0, shape: "triangle"},
33
+ { color: 1, shape: "triangle"}
34
+ ];
35
+ var inputFunction = function (callback) {
36
+ rawData.forEach(function (element, index) {
37
+ callback({
38
+ color: lookupColour[element.color],
39
+ shape: element.shape
40
+ });
41
+ });
42
+ };
43
+
44
+ $("#output").pivot(inputFunction, {
45
+ rows: ["color"],
46
+ cols: ["shape"]
47
+ });
48
+ });
49
+ </script>
50
+
51
+ <p><a href="index.html">&laquo; back to examples</a></p>
52
+
53
+ <div id="output" style="margin: 30px;"></div>
54
+
55
+ </body>
56
+
57
+ </html>
@@ -0,0 +1,42 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Pivot Demo</title>
5
+ <!-- external libs from cdnjs -->
6
+ <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
7
+ <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
8
+
9
+ <!-- PivotTable.js libs from ../dist -->
10
+ <link rel="stylesheet" type="text/css" href="../dist/pivot.css">
11
+ <script type="text/javascript" src="../dist/pivot.js"></script>
12
+ <style>
13
+ body {font-family: Verdana;}
14
+ </style>
15
+
16
+ <!-- for examples only! script to show code to user -->
17
+ <script type="text/javascript" src="show_code.js"></script>
18
+ </head>
19
+ <body>
20
+ <script type="text/javascript">
21
+ // This example is the most basic usage of pivotUI()
22
+
23
+ $(function(){
24
+ $("#output").pivotUI(
25
+ [
26
+ {color: "blue", shape: "circle"},
27
+ {color: "red", shape: "triangle"}
28
+ ],
29
+ {
30
+ rows: ["color"],
31
+ cols: ["shape"]
32
+ }
33
+ );
34
+ });
35
+ </script>
36
+
37
+ <p><a href="index.html">&laquo; back to examples</a></p>
38
+
39
+ <div id="output" style="margin: 30px;"></div>
40
+
41
+ </body>
42
+ </html>
@@ -0,0 +1,60 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Pivot Demo</title>
5
+ <!-- external libs from cdnjs -->
6
+ <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
7
+ <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
8
+
9
+ <!-- PivotTable.js libs from ../dist -->
10
+ <link rel="stylesheet" type="text/css" href="../dist/pivot.css">
11
+ <script type="text/javascript" src="../dist/pivot.js"></script>
12
+ <style>
13
+ body {font-family: Verdana;}
14
+ </style>
15
+
16
+ <!-- for examples only! script to show code to user -->
17
+ <script type="text/javascript" src="show_code.js"></script>
18
+ </head>
19
+ <body>
20
+ <script type="text/javascript">
21
+ // This example loads data from the HTML table below.
22
+
23
+ $(function(){
24
+ $("#output").pivotUI($("#input"),
25
+ {
26
+ rows: ["color"],
27
+ cols: ["shape"]
28
+ });
29
+ });
30
+ </script>
31
+
32
+ <p><a href="index.html">&laquo; back to examples</a></p>
33
+
34
+ <div id="output" style="margin: 30px;"></div>
35
+
36
+ <br />
37
+ <h3>Input table:</h3>
38
+ <table id="input" border="1" style="margin: 30px;">
39
+ <thead>
40
+ <tr>
41
+ <th>color</th>
42
+ <th>shape</th>
43
+ <!-- etc... -->
44
+ </tr>
45
+ </thead>
46
+ <tbody>
47
+ <tr>
48
+ <td><span style='color: blue;'>blue</span></td>
49
+ <td><span style='font-size:20px'>&bigcirc;</span></td>
50
+ </tr>
51
+ <tr>
52
+ <td><span style='color: red;'>red</span></td>
53
+ <td><span style='font-size:20px'>&bigtriangleup;</span></td>
54
+ </tr>
55
+ <!-- etc... -->
56
+ </tbody>
57
+ </table>
58
+
59
+ </body>
60
+ </html>
@@ -0,0 +1,57 @@
1
+ callWithJQuery = (pivotModule) ->
2
+ if typeof exports is "object" and typeof module is "object" # CommonJS
3
+ pivotModule require("jquery")
4
+ else if typeof define is "function" and define.amd # AMD
5
+ define ["jquery"], pivotModule
6
+ # Plain browser env
7
+ else
8
+ pivotModule jQuery
9
+
10
+ callWithJQuery ($) ->
11
+
12
+ $.pivotUtilities.export_renderers = "TSV Export": (pivotData, opts) ->
13
+ defaults =
14
+ localeStrings: {}
15
+
16
+ opts = $.extend defaults, opts
17
+
18
+ rowKeys = pivotData.getRowKeys()
19
+ rowKeys.push [] if rowKeys.length == 0
20
+ colKeys = pivotData.getColKeys()
21
+ colKeys.push [] if colKeys.length == 0
22
+ rowAttrs = pivotData.rowAttrs
23
+ colAttrs = pivotData.colAttrs
24
+
25
+ result = []
26
+
27
+ row = []
28
+ for rowAttr in rowAttrs
29
+ row.push rowAttr
30
+ if colKeys.length == 1 and colKeys[0].length == 0
31
+ row.push pivotData.aggregatorName
32
+ else
33
+ for colKey in colKeys
34
+ row.push colKey.join("-")
35
+
36
+ result.push row
37
+
38
+ for rowKey in rowKeys
39
+ row = []
40
+ for r in rowKey
41
+ row.push r
42
+
43
+ for colKey in colKeys
44
+ agg = pivotData.getAggregator(rowKey, colKey)
45
+ if agg.value()?
46
+ row.push agg.value()
47
+ else
48
+ row.push ""
49
+ result.push row
50
+ text = ""
51
+ for r in result
52
+ text += r.join("\t")+"\n"
53
+
54
+ return $("<textarea>").text(text).css(
55
+ width: ($(window).width() / 2) + "px",
56
+ height: ($(window).height() / 2) + "px")
57
+
@@ -0,0 +1,111 @@
1
+ callWithJQuery = (pivotModule) ->
2
+ if typeof exports is "object" and typeof module is "object" # CommonJS
3
+ pivotModule require("jquery")
4
+ else if typeof define is "function" and define.amd # AMD
5
+ define ["jquery"], pivotModule
6
+ # Plain browser env
7
+ else
8
+ pivotModule jQuery
9
+
10
+ callWithJQuery ($) ->
11
+
12
+ makeGoogleChart = (chartType, extraOptions) -> (pivotData, opts) ->
13
+ defaults =
14
+ localeStrings:
15
+ vs: "vs"
16
+ by: "by"
17
+ gchart: {}
18
+
19
+ opts = $.extend true, defaults, opts
20
+ opts.gchart.width ?= window.innerWidth / 1.4
21
+ opts.gchart.height ?= window.innerHeight / 1.4
22
+
23
+ rowKeys = pivotData.getRowKeys()
24
+ rowKeys.push [] if rowKeys.length == 0
25
+ colKeys = pivotData.getColKeys()
26
+ colKeys.push [] if colKeys.length == 0
27
+ fullAggName = pivotData.aggregatorName
28
+ if pivotData.valAttrs.length
29
+ fullAggName += "(#{pivotData.valAttrs.join(", ")})"
30
+ headers = (h.join("-") for h in rowKeys)
31
+ headers.unshift ""
32
+
33
+ numCharsInHAxis = 0
34
+ if chartType == "ScatterChart"
35
+ dataArray = []
36
+ for y, tree2 of pivotData.tree
37
+ for x, agg of tree2
38
+ dataArray.push [
39
+ parseFloat(x),
40
+ parseFloat(y),
41
+ fullAggName+": \n"+agg.format(agg.value())
42
+ ]
43
+ dataTable = new google.visualization.DataTable()
44
+ dataTable.addColumn 'number', pivotData.colAttrs.join("-")
45
+ dataTable.addColumn 'number', pivotData.rowAttrs.join("-")
46
+ dataTable.addColumn type: "string", role: "tooltip"
47
+ dataTable.addRows dataArray
48
+ hAxisTitle = pivotData.colAttrs.join("-")
49
+ vAxisTitle = pivotData.rowAttrs.join("-")
50
+ title = ""
51
+ else
52
+ dataArray = [headers]
53
+ for colKey in colKeys
54
+ row = [colKey.join("-")]
55
+ numCharsInHAxis += row[0].length
56
+ for rowKey in rowKeys
57
+ agg = pivotData.getAggregator(rowKey, colKey)
58
+ if agg.value()?
59
+ val = agg.value()
60
+ if $.isNumeric val
61
+ if val < 1
62
+ row.push parseFloat(val.toPrecision(3))
63
+ else
64
+ row.push parseFloat(val.toFixed(3))
65
+ else
66
+ row.push val
67
+ else row.push null
68
+ dataArray.push row
69
+
70
+ dataTable = google.visualization.arrayToDataTable(dataArray)
71
+
72
+ title = vAxisTitle = fullAggName
73
+ hAxisTitle = pivotData.colAttrs.join("-")
74
+ title += " #{opts.localeStrings.vs} #{hAxisTitle}" if hAxisTitle != ""
75
+ groupByTitle = pivotData.rowAttrs.join("-")
76
+ title += " #{opts.localeStrings.by} #{groupByTitle}" if groupByTitle != ""
77
+
78
+ options =
79
+ title: title
80
+ hAxis: {title: hAxisTitle, slantedText: numCharsInHAxis > 50}
81
+ vAxis: {title: vAxisTitle}
82
+ tooltip: { textStyle: { fontName: 'Arial', fontSize: 12 } }
83
+
84
+ if chartType == "ColumnChart"
85
+ options.vAxis.minValue = 0
86
+
87
+ if chartType == "ScatterChart"
88
+ options.legend = position: "none"
89
+ options.chartArea = {'width': '80%', 'height': '80%'}
90
+
91
+ else if dataArray[0].length == 2 and dataArray[0][1] == ""
92
+ options.legend = position: "none"
93
+
94
+ $.extend options, opts.gchart, extraOptions
95
+
96
+ result = $("<div>").css(width: "100%", height: "100%")
97
+ wrapper = new google.visualization.ChartWrapper {dataTable, chartType, options}
98
+ wrapper.draw(result[0])
99
+ result.bind "dblclick", ->
100
+ editor = new google.visualization.ChartEditor()
101
+ google.visualization.events.addListener editor, 'ok', ->
102
+ editor.getChartWrapper().draw(result[0])
103
+ editor.openDialog(wrapper)
104
+ return result
105
+
106
+ $.pivotUtilities.gchart_renderers =
107
+ "Line Chart": makeGoogleChart("LineChart")
108
+ "Bar Chart": makeGoogleChart("ColumnChart")
109
+ "Stacked Bar Chart": makeGoogleChart("ColumnChart", isStacked: true)
110
+ "Area Chart": makeGoogleChart("AreaChart", isStacked: true)
111
+ "Scatter Chart": makeGoogleChart("ScatterChart")
@@ -0,0 +1,95 @@
1
+ var gulp = require('gulp'),
2
+ git = require('gulp-git'),
3
+ bump = require('gulp-bump'),
4
+ filter = require('gulp-filter'),
5
+ tag_version = require('gulp-tag-version'),
6
+ runSequence = require('run-sequence').use(gulp),
7
+ spawn = require('child_process').spawn,
8
+ coffee = require('gulp-coffee'),
9
+ gutil = require('gulp-util'),
10
+ uglify = require("gulp-uglify"),
11
+ rename = require('gulp-rename'),
12
+ sourcemaps = require('gulp-sourcemaps'),
13
+ concat = require('gulp-concat'),
14
+ minifyCSS = require('gulp-minify-css');
15
+
16
+ gulp.task('makeCss', function() {
17
+ gulp.src('./dist/pivot.css')
18
+ .pipe(minifyCSS())
19
+ .pipe(concat('pivot.min.css'))//trick to output to new file
20
+ .pipe(gulp.dest('./dist/'))
21
+ });
22
+
23
+
24
+ gulp.task('makeJs', function() {
25
+
26
+ gulp.src('./*.coffee')
27
+ //compile to js (and create map files)
28
+ .pipe(sourcemaps.init())
29
+ .pipe(coffee()).on('error', gutil.log)
30
+ .pipe(sourcemaps.write('./'))
31
+ .pipe(gulp.dest('./dist'))
32
+
33
+ //minify js files as well
34
+ .pipe(filter('*.js'))//filter, to avoid doing this processing on the map files generated above
35
+ .pipe(rename({
36
+ suffix: '.min'
37
+ }))
38
+ .pipe(sourcemaps.init({loadMaps: true}))//load the source maps generated in the first step
39
+ .pipe(uglify())
40
+ .pipe(sourcemaps.write('./'))
41
+ .pipe(gulp.dest('./dist'));
42
+ });
43
+
44
+
45
+
46
+ function inc(importance) {
47
+ // get all the files to bump version in
48
+ return gulp.src(['./package.json', './bower.json', './pivottable.jquery.json'])
49
+ // bump the version number in those files
50
+ .pipe(bump({type: importance}))
51
+ // save it back to filesystem
52
+ .pipe(gulp.dest('./'));
53
+ }
54
+
55
+ gulp.task('publish', function (done) {
56
+ spawn('npm', ['publish'], { stdio: 'inherit' }).on('close', done);
57
+ });
58
+
59
+ gulp.task('push', function (done) {
60
+ git.push('origin', 'master', {args: '--tags'}, function (err) {
61
+ if (err) throw err;
62
+ });
63
+ });
64
+
65
+
66
+ gulp.task('tag', function() {
67
+ return gulp.src(['./package.json', './bower.json', './pivottable.jquery.json'])
68
+ .pipe(git.commit('version bump'))
69
+ // read only one file to get the version number
70
+ .pipe(filter('package.json'))
71
+ .pipe(tag_version());
72
+ });
73
+
74
+
75
+ gulp.task('bumpPatch', function() { return inc('patch'); })
76
+ gulp.task('bumpMinor', function() { return inc('minor'); })
77
+ gulp.task('bumpMajor', function() { return inc('major'); })
78
+
79
+ gulp.task('patch', function() {
80
+ runSequence('bumpPatch', 'default', 'tag', 'publish', 'push');
81
+ });
82
+ gulp.task('minor', function() {
83
+ runSequence('bumpMinor', 'default', 'tag', 'publish', 'push');
84
+ });
85
+ gulp.task('major', function() {
86
+ runSequence('bumpMajor', 'default', 'tag', 'publish', 'push');
87
+ });
88
+
89
+ gulp.task('watch', function() {
90
+ gulp.watch('./*.coffee', ['makeJs']);
91
+ gulp.watch('./dist/pivot.css', ['makeCss']);
92
+ });
93
+
94
+ gulp.task('default', ['makeJs', 'makeCss']);
95
+