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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e593b8292f51984fe7c22997d1fa09b52f09714
4
- data.tar.gz: a102ab716e6f4e143d59a03f28a0a6a35c460d47
3
+ metadata.gz: a0ad7a6802b67d90ce1e2fc3a418bc429a7b9328
4
+ data.tar.gz: 4534477db59ea29d996c88b19c8a45c1b492b49c
5
5
  SHA512:
6
- metadata.gz: dbcab027094cd7880b6d8a4e721b9b1db07268b5f6f3a83e8a90b074347529f9d3697341264d67be2f10339ee0fcf7ca2723148341a78fa01b6863e230032d01
7
- data.tar.gz: 22f5fd2345df864490d8bf4e1e131f826374d6c8a45aa74385ebafa6f11f0e57426f873945d3592b3a14bcdcaffa1681fbfce2ce06ba898aa22a454e38443cae
6
+ metadata.gz: bed3b471866d0dfc919e06ac22a2ca74f19a8951be5af12dd036bb04254723fba3b89d04574cec3f7004dfecaa362f3b650f86b3ecede47064d2676221bb8eb6
7
+ data.tar.gz: f2ab8d1625f1b6109ca3c8b349a19c2f69581848c263ee9e61a71b6a84a00f74ec4b416db8f1ffb2eb99c4288133bf92fb2fb1ad7da2834c9c2cf6cc617dd124
data/lib/app.rb CHANGED
@@ -6,7 +6,7 @@ require 'json'
6
6
  # Home
7
7
  class PostRest < Sinatra::Base
8
8
  set :static, true
9
- set :public_folder, File.expand_path('..', __FILE__)
9
+ set :public_folder, "#{File.expand_path('..', __FILE__)}/../public"
10
10
 
11
11
  get '/' do
12
12
  send_file settings.public_folder + '/index.htm'
data/public/index.htm ADDED
@@ -0,0 +1,116 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset='utf-8'>
5
+ <title>postrest</title>
6
+ <link href='//fonts.googleapis.com/css?family=Raleway:400,300,600' rel='stylesheet' type='text/css'>
7
+ <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.2/normalize.min.css'>
8
+ <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.min.css'>
9
+ <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/chosen/1.1.0/chosen.min.css">
10
+ <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/c3/0.4.10/c3.min.css">
11
+
12
+ <script src='https://code.jquery.com/jquery-2.1.4.min.js'></script>
13
+ <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
14
+ <script src='https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js'></script>
15
+ <script src='https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.12.0/moment.min.js'></script>
16
+ <script src='https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.16/d3.min.js'></script>
17
+ <script src='https://cdnjs.cloudflare.com/ajax/libs/c3/0.4.10/c3.min.js'></script>
18
+
19
+ <link rel="stylesheet" type="text/css" href="node_modules/pivottable/dist/pivot.css">
20
+ <script type="text/javascript" src="node_modules/pivottable/dist/pivot.js"></script>
21
+ <script type="text/javascript" src="node_modules/pivottable/dist/c3_renderers.js"></script>
22
+ <script type="text/javascript" src="node_modules/pivottable/dist/export_renderers.js"></script>
23
+
24
+ <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/chosen/1.1.0/chosen.jquery.min.js"></script>
25
+ <script src='/vendor.js'></script>
26
+ <style type="text/css" media="all">
27
+ body { margin-top: 30px; }
28
+ .templates { display: none; }
29
+
30
+ .grid {
31
+ font-size: 0.8em;
32
+ margin: auto;
33
+ }
34
+
35
+ .output table {
36
+ width: 80%;
37
+ margin: auto;
38
+ }
39
+
40
+ .chart {
41
+ width: 80%;
42
+ margin: auto;
43
+ }
44
+
45
+ form {
46
+ display: block;
47
+ margin: auto;
48
+ width: 80%;
49
+ }
50
+ form textarea {
51
+ width: 100%;
52
+ }
53
+
54
+ form button.submit {
55
+ right: 0;
56
+ }
57
+
58
+ .c3-line, .c3-focused {stroke-width: 3px !important;}
59
+ .c3-bar {stroke: white !important; stroke-width: 1;}
60
+ .c3 text { font-size: 12px; color: grey;}
61
+ .tick line {stroke: white;}
62
+ .c3-axis path {stroke: grey;}
63
+ .c3-circle { opacity: 1 !important; }
64
+
65
+ .connection_string {
66
+ width: 100%;
67
+ }
68
+ </style>
69
+ </head>
70
+
71
+ <body>
72
+ <form class='form'>
73
+ <label for='connection_string'>Connection String</label>
74
+ <input type='text' class='connection_string' value='DB'></input>
75
+ <label for='sql'>Sql</label>
76
+ <textarea class='sql'></textarea>
77
+ <button type='submit' class='sql-submit'>Run</button>
78
+ </form>
79
+ <div id="output" class="output"></div>
80
+ </body>
81
+ <script>
82
+ var renderers = $.extend($.pivotUtilities.renderers,
83
+ $.pivotUtilities.c3_renderers,
84
+ $.pivotUtilities.export_renderers);
85
+ function run_sql() {
86
+ var payload = {
87
+ connection_string: $(".form .connection_string").val(),
88
+ sql: $(".form .sql").val()
89
+ }
90
+
91
+ $.post("/sql", payload, function(l) {
92
+ console.log( 'l: ', l );
93
+ $("#output").pivotUI(l, {
94
+ renderers: renderers,
95
+ rows: Object.keys(l[0]),
96
+ rendererName: "Table"
97
+ }, true);
98
+ });
99
+
100
+ return false;
101
+ }
102
+
103
+ $("form .connection_string").change(function () {
104
+ localStorage.connection_string = this.value;
105
+ });
106
+ $("form .sql").change(function () {
107
+ localStorage.sql = this.value;
108
+ });
109
+
110
+ $( ".form" ).submit(run_sql);
111
+
112
+ $("form .connection_string").val(localStorage.connection_string);
113
+ $("form .sql").val(localStorage.sql);
114
+
115
+ </script>
116
+ </html>
@@ -0,0 +1,19 @@
1
+ ## Issues
2
+
3
+ [Issues](https://github.com/nicolaskruchten/pivottable/issues/new) are the preferred way to communicate with the author and users of PivotTable.js, rather than private email.
4
+
5
+ * If you have multiple questions, please create multiple issues
6
+ * Please do not add a comment to an existing issue to ask an unrelated question: create a new issue instead
7
+ * When creating issue to report a problem, please try to provide a replicable test case (set of steps and/or a URL demonstrating the problem) so that others can help you.
8
+
9
+ ## Pull Requests
10
+
11
+ [Pull requests](https://help.github.com/articles/using-pull-requests) to this project are very welcome! They are most likely to be merged in if they conform to this project's basic goals, scope and structure:
12
+
13
+ * If accepted, you agree that your pull-requests will be released to the world under the same license as the rest of the code: the [MIT license](LICENSE.md).
14
+ * It's probably best to log an issue (see above) to report a bug or ask how something was meant to be done before jumping in and modifying the code, if only to confirm that there isn't another way to do what you're aiming for, and to increase the odds that your pull request will be merged :)
15
+ * Multiple small pull requests which aim to solve clearly-stated problems are preferable to large pull requests which make many unrelated changes
16
+ * The code for this project is written in CoffeeScript and thereafter compiled to Javascript, so it would be best to submit modifications to the CoffeeScript source files rather than to the automatically-generated Javascript source files (please reach out if you've made some neat modifications to the Javascript and want help 'porting' back up to the CoffeeScript version). The easy way to work with this is to leave a `coffee -w -o dist -c *coffee` command running in a terminal, which auto-compiles from CoffeeScript into the `dist` directory as you make changes so that the examples in the `examples` directory will work.
17
+ * Releases for this project are built using the Gulp build system, and the resulting build products (located under `dist`) are tested with the Jasmine test suite under `tests`. See the building/test section of the main ReadMe for details.
18
+ * The aim of this project is to have an extensible core component that fits into a single smallish file ([pivot.coffee](https://github.com/nicolaskruchten/pivottable/blob/master/pivot.coffee)), which depends only on the jQuery and jQueryUI core. If you want to submit changes which depend on other libraries, please submit them as separate 'plugin' files like the Google Chart or D3 renderers.
19
+ * This is a cross-browser, client-side library with very little (if any) browser-specific shim code, so please try to submit modifications that work with as many browsers as possible and which don't require any server-side components
@@ -0,0 +1,9 @@
1
+ (MIT License)
2
+
3
+ PivotTable.js is © 2012-2013 Nicolas Kruchten, Datacratic, other contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,155 @@
1
+ [![npm](https://img.shields.io/badge/npm-pivottable-red.svg)](https://www.npmjs.com/package/pivottable) [![cdnjs](https://img.shields.io/badge/cdnjs-pivottable-orange.svg)](https://cdnjs.com/libraries/pivottable) [![tests](https://img.shields.io/badge/tests-jasmine-green.svg)](http://nicolas.kruchten.com/pivottable/tests/) [![license](https://img.shields.io/badge/license-mit-blue.svg)](https://github.com/nicolaskruchten/pivottable/blob/master/LICENSE.md)
2
+
3
+
4
+ # PivotTable.js
5
+
6
+ PivotTable.js is a Javascript Pivot Table library with drag'n'drop functionality built on top of jQuery/jQueryUI and originally written in CoffeeScript by [Nicolas Kruchten](http://nicolas.kruchten.com) at [Datacratic](http://datacratic.com).
7
+
8
+ It is available under an MIT license from [CDNJS](https://cdnjs.com/libraries/pivottable) and [NPM](https://www.npmjs.com/package/pivottable) and [Bower](http://bower.io/) under the name `pivottable`.
9
+
10
+ PivotTable.js can be used with [Python/Jupyter](https://pypi.python.org/pypi/pivottablejs) and [R/RStudio](https://github.com/smartinsightsfromdata/rpivotTable) and you can [try it right now](http://nicolas.kruchten.com/pivottable/examples/local.html) in your browser on a CSV file.
11
+
12
+ ## What does it do?
13
+
14
+ PivotTable.js' basic function is to enable data exploration and analysis by turning a data set into a summary table and then optionally adding a true 2-d drag'n'drop UI to allow a user to manipulate this summary table, turning it into a pivot table, very similar to the one found in older versions of Microsoft Excel with a bunch of extra developer-oriented features and some visualization effects. With [optional add-ons](https://github.com/nicolaskruchten/pivottable/wiki/Optional-Extra-Renderers), the summary table can be rendered as various kinds of charts, turning the pivot table into a pivot chart.
15
+
16
+ ![image](http://nicolas.kruchten.com/pivottable/images/animation.gif)
17
+
18
+ The animation above is based on the [Canadian Parliament 2012 dataset example](http://nicolas.kruchten.com/pivottable/examples/fully_loaded.html).
19
+
20
+ ## Why is it good?
21
+
22
+ * it's lightweight: the core (without chart support) is a single file with less than 1000 LOC of CoffeeScript, compiles down to 6.3kb of Javascript minified and gzipped, and depends only on jQuery and jQueryUI's 'sortable'
23
+ * it works wherever jQuery and jQueryUI work (tested with jQuery 1.8.3 and jQueryUI 1.9.2)
24
+ * it works acceptably fast in Chrome on commodity hardware up to around a hundred thousand records, depending on the cardinality of the attributes.
25
+ * its UI is [localizable](https://github.com/nicolaskruchten/pivottable/wiki/Localization)
26
+ * its layered architecture allows for summary table generation with or without the pivot table UI around it (if you don't use the UI, then there is no dependency on jQueryUI)
27
+ * it works with common [input formats](https://github.com/nicolaskruchten/pivottable/wiki/Input-Formats)
28
+ * its [derived attributes](https://github.com/nicolaskruchten/pivottable/wiki/Derived-Attributes) can be created on the fly based on the whole input record by passing in a function
29
+ * its complex [aggregation functions](https://github.com/nicolaskruchten/pivottable/wiki/Aggregators) can compute values based on the whole input record (e.g. weighted averages)
30
+ * it has built-in support for basic heatmap and bar chart [renderers](https://github.com/nicolaskruchten/pivottable/wiki/Renderers), and [optional extra renderers that add charting or TSV export support](https://github.com/nicolaskruchten/pivottable/wiki/Optional-Extra-Renderers)
31
+ * its extension points allow aggregation functions, table output, UI and visualizations to be tailored to specific applications
32
+ * it works on mobile devices with [jQuery UI Touch Punch](http://touchpunch.furf.com/)
33
+ * it has a [test suite](http://nicolas.kruchten.com/pivottable/tests)
34
+
35
+ ## Where are the demos/examples?
36
+
37
+ There are lots on the [examples page](http://nicolas.kruchten.com/pivottable/examples/index.html) but here are some good entry points:
38
+
39
+ * [a simple demo running on the "Canadian Parliament 2012" dataset](http://nicolaskruchten.github.io/pivottable/examples/mps_prepop.html)
40
+ * [fully-loaded demo running on the 700+ datasets that ship with R](http://nicolas.kruchten.com/pivottable/examples/rcsvs.html)
41
+ * [fully-loaded demo where you provide a CSV file for input](http://nicolaskruchten.github.io/pivottable/examples/fully_loaded.html)
42
+
43
+ ## How do I use the UI?
44
+
45
+ PivotTable.js implements a pivot table drag'n'drop UI similar to that found in popular spreadsheet programs. You can drag attributes into/out of the row/column areas, and specify rendering, aggregation and filtering options. There is a [step-by-step tutorial](https://github.com/nicolaskruchten/pivottable/wiki/UI-Tutorial) in the wiki.
46
+
47
+ ## How do I load the code?
48
+
49
+ PivotTable.js implements the [Universal Module Definition (UMD)](https://github.com/umdjs/umd) pattern and so should be compatible with most approaches to script loading and dependency management: direct script loading i.e. from [CDNJS](https://cdnjs.com/libraries/pivottable) or with [RequireJS](http://requirejs.org/), [Browserify](http://browserify.org/) etc. For the latter options, you can grab it from [NPM](https://www.npmjs.com/package/pivottable) with `npm install pivottable` or via [Bower](http://bower.io/) with `bower install pivottable`.
50
+
51
+ If you are loading the scripts directly (as in the [examples](http://nicolas.kruchten.com/pivottable)), you need to:
52
+
53
+ 1. load the dependencies:
54
+ 1. jQuery in all cases
55
+ 2. jQueryUI for the interactive `pivotUI()` function (see below)
56
+ 3. D3.js, C3.js and/or Google Charts if you use [charting plugins](https://github.com/nicolaskruchten/pivottable/wiki/Optional-Extra-Renderers)
57
+ 2. load the PivotTable.js files:
58
+ 1. `pivot.min.js`
59
+ 2. any [plugins](https://github.com/nicolaskruchten/pivottable/wiki/Optional-Extra-Renderers) you wish to use
60
+
61
+ The dependencies and PivotTable.js files can be loaded:
62
+
63
+ 1. By copying the files from their official distributions to your project and loading them locally (the [`dist`](https://github.com/nicolaskruchten/pivottable/tree/master/dist) directory is where you will find the PivotTable.js files)
64
+ 2. From a Content Distribution Network (CDN) like [CDNJS](https://cdnjs.com/libraries/pivottable)
65
+
66
+ (The [examples](http://nicolas.kruchten.com/pivottable) load dependencies from CDNJS and PivotTable.js locally)
67
+
68
+ ## How do I use the code?
69
+
70
+ There are two main functions provided by PivotTable.js: `pivot()` and `pivotUI()`, both implemented as jQuery plugins, as well as a bunch of helpers and templates.
71
+
72
+ ### `pivot()`
73
+
74
+ Once you've loaded jQuery and pivot.js, this code ([demo](http://nicolaskruchten.github.io/pivottable/examples/simple.html)):
75
+
76
+ ```javascript
77
+ $("#output").pivot(
78
+ [
79
+ {color: "blue", shape: "circle"},
80
+ {color: "red", shape: "triangle"}
81
+ ],
82
+ {
83
+ rows: ["color"],
84
+ cols: ["shape"]
85
+ }
86
+ );
87
+ ```
88
+
89
+ appends this table to `$("#output")` (the default, *overridable* behaviour is to populate the table cells with counts):
90
+
91
+ ![image](http://nicolaskruchten.github.io/pivottable/images/simple.png)
92
+
93
+ ### `pivotUI()`
94
+
95
+ A slight change to the code (calling `pivotUI()` instead of `pivot()` ) yields the same table with a drag'n'drop UI around it, so long as you've imported jQueryUI ([demo](http://nicolaskruchten.github.io/pivottable/examples/simple_ui.html)):
96
+
97
+ ```javascript
98
+ $("#output").pivotUI(
99
+ [
100
+ {color: "blue", shape: "circle"},
101
+ {color: "red", shape: "triangle"}
102
+ ],
103
+ {
104
+ rows: ["color"],
105
+ cols: ["shape"]
106
+ }
107
+ );
108
+ ```
109
+
110
+ ![image](http://nicolaskruchten.github.io/pivottable/images/simple_ui.png)
111
+
112
+ Note that **`pivot()` and `pivotUI()` take different parameters in general**, even though in the example above we passed the same parameters to both.
113
+
114
+ See the wiki for [full parameter documentation](https://github.com/nicolaskruchten/pivottable/wiki/Parameters).
115
+
116
+ ## Where is the documentation?
117
+
118
+ More extensive documentation can be found in the [wiki](https://github.com/nicolaskruchten/pivottable/wiki):
119
+
120
+ * [Frequently Asked Questions](https://github.com/nicolaskruchten/pivottable/wiki/Frequently-Asked-Questions)
121
+ * [Step by step UI Tutorial](https://github.com/nicolaskruchten/pivottable/wiki/UI-Tutorial)
122
+ * [Full Parameter Documentation](https://github.com/nicolaskruchten/pivottable/wiki/Parameters)
123
+ * [Input Formats](https://github.com/nicolaskruchten/pivottable/wiki/Input-Formats)
124
+ * [Aggregators](https://github.com/nicolaskruchten/pivottable/wiki/Aggregators)
125
+ * [Renderers](https://github.com/nicolaskruchten/pivottable/wiki/Renderers)
126
+ * [Derived Attributes](https://github.com/nicolaskruchten/pivottable/wiki/Derived-Attributes)
127
+ * [Localization](https://github.com/nicolaskruchten/pivottable/wiki/Localization)
128
+ * [Optional Extra Renderers: Google Charts and D3/C3 Support](https://github.com/nicolaskruchten/pivottable/wiki/Optional-Extra-Renderers)
129
+ * [Used By](https://github.com/nicolaskruchten/pivottable/wiki/Used-By)
130
+
131
+ ## How can I build the code and run the tests?
132
+
133
+ To install the development dependencies, just run `npm install`, which will create a `node_modules` directory with the files required to run the [Gulp](http://gulpjs.com/) build system.
134
+
135
+ After modifying any of the `.coffee` files at the top of the repo, you can compile/minify the files into the `dist` directory by running `node_modules/gulp/bin/gulp.js`
136
+
137
+ Once that's done, you can point your browser to `tests/index.html` to run the [Jasmine](http://jasmine.github.io/) test suite. You can view the [current test results here](http://nicolas.kruchten.com/pivottable/tests).
138
+
139
+ ## How can I contribute?
140
+
141
+ Pull requests are welcome! Here are some [Contribution Guidelines](https://github.com/nicolaskruchten/pivottable/blob/master/CONTRIBUTING.md).
142
+
143
+ ## I have a question, how can I get in touch?
144
+
145
+ Please first check the [Frequently Asked Questions](https://github.com/nicolaskruchten/pivottable/wiki/Frequently-Asked-Questions) and if you can't find what you're looking for there, or in the [wiki](https://github.com/nicolaskruchten/pivottable/wiki), then please [create a GitHub Issue](https://github.com/nicolaskruchten/pivottable/issues/new). When creating an issue, please try to provide a replicable test case so that others can more easily help you.
146
+
147
+ ## Copyright & Licence (MIT License)
148
+
149
+ PivotTable.js is © 2012-2013 Nicolas Kruchten, Datacratic, other contributors
150
+
151
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
152
+
153
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
154
+
155
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "pivottable",
3
+ "description": "Javascript Pivot Table (aka Pivot Grid, Pivot Chart, Cross-Tab) implementation with drag'n'drop",
4
+ "version": "2.0.2",
5
+ "main": [
6
+ "dist/pivot.js",
7
+ "dist/pivot.css"
8
+ ],
9
+ "license": "MIT",
10
+ "ignore": [
11
+ "examples"
12
+ ],
13
+ "keywords": [
14
+ "pivot",
15
+ "crosstab",
16
+ "grid",
17
+ "table",
18
+ "pivottable",
19
+ "pivotgrid",
20
+ "pivotchart",
21
+ "jquery"
22
+ ],
23
+ "homepage": "http://nicolas.kruchten.com/pivottable",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git://github.com/nicolaskruchten/pivottable.git"
27
+ },
28
+ "dependencies": {
29
+ "jquery": ">=1.9.0"
30
+ }
31
+ }
@@ -0,0 +1,155 @@
1
+ callWithJQuery = (pivotModule) ->
2
+ if typeof exports is "object" and typeof module is "object" # CommonJS
3
+ pivotModule require("jquery"), require("c3")
4
+ else if typeof define is "function" and define.amd # AMD
5
+ define ["jquery", "c3"], pivotModule
6
+ # Plain browser env
7
+ else
8
+ pivotModule jQuery, c3
9
+
10
+ callWithJQuery ($, c3) ->
11
+
12
+ makeC3Chart = (chartOpts = {}) -> (pivotData, opts) ->
13
+ defaults =
14
+ localeStrings:
15
+ vs: "vs"
16
+ by: "by"
17
+ c3: {}
18
+
19
+ opts = $.extend true, defaults, opts
20
+ opts.c3.size ?= {}
21
+ opts.c3.size.width ?= window.innerWidth / 1.4
22
+ opts.c3.size.height ?= window.innerHeight / 1.4 - 50
23
+ chartOpts.type ?= "line"
24
+
25
+ rowKeys = pivotData.getRowKeys()
26
+ rowKeys.push [] if rowKeys.length == 0
27
+ colKeys = pivotData.getColKeys()
28
+ colKeys.push [] if colKeys.length == 0
29
+
30
+ headers = (h.join("-") for h in colKeys)
31
+ rotationAngle = 0
32
+
33
+ fullAggName = pivotData.aggregatorName
34
+ if pivotData.valAttrs.length
35
+ fullAggName += "(#{pivotData.valAttrs.join(", ")})"
36
+
37
+ if chartOpts.type == "scatter"
38
+ scatterData = x:{}, y:{}, t:{}
39
+ attrs = pivotData.rowAttrs.concat(pivotData.colAttrs)
40
+ vAxisTitle = attrs[0] ? ""
41
+ hAxisTitle = attrs[1] ? ""
42
+ groupByTitle = attrs.slice(2).join("-")
43
+ titleText = vAxisTitle
44
+ titleText += " #{opts.localeStrings.vs} #{hAxisTitle}" if hAxisTitle != ""
45
+ titleText += " #{opts.localeStrings.by} #{groupByTitle}" if groupByTitle != ""
46
+ for rowKey in rowKeys
47
+ for colKey in colKeys
48
+ agg = pivotData.getAggregator(rowKey, colKey)
49
+ if agg.value()?
50
+ vals = rowKey.concat(colKey)
51
+ series = vals.slice(2).join("-")
52
+ if series == "" then series = "series"
53
+ scatterData.x[series] ?= []
54
+ scatterData.y[series] ?= []
55
+ scatterData.t[series] ?= []
56
+ scatterData.y[series].push vals[0] ? 0
57
+ scatterData.x[series].push vals[1] ? 0
58
+ scatterData.t[series].push agg.format(agg.value())
59
+ else
60
+ numCharsInHAxis = 0
61
+ for x in headers
62
+ numCharsInHAxis += x.length
63
+ if numCharsInHAxis > 50
64
+ rotationAngle = 45
65
+
66
+ columns = []
67
+ for rowKey in rowKeys
68
+ rowHeader = rowKey.join("-")
69
+ row = [if rowHeader == "" then pivotData.aggregatorName else rowHeader]
70
+ for colKey in colKeys
71
+ val = parseFloat pivotData.getAggregator(rowKey, colKey).value()
72
+ if isFinite(val)
73
+ if val < 1
74
+ row.push val.toPrecision(3)
75
+ else
76
+ row.push val.toFixed(3)
77
+ else
78
+ row.push null
79
+ columns.push row
80
+
81
+ vAxisTitle = pivotData.aggregatorName+
82
+ if pivotData.valAttrs.length then "(#{pivotData.valAttrs.join(", ")})" else ""
83
+ hAxisTitle = pivotData.colAttrs.join("-")
84
+
85
+ titleText = fullAggName
86
+ titleText += " #{opts.localeStrings.vs} #{hAxisTitle}" if hAxisTitle != ""
87
+ groupByTitle = pivotData.rowAttrs.join("-")
88
+ titleText += " #{opts.localeStrings.by} #{groupByTitle}" if groupByTitle != ""
89
+
90
+ title = $("<p>", {style: "text-align: center; font-weight: bold"})
91
+ title.text(titleText)
92
+
93
+ params =
94
+ axis:
95
+ y:
96
+ label: vAxisTitle
97
+ x:
98
+ label: hAxisTitle
99
+ tick:
100
+ rotate: rotationAngle
101
+ multiline: false
102
+ data:
103
+ type: chartOpts.type
104
+ tooltip:
105
+ grouped: false
106
+ color:
107
+ pattern: [ "#3366cc", "#dc3912", "#ff9900", "#109618",
108
+ "#990099", "#0099c6", "#dd4477", "#66aa00",
109
+ "#b82e2e", "#316395", "#994499", "#22aa99",
110
+ "#aaaa11", "#6633cc", "#e67300", "#8b0707",
111
+ "#651067", "#329262", "#5574a6", "#3b3eac" ]
112
+
113
+
114
+ $.extend params, opts.c3
115
+
116
+ if chartOpts.type == "scatter"
117
+ xs = {}
118
+ numSeries = 0
119
+ dataColumns = []
120
+ for s of scatterData.x
121
+ numSeries += 1
122
+ xs[s] = s+"_x"
123
+ dataColumns.push [s+"_x"].concat(scatterData.x[s])
124
+ dataColumns.push [s].concat(scatterData.y[s])
125
+ params.data.xs = xs
126
+ params.data.columns = dataColumns
127
+ params.axis.x.tick = fit: false
128
+ if numSeries == 1
129
+ params.legend = show: false
130
+ params.tooltip.format =
131
+ title: -> fullAggName
132
+ name: -> ""
133
+ value: (a,b,c,d) -> scatterData.t[c][d]
134
+ else
135
+ params.axis.x.type= 'category'
136
+ params.axis.x.categories = headers
137
+ params.data.columns = columns
138
+
139
+
140
+ if chartOpts.stacked?
141
+ params.data.groups = [x.join("-") for x in rowKeys]
142
+ renderArea = $("<div>", style: "display:none;").appendTo $("body")
143
+ result = $("<div>").appendTo renderArea
144
+ params.bindto = result[0]
145
+ c3.generate params
146
+ result.detach()
147
+ renderArea.remove()
148
+ return $("<div>").append title, result
149
+
150
+ $.pivotUtilities.c3_renderers =
151
+ "Line Chart": makeC3Chart()
152
+ "Bar Chart": makeC3Chart(type: "bar")
153
+ "Stacked Bar Chart": makeC3Chart(type: "bar", stacked: true)
154
+ "Area Chart": makeC3Chart(type: "area", stacked: true)
155
+ "Scatter Chart": makeC3Chart(type: "scatter")