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 @@
1
+ {"version":3,"sources":["pivot.es.coffee"],"names":[],"mappings":"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","file":"pivot.es.js","sourceRoot":"/source/","sourcesContent":["callWithJQuery = (pivotModule) ->\n if typeof exports is \"object\" and typeof module is \"object\" # CommonJS\n pivotModule require(\"jquery\")\n else if typeof define is \"function\" and define.amd # AMD\n define [\"jquery\"], pivotModule\n # Plain browser env\n else\n pivotModule jQuery\n \ncallWithJQuery ($) ->\n nf = $.pivotUtilities.numberFormat\n tpl = $.pivotUtilities.aggregatorTemplates\n\n frFmt = nf(thousandsSep: \" \", decimalSep: \",\")\n frFmtInt = nf(digitsAfterDecimal: 0, thousandsSep: \" \", decimalSep: \",\")\n frFmtPct = nf(digitsAfterDecimal: 1, scaler: 100, suffix: \"%\", thousandsSep: \" \", decimalSep: \",\")\n\n $.pivotUtilities.locales.es = \n\n localeStrings:\n renderError: \"Ocurrió un error durante la interpretación de la tabla din´mica.\"\n computeError: \"Ocurrió un error durante el c´lculo de la tabla din´mica.\"\n uiRenderError: \"Ocurrió un error durante el dibujado de la tabla din´mica.\"\n selectAll: \"Seleccionar todo\"\n selectNone: \"Deseleccionar todo\"\n tooMany: \"(demasiados valores)\"\n filterResults: \"Filtrar resultados\"\n totals: \"Totales\"\n vs: \"vs\"\n by: \"por\"\n aggregators: \n \"Cuenta\": tpl.count(frFmtInt)\n \"Cuenta de valores únicos\": tpl.countUnique(frFmtInt)\n \"Lista de valores únicos\": tpl.listUnique(\", \")\n \"Suma\": tpl.sum(frFmt)\n \"Suma de enteros\": tpl.sum(frFmtInt)\n \"Promedio\": tpl.average(frFmt)\n \"Mínimo\": tpl.min(frFmt)\n \"Máximo\": tpl.max(frFmt)\n \"Suma de sumas\": tpl.sumOverSum(frFmt)\n \"Cota 80% superior\": tpl.sumOverSumBound80(true, frFmt)\n \"Cota 80% inferior\": tpl.sumOverSumBound80(false, frFmt)\n \"Proporción del total (suma)\": tpl.fractionOf(tpl.sum(), \"total\", frFmtPct)\n \"Proporción de la fila (suma)\": tpl.fractionOf(tpl.sum(), \"row\", frFmtPct)\n \"Proporción de la columna (suma)\": tpl.fractionOf(tpl.sum(), \"col\", frFmtPct)\n \"Proporción del total (cuenta)\": tpl.fractionOf(tpl.count(), \"total\", frFmtPct)\n \"Proporción de la fila (cuenta)\": tpl.fractionOf(tpl.count(), \"row\", frFmtPct)\n \"Proporción de la columna (cuenta)\": tpl.fractionOf(tpl.count(), \"col\", frFmtPct)\n\n renderers:\n \"Tabla\": $.pivotUtilities.renderers[\"Table\"]\n \"Tabla con barras\": $.pivotUtilities.renderers[\"Table Barchart\"]\n \"Heatmap\": $.pivotUtilities.renderers[\"Heatmap\"]\n \"Heatmap por filas\": $.pivotUtilities.renderers[\"Row Heatmap\"]\n \"Heatmap por columnas\": $.pivotUtilities.renderers[\"Col Heatmap\"]\n\n\n"]}
@@ -0,0 +1,2 @@
1
+ (function(){var e;(e=function(e){return"object"==typeof exports&&"object"==typeof module?e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){var a,t,r,o,i;return o=e.pivotUtilities.numberFormat,i=e.pivotUtilities.aggregatorTemplates,a=o({thousandsSep:" ",decimalSep:","}),t=o({digitsAfterDecimal:0,thousandsSep:" ",decimalSep:","}),r=o({digitsAfterDecimal:1,scaler:100,suffix:"%",thousandsSep:" ",decimalSep:","}),e.pivotUtilities.locales.es={localeStrings:{renderError:"Ocurrió un error durante la interpretación de la tabla din´mica.",computeError:"Ocurrió un error durante el c´lculo de la tabla din´mica.",uiRenderError:"Ocurrió un error durante el dibujado de la tabla din´mica.",selectAll:"Seleccionar todo",selectNone:"Deseleccionar todo",tooMany:"(demasiados valores)",filterResults:"Filtrar resultados",totals:"Totales",vs:"vs",by:"por"},aggregators:{Cuenta:i.count(t),"Cuenta de valores únicos":i.countUnique(t),"Lista de valores únicos":i.listUnique(", "),Suma:i.sum(a),"Suma de enteros":i.sum(t),Promedio:i.average(a),"Mínimo":i.min(a),"Máximo":i.max(a),"Suma de sumas":i.sumOverSum(a),"Cota 80% superior":i.sumOverSumBound80(!0,a),"Cota 80% inferior":i.sumOverSumBound80(!1,a),"Proporción del total (suma)":i.fractionOf(i.sum(),"total",r),"Proporción de la fila (suma)":i.fractionOf(i.sum(),"row",r),"Proporción de la columna (suma)":i.fractionOf(i.sum(),"col",r),"Proporción del total (cuenta)":i.fractionOf(i.count(),"total",r),"Proporción de la fila (cuenta)":i.fractionOf(i.count(),"row",r),"Proporción de la columna (cuenta)":i.fractionOf(i.count(),"col",r)},renderers:{Tabla:e.pivotUtilities.renderers.Table,"Tabla con barras":e.pivotUtilities.renderers["Table Barchart"],Heatmap:e.pivotUtilities.renderers.Heatmap,"Heatmap por filas":e.pivotUtilities.renderers["Row Heatmap"],"Heatmap por columnas":e.pivotUtilities.renderers["Col Heatmap"]}}})}).call(this);
2
+ //# sourceMappingURL=pivot.es.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/source/pivot.es.coffee","pivot.es.min.js"],"names":["callWithJQuery","pivotModule","exports","module","require","define","amd","jQuery","$","frFmt","frFmtInt","frFmtPct","nf","tpl","pivotUtilities","numberFormat","aggregatorTemplates","thousandsSep","decimalSep","digitsAfterDecimal","scaler","suffix","locales","es","localeStrings","renderError","computeError","uiRenderError","selectAll","selectNone","tooMany","filterResults","totals","vs","by","aggregators","Cuenta","count","Cuenta de valores únicos","countUnique","Lista de valores únicos","listUnique","Suma","sum","Suma de enteros","Promedio","average","Mínimo","min","Máximo","max","Suma de sumas","sumOverSum","Cota 80% superior","sumOverSumBound80","Cota 80% inferior","Proporción del total (suma)","fractionOf","Proporción de la fila (suma)","Proporción de la columna (suma)","Proporción del total (cuenta)","Proporción de la fila (cuenta)","Proporción de la columna (cuenta)","renderers","Tabla","Tabla con barras","Heatmap","Heatmap por filas","Heatmap por columnas","call","this"],"mappings":"CAAA,WAAA,GAAAA,IAAAA,EAAiB,SAACC,GACd,MAAqB,gBAAXC,UAAyC,gBAAVC,QACrCF,EAAYG,QAAQ,WACC,kBAAVC,SAAyBA,OAAOC,IAC3CD,QAAQ,UAAWJ,GAGnBA,EAAYM,UAEL,SAACC,GACZ,GAAAC,GAAAC,EAAAC,EAAAC,EAAAC,CCuBA,ODvBAD,GAAKJ,EAAEM,eAAeC,aACtBF,EAAML,EAAEM,eAAeE,oBAEvBP,EAAWG,GAAGK,aAAc,IAAKC,WAAY,MAC7CR,EAAWE,GAAGO,mBAAoB,EAAGF,aAAc,IAAKC,WAAY,MACpEP,EAAWC,GAAGO,mBAAoB,EAAGC,OAAQ,IAAKC,OAAQ,IAAKJ,aAAc,IAAKC,WAAY,MAE9FV,EAAEM,eAAeQ,QAAQC,IAErBC,eACIC,YAAa,uFACbC,aAAc,+EACdC,cAAe,0EACfC,UAAW,mBACXC,WAAY,qBACZC,QAAS,uBACTC,cAAe,qBACfC,OAAQ,UACRC,GAAI,KACJC,GAAI,OACRC,aACIC,OAAsCvB,EAAIwB,MAAM3B,GAChD4B,kCAA4CzB,EAAI0B,YAAY7B,GAC5D8B,iCAA4C3B,EAAI4B,WAAW,MAC3DC,KAAqC7B,EAAI8B,IAAIlC,GAC7CmC,kBAAqC/B,EAAI8B,IAAIjC,GAC7CmC,SAAuChC,EAAIiC,QAAQrC,GACnDsC,SAAgDlC,EAAImC,IAAIvC,GACxDwC,SAAgDpC,EAAIqC,IAAIzC,GACxD0C,gBAAoCtC,EAAIuC,WAAW3C,GACnD4C,oBAA4BxC,EAAIyC,mBAAkB,EAAM7C,GACxD8C,oBAA4B1C,EAAIyC,mBAAkB,EAAO7C,GACzD+C,qCAA2C3C,EAAI4C,WAAW5C,EAAI8B,MAAS,QAAShC,GAChF+C,sCAA0C7C,EAAI4C,WAAW5C,EAAI8B,MAAS,MAAShC,GAC/EgD,yCAA2C9C,EAAI4C,WAAW5C,EAAI8B,MAAS,MAAShC,GAChFiD,uCAA4C/C,EAAI4C,WAAW5C,EAAIwB,QAAS,QAAS1B,GACjFkD,wCAA2ChD,EAAI4C,WAAW5C,EAAIwB,QAAS,MAAS1B,GAChFmD,2CAA4CjD,EAAI4C,WAAW5C,EAAIwB,QAAS,MAAS1B,IAErFoD,WACIC,MAAmCxD,EAAEM,eAAeiD,UAAU,MAC9DE,mBAAkCzD,EAAEM,eAAeiD,UAAU,kBAC7DG,QAA0B1D,EAAEM,eAAeiD,UAAU,QACrDI,oBAA0B3D,EAAEM,eAAeiD,UAAU,eACrDK,uBAA2B5D,EAAEM,eAAeiD,UAAU,qBCqB/DM,KAAKC","file":"pivot.es.min.js","sourcesContent":["callWithJQuery = (pivotModule) ->\n if typeof exports is \"object\" and typeof module is \"object\" # CommonJS\n pivotModule require(\"jquery\")\n else if typeof define is \"function\" and define.amd # AMD\n define [\"jquery\"], pivotModule\n # Plain browser env\n else\n pivotModule jQuery\n \ncallWithJQuery ($) ->\n nf = $.pivotUtilities.numberFormat\n tpl = $.pivotUtilities.aggregatorTemplates\n\n frFmt = nf(thousandsSep: \" \", decimalSep: \",\")\n frFmtInt = nf(digitsAfterDecimal: 0, thousandsSep: \" \", decimalSep: \",\")\n frFmtPct = nf(digitsAfterDecimal: 1, scaler: 100, suffix: \"%\", thousandsSep: \" \", decimalSep: \",\")\n\n $.pivotUtilities.locales.es = \n\n localeStrings:\n renderError: \"Ocurrió un error durante la interpretación de la tabla din´mica.\"\n computeError: \"Ocurrió un error durante el c´lculo de la tabla din´mica.\"\n uiRenderError: \"Ocurrió un error durante el dibujado de la tabla din´mica.\"\n selectAll: \"Seleccionar todo\"\n selectNone: \"Deseleccionar todo\"\n tooMany: \"(demasiados valores)\"\n filterResults: \"Filtrar resultados\"\n totals: \"Totales\"\n vs: \"vs\"\n by: \"por\"\n aggregators: \n \"Cuenta\": tpl.count(frFmtInt)\n \"Cuenta de valores únicos\": tpl.countUnique(frFmtInt)\n \"Lista de valores únicos\": tpl.listUnique(\", \")\n \"Suma\": tpl.sum(frFmt)\n \"Suma de enteros\": tpl.sum(frFmtInt)\n \"Promedio\": tpl.average(frFmt)\n \"Mínimo\": tpl.min(frFmt)\n \"Máximo\": tpl.max(frFmt)\n \"Suma de sumas\": tpl.sumOverSum(frFmt)\n \"Cota 80% superior\": tpl.sumOverSumBound80(true, frFmt)\n \"Cota 80% inferior\": tpl.sumOverSumBound80(false, frFmt)\n \"Proporción del total (suma)\": tpl.fractionOf(tpl.sum(), \"total\", frFmtPct)\n \"Proporción de la fila (suma)\": tpl.fractionOf(tpl.sum(), \"row\", frFmtPct)\n \"Proporción de la columna (suma)\": tpl.fractionOf(tpl.sum(), \"col\", frFmtPct)\n \"Proporción del total (cuenta)\": tpl.fractionOf(tpl.count(), \"total\", frFmtPct)\n \"Proporción de la fila (cuenta)\": tpl.fractionOf(tpl.count(), \"row\", frFmtPct)\n \"Proporción de la columna (cuenta)\": tpl.fractionOf(tpl.count(), \"col\", frFmtPct)\n\n renderers:\n \"Tabla\": $.pivotUtilities.renderers[\"Table\"]\n \"Tabla con barras\": $.pivotUtilities.renderers[\"Table Barchart\"]\n \"Heatmap\": $.pivotUtilities.renderers[\"Heatmap\"]\n \"Heatmap por filas\": $.pivotUtilities.renderers[\"Row Heatmap\"]\n \"Heatmap por columnas\": $.pivotUtilities.renderers[\"Col Heatmap\"]\n\n\n","(function() {\n var callWithJQuery;\n\n callWithJQuery = function(pivotModule) {\n if (typeof exports === \"object\" && typeof module === \"object\") {\n return pivotModule(require(\"jquery\"));\n } else if (typeof define === \"function\" && define.amd) {\n return define([\"jquery\"], pivotModule);\n } else {\n return pivotModule(jQuery);\n }\n };\n\n callWithJQuery(function($) {\n var frFmt, frFmtInt, frFmtPct, nf, tpl;\n nf = $.pivotUtilities.numberFormat;\n tpl = $.pivotUtilities.aggregatorTemplates;\n frFmt = nf({\n thousandsSep: \" \",\n decimalSep: \",\"\n });\n frFmtInt = nf({\n digitsAfterDecimal: 0,\n thousandsSep: \" \",\n decimalSep: \",\"\n });\n frFmtPct = nf({\n digitsAfterDecimal: 1,\n scaler: 100,\n suffix: \"%\",\n thousandsSep: \" \",\n decimalSep: \",\"\n });\n return $.pivotUtilities.locales.es = {\n localeStrings: {\n renderError: \"Ocurrió un error durante la interpretación de la tabla din´mica.\",\n computeError: \"Ocurrió un error durante el c´lculo de la tabla din´mica.\",\n uiRenderError: \"Ocurrió un error durante el dibujado de la tabla din´mica.\",\n selectAll: \"Seleccionar todo\",\n selectNone: \"Deseleccionar todo\",\n tooMany: \"(demasiados valores)\",\n filterResults: \"Filtrar resultados\",\n totals: \"Totales\",\n vs: \"vs\",\n by: \"por\"\n },\n aggregators: {\n \"Cuenta\": tpl.count(frFmtInt),\n \"Cuenta de valores únicos\": tpl.countUnique(frFmtInt),\n \"Lista de valores únicos\": tpl.listUnique(\", \"),\n \"Suma\": tpl.sum(frFmt),\n \"Suma de enteros\": tpl.sum(frFmtInt),\n \"Promedio\": tpl.average(frFmt),\n \"Mínimo\": tpl.min(frFmt),\n \"Máximo\": tpl.max(frFmt),\n \"Suma de sumas\": tpl.sumOverSum(frFmt),\n \"Cota 80% superior\": tpl.sumOverSumBound80(true, frFmt),\n \"Cota 80% inferior\": tpl.sumOverSumBound80(false, frFmt),\n \"Proporción del total (suma)\": tpl.fractionOf(tpl.sum(), \"total\", frFmtPct),\n \"Proporción de la fila (suma)\": tpl.fractionOf(tpl.sum(), \"row\", frFmtPct),\n \"Proporción de la columna (suma)\": tpl.fractionOf(tpl.sum(), \"col\", frFmtPct),\n \"Proporción del total (cuenta)\": tpl.fractionOf(tpl.count(), \"total\", frFmtPct),\n \"Proporción de la fila (cuenta)\": tpl.fractionOf(tpl.count(), \"row\", frFmtPct),\n \"Proporción de la columna (cuenta)\": tpl.fractionOf(tpl.count(), \"col\", frFmtPct)\n },\n renderers: {\n \"Tabla\": $.pivotUtilities.renderers[\"Table\"],\n \"Tabla con barras\": $.pivotUtilities.renderers[\"Table Barchart\"],\n \"Heatmap\": $.pivotUtilities.renderers[\"Heatmap\"],\n \"Heatmap por filas\": $.pivotUtilities.renderers[\"Row Heatmap\"],\n \"Heatmap por columnas\": $.pivotUtilities.renderers[\"Col Heatmap\"]\n }\n };\n });\n\n}).call(this);\n\n//# sourceMappingURL=pivot.es.js.map\n"],"sourceRoot":"/source/"}
@@ -0,0 +1,78 @@
1
+ (function() {
2
+ var callWithJQuery;
3
+
4
+ callWithJQuery = function(pivotModule) {
5
+ if (typeof exports === "object" && typeof module === "object") {
6
+ return pivotModule(require("jquery"));
7
+ } else if (typeof define === "function" && define.amd) {
8
+ return define(["jquery"], pivotModule);
9
+ } else {
10
+ return pivotModule(jQuery);
11
+ }
12
+ };
13
+
14
+ callWithJQuery(function($) {
15
+ var frFmt, frFmtInt, frFmtPct, nf, tpl;
16
+ nf = $.pivotUtilities.numberFormat;
17
+ tpl = $.pivotUtilities.aggregatorTemplates;
18
+ frFmt = nf({
19
+ thousandsSep: " ",
20
+ decimalSep: ","
21
+ });
22
+ frFmtInt = nf({
23
+ digitsAfterDecimal: 0,
24
+ thousandsSep: " ",
25
+ decimalSep: ","
26
+ });
27
+ frFmtPct = nf({
28
+ digitsAfterDecimal: 1,
29
+ scaler: 100,
30
+ suffix: "%",
31
+ thousandsSep: " ",
32
+ decimalSep: ","
33
+ });
34
+ return $.pivotUtilities.locales.fr = {
35
+ localeStrings: {
36
+ renderError: "Une erreur est survenue en dessinant le tableau croisé.",
37
+ computeError: "Une erreur est survenue en calculant le tableau croisé.",
38
+ uiRenderError: "Une erreur est survenue en dessinant l'interface du tableau croisé dynamique.",
39
+ selectAll: "Sélectionner tout",
40
+ selectNone: "Sélectionner rien",
41
+ tooMany: "(trop de valeurs à afficher)",
42
+ filterResults: "Filtrer les valeurs",
43
+ totals: "Totaux",
44
+ vs: "sur",
45
+ by: "par"
46
+ },
47
+ aggregators: {
48
+ "Nombre": tpl.count(frFmtInt),
49
+ "Nombre de valeurs uniques": tpl.countUnique(frFmtInt),
50
+ "Liste de valeurs uniques": tpl.listUnique(", "),
51
+ "Somme": tpl.sum(frFmt),
52
+ "Somme en entiers": tpl.sum(frFmtInt),
53
+ "Moyenne": tpl.average(frFmt),
54
+ "Minimum": tpl.min(frFmt),
55
+ "Maximum": tpl.max(frFmt),
56
+ "Ratio de sommes": tpl.sumOverSum(frFmt),
57
+ "Borne supérieure 80%": tpl.sumOverSumBound80(true, frFmt),
58
+ "Borne inférieure 80%": tpl.sumOverSumBound80(false, frFmt),
59
+ "Somme en proportion du totale": tpl.fractionOf(tpl.sum(), "total", frFmtPct),
60
+ "Somme en proportion de la ligne": tpl.fractionOf(tpl.sum(), "row", frFmtPct),
61
+ "Somme en proportion de la colonne": tpl.fractionOf(tpl.sum(), "col", frFmtPct),
62
+ "Nombre en proportion du totale": tpl.fractionOf(tpl.count(), "total", frFmtPct),
63
+ "Nombre en proportion de la ligne": tpl.fractionOf(tpl.count(), "row", frFmtPct),
64
+ "Nombre en proportion de la colonne": tpl.fractionOf(tpl.count(), "col", frFmtPct)
65
+ },
66
+ renderers: {
67
+ "Table": $.pivotUtilities.renderers["Table"],
68
+ "Table avec barres": $.pivotUtilities.renderers["Table Barchart"],
69
+ "Carte de chaleur": $.pivotUtilities.renderers["Heatmap"],
70
+ "Carte de chaleur par ligne": $.pivotUtilities.renderers["Row Heatmap"],
71
+ "Carte de chaleur par colonne": $.pivotUtilities.renderers["Col Heatmap"]
72
+ }
73
+ };
74
+ });
75
+
76
+ }).call(this);
77
+
78
+ //# sourceMappingURL=pivot.fr.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["pivot.fr.coffee"],"names":[],"mappings":"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","file":"pivot.fr.js","sourceRoot":"/source/","sourcesContent":["callWithJQuery = (pivotModule) ->\n if typeof exports is \"object\" and typeof module is \"object\" # CommonJS\n pivotModule require(\"jquery\")\n else if typeof define is \"function\" and define.amd # AMD\n define [\"jquery\"], pivotModule\n # Plain browser env\n else\n pivotModule jQuery\n \ncallWithJQuery ($) ->\n nf = $.pivotUtilities.numberFormat\n tpl = $.pivotUtilities.aggregatorTemplates\n\n frFmt = nf(thousandsSep: \" \", decimalSep: \",\")\n frFmtInt = nf(digitsAfterDecimal: 0, thousandsSep: \" \", decimalSep: \",\")\n frFmtPct = nf(digitsAfterDecimal: 1, scaler: 100, suffix: \"%\", thousandsSep: \" \", decimalSep: \",\")\n\n $.pivotUtilities.locales.fr = \n localeStrings:\n renderError: \"Une erreur est survenue en dessinant le tableau croisé.\"\n computeError: \"Une erreur est survenue en calculant le tableau croisé.\"\n uiRenderError: \"Une erreur est survenue en dessinant l'interface du tableau croisé dynamique.\"\n selectAll: \"Sélectionner tout\"\n selectNone: \"Sélectionner rien\"\n tooMany: \"(trop de valeurs à afficher)\"\n filterResults: \"Filtrer les valeurs\"\n totals: \"Totaux\"\n vs: \"sur\"\n by: \"par\"\n\n aggregators: \n \"Nombre\": tpl.count(frFmtInt)\n \"Nombre de valeurs uniques\": tpl.countUnique(frFmtInt)\n \"Liste de valeurs uniques\": tpl.listUnique(\", \")\n \"Somme\": tpl.sum(frFmt)\n \"Somme en entiers\": tpl.sum(frFmtInt)\n \"Moyenne\": tpl.average(frFmt)\n \"Minimum\": tpl.min(frFmt)\n \"Maximum\": tpl.max(frFmt)\n \"Ratio de sommes\": tpl.sumOverSum(frFmt)\n \"Borne supérieure 80%\": tpl.sumOverSumBound80(true, frFmt)\n \"Borne inférieure 80%\": tpl.sumOverSumBound80(false, frFmt)\n \"Somme en proportion du totale\": tpl.fractionOf(tpl.sum(), \"total\", frFmtPct)\n \"Somme en proportion de la ligne\": tpl.fractionOf(tpl.sum(), \"row\", frFmtPct)\n \"Somme en proportion de la colonne\": tpl.fractionOf(tpl.sum(), \"col\", frFmtPct)\n \"Nombre en proportion du totale\": tpl.fractionOf(tpl.count(), \"total\", frFmtPct)\n \"Nombre en proportion de la ligne\": tpl.fractionOf(tpl.count(), \"row\", frFmtPct)\n \"Nombre en proportion de la colonne\": tpl.fractionOf(tpl.count(), \"col\", frFmtPct)\n\n renderers:\n \"Table\": $.pivotUtilities.renderers[\"Table\"]\n \"Table avec barres\": $.pivotUtilities.renderers[\"Table Barchart\"]\n \"Carte de chaleur\": $.pivotUtilities.renderers[\"Heatmap\"]\n \"Carte de chaleur par ligne\": $.pivotUtilities.renderers[\"Row Heatmap\"]\n \"Carte de chaleur par colonne\": $.pivotUtilities.renderers[\"Col Heatmap\"]\n\n\n"]}
@@ -0,0 +1,2 @@
1
+ (function(){var e;(e=function(e){return"object"==typeof exports&&"object"==typeof module?e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){var r,t,o,i,n;return i=e.pivotUtilities.numberFormat,n=e.pivotUtilities.aggregatorTemplates,r=i({thousandsSep:" ",decimalSep:","}),t=i({digitsAfterDecimal:0,thousandsSep:" ",decimalSep:","}),o=i({digitsAfterDecimal:1,scaler:100,suffix:"%",thousandsSep:" ",decimalSep:","}),e.pivotUtilities.locales.fr={localeStrings:{renderError:"Une erreur est survenue en dessinant le tableau croisé.",computeError:"Une erreur est survenue en calculant le tableau croisé.",uiRenderError:"Une erreur est survenue en dessinant l'interface du tableau croisé dynamique.",selectAll:"Sélectionner tout",selectNone:"Sélectionner rien",tooMany:"(trop de valeurs à afficher)",filterResults:"Filtrer les valeurs",totals:"Totaux",vs:"sur",by:"par"},aggregators:{Nombre:n.count(t),"Nombre de valeurs uniques":n.countUnique(t),"Liste de valeurs uniques":n.listUnique(", "),Somme:n.sum(r),"Somme en entiers":n.sum(t),Moyenne:n.average(r),Minimum:n.min(r),Maximum:n.max(r),"Ratio de sommes":n.sumOverSum(r),"Borne supérieure 80%":n.sumOverSumBound80(!0,r),"Borne inférieure 80%":n.sumOverSumBound80(!1,r),"Somme en proportion du totale":n.fractionOf(n.sum(),"total",o),"Somme en proportion de la ligne":n.fractionOf(n.sum(),"row",o),"Somme en proportion de la colonne":n.fractionOf(n.sum(),"col",o),"Nombre en proportion du totale":n.fractionOf(n.count(),"total",o),"Nombre en proportion de la ligne":n.fractionOf(n.count(),"row",o),"Nombre en proportion de la colonne":n.fractionOf(n.count(),"col",o)},renderers:{Table:e.pivotUtilities.renderers.Table,"Table avec barres":e.pivotUtilities.renderers["Table Barchart"],"Carte de chaleur":e.pivotUtilities.renderers.Heatmap,"Carte de chaleur par ligne":e.pivotUtilities.renderers["Row Heatmap"],"Carte de chaleur par colonne":e.pivotUtilities.renderers["Col Heatmap"]}}})}).call(this);
2
+ //# sourceMappingURL=pivot.fr.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/source/pivot.fr.coffee","pivot.fr.min.js"],"names":["callWithJQuery","pivotModule","exports","module","require","define","amd","jQuery","$","frFmt","frFmtInt","frFmtPct","nf","tpl","pivotUtilities","numberFormat","aggregatorTemplates","thousandsSep","decimalSep","digitsAfterDecimal","scaler","suffix","locales","fr","localeStrings","renderError","computeError","uiRenderError","selectAll","selectNone","tooMany","filterResults","totals","vs","by","aggregators","Nombre","count","Nombre de valeurs uniques","countUnique","Liste de valeurs uniques","listUnique","Somme","sum","Somme en entiers","Moyenne","average","Minimum","min","Maximum","max","Ratio de sommes","sumOverSum","Borne supérieure 80%","sumOverSumBound80","Borne inférieure 80%","Somme en proportion du totale","fractionOf","Somme en proportion de la ligne","Somme en proportion de la colonne","Nombre en proportion du totale","Nombre en proportion de la ligne","Nombre en proportion de la colonne","renderers","Table","Table avec barres","Carte de chaleur","Carte de chaleur par ligne","Carte de chaleur par colonne","call","this"],"mappings":"CAAA,WAAA,GAAAA,IAAAA,EAAiB,SAACC,GACd,MAAqB,gBAAXC,UAAyC,gBAAVC,QACrCF,EAAYG,QAAQ,WACC,kBAAVC,SAAyBA,OAAOC,IAC3CD,QAAQ,UAAWJ,GAGnBA,EAAYM,UAEL,SAACC,GACZ,GAAAC,GAAAC,EAAAC,EAAAC,EAAAC,CCuBA,ODvBAD,GAAKJ,EAAEM,eAAeC,aACtBF,EAAML,EAAEM,eAAeE,oBAEvBP,EAAWG,GAAGK,aAAc,IAAKC,WAAY,MAC7CR,EAAWE,GAAGO,mBAAoB,EAAGF,aAAc,IAAKC,WAAY,MACpEP,EAAWC,GAAGO,mBAAoB,EAAGC,OAAQ,IAAKC,OAAQ,IAAKJ,aAAc,IAAKC,WAAY,MAE9FV,EAAEM,eAAeQ,QAAQC,IACrBC,eACIC,YAAa,iEACbC,aAAc,iEACdC,cAAe,uFACfC,UAAW,2BACXC,WAAY,2BACZC,QAAS,sCACTC,cAAe,sBACfC,OAAQ,SACRC,GAAI,MACJC,GAAI,OAERC,aACIC,OAAsCvB,EAAIwB,MAAM3B,GAChD4B,4BAAsCzB,EAAI0B,YAAY7B,GACtD8B,2BAAsC3B,EAAI4B,WAAW,MACrDC,MAAsC7B,EAAI8B,IAAIlC,GAC9CmC,mBAAsC/B,EAAI8B,IAAIjC,GAC9CmC,QAAsChC,EAAIiC,QAAQrC,GAClDsC,QAAsClC,EAAImC,IAAIvC,GAC9CwC,QAAsCpC,EAAIqC,IAAIzC,GAC9C0C,kBAAsCtC,EAAIuC,WAAW3C,GACrD4C,8BAAsCxC,EAAIyC,mBAAkB,EAAM7C,GAClE8C,8BAAsC1C,EAAIyC,mBAAkB,EAAO7C,GACnE+C,gCAAsC3C,EAAI4C,WAAW5C,EAAI8B,MAAS,QAAShC,GAC3E+C,kCAAsC7C,EAAI4C,WAAW5C,EAAI8B,MAAS,MAAShC,GAC3EgD,oCAAsC9C,EAAI4C,WAAW5C,EAAI8B,MAAS,MAAShC,GAC3EiD,iCAAsC/C,EAAI4C,WAAW5C,EAAIwB,QAAS,QAAS1B,GAC3EkD,mCAAsChD,EAAI4C,WAAW5C,EAAIwB,QAAS,MAAS1B,GAC3EmD,qCAAsCjD,EAAI4C,WAAW5C,EAAIwB,QAAS,MAAS1B,IAE/EoD,WACIC,MAAmCxD,EAAEM,eAAeiD,UAAU,MAC9DE,oBAAmCzD,EAAEM,eAAeiD,UAAU,kBAC9DG,mBAAmC1D,EAAEM,eAAeiD,UAAU,QAC9DI,6BAAmC3D,EAAEM,eAAeiD,UAAU,eAC9DK,+BAAmC5D,EAAEM,eAAeiD,UAAU,qBCqBvEM,KAAKC","file":"pivot.fr.min.js","sourcesContent":["callWithJQuery = (pivotModule) ->\n if typeof exports is \"object\" and typeof module is \"object\" # CommonJS\n pivotModule require(\"jquery\")\n else if typeof define is \"function\" and define.amd # AMD\n define [\"jquery\"], pivotModule\n # Plain browser env\n else\n pivotModule jQuery\n \ncallWithJQuery ($) ->\n nf = $.pivotUtilities.numberFormat\n tpl = $.pivotUtilities.aggregatorTemplates\n\n frFmt = nf(thousandsSep: \" \", decimalSep: \",\")\n frFmtInt = nf(digitsAfterDecimal: 0, thousandsSep: \" \", decimalSep: \",\")\n frFmtPct = nf(digitsAfterDecimal: 1, scaler: 100, suffix: \"%\", thousandsSep: \" \", decimalSep: \",\")\n\n $.pivotUtilities.locales.fr = \n localeStrings:\n renderError: \"Une erreur est survenue en dessinant le tableau croisé.\"\n computeError: \"Une erreur est survenue en calculant le tableau croisé.\"\n uiRenderError: \"Une erreur est survenue en dessinant l'interface du tableau croisé dynamique.\"\n selectAll: \"Sélectionner tout\"\n selectNone: \"Sélectionner rien\"\n tooMany: \"(trop de valeurs à afficher)\"\n filterResults: \"Filtrer les valeurs\"\n totals: \"Totaux\"\n vs: \"sur\"\n by: \"par\"\n\n aggregators: \n \"Nombre\": tpl.count(frFmtInt)\n \"Nombre de valeurs uniques\": tpl.countUnique(frFmtInt)\n \"Liste de valeurs uniques\": tpl.listUnique(\", \")\n \"Somme\": tpl.sum(frFmt)\n \"Somme en entiers\": tpl.sum(frFmtInt)\n \"Moyenne\": tpl.average(frFmt)\n \"Minimum\": tpl.min(frFmt)\n \"Maximum\": tpl.max(frFmt)\n \"Ratio de sommes\": tpl.sumOverSum(frFmt)\n \"Borne supérieure 80%\": tpl.sumOverSumBound80(true, frFmt)\n \"Borne inférieure 80%\": tpl.sumOverSumBound80(false, frFmt)\n \"Somme en proportion du totale\": tpl.fractionOf(tpl.sum(), \"total\", frFmtPct)\n \"Somme en proportion de la ligne\": tpl.fractionOf(tpl.sum(), \"row\", frFmtPct)\n \"Somme en proportion de la colonne\": tpl.fractionOf(tpl.sum(), \"col\", frFmtPct)\n \"Nombre en proportion du totale\": tpl.fractionOf(tpl.count(), \"total\", frFmtPct)\n \"Nombre en proportion de la ligne\": tpl.fractionOf(tpl.count(), \"row\", frFmtPct)\n \"Nombre en proportion de la colonne\": tpl.fractionOf(tpl.count(), \"col\", frFmtPct)\n\n renderers:\n \"Table\": $.pivotUtilities.renderers[\"Table\"]\n \"Table avec barres\": $.pivotUtilities.renderers[\"Table Barchart\"]\n \"Carte de chaleur\": $.pivotUtilities.renderers[\"Heatmap\"]\n \"Carte de chaleur par ligne\": $.pivotUtilities.renderers[\"Row Heatmap\"]\n \"Carte de chaleur par colonne\": $.pivotUtilities.renderers[\"Col Heatmap\"]\n\n\n","(function() {\n var callWithJQuery;\n\n callWithJQuery = function(pivotModule) {\n if (typeof exports === \"object\" && typeof module === \"object\") {\n return pivotModule(require(\"jquery\"));\n } else if (typeof define === \"function\" && define.amd) {\n return define([\"jquery\"], pivotModule);\n } else {\n return pivotModule(jQuery);\n }\n };\n\n callWithJQuery(function($) {\n var frFmt, frFmtInt, frFmtPct, nf, tpl;\n nf = $.pivotUtilities.numberFormat;\n tpl = $.pivotUtilities.aggregatorTemplates;\n frFmt = nf({\n thousandsSep: \" \",\n decimalSep: \",\"\n });\n frFmtInt = nf({\n digitsAfterDecimal: 0,\n thousandsSep: \" \",\n decimalSep: \",\"\n });\n frFmtPct = nf({\n digitsAfterDecimal: 1,\n scaler: 100,\n suffix: \"%\",\n thousandsSep: \" \",\n decimalSep: \",\"\n });\n return $.pivotUtilities.locales.fr = {\n localeStrings: {\n renderError: \"Une erreur est survenue en dessinant le tableau croisé.\",\n computeError: \"Une erreur est survenue en calculant le tableau croisé.\",\n uiRenderError: \"Une erreur est survenue en dessinant l'interface du tableau croisé dynamique.\",\n selectAll: \"Sélectionner tout\",\n selectNone: \"Sélectionner rien\",\n tooMany: \"(trop de valeurs à afficher)\",\n filterResults: \"Filtrer les valeurs\",\n totals: \"Totaux\",\n vs: \"sur\",\n by: \"par\"\n },\n aggregators: {\n \"Nombre\": tpl.count(frFmtInt),\n \"Nombre de valeurs uniques\": tpl.countUnique(frFmtInt),\n \"Liste de valeurs uniques\": tpl.listUnique(\", \"),\n \"Somme\": tpl.sum(frFmt),\n \"Somme en entiers\": tpl.sum(frFmtInt),\n \"Moyenne\": tpl.average(frFmt),\n \"Minimum\": tpl.min(frFmt),\n \"Maximum\": tpl.max(frFmt),\n \"Ratio de sommes\": tpl.sumOverSum(frFmt),\n \"Borne supérieure 80%\": tpl.sumOverSumBound80(true, frFmt),\n \"Borne inférieure 80%\": tpl.sumOverSumBound80(false, frFmt),\n \"Somme en proportion du totale\": tpl.fractionOf(tpl.sum(), \"total\", frFmtPct),\n \"Somme en proportion de la ligne\": tpl.fractionOf(tpl.sum(), \"row\", frFmtPct),\n \"Somme en proportion de la colonne\": tpl.fractionOf(tpl.sum(), \"col\", frFmtPct),\n \"Nombre en proportion du totale\": tpl.fractionOf(tpl.count(), \"total\", frFmtPct),\n \"Nombre en proportion de la ligne\": tpl.fractionOf(tpl.count(), \"row\", frFmtPct),\n \"Nombre en proportion de la colonne\": tpl.fractionOf(tpl.count(), \"col\", frFmtPct)\n },\n renderers: {\n \"Table\": $.pivotUtilities.renderers[\"Table\"],\n \"Table avec barres\": $.pivotUtilities.renderers[\"Table Barchart\"],\n \"Carte de chaleur\": $.pivotUtilities.renderers[\"Heatmap\"],\n \"Carte de chaleur par ligne\": $.pivotUtilities.renderers[\"Row Heatmap\"],\n \"Carte de chaleur par colonne\": $.pivotUtilities.renderers[\"Col Heatmap\"]\n }\n };\n });\n\n}).call(this);\n\n//# sourceMappingURL=pivot.fr.js.map\n"],"sourceRoot":"/source/"}
@@ -0,0 +1,1511 @@
1
+ (function() {
2
+ var callWithJQuery,
3
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
4
+ slice = [].slice,
5
+ bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
6
+ hasProp = {}.hasOwnProperty;
7
+
8
+ callWithJQuery = function(pivotModule) {
9
+ if (typeof exports === "object" && typeof module === "object") {
10
+ return pivotModule(require("jquery"));
11
+ } else if (typeof define === "function" && define.amd) {
12
+ return define(["jquery"], pivotModule);
13
+ } else {
14
+ return pivotModule(jQuery);
15
+ }
16
+ };
17
+
18
+ callWithJQuery(function($) {
19
+
20
+ /*
21
+ Utilities
22
+ */
23
+ var PivotData, addSeparators, aggregatorTemplates, aggregators, dayNamesEn, derivers, getSort, locales, mthNamesEn, naturalSort, numberFormat, pivotTableRenderer, renderers, sortAs, usFmt, usFmtInt, usFmtPct, zeroPad;
24
+ addSeparators = function(nStr, thousandsSep, decimalSep) {
25
+ var rgx, x, x1, x2;
26
+ nStr += '';
27
+ x = nStr.split('.');
28
+ x1 = x[0];
29
+ x2 = x.length > 1 ? decimalSep + x[1] : '';
30
+ rgx = /(\d+)(\d{3})/;
31
+ while (rgx.test(x1)) {
32
+ x1 = x1.replace(rgx, '$1' + thousandsSep + '$2');
33
+ }
34
+ return x1 + x2;
35
+ };
36
+ numberFormat = function(opts) {
37
+ var defaults;
38
+ defaults = {
39
+ digitsAfterDecimal: 2,
40
+ scaler: 1,
41
+ thousandsSep: ",",
42
+ decimalSep: ".",
43
+ prefix: "",
44
+ suffix: "",
45
+ showZero: false
46
+ };
47
+ opts = $.extend(defaults, opts);
48
+ return function(x) {
49
+ var result;
50
+ if (isNaN(x) || !isFinite(x)) {
51
+ return "";
52
+ }
53
+ if (x === 0 && !opts.showZero) {
54
+ return "";
55
+ }
56
+ result = addSeparators((opts.scaler * x).toFixed(opts.digitsAfterDecimal), opts.thousandsSep, opts.decimalSep);
57
+ return "" + opts.prefix + result + opts.suffix;
58
+ };
59
+ };
60
+ usFmt = numberFormat();
61
+ usFmtInt = numberFormat({
62
+ digitsAfterDecimal: 0
63
+ });
64
+ usFmtPct = numberFormat({
65
+ digitsAfterDecimal: 1,
66
+ scaler: 100,
67
+ suffix: "%"
68
+ });
69
+ aggregatorTemplates = {
70
+ count: function(formatter) {
71
+ if (formatter == null) {
72
+ formatter = usFmtInt;
73
+ }
74
+ return function() {
75
+ return function(data, rowKey, colKey) {
76
+ return {
77
+ count: 0,
78
+ push: function() {
79
+ return this.count++;
80
+ },
81
+ value: function() {
82
+ return this.count;
83
+ },
84
+ format: formatter
85
+ };
86
+ };
87
+ };
88
+ },
89
+ countUnique: function(formatter) {
90
+ if (formatter == null) {
91
+ formatter = usFmtInt;
92
+ }
93
+ return function(arg) {
94
+ var attr;
95
+ attr = arg[0];
96
+ return function(data, rowKey, colKey) {
97
+ return {
98
+ uniq: [],
99
+ push: function(record) {
100
+ var ref;
101
+ if (ref = record[attr], indexOf.call(this.uniq, ref) < 0) {
102
+ return this.uniq.push(record[attr]);
103
+ }
104
+ },
105
+ value: function() {
106
+ return this.uniq.length;
107
+ },
108
+ format: formatter,
109
+ numInputs: attr != null ? 0 : 1
110
+ };
111
+ };
112
+ };
113
+ },
114
+ listUnique: function(sep) {
115
+ return function(arg) {
116
+ var attr;
117
+ attr = arg[0];
118
+ return function(data, rowKey, colKey) {
119
+ return {
120
+ uniq: [],
121
+ push: function(record) {
122
+ var ref;
123
+ if (ref = record[attr], indexOf.call(this.uniq, ref) < 0) {
124
+ return this.uniq.push(record[attr]);
125
+ }
126
+ },
127
+ value: function() {
128
+ return this.uniq.join(sep);
129
+ },
130
+ format: function(x) {
131
+ return x;
132
+ },
133
+ numInputs: attr != null ? 0 : 1
134
+ };
135
+ };
136
+ };
137
+ },
138
+ sum: function(formatter) {
139
+ if (formatter == null) {
140
+ formatter = usFmt;
141
+ }
142
+ return function(arg) {
143
+ var attr;
144
+ attr = arg[0];
145
+ return function(data, rowKey, colKey) {
146
+ return {
147
+ sum: 0,
148
+ push: function(record) {
149
+ if (!isNaN(parseFloat(record[attr]))) {
150
+ return this.sum += parseFloat(record[attr]);
151
+ }
152
+ },
153
+ value: function() {
154
+ return this.sum;
155
+ },
156
+ format: formatter,
157
+ numInputs: attr != null ? 0 : 1
158
+ };
159
+ };
160
+ };
161
+ },
162
+ min: function(formatter) {
163
+ if (formatter == null) {
164
+ formatter = usFmt;
165
+ }
166
+ return function(arg) {
167
+ var attr;
168
+ attr = arg[0];
169
+ return function(data, rowKey, colKey) {
170
+ return {
171
+ val: null,
172
+ push: function(record) {
173
+ var ref, x;
174
+ x = parseFloat(record[attr]);
175
+ if (!isNaN(x)) {
176
+ return this.val = Math.min(x, (ref = this.val) != null ? ref : x);
177
+ }
178
+ },
179
+ value: function() {
180
+ return this.val;
181
+ },
182
+ format: formatter,
183
+ numInputs: attr != null ? 0 : 1
184
+ };
185
+ };
186
+ };
187
+ },
188
+ max: function(formatter) {
189
+ if (formatter == null) {
190
+ formatter = usFmt;
191
+ }
192
+ return function(arg) {
193
+ var attr;
194
+ attr = arg[0];
195
+ return function(data, rowKey, colKey) {
196
+ return {
197
+ val: null,
198
+ push: function(record) {
199
+ var ref, x;
200
+ x = parseFloat(record[attr]);
201
+ if (!isNaN(x)) {
202
+ return this.val = Math.max(x, (ref = this.val) != null ? ref : x);
203
+ }
204
+ },
205
+ value: function() {
206
+ return this.val;
207
+ },
208
+ format: formatter,
209
+ numInputs: attr != null ? 0 : 1
210
+ };
211
+ };
212
+ };
213
+ },
214
+ average: function(formatter) {
215
+ if (formatter == null) {
216
+ formatter = usFmt;
217
+ }
218
+ return function(arg) {
219
+ var attr;
220
+ attr = arg[0];
221
+ return function(data, rowKey, colKey) {
222
+ return {
223
+ sum: 0,
224
+ len: 0,
225
+ push: function(record) {
226
+ if (!isNaN(parseFloat(record[attr]))) {
227
+ this.sum += parseFloat(record[attr]);
228
+ return this.len++;
229
+ }
230
+ },
231
+ value: function() {
232
+ return this.sum / this.len;
233
+ },
234
+ format: formatter,
235
+ numInputs: attr != null ? 0 : 1
236
+ };
237
+ };
238
+ };
239
+ },
240
+ sumOverSum: function(formatter) {
241
+ if (formatter == null) {
242
+ formatter = usFmt;
243
+ }
244
+ return function(arg) {
245
+ var denom, num;
246
+ num = arg[0], denom = arg[1];
247
+ return function(data, rowKey, colKey) {
248
+ return {
249
+ sumNum: 0,
250
+ sumDenom: 0,
251
+ push: function(record) {
252
+ if (!isNaN(parseFloat(record[num]))) {
253
+ this.sumNum += parseFloat(record[num]);
254
+ }
255
+ if (!isNaN(parseFloat(record[denom]))) {
256
+ return this.sumDenom += parseFloat(record[denom]);
257
+ }
258
+ },
259
+ value: function() {
260
+ return this.sumNum / this.sumDenom;
261
+ },
262
+ format: formatter,
263
+ numInputs: (num != null) && (denom != null) ? 0 : 2
264
+ };
265
+ };
266
+ };
267
+ },
268
+ sumOverSumBound80: function(upper, formatter) {
269
+ if (upper == null) {
270
+ upper = true;
271
+ }
272
+ if (formatter == null) {
273
+ formatter = usFmt;
274
+ }
275
+ return function(arg) {
276
+ var denom, num;
277
+ num = arg[0], denom = arg[1];
278
+ return function(data, rowKey, colKey) {
279
+ return {
280
+ sumNum: 0,
281
+ sumDenom: 0,
282
+ push: function(record) {
283
+ if (!isNaN(parseFloat(record[num]))) {
284
+ this.sumNum += parseFloat(record[num]);
285
+ }
286
+ if (!isNaN(parseFloat(record[denom]))) {
287
+ return this.sumDenom += parseFloat(record[denom]);
288
+ }
289
+ },
290
+ value: function() {
291
+ var sign;
292
+ sign = upper ? 1 : -1;
293
+ return (0.821187207574908 / this.sumDenom + this.sumNum / this.sumDenom + 1.2815515655446004 * sign * Math.sqrt(0.410593603787454 / (this.sumDenom * this.sumDenom) + (this.sumNum * (1 - this.sumNum / this.sumDenom)) / (this.sumDenom * this.sumDenom))) / (1 + 1.642374415149816 / this.sumDenom);
294
+ },
295
+ format: formatter,
296
+ numInputs: (num != null) && (denom != null) ? 0 : 2
297
+ };
298
+ };
299
+ };
300
+ },
301
+ fractionOf: function(wrapped, type, formatter) {
302
+ if (type == null) {
303
+ type = "total";
304
+ }
305
+ if (formatter == null) {
306
+ formatter = usFmtPct;
307
+ }
308
+ return function() {
309
+ var x;
310
+ x = 1 <= arguments.length ? slice.call(arguments, 0) : [];
311
+ return function(data, rowKey, colKey) {
312
+ return {
313
+ selector: {
314
+ total: [[], []],
315
+ row: [rowKey, []],
316
+ col: [[], colKey]
317
+ }[type],
318
+ inner: wrapped.apply(null, x)(data, rowKey, colKey),
319
+ push: function(record) {
320
+ return this.inner.push(record);
321
+ },
322
+ format: formatter,
323
+ value: function() {
324
+ return this.inner.value() / data.getAggregator.apply(data, this.selector).inner.value();
325
+ },
326
+ numInputs: wrapped.apply(null, x)().numInputs
327
+ };
328
+ };
329
+ };
330
+ }
331
+ };
332
+ aggregators = (function(tpl) {
333
+ return {
334
+ "Count": tpl.count(usFmtInt),
335
+ "Count Unique Values": tpl.countUnique(usFmtInt),
336
+ "List Unique Values": tpl.listUnique(", "),
337
+ "Sum": tpl.sum(usFmt),
338
+ "Integer Sum": tpl.sum(usFmtInt),
339
+ "Average": tpl.average(usFmt),
340
+ "Minimum": tpl.min(usFmt),
341
+ "Maximum": tpl.max(usFmt),
342
+ "Sum over Sum": tpl.sumOverSum(usFmt),
343
+ "80% Upper Bound": tpl.sumOverSumBound80(true, usFmt),
344
+ "80% Lower Bound": tpl.sumOverSumBound80(false, usFmt),
345
+ "Sum as Fraction of Total": tpl.fractionOf(tpl.sum(), "total", usFmtPct),
346
+ "Sum as Fraction of Rows": tpl.fractionOf(tpl.sum(), "row", usFmtPct),
347
+ "Sum as Fraction of Columns": tpl.fractionOf(tpl.sum(), "col", usFmtPct),
348
+ "Count as Fraction of Total": tpl.fractionOf(tpl.count(), "total", usFmtPct),
349
+ "Count as Fraction of Rows": tpl.fractionOf(tpl.count(), "row", usFmtPct),
350
+ "Count as Fraction of Columns": tpl.fractionOf(tpl.count(), "col", usFmtPct)
351
+ };
352
+ })(aggregatorTemplates);
353
+ renderers = {
354
+ "Table": function(pvtData, opts) {
355
+ return pivotTableRenderer(pvtData, opts);
356
+ },
357
+ "Table Barchart": function(pvtData, opts) {
358
+ return $(pivotTableRenderer(pvtData, opts)).barchart();
359
+ },
360
+ "Heatmap": function(pvtData, opts) {
361
+ return $(pivotTableRenderer(pvtData, opts)).heatmap();
362
+ },
363
+ "Row Heatmap": function(pvtData, opts) {
364
+ return $(pivotTableRenderer(pvtData, opts)).heatmap("rowheatmap");
365
+ },
366
+ "Col Heatmap": function(pvtData, opts) {
367
+ return $(pivotTableRenderer(pvtData, opts)).heatmap("colheatmap");
368
+ }
369
+ };
370
+ locales = {
371
+ en: {
372
+ aggregators: aggregators,
373
+ renderers: renderers,
374
+ localeStrings: {
375
+ renderError: "An error occurred rendering the PivotTable results.",
376
+ computeError: "An error occurred computing the PivotTable results.",
377
+ uiRenderError: "An error occurred rendering the PivotTable UI.",
378
+ selectAll: "Select All",
379
+ selectNone: "Select None",
380
+ tooMany: "(too many to list)",
381
+ filterResults: "Filter results",
382
+ totals: "Totals",
383
+ vs: "vs",
384
+ by: "by"
385
+ }
386
+ }
387
+ };
388
+ mthNamesEn = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
389
+ dayNamesEn = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
390
+ zeroPad = function(number) {
391
+ return ("0" + number).substr(-2, 2);
392
+ };
393
+ derivers = {
394
+ bin: function(col, binWidth) {
395
+ return function(record) {
396
+ return record[col] - record[col] % binWidth;
397
+ };
398
+ },
399
+ dateFormat: function(col, formatString, utcOutput, mthNames, dayNames) {
400
+ var utc;
401
+ if (utcOutput == null) {
402
+ utcOutput = false;
403
+ }
404
+ if (mthNames == null) {
405
+ mthNames = mthNamesEn;
406
+ }
407
+ if (dayNames == null) {
408
+ dayNames = dayNamesEn;
409
+ }
410
+ utc = utcOutput ? "UTC" : "";
411
+ return function(record) {
412
+ var date;
413
+ date = new Date(Date.parse(record[col]));
414
+ if (isNaN(date)) {
415
+ return "";
416
+ }
417
+ return formatString.replace(/%(.)/g, function(m, p) {
418
+ switch (p) {
419
+ case "y":
420
+ return date["get" + utc + "FullYear"]();
421
+ case "m":
422
+ return zeroPad(date["get" + utc + "Month"]() + 1);
423
+ case "n":
424
+ return mthNames[date["get" + utc + "Month"]()];
425
+ case "d":
426
+ return zeroPad(date["get" + utc + "Date"]());
427
+ case "w":
428
+ return dayNames[date["get" + utc + "Day"]()];
429
+ case "x":
430
+ return date["get" + utc + "Day"]();
431
+ case "H":
432
+ return zeroPad(date["get" + utc + "Hours"]());
433
+ case "M":
434
+ return zeroPad(date["get" + utc + "Minutes"]());
435
+ case "S":
436
+ return zeroPad(date["get" + utc + "Seconds"]());
437
+ default:
438
+ return "%" + p;
439
+ }
440
+ });
441
+ };
442
+ }
443
+ };
444
+ naturalSort = (function(_this) {
445
+ return function(as, bs) {
446
+ var a, a1, b, b1, rd, rx, rz;
447
+ rx = /(\d+)|(\D+)/g;
448
+ rd = /\d/;
449
+ rz = /^0/;
450
+ if (typeof as === "number" || typeof bs === "number") {
451
+ if (isNaN(as)) {
452
+ return 1;
453
+ }
454
+ if (isNaN(bs)) {
455
+ return -1;
456
+ }
457
+ return as - bs;
458
+ }
459
+ a = String(as).toLowerCase();
460
+ b = String(bs).toLowerCase();
461
+ if (a === b) {
462
+ return 0;
463
+ }
464
+ if (!(rd.test(a) && rd.test(b))) {
465
+ return (a > b ? 1 : -1);
466
+ }
467
+ a = a.match(rx);
468
+ b = b.match(rx);
469
+ while (a.length && b.length) {
470
+ a1 = a.shift();
471
+ b1 = b.shift();
472
+ if (a1 !== b1) {
473
+ if (rd.test(a1) && rd.test(b1)) {
474
+ return a1.replace(rz, ".0") - b1.replace(rz, ".0");
475
+ } else {
476
+ return (a1 > b1 ? 1 : -1);
477
+ }
478
+ }
479
+ }
480
+ return a.length - b.length;
481
+ };
482
+ })(this);
483
+ sortAs = function(order) {
484
+ var i, mapping, x;
485
+ mapping = {};
486
+ for (i in order) {
487
+ x = order[i];
488
+ mapping[x] = i;
489
+ }
490
+ return function(a, b) {
491
+ if ((mapping[a] != null) && (mapping[b] != null)) {
492
+ return mapping[a] - mapping[b];
493
+ } else if (mapping[a] != null) {
494
+ return -1;
495
+ } else if (mapping[b] != null) {
496
+ return 1;
497
+ } else {
498
+ return naturalSort(a, b);
499
+ }
500
+ };
501
+ };
502
+ getSort = function(sorters, attr) {
503
+ var sort;
504
+ sort = sorters(attr);
505
+ if ($.isFunction(sort)) {
506
+ return sort;
507
+ } else {
508
+ return naturalSort;
509
+ }
510
+ };
511
+
512
+ /*
513
+ Data Model class
514
+ */
515
+ PivotData = (function() {
516
+ function PivotData(input, opts) {
517
+ this.getAggregator = bind(this.getAggregator, this);
518
+ this.getRowKeys = bind(this.getRowKeys, this);
519
+ this.getColKeys = bind(this.getColKeys, this);
520
+ this.sortKeys = bind(this.sortKeys, this);
521
+ this.arrSort = bind(this.arrSort, this);
522
+ this.aggregator = opts.aggregator;
523
+ this.aggregatorName = opts.aggregatorName;
524
+ this.colAttrs = opts.cols;
525
+ this.rowAttrs = opts.rows;
526
+ this.valAttrs = opts.vals;
527
+ this.sorters = opts.sorters;
528
+ this.tree = {};
529
+ this.rowKeys = [];
530
+ this.colKeys = [];
531
+ this.rowTotals = {};
532
+ this.colTotals = {};
533
+ this.allTotal = this.aggregator(this, [], []);
534
+ this.sorted = false;
535
+ PivotData.forEachRecord(input, opts.derivedAttributes, (function(_this) {
536
+ return function(record) {
537
+ if (opts.filter(record)) {
538
+ return _this.processRecord(record);
539
+ }
540
+ };
541
+ })(this));
542
+ }
543
+
544
+ PivotData.forEachRecord = function(input, derivedAttributes, f) {
545
+ var addRecord, compactRecord, i, j, k, l, len1, record, ref, results, results1, tblCols;
546
+ if ($.isEmptyObject(derivedAttributes)) {
547
+ addRecord = f;
548
+ } else {
549
+ addRecord = function(record) {
550
+ var k, ref, v;
551
+ for (k in derivedAttributes) {
552
+ v = derivedAttributes[k];
553
+ record[k] = (ref = v(record)) != null ? ref : record[k];
554
+ }
555
+ return f(record);
556
+ };
557
+ }
558
+ if ($.isFunction(input)) {
559
+ return input(addRecord);
560
+ } else if ($.isArray(input)) {
561
+ if ($.isArray(input[0])) {
562
+ results = [];
563
+ for (i in input) {
564
+ if (!hasProp.call(input, i)) continue;
565
+ compactRecord = input[i];
566
+ if (!(i > 0)) {
567
+ continue;
568
+ }
569
+ record = {};
570
+ ref = input[0];
571
+ for (j in ref) {
572
+ if (!hasProp.call(ref, j)) continue;
573
+ k = ref[j];
574
+ record[k] = compactRecord[j];
575
+ }
576
+ results.push(addRecord(record));
577
+ }
578
+ return results;
579
+ } else {
580
+ results1 = [];
581
+ for (l = 0, len1 = input.length; l < len1; l++) {
582
+ record = input[l];
583
+ results1.push(addRecord(record));
584
+ }
585
+ return results1;
586
+ }
587
+ } else if (input instanceof jQuery) {
588
+ tblCols = [];
589
+ $("thead > tr > th", input).each(function(i) {
590
+ return tblCols.push($(this).text());
591
+ });
592
+ return $("tbody > tr", input).each(function(i) {
593
+ record = {};
594
+ $("td", this).each(function(j) {
595
+ return record[tblCols[j]] = $(this).text();
596
+ });
597
+ return addRecord(record);
598
+ });
599
+ } else {
600
+ throw new Error("unknown input format");
601
+ }
602
+ };
603
+
604
+ PivotData.convertToArray = function(input) {
605
+ var result;
606
+ result = [];
607
+ PivotData.forEachRecord(input, {}, function(record) {
608
+ return result.push(record);
609
+ });
610
+ return result;
611
+ };
612
+
613
+ PivotData.prototype.arrSort = function(attrs) {
614
+ var a, sortersArr;
615
+ sortersArr = (function() {
616
+ var l, len1, results;
617
+ results = [];
618
+ for (l = 0, len1 = attrs.length; l < len1; l++) {
619
+ a = attrs[l];
620
+ results.push(getSort(this.sorters, a));
621
+ }
622
+ return results;
623
+ }).call(this);
624
+ return function(a, b) {
625
+ var comparison, i, sorter;
626
+ for (i in sortersArr) {
627
+ if (!hasProp.call(sortersArr, i)) continue;
628
+ sorter = sortersArr[i];
629
+ comparison = sorter(a[i], b[i]);
630
+ if (comparison !== 0) {
631
+ return comparison;
632
+ }
633
+ }
634
+ return 0;
635
+ };
636
+ };
637
+
638
+ PivotData.prototype.sortKeys = function() {
639
+ if (!this.sorted) {
640
+ this.sorted = true;
641
+ this.rowKeys.sort(this.arrSort(this.rowAttrs));
642
+ return this.colKeys.sort(this.arrSort(this.colAttrs));
643
+ }
644
+ };
645
+
646
+ PivotData.prototype.getColKeys = function() {
647
+ this.sortKeys();
648
+ return this.colKeys;
649
+ };
650
+
651
+ PivotData.prototype.getRowKeys = function() {
652
+ this.sortKeys();
653
+ return this.rowKeys;
654
+ };
655
+
656
+ PivotData.prototype.processRecord = function(record) {
657
+ var colKey, flatColKey, flatRowKey, l, len1, len2, n, ref, ref1, ref2, ref3, rowKey, x;
658
+ colKey = [];
659
+ rowKey = [];
660
+ ref = this.colAttrs;
661
+ for (l = 0, len1 = ref.length; l < len1; l++) {
662
+ x = ref[l];
663
+ colKey.push((ref1 = record[x]) != null ? ref1 : "null");
664
+ }
665
+ ref2 = this.rowAttrs;
666
+ for (n = 0, len2 = ref2.length; n < len2; n++) {
667
+ x = ref2[n];
668
+ rowKey.push((ref3 = record[x]) != null ? ref3 : "null");
669
+ }
670
+ flatRowKey = rowKey.join(String.fromCharCode(0));
671
+ flatColKey = colKey.join(String.fromCharCode(0));
672
+ this.allTotal.push(record);
673
+ if (rowKey.length !== 0) {
674
+ if (!this.rowTotals[flatRowKey]) {
675
+ this.rowKeys.push(rowKey);
676
+ this.rowTotals[flatRowKey] = this.aggregator(this, rowKey, []);
677
+ }
678
+ this.rowTotals[flatRowKey].push(record);
679
+ }
680
+ if (colKey.length !== 0) {
681
+ if (!this.colTotals[flatColKey]) {
682
+ this.colKeys.push(colKey);
683
+ this.colTotals[flatColKey] = this.aggregator(this, [], colKey);
684
+ }
685
+ this.colTotals[flatColKey].push(record);
686
+ }
687
+ if (colKey.length !== 0 && rowKey.length !== 0) {
688
+ if (!this.tree[flatRowKey]) {
689
+ this.tree[flatRowKey] = {};
690
+ }
691
+ if (!this.tree[flatRowKey][flatColKey]) {
692
+ this.tree[flatRowKey][flatColKey] = this.aggregator(this, rowKey, colKey);
693
+ }
694
+ return this.tree[flatRowKey][flatColKey].push(record);
695
+ }
696
+ };
697
+
698
+ PivotData.prototype.getAggregator = function(rowKey, colKey) {
699
+ var agg, flatColKey, flatRowKey;
700
+ flatRowKey = rowKey.join(String.fromCharCode(0));
701
+ flatColKey = colKey.join(String.fromCharCode(0));
702
+ if (rowKey.length === 0 && colKey.length === 0) {
703
+ agg = this.allTotal;
704
+ } else if (rowKey.length === 0) {
705
+ agg = this.colTotals[flatColKey];
706
+ } else if (colKey.length === 0) {
707
+ agg = this.rowTotals[flatRowKey];
708
+ } else {
709
+ agg = this.tree[flatRowKey][flatColKey];
710
+ }
711
+ return agg != null ? agg : {
712
+ value: (function() {
713
+ return null;
714
+ }),
715
+ format: function() {
716
+ return "";
717
+ }
718
+ };
719
+ };
720
+
721
+ return PivotData;
722
+
723
+ })();
724
+ $.pivotUtilities = {
725
+ aggregatorTemplates: aggregatorTemplates,
726
+ aggregators: aggregators,
727
+ renderers: renderers,
728
+ derivers: derivers,
729
+ locales: locales,
730
+ naturalSort: naturalSort,
731
+ numberFormat: numberFormat,
732
+ sortAs: sortAs,
733
+ PivotData: PivotData
734
+ };
735
+
736
+ /*
737
+ Default Renderer for hierarchical table layout
738
+ */
739
+ pivotTableRenderer = function(pivotData, opts) {
740
+ var aggregator, c, colAttrs, colKey, colKeys, defaults, i, j, r, result, rowAttrs, rowKey, rowKeys, spanSize, td, th, totalAggregator, tr, txt, val, x;
741
+ defaults = {
742
+ localeStrings: {
743
+ totals: "Totals"
744
+ }
745
+ };
746
+ opts = $.extend(defaults, opts);
747
+ colAttrs = pivotData.colAttrs;
748
+ rowAttrs = pivotData.rowAttrs;
749
+ rowKeys = pivotData.getRowKeys();
750
+ colKeys = pivotData.getColKeys();
751
+ result = document.createElement("table");
752
+ result.className = "pvtTable";
753
+ spanSize = function(arr, i, j) {
754
+ var l, len, n, noDraw, ref, ref1, stop, x;
755
+ if (i !== 0) {
756
+ noDraw = true;
757
+ for (x = l = 0, ref = j; 0 <= ref ? l <= ref : l >= ref; x = 0 <= ref ? ++l : --l) {
758
+ if (arr[i - 1][x] !== arr[i][x]) {
759
+ noDraw = false;
760
+ }
761
+ }
762
+ if (noDraw) {
763
+ return -1;
764
+ }
765
+ }
766
+ len = 0;
767
+ while (i + len < arr.length) {
768
+ stop = false;
769
+ for (x = n = 0, ref1 = j; 0 <= ref1 ? n <= ref1 : n >= ref1; x = 0 <= ref1 ? ++n : --n) {
770
+ if (arr[i][x] !== arr[i + len][x]) {
771
+ stop = true;
772
+ }
773
+ }
774
+ if (stop) {
775
+ break;
776
+ }
777
+ len++;
778
+ }
779
+ return len;
780
+ };
781
+ for (j in colAttrs) {
782
+ if (!hasProp.call(colAttrs, j)) continue;
783
+ c = colAttrs[j];
784
+ tr = document.createElement("tr");
785
+ if (parseInt(j) === 0 && rowAttrs.length !== 0) {
786
+ th = document.createElement("th");
787
+ th.setAttribute("colspan", rowAttrs.length);
788
+ th.setAttribute("rowspan", colAttrs.length);
789
+ tr.appendChild(th);
790
+ }
791
+ th = document.createElement("th");
792
+ th.className = "pvtAxisLabel";
793
+ th.textContent = c;
794
+ tr.appendChild(th);
795
+ for (i in colKeys) {
796
+ if (!hasProp.call(colKeys, i)) continue;
797
+ colKey = colKeys[i];
798
+ x = spanSize(colKeys, parseInt(i), parseInt(j));
799
+ if (x !== -1) {
800
+ th = document.createElement("th");
801
+ th.className = "pvtColLabel";
802
+ th.textContent = colKey[j];
803
+ th.setAttribute("colspan", x);
804
+ if (parseInt(j) === colAttrs.length - 1 && rowAttrs.length !== 0) {
805
+ th.setAttribute("rowspan", 2);
806
+ }
807
+ tr.appendChild(th);
808
+ }
809
+ }
810
+ if (parseInt(j) === 0) {
811
+ th = document.createElement("th");
812
+ th.className = "pvtTotalLabel";
813
+ th.innerHTML = opts.localeStrings.totals;
814
+ th.setAttribute("rowspan", colAttrs.length + (rowAttrs.length === 0 ? 0 : 1));
815
+ tr.appendChild(th);
816
+ }
817
+ result.appendChild(tr);
818
+ }
819
+ if (rowAttrs.length !== 0) {
820
+ tr = document.createElement("tr");
821
+ for (i in rowAttrs) {
822
+ if (!hasProp.call(rowAttrs, i)) continue;
823
+ r = rowAttrs[i];
824
+ th = document.createElement("th");
825
+ th.className = "pvtAxisLabel";
826
+ th.textContent = r;
827
+ tr.appendChild(th);
828
+ }
829
+ th = document.createElement("th");
830
+ if (colAttrs.length === 0) {
831
+ th.className = "pvtTotalLabel";
832
+ th.innerHTML = opts.localeStrings.totals;
833
+ }
834
+ tr.appendChild(th);
835
+ result.appendChild(tr);
836
+ }
837
+ for (i in rowKeys) {
838
+ if (!hasProp.call(rowKeys, i)) continue;
839
+ rowKey = rowKeys[i];
840
+ tr = document.createElement("tr");
841
+ for (j in rowKey) {
842
+ if (!hasProp.call(rowKey, j)) continue;
843
+ txt = rowKey[j];
844
+ x = spanSize(rowKeys, parseInt(i), parseInt(j));
845
+ if (x !== -1) {
846
+ th = document.createElement("th");
847
+ th.className = "pvtRowLabel";
848
+ th.textContent = txt;
849
+ th.setAttribute("rowspan", x);
850
+ if (parseInt(j) === rowAttrs.length - 1 && colAttrs.length !== 0) {
851
+ th.setAttribute("colspan", 2);
852
+ }
853
+ tr.appendChild(th);
854
+ }
855
+ }
856
+ for (j in colKeys) {
857
+ if (!hasProp.call(colKeys, j)) continue;
858
+ colKey = colKeys[j];
859
+ aggregator = pivotData.getAggregator(rowKey, colKey);
860
+ val = aggregator.value();
861
+ td = document.createElement("td");
862
+ td.className = "pvtVal row" + i + " col" + j;
863
+ td.textContent = aggregator.format(val);
864
+ td.setAttribute("data-value", val);
865
+ tr.appendChild(td);
866
+ }
867
+ totalAggregator = pivotData.getAggregator(rowKey, []);
868
+ val = totalAggregator.value();
869
+ td = document.createElement("td");
870
+ td.className = "pvtTotal rowTotal";
871
+ td.textContent = totalAggregator.format(val);
872
+ td.setAttribute("data-value", val);
873
+ td.setAttribute("data-for", "row" + i);
874
+ tr.appendChild(td);
875
+ result.appendChild(tr);
876
+ }
877
+ tr = document.createElement("tr");
878
+ th = document.createElement("th");
879
+ th.className = "pvtTotalLabel";
880
+ th.innerHTML = opts.localeStrings.totals;
881
+ th.setAttribute("colspan", rowAttrs.length + (colAttrs.length === 0 ? 0 : 1));
882
+ tr.appendChild(th);
883
+ for (j in colKeys) {
884
+ if (!hasProp.call(colKeys, j)) continue;
885
+ colKey = colKeys[j];
886
+ totalAggregator = pivotData.getAggregator([], colKey);
887
+ val = totalAggregator.value();
888
+ td = document.createElement("td");
889
+ td.className = "pvtTotal colTotal";
890
+ td.textContent = totalAggregator.format(val);
891
+ td.setAttribute("data-value", val);
892
+ td.setAttribute("data-for", "col" + j);
893
+ tr.appendChild(td);
894
+ }
895
+ totalAggregator = pivotData.getAggregator([], []);
896
+ val = totalAggregator.value();
897
+ td = document.createElement("td");
898
+ td.className = "pvtGrandTotal";
899
+ td.textContent = totalAggregator.format(val);
900
+ td.setAttribute("data-value", val);
901
+ tr.appendChild(td);
902
+ result.appendChild(tr);
903
+ result.setAttribute("data-numrows", rowKeys.length);
904
+ result.setAttribute("data-numcols", colKeys.length);
905
+ return result;
906
+ };
907
+
908
+ /*
909
+ Pivot Table core: create PivotData object and call Renderer on it
910
+ */
911
+ $.fn.pivot = function(input, opts) {
912
+ var defaults, e, error, error1, pivotData, result, x;
913
+ defaults = {
914
+ cols: [],
915
+ rows: [],
916
+ vals: [],
917
+ filter: function() {
918
+ return true;
919
+ },
920
+ aggregator: aggregatorTemplates.count()(),
921
+ aggregatorName: "Count",
922
+ sorters: function() {},
923
+ derivedAttributes: {},
924
+ renderer: pivotTableRenderer,
925
+ rendererOptions: null,
926
+ localeStrings: locales.en.localeStrings
927
+ };
928
+ opts = $.extend(defaults, opts);
929
+ result = null;
930
+ try {
931
+ pivotData = new PivotData(input, opts);
932
+ try {
933
+ result = opts.renderer(pivotData, opts.rendererOptions);
934
+ } catch (error) {
935
+ e = error;
936
+ if (typeof console !== "undefined" && console !== null) {
937
+ console.error(e.stack);
938
+ }
939
+ result = $("<span>").html(opts.localeStrings.renderError);
940
+ }
941
+ } catch (error1) {
942
+ e = error1;
943
+ if (typeof console !== "undefined" && console !== null) {
944
+ console.error(e.stack);
945
+ }
946
+ result = $("<span>").html(opts.localeStrings.computeError);
947
+ }
948
+ x = this[0];
949
+ while (x.hasChildNodes()) {
950
+ x.removeChild(x.lastChild);
951
+ }
952
+ return this.append(result);
953
+ };
954
+
955
+ /*
956
+ Pivot Table UI: calls Pivot Table core above with options set by user
957
+ */
958
+ $.fn.pivotUI = function(input, inputOpts, overwrite, locale) {
959
+ var a, aggregator, attrLength, axisValues, c, colList, defaults, e, error, existingOpts, fn, i, initialRender, k, l, len1, len2, len3, len4, n, o, opts, pivotTable, q, ref, ref1, ref2, ref3, ref4, refresh, refreshDelayed, renderer, rendererControl, shownAttributes, tblCols, tr1, tr2, uiTable, unusedAttrsVerticalAutoCutoff, unusedAttrsVerticalAutoOverride, x;
960
+ if (overwrite == null) {
961
+ overwrite = false;
962
+ }
963
+ if (locale == null) {
964
+ locale = "en";
965
+ }
966
+ if (locales[locale] == null) {
967
+ locale = "en";
968
+ }
969
+ defaults = {
970
+ derivedAttributes: {},
971
+ aggregators: locales[locale].aggregators,
972
+ renderers: locales[locale].renderers,
973
+ hiddenAttributes: [],
974
+ menuLimit: 200,
975
+ cols: [],
976
+ rows: [],
977
+ vals: [],
978
+ exclusions: {},
979
+ inclusions: {},
980
+ unusedAttrsVertical: 85,
981
+ autoSortUnusedAttrs: false,
982
+ rendererOptions: {
983
+ localeStrings: locales[locale].localeStrings
984
+ },
985
+ onRefresh: null,
986
+ filter: function() {
987
+ return true;
988
+ },
989
+ sorters: function() {},
990
+ localeStrings: locales[locale].localeStrings
991
+ };
992
+ existingOpts = this.data("pivotUIOptions");
993
+ if ((existingOpts == null) || overwrite) {
994
+ opts = $.extend(defaults, inputOpts);
995
+ } else {
996
+ opts = existingOpts;
997
+ }
998
+ try {
999
+ input = PivotData.convertToArray(input);
1000
+ tblCols = (function() {
1001
+ var ref, results;
1002
+ ref = input[0];
1003
+ results = [];
1004
+ for (k in ref) {
1005
+ if (!hasProp.call(ref, k)) continue;
1006
+ results.push(k);
1007
+ }
1008
+ return results;
1009
+ })();
1010
+ ref = opts.derivedAttributes;
1011
+ for (c in ref) {
1012
+ if (!hasProp.call(ref, c)) continue;
1013
+ if ((indexOf.call(tblCols, c) < 0)) {
1014
+ tblCols.push(c);
1015
+ }
1016
+ }
1017
+ axisValues = {};
1018
+ for (l = 0, len1 = tblCols.length; l < len1; l++) {
1019
+ x = tblCols[l];
1020
+ axisValues[x] = {};
1021
+ }
1022
+ PivotData.forEachRecord(input, opts.derivedAttributes, function(record) {
1023
+ var base, results, v;
1024
+ results = [];
1025
+ for (k in record) {
1026
+ if (!hasProp.call(record, k)) continue;
1027
+ v = record[k];
1028
+ if (!(opts.filter(record))) {
1029
+ continue;
1030
+ }
1031
+ if (v == null) {
1032
+ v = "null";
1033
+ }
1034
+ if ((base = axisValues[k])[v] == null) {
1035
+ base[v] = 0;
1036
+ }
1037
+ results.push(axisValues[k][v]++);
1038
+ }
1039
+ return results;
1040
+ });
1041
+ uiTable = $("<table>", {
1042
+ "class": "pvtUi"
1043
+ }).attr("cellpadding", 5);
1044
+ rendererControl = $("<td>");
1045
+ renderer = $("<select>").addClass('pvtRenderer').appendTo(rendererControl).bind("change", function() {
1046
+ return refresh();
1047
+ });
1048
+ ref1 = opts.renderers;
1049
+ for (x in ref1) {
1050
+ if (!hasProp.call(ref1, x)) continue;
1051
+ $("<option>").val(x).html(x).appendTo(renderer);
1052
+ }
1053
+ colList = $("<td>").addClass('pvtAxisContainer pvtUnused');
1054
+ shownAttributes = (function() {
1055
+ var len2, n, results;
1056
+ results = [];
1057
+ for (n = 0, len2 = tblCols.length; n < len2; n++) {
1058
+ c = tblCols[n];
1059
+ if (indexOf.call(opts.hiddenAttributes, c) < 0) {
1060
+ results.push(c);
1061
+ }
1062
+ }
1063
+ return results;
1064
+ })();
1065
+ unusedAttrsVerticalAutoOverride = false;
1066
+ if (opts.unusedAttrsVertical === "auto") {
1067
+ unusedAttrsVerticalAutoCutoff = 120;
1068
+ } else {
1069
+ unusedAttrsVerticalAutoCutoff = parseInt(opts.unusedAttrsVertical);
1070
+ }
1071
+ if (!isNaN(unusedAttrsVerticalAutoCutoff)) {
1072
+ attrLength = 0;
1073
+ for (n = 0, len2 = shownAttributes.length; n < len2; n++) {
1074
+ a = shownAttributes[n];
1075
+ attrLength += a.length;
1076
+ }
1077
+ unusedAttrsVerticalAutoOverride = attrLength > unusedAttrsVerticalAutoCutoff;
1078
+ }
1079
+ if (opts.unusedAttrsVertical === true || unusedAttrsVerticalAutoOverride) {
1080
+ colList.addClass('pvtVertList');
1081
+ } else {
1082
+ colList.addClass('pvtHorizList');
1083
+ }
1084
+ fn = function(c) {
1085
+ var attrElem, btns, checkContainer, filterItem, filterItemExcluded, hasExcludedItem, keys, len3, o, ref2, showFilterList, triangleLink, updateFilter, v, valueList;
1086
+ keys = (function() {
1087
+ var results;
1088
+ results = [];
1089
+ for (k in axisValues[c]) {
1090
+ results.push(k);
1091
+ }
1092
+ return results;
1093
+ })();
1094
+ hasExcludedItem = false;
1095
+ valueList = $("<div>").addClass('pvtFilterBox').hide();
1096
+ valueList.append($("<h4>").text(c + " (" + keys.length + ")"));
1097
+ if (keys.length > opts.menuLimit) {
1098
+ valueList.append($("<p>").html(opts.localeStrings.tooMany));
1099
+ } else {
1100
+ btns = $("<p>").appendTo(valueList);
1101
+ btns.append($("<button>", {
1102
+ type: "button"
1103
+ }).html(opts.localeStrings.selectAll).bind("click", function() {
1104
+ return valueList.find("input:visible").prop("checked", true);
1105
+ }));
1106
+ btns.append($("<button>", {
1107
+ type: "button"
1108
+ }).html(opts.localeStrings.selectNone).bind("click", function() {
1109
+ return valueList.find("input:visible").prop("checked", false);
1110
+ }));
1111
+ btns.append($("<br>"));
1112
+ btns.append($("<input>", {
1113
+ type: "text",
1114
+ placeholder: opts.localeStrings.filterResults,
1115
+ "class": "pvtSearch"
1116
+ }).bind("keyup", function() {
1117
+ var filter;
1118
+ filter = $(this).val().toLowerCase();
1119
+ return valueList.find('.pvtCheckContainer p').each(function() {
1120
+ var testString;
1121
+ testString = $(this).text().toLowerCase().indexOf(filter);
1122
+ if (testString !== -1) {
1123
+ return $(this).show();
1124
+ } else {
1125
+ return $(this).hide();
1126
+ }
1127
+ });
1128
+ }));
1129
+ checkContainer = $("<div>").addClass("pvtCheckContainer").appendTo(valueList);
1130
+ ref2 = keys.sort(getSort(opts.sorters, c));
1131
+ for (o = 0, len3 = ref2.length; o < len3; o++) {
1132
+ k = ref2[o];
1133
+ v = axisValues[c][k];
1134
+ filterItem = $("<label>");
1135
+ filterItemExcluded = false;
1136
+ if (opts.inclusions[c]) {
1137
+ filterItemExcluded = (indexOf.call(opts.inclusions[c], k) < 0);
1138
+ } else if (opts.exclusions[c]) {
1139
+ filterItemExcluded = (indexOf.call(opts.exclusions[c], k) >= 0);
1140
+ }
1141
+ hasExcludedItem || (hasExcludedItem = filterItemExcluded);
1142
+ $("<input>").attr("type", "checkbox").addClass('pvtFilter').attr("checked", !filterItemExcluded).data("filter", [c, k]).appendTo(filterItem);
1143
+ filterItem.append($("<span>").text(k));
1144
+ filterItem.append($("<span>").text(" (" + v + ")"));
1145
+ checkContainer.append($("<p>").append(filterItem));
1146
+ }
1147
+ }
1148
+ updateFilter = function() {
1149
+ var unselectedCount;
1150
+ unselectedCount = valueList.find("[type='checkbox']").length - valueList.find("[type='checkbox']:checked").length;
1151
+ if (unselectedCount > 0) {
1152
+ attrElem.addClass("pvtFilteredAttribute");
1153
+ } else {
1154
+ attrElem.removeClass("pvtFilteredAttribute");
1155
+ }
1156
+ if (keys.length > opts.menuLimit) {
1157
+ return valueList.toggle();
1158
+ } else {
1159
+ return valueList.toggle(0, refresh);
1160
+ }
1161
+ };
1162
+ $("<p>").appendTo(valueList).append($("<button>", {
1163
+ type: "button"
1164
+ }).text("OK").bind("click", updateFilter));
1165
+ showFilterList = function(e) {
1166
+ var clickLeft, clickTop, ref3;
1167
+ ref3 = $(e.currentTarget).position(), clickLeft = ref3.left, clickTop = ref3.top;
1168
+ valueList.css({
1169
+ left: clickLeft + 10,
1170
+ top: clickTop + 10
1171
+ }).toggle();
1172
+ valueList.find('.pvtSearch').val('');
1173
+ return valueList.find('.pvtCheckContainer p').show();
1174
+ };
1175
+ triangleLink = $("<span>").addClass('pvtTriangle').html(" &#x25BE;").bind("click", showFilterList);
1176
+ attrElem = $("<li>").addClass("axis_" + i).append($("<span>").addClass('pvtAttr').text(c).data("attrName", c).append(triangleLink));
1177
+ if (hasExcludedItem) {
1178
+ attrElem.addClass('pvtFilteredAttribute');
1179
+ }
1180
+ colList.append(attrElem).append(valueList);
1181
+ return attrElem.bind("dblclick", showFilterList);
1182
+ };
1183
+ for (i in shownAttributes) {
1184
+ if (!hasProp.call(shownAttributes, i)) continue;
1185
+ c = shownAttributes[i];
1186
+ fn(c);
1187
+ }
1188
+ tr1 = $("<tr>").appendTo(uiTable);
1189
+ aggregator = $("<select>").addClass('pvtAggregator').bind("change", function() {
1190
+ return refresh();
1191
+ });
1192
+ ref2 = opts.aggregators;
1193
+ for (x in ref2) {
1194
+ if (!hasProp.call(ref2, x)) continue;
1195
+ aggregator.append($("<option>").val(x).html(x));
1196
+ }
1197
+ $("<td>").addClass('pvtVals').appendTo(tr1).append(aggregator).append($("<br>"));
1198
+ $("<td>").addClass('pvtAxisContainer pvtHorizList pvtCols').appendTo(tr1);
1199
+ tr2 = $("<tr>").appendTo(uiTable);
1200
+ tr2.append($("<td>").addClass('pvtAxisContainer pvtRows').attr("valign", "top"));
1201
+ pivotTable = $("<td>").attr("valign", "top").addClass('pvtRendererArea').appendTo(tr2);
1202
+ if (opts.unusedAttrsVertical === true || unusedAttrsVerticalAutoOverride) {
1203
+ uiTable.find('tr:nth-child(1)').prepend(rendererControl);
1204
+ uiTable.find('tr:nth-child(2)').prepend(colList);
1205
+ } else {
1206
+ uiTable.prepend($("<tr>").append(rendererControl).append(colList));
1207
+ }
1208
+ this.html(uiTable);
1209
+ ref3 = opts.cols;
1210
+ for (o = 0, len3 = ref3.length; o < len3; o++) {
1211
+ x = ref3[o];
1212
+ this.find(".pvtCols").append(this.find(".axis_" + ($.inArray(x, shownAttributes))));
1213
+ }
1214
+ ref4 = opts.rows;
1215
+ for (q = 0, len4 = ref4.length; q < len4; q++) {
1216
+ x = ref4[q];
1217
+ this.find(".pvtRows").append(this.find(".axis_" + ($.inArray(x, shownAttributes))));
1218
+ }
1219
+ if (opts.aggregatorName != null) {
1220
+ this.find(".pvtAggregator").val(opts.aggregatorName);
1221
+ }
1222
+ if (opts.rendererName != null) {
1223
+ this.find(".pvtRenderer").val(opts.rendererName);
1224
+ }
1225
+ initialRender = true;
1226
+ refreshDelayed = (function(_this) {
1227
+ return function() {
1228
+ var attr, exclusions, inclusions, len5, newDropdown, numInputsToProcess, pivotUIOptions, pvtVals, ref5, ref6, s, subopts, t, unusedAttrsContainer, vals;
1229
+ subopts = {
1230
+ derivedAttributes: opts.derivedAttributes,
1231
+ localeStrings: opts.localeStrings,
1232
+ rendererOptions: opts.rendererOptions,
1233
+ sorters: opts.sorters,
1234
+ cols: [],
1235
+ rows: []
1236
+ };
1237
+ numInputsToProcess = (ref5 = opts.aggregators[aggregator.val()]([])().numInputs) != null ? ref5 : 0;
1238
+ vals = [];
1239
+ _this.find(".pvtRows li span.pvtAttr").each(function() {
1240
+ return subopts.rows.push($(this).data("attrName"));
1241
+ });
1242
+ _this.find(".pvtCols li span.pvtAttr").each(function() {
1243
+ return subopts.cols.push($(this).data("attrName"));
1244
+ });
1245
+ _this.find(".pvtVals select.pvtAttrDropdown").each(function() {
1246
+ if (numInputsToProcess === 0) {
1247
+ return $(this).remove();
1248
+ } else {
1249
+ numInputsToProcess--;
1250
+ if ($(this).val() !== "") {
1251
+ return vals.push($(this).val());
1252
+ }
1253
+ }
1254
+ });
1255
+ if (numInputsToProcess !== 0) {
1256
+ pvtVals = _this.find(".pvtVals");
1257
+ for (x = s = 0, ref6 = numInputsToProcess; 0 <= ref6 ? s < ref6 : s > ref6; x = 0 <= ref6 ? ++s : --s) {
1258
+ newDropdown = $("<select>").addClass('pvtAttrDropdown').append($("<option>")).bind("change", function() {
1259
+ return refresh();
1260
+ });
1261
+ for (t = 0, len5 = shownAttributes.length; t < len5; t++) {
1262
+ attr = shownAttributes[t];
1263
+ newDropdown.append($("<option>").val(attr).text(attr));
1264
+ }
1265
+ pvtVals.append(newDropdown);
1266
+ }
1267
+ }
1268
+ if (initialRender) {
1269
+ vals = opts.vals;
1270
+ i = 0;
1271
+ _this.find(".pvtVals select.pvtAttrDropdown").each(function() {
1272
+ $(this).val(vals[i]);
1273
+ return i++;
1274
+ });
1275
+ initialRender = false;
1276
+ }
1277
+ subopts.aggregatorName = aggregator.val();
1278
+ subopts.vals = vals;
1279
+ subopts.aggregator = opts.aggregators[aggregator.val()](vals);
1280
+ subopts.renderer = opts.renderers[renderer.val()];
1281
+ exclusions = {};
1282
+ _this.find('input.pvtFilter').not(':checked').each(function() {
1283
+ var filter;
1284
+ filter = $(this).data("filter");
1285
+ if (exclusions[filter[0]] != null) {
1286
+ return exclusions[filter[0]].push(filter[1]);
1287
+ } else {
1288
+ return exclusions[filter[0]] = [filter[1]];
1289
+ }
1290
+ });
1291
+ inclusions = {};
1292
+ _this.find('input.pvtFilter:checked').each(function() {
1293
+ var filter;
1294
+ filter = $(this).data("filter");
1295
+ if (exclusions[filter[0]] != null) {
1296
+ if (inclusions[filter[0]] != null) {
1297
+ return inclusions[filter[0]].push(filter[1]);
1298
+ } else {
1299
+ return inclusions[filter[0]] = [filter[1]];
1300
+ }
1301
+ }
1302
+ });
1303
+ subopts.filter = function(record) {
1304
+ var excludedItems, ref7;
1305
+ if (!opts.filter(record)) {
1306
+ return false;
1307
+ }
1308
+ for (k in exclusions) {
1309
+ excludedItems = exclusions[k];
1310
+ if (ref7 = "" + record[k], indexOf.call(excludedItems, ref7) >= 0) {
1311
+ return false;
1312
+ }
1313
+ }
1314
+ return true;
1315
+ };
1316
+ pivotTable.pivot(input, subopts);
1317
+ pivotUIOptions = $.extend(opts, {
1318
+ cols: subopts.cols,
1319
+ rows: subopts.rows,
1320
+ vals: vals,
1321
+ exclusions: exclusions,
1322
+ inclusions: inclusions,
1323
+ inclusionsInfo: inclusions,
1324
+ aggregatorName: aggregator.val(),
1325
+ rendererName: renderer.val()
1326
+ });
1327
+ _this.data("pivotUIOptions", pivotUIOptions);
1328
+ if (opts.autoSortUnusedAttrs) {
1329
+ unusedAttrsContainer = _this.find("td.pvtUnused.pvtAxisContainer");
1330
+ $(unusedAttrsContainer).children("li").sort(function(a, b) {
1331
+ return naturalSort($(a).text(), $(b).text());
1332
+ }).appendTo(unusedAttrsContainer);
1333
+ }
1334
+ pivotTable.css("opacity", 1);
1335
+ if (opts.onRefresh != null) {
1336
+ return opts.onRefresh(pivotUIOptions);
1337
+ }
1338
+ };
1339
+ })(this);
1340
+ refresh = (function(_this) {
1341
+ return function() {
1342
+ pivotTable.css("opacity", 0.5);
1343
+ return setTimeout(refreshDelayed, 10);
1344
+ };
1345
+ })(this);
1346
+ refresh();
1347
+ this.find(".pvtAxisContainer").sortable({
1348
+ update: function(e, ui) {
1349
+ if (ui.sender == null) {
1350
+ return refresh();
1351
+ }
1352
+ },
1353
+ connectWith: this.find(".pvtAxisContainer"),
1354
+ items: 'li',
1355
+ placeholder: 'pvtPlaceholder'
1356
+ });
1357
+ } catch (error) {
1358
+ e = error;
1359
+ if (typeof console !== "undefined" && console !== null) {
1360
+ console.error(e.stack);
1361
+ }
1362
+ this.html(opts.localeStrings.uiRenderError);
1363
+ }
1364
+ return this;
1365
+ };
1366
+
1367
+ /*
1368
+ Heatmap post-processing
1369
+ */
1370
+ $.fn.heatmap = function(scope) {
1371
+ var colorGen, heatmapper, i, j, l, n, numCols, numRows, ref, ref1;
1372
+ if (scope == null) {
1373
+ scope = "heatmap";
1374
+ }
1375
+ numRows = this.data("numrows");
1376
+ numCols = this.data("numcols");
1377
+ colorGen = function(color, min, max) {
1378
+ var hexGen;
1379
+ hexGen = (function() {
1380
+ switch (color) {
1381
+ case "red":
1382
+ return function(hex) {
1383
+ return "ff" + hex + hex;
1384
+ };
1385
+ case "green":
1386
+ return function(hex) {
1387
+ return hex + "ff" + hex;
1388
+ };
1389
+ case "blue":
1390
+ return function(hex) {
1391
+ return "" + hex + hex + "ff";
1392
+ };
1393
+ }
1394
+ })();
1395
+ return function(x) {
1396
+ var hex, intensity;
1397
+ intensity = 255 - Math.round(255 * (x - min) / (max - min));
1398
+ hex = intensity.toString(16).split(".")[0];
1399
+ if (hex.length === 1) {
1400
+ hex = 0 + hex;
1401
+ }
1402
+ return hexGen(hex);
1403
+ };
1404
+ };
1405
+ heatmapper = (function(_this) {
1406
+ return function(scope, color) {
1407
+ var colorFor, forEachCell, values;
1408
+ forEachCell = function(f) {
1409
+ return _this.find(scope).each(function() {
1410
+ var x;
1411
+ x = $(this).data("value");
1412
+ if ((x != null) && isFinite(x)) {
1413
+ return f(x, $(this));
1414
+ }
1415
+ });
1416
+ };
1417
+ values = [];
1418
+ forEachCell(function(x) {
1419
+ return values.push(x);
1420
+ });
1421
+ colorFor = colorGen(color, Math.min.apply(Math, values), Math.max.apply(Math, values));
1422
+ return forEachCell(function(x, elem) {
1423
+ return elem.css("background-color", "#" + colorFor(x));
1424
+ });
1425
+ };
1426
+ })(this);
1427
+ switch (scope) {
1428
+ case "heatmap":
1429
+ heatmapper(".pvtVal", "red");
1430
+ break;
1431
+ case "rowheatmap":
1432
+ for (i = l = 0, ref = numRows; 0 <= ref ? l < ref : l > ref; i = 0 <= ref ? ++l : --l) {
1433
+ heatmapper(".pvtVal.row" + i, "red");
1434
+ }
1435
+ break;
1436
+ case "colheatmap":
1437
+ for (j = n = 0, ref1 = numCols; 0 <= ref1 ? n < ref1 : n > ref1; j = 0 <= ref1 ? ++n : --n) {
1438
+ heatmapper(".pvtVal.col" + j, "red");
1439
+ }
1440
+ }
1441
+ heatmapper(".pvtTotal.rowTotal", "red");
1442
+ heatmapper(".pvtTotal.colTotal", "red");
1443
+ return this;
1444
+ };
1445
+
1446
+ /*
1447
+ Barchart post-processing
1448
+ */
1449
+ return $.fn.barchart = function() {
1450
+ var barcharter, i, l, numCols, numRows, ref;
1451
+ numRows = this.data("numrows");
1452
+ numCols = this.data("numcols");
1453
+ barcharter = (function(_this) {
1454
+ return function(scope) {
1455
+ var forEachCell, max, scaler, values;
1456
+ forEachCell = function(f) {
1457
+ return _this.find(scope).each(function() {
1458
+ var x;
1459
+ x = $(this).data("value");
1460
+ if ((x != null) && isFinite(x)) {
1461
+ return f(x, $(this));
1462
+ }
1463
+ });
1464
+ };
1465
+ values = [];
1466
+ forEachCell(function(x) {
1467
+ return values.push(x);
1468
+ });
1469
+ max = Math.max.apply(Math, values);
1470
+ scaler = function(x) {
1471
+ return 100 * x / (1.4 * max);
1472
+ };
1473
+ return forEachCell(function(x, elem) {
1474
+ var text, wrapper;
1475
+ text = elem.text();
1476
+ wrapper = $("<div>").css({
1477
+ "position": "relative",
1478
+ "height": "55px"
1479
+ });
1480
+ wrapper.append($("<div>").css({
1481
+ "position": "absolute",
1482
+ "bottom": 0,
1483
+ "left": 0,
1484
+ "right": 0,
1485
+ "height": scaler(x) + "%",
1486
+ "background-color": "gray"
1487
+ }));
1488
+ wrapper.append($("<div>").text(text).css({
1489
+ "position": "relative",
1490
+ "padding-left": "5px",
1491
+ "padding-right": "5px"
1492
+ }));
1493
+ return elem.css({
1494
+ "padding": 0,
1495
+ "padding-top": "5px",
1496
+ "text-align": "center"
1497
+ }).html(wrapper);
1498
+ });
1499
+ };
1500
+ })(this);
1501
+ for (i = l = 0, ref = numRows; 0 <= ref ? l < ref : l > ref; i = 0 <= ref ? ++l : --l) {
1502
+ barcharter(".pvtVal.row" + i);
1503
+ }
1504
+ barcharter(".pvtTotal.colTotal");
1505
+ return this;
1506
+ };
1507
+ });
1508
+
1509
+ }).call(this);
1510
+
1511
+ //# sourceMappingURL=pivot.js.map