mdarray-sol 0.1.0-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (683) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +35 -0
  3. data/LICENSE.txt~ +73 -0
  4. data/README.md +140 -0
  5. data/README.md~ +290 -0
  6. data/Rakefile +80 -0
  7. data/config.rb +223 -0
  8. data/doc/Nashorn.html +1406 -0
  9. data/doc/Sol.html +692 -0
  10. data/doc/Sol/BarChart.html +181 -0
  11. data/doc/Sol/BaseChart.html +799 -0
  12. data/doc/Sol/Bootstrap.html +1134 -0
  13. data/doc/Sol/Bridge.html +448 -0
  14. data/doc/Sol/Chart.html +1162 -0
  15. data/doc/Sol/CoordinateChart.html +673 -0
  16. data/doc/Sol/DCFX.html +807 -0
  17. data/doc/Sol/Dashboard.html +1967 -0
  18. data/doc/Sol/ExecMessages.html +332 -0
  19. data/doc/Sol/GuiCommunication.html +230 -0
  20. data/doc/Sol/Interval.html +1213 -0
  21. data/doc/Sol/JS.html +448 -0
  22. data/doc/Sol/LineChart.html +344 -0
  23. data/doc/Sol/LinearScale.html +334 -0
  24. data/doc/Sol/Margins.html +219 -0
  25. data/doc/Sol/OrdinalScale.html +263 -0
  26. data/doc/Sol/ReadBuffer.html +302 -0
  27. data/doc/Sol/Scale.html +462 -0
  28. data/doc/Sol/Stack.html +199 -0
  29. data/doc/Sol/TimeScale.html +396 -0
  30. data/doc/_index.html +362 -0
  31. data/doc/class_list.html +58 -0
  32. data/doc/css/common.css +1 -0
  33. data/doc/css/full_list.css +57 -0
  34. data/doc/css/style.css +339 -0
  35. data/doc/file.README.html +95 -0
  36. data/doc/file_list.html +60 -0
  37. data/doc/frames.html +26 -0
  38. data/doc/index.html +95 -0
  39. data/doc/js/app.js +219 -0
  40. data/doc/js/full_list.js +181 -0
  41. data/doc/js/jquery.js +4 -0
  42. data/doc/method_list.html +849 -0
  43. data/doc/top-level-namespace.html +135 -0
  44. data/examples/bar_chart/bar_chart.rb +268 -0
  45. data/examples/bar_plot.rb +96 -0
  46. data/examples/charts/area.rb +25 -0
  47. data/examples/charts/area_script.rb +69 -0
  48. data/examples/charts/env.rb +8 -0
  49. data/examples/charts/monthly-move.csv +6725 -0
  50. data/examples/charts/morley.csv +101 -0
  51. data/examples/charts/morley2.csv +81 -0
  52. data/examples/charts/morley3.csv +121 -0
  53. data/examples/d3_tutorial.rb +98 -0
  54. data/examples/sc_plot.rb +57 -0
  55. data/examples/scatterplot/axes.rb +111 -0
  56. data/examples/scatterplot/scatterplot.rb +221 -0
  57. data/examples/us_states/map.rb +90 -0
  58. data/examples/us_states/us-ag-productivity2004.csv +49 -0
  59. data/examples/us_states/us-cities.csv +51 -0
  60. data/examples/util/linear_scale.rb +83 -0
  61. data/examples/util/ordinal_scale.rb +72 -0
  62. data/init.rb +39 -0
  63. data/lib/jx/array_handler.js +70 -0
  64. data/lib/jx/callback.rb +255 -0
  65. data/lib/jx/hash_handler.js +87 -0
  66. data/lib/jx/irbobject.rb +121 -0
  67. data/lib/jx/js.rb +442 -0
  68. data/lib/jx/js_array.rb +31 -0
  69. data/lib/jx/js_hash.rb +76 -0
  70. data/lib/jx/js_init.rb +62 -0
  71. data/lib/jx/jsarray.rb +66 -0
  72. data/lib/jx/jsfunction.rb +73 -0
  73. data/lib/jx/jsobject.rb +188 -0
  74. data/lib/jx/jsstyle_sheet.rb +231 -0
  75. data/lib/jx/jsundefined.rb +46 -0
  76. data/lib/jx/proxy_array.rb +62 -0
  77. data/lib/jx/rbobject.rb +80 -0
  78. data/lib/jx/ruby_proxy.js +176 -0
  79. data/lib/jx/ruby_rich.js +70 -0
  80. data/lib/jx/sol.rb +109 -0
  81. data/lib/mdarray-sol.rb +34 -0
  82. data/lib/mdarray/jsmdarray.rb +39 -0
  83. data/lib/ruby_rich/bootstrap.rb +230 -0
  84. data/lib/ruby_rich/config.html +22 -0
  85. data/lib/ruby_rich/dashboard.rb +299 -0
  86. data/lib/ruby_rich/ruby_rich.rb +120 -0
  87. data/lib/sol/bar_chart.rb +35 -0
  88. data/lib/sol/base_chart.rb +148 -0
  89. data/lib/sol/chart.rb +138 -0
  90. data/lib/sol/coordinate_chart.rb +128 -0
  91. data/lib/sol/interval.rb +156 -0
  92. data/lib/sol/line_chart.rb +58 -0
  93. data/lib/sol/margins.rb +52 -0
  94. data/lib/sol/scale.rb +212 -0
  95. data/lib/sol/stack.rb +44 -0
  96. data/node_modules/bootstrap/Gruntfile.js +533 -0
  97. data/node_modules/bootstrap/dist/js/bootstrap.js +2363 -0
  98. data/node_modules/bootstrap/dist/js/bootstrap.min.js +7 -0
  99. data/node_modules/bootstrap/dist/js/npm.js +13 -0
  100. data/node_modules/bootstrap/grunt/bs-commonjs-generator.js +30 -0
  101. data/node_modules/bootstrap/grunt/bs-glyphicons-data-generator.js +42 -0
  102. data/node_modules/bootstrap/grunt/bs-lessdoc-parser.js +237 -0
  103. data/node_modules/bootstrap/grunt/bs-raw-files-generator.js +44 -0
  104. data/node_modules/bootstrap/js/affix.js +162 -0
  105. data/node_modules/bootstrap/js/alert.js +94 -0
  106. data/node_modules/bootstrap/js/button.js +120 -0
  107. data/node_modules/bootstrap/js/carousel.js +237 -0
  108. data/node_modules/bootstrap/js/collapse.js +211 -0
  109. data/node_modules/bootstrap/js/dropdown.js +165 -0
  110. data/node_modules/bootstrap/js/modal.js +337 -0
  111. data/node_modules/bootstrap/js/popover.js +108 -0
  112. data/node_modules/bootstrap/js/scrollspy.js +172 -0
  113. data/node_modules/bootstrap/js/tab.js +155 -0
  114. data/node_modules/bootstrap/js/tooltip.js +514 -0
  115. data/node_modules/bootstrap/js/transition.js +59 -0
  116. data/node_modules/chai/chai.js +6142 -0
  117. data/node_modules/chai/index.js +1 -0
  118. data/node_modules/chai/karma.conf.js +28 -0
  119. data/node_modules/chai/karma.sauce.js +41 -0
  120. data/node_modules/chai/lib/chai.js +93 -0
  121. data/node_modules/chai/lib/chai/assertion.js +131 -0
  122. data/node_modules/chai/lib/chai/config.js +55 -0
  123. data/node_modules/chai/lib/chai/core/assertions.js +1860 -0
  124. data/node_modules/chai/lib/chai/interface/assert.js +1645 -0
  125. data/node_modules/chai/lib/chai/interface/expect.js +34 -0
  126. data/node_modules/chai/lib/chai/interface/should.js +201 -0
  127. data/node_modules/chai/lib/chai/utils/addChainableMethod.js +112 -0
  128. data/node_modules/chai/lib/chai/utils/addMethod.js +44 -0
  129. data/node_modules/chai/lib/chai/utils/addProperty.js +48 -0
  130. data/node_modules/chai/lib/chai/utils/expectTypes.js +42 -0
  131. data/node_modules/chai/lib/chai/utils/flag.js +33 -0
  132. data/node_modules/chai/lib/chai/utils/getActual.js +20 -0
  133. data/node_modules/chai/lib/chai/utils/getEnumerableProperties.js +26 -0
  134. data/node_modules/chai/lib/chai/utils/getMessage.js +51 -0
  135. data/node_modules/chai/lib/chai/utils/getName.js +22 -0
  136. data/node_modules/chai/lib/chai/utils/getPathInfo.js +111 -0
  137. data/node_modules/chai/lib/chai/utils/getPathValue.js +43 -0
  138. data/node_modules/chai/lib/chai/utils/getProperties.js +36 -0
  139. data/node_modules/chai/lib/chai/utils/hasProperty.js +64 -0
  140. data/node_modules/chai/lib/chai/utils/index.js +130 -0
  141. data/node_modules/chai/lib/chai/utils/inspect.js +335 -0
  142. data/node_modules/chai/lib/chai/utils/objDisplay.js +50 -0
  143. data/node_modules/chai/lib/chai/utils/overwriteChainableMethod.js +54 -0
  144. data/node_modules/chai/lib/chai/utils/overwriteMethod.js +52 -0
  145. data/node_modules/chai/lib/chai/utils/overwriteProperty.js +55 -0
  146. data/node_modules/chai/lib/chai/utils/test.js +28 -0
  147. data/node_modules/chai/lib/chai/utils/transferFlags.js +45 -0
  148. data/node_modules/chai/node_modules/assertion-error/index.js +116 -0
  149. data/node_modules/chai/node_modules/deep-eql/index.js +1 -0
  150. data/node_modules/chai/node_modules/deep-eql/karma.conf.js +20 -0
  151. data/node_modules/chai/node_modules/deep-eql/lib/eql.js +257 -0
  152. data/node_modules/chai/node_modules/deep-eql/node_modules/type-detect/index.js +1 -0
  153. data/node_modules/chai/node_modules/deep-eql/node_modules/type-detect/lib/type.js +142 -0
  154. data/node_modules/chai/node_modules/type-detect/index.js +1 -0
  155. data/node_modules/chai/node_modules/type-detect/lib/type.js +134 -0
  156. data/node_modules/chai/sauce.browsers.js +128 -0
  157. data/node_modules/dc/Gruntfile.js +437 -0
  158. data/node_modules/dc/dc.js +10477 -0
  159. data/node_modules/dc/dc.min.js +23 -0
  160. data/node_modules/dc/docs/coverage.js +203 -0
  161. data/node_modules/dc/grunt/format-file-list.js +33 -0
  162. data/node_modules/dc/index.js +5 -0
  163. data/node_modules/dc/node_modules/crossfilter2/crossfilter.js +1401 -0
  164. data/node_modules/dc/node_modules/crossfilter2/crossfilter.min.js +1 -0
  165. data/node_modules/dc/node_modules/crossfilter2/index.js +1 -0
  166. data/node_modules/dc/node_modules/crossfilter2/src/array.js +46 -0
  167. data/node_modules/dc/node_modules/crossfilter2/src/bisect.js +44 -0
  168. data/node_modules/dc/node_modules/crossfilter2/src/crossfilter.js +872 -0
  169. data/node_modules/dc/node_modules/crossfilter2/src/filter.js +19 -0
  170. data/node_modules/dc/node_modules/crossfilter2/src/heap.js +44 -0
  171. data/node_modules/dc/node_modules/crossfilter2/src/heapselect.js +36 -0
  172. data/node_modules/dc/node_modules/crossfilter2/src/identity.js +3 -0
  173. data/node_modules/dc/node_modules/crossfilter2/src/insertionsort.js +18 -0
  174. data/node_modules/dc/node_modules/crossfilter2/src/null.js +3 -0
  175. data/node_modules/dc/node_modules/crossfilter2/src/permute.js +8 -0
  176. data/node_modules/dc/node_modules/crossfilter2/src/quicksort.js +283 -0
  177. data/node_modules/dc/node_modules/crossfilter2/src/reduce.js +19 -0
  178. data/node_modules/dc/node_modules/crossfilter2/src/zero.js +3 -0
  179. data/node_modules/dc/node_modules/d3/d3.js +9554 -0
  180. data/node_modules/dc/node_modules/d3/d3.min.js +5 -0
  181. data/node_modules/dc/node_modules/d3/package.js +13 -0
  182. data/node_modules/dc/node_modules/d3/src/arrays/ascending.js +5 -0
  183. data/node_modules/dc/node_modules/d3/src/arrays/bisect.js +36 -0
  184. data/node_modules/dc/node_modules/d3/src/arrays/descending.js +3 -0
  185. data/node_modules/dc/node_modules/d3/src/arrays/deviation.js +6 -0
  186. data/node_modules/dc/node_modules/d3/src/arrays/entries.js +5 -0
  187. data/node_modules/dc/node_modules/d3/src/arrays/extent.js +21 -0
  188. data/node_modules/dc/node_modules/d3/src/arrays/index.js +25 -0
  189. data/node_modules/dc/node_modules/d3/src/arrays/keys.js +5 -0
  190. data/node_modules/dc/node_modules/d3/src/arrays/map.js +84 -0
  191. data/node_modules/dc/node_modules/d3/src/arrays/max.js +14 -0
  192. data/node_modules/dc/node_modules/d3/src/arrays/mean.js +15 -0
  193. data/node_modules/dc/node_modules/d3/src/arrays/median.js +16 -0
  194. data/node_modules/dc/node_modules/d3/src/arrays/merge.js +21 -0
  195. data/node_modules/dc/node_modules/d3/src/arrays/min.js +14 -0
  196. data/node_modules/dc/node_modules/d3/src/arrays/nest.js +97 -0
  197. data/node_modules/dc/node_modules/d3/src/arrays/pairs.js +5 -0
  198. data/node_modules/dc/node_modules/d3/src/arrays/permute.js +5 -0
  199. data/node_modules/dc/node_modules/d3/src/arrays/quantile.js +8 -0
  200. data/node_modules/dc/node_modules/d3/src/arrays/range.js +26 -0
  201. data/node_modules/dc/node_modules/d3/src/arrays/set.js +27 -0
  202. data/node_modules/dc/node_modules/d3/src/arrays/shuffle.js +9 -0
  203. data/node_modules/dc/node_modules/d3/src/arrays/sum.js +14 -0
  204. data/node_modules/dc/node_modules/d3/src/arrays/transpose.js +15 -0
  205. data/node_modules/dc/node_modules/d3/src/arrays/values.js +5 -0
  206. data/node_modules/dc/node_modules/d3/src/arrays/variance.js +29 -0
  207. data/node_modules/dc/node_modules/d3/src/arrays/zip.js +5 -0
  208. data/node_modules/dc/node_modules/d3/src/behavior/behavior.js +1 -0
  209. data/node_modules/dc/node_modules/d3/src/behavior/drag.js +88 -0
  210. data/node_modules/dc/node_modules/d3/src/behavior/index.js +3 -0
  211. data/node_modules/dc/node_modules/d3/src/behavior/zoom.js +348 -0
  212. data/node_modules/dc/node_modules/d3/src/color/color.js +7 -0
  213. data/node_modules/dc/node_modules/d3/src/color/hcl.js +34 -0
  214. data/node_modules/dc/node_modules/d3/src/color/hsl.js +56 -0
  215. data/node_modules/dc/node_modules/d3/src/color/index.js +6 -0
  216. data/node_modules/dc/node_modules/d3/src/color/lab.js +60 -0
  217. data/node_modules/dc/node_modules/d3/src/color/rgb.js +301 -0
  218. data/node_modules/dc/node_modules/d3/src/color/xyz.js +7 -0
  219. data/node_modules/dc/node_modules/d3/src/compat/array.js +15 -0
  220. data/node_modules/dc/node_modules/d3/src/compat/date.js +3 -0
  221. data/node_modules/dc/node_modules/d3/src/compat/index.js +3 -0
  222. data/node_modules/dc/node_modules/d3/src/compat/style.js +23 -0
  223. data/node_modules/dc/node_modules/d3/src/core/array.js +2 -0
  224. data/node_modules/dc/node_modules/d3/src/core/class.js +8 -0
  225. data/node_modules/dc/node_modules/d3/src/core/document.js +15 -0
  226. data/node_modules/dc/node_modules/d3/src/core/functor.js +5 -0
  227. data/node_modules/dc/node_modules/d3/src/core/identity.js +3 -0
  228. data/node_modules/dc/node_modules/d3/src/core/index.js +3 -0
  229. data/node_modules/dc/node_modules/d3/src/core/noop.js +1 -0
  230. data/node_modules/dc/node_modules/d3/src/core/ns.js +18 -0
  231. data/node_modules/dc/node_modules/d3/src/core/rebind.js +16 -0
  232. data/node_modules/dc/node_modules/d3/src/core/source.js +3 -0
  233. data/node_modules/dc/node_modules/d3/src/core/subclass.js +11 -0
  234. data/node_modules/dc/node_modules/d3/src/core/target.js +3 -0
  235. data/node_modules/dc/node_modules/d3/src/core/true.js +3 -0
  236. data/node_modules/dc/node_modules/d3/src/core/vendor.js +10 -0
  237. data/node_modules/dc/node_modules/d3/src/core/zero.js +3 -0
  238. data/node_modules/dc/node_modules/d3/src/d3.js +23 -0
  239. data/node_modules/dc/node_modules/d3/src/dsv/csv.js +3 -0
  240. data/node_modules/dc/node_modules/d3/src/dsv/dsv.js +136 -0
  241. data/node_modules/dc/node_modules/d3/src/dsv/index.js +3 -0
  242. data/node_modules/dc/node_modules/d3/src/dsv/tsv.js +3 -0
  243. data/node_modules/dc/node_modules/d3/src/end.js +4 -0
  244. data/node_modules/dc/node_modules/d3/src/event/dispatch.js +69 -0
  245. data/node_modules/dc/node_modules/d3/src/event/drag.js +36 -0
  246. data/node_modules/dc/node_modules/d3/src/event/event.js +50 -0
  247. data/node_modules/dc/node_modules/d3/src/event/index.js +6 -0
  248. data/node_modules/dc/node_modules/d3/src/event/mouse.js +39 -0
  249. data/node_modules/dc/node_modules/d3/src/event/timer.js +82 -0
  250. data/node_modules/dc/node_modules/d3/src/event/touch.js +11 -0
  251. data/node_modules/dc/node_modules/d3/src/event/touches.js +12 -0
  252. data/node_modules/dc/node_modules/d3/src/format/collapse.js +3 -0
  253. data/node_modules/dc/node_modules/d3/src/format/format.js +3 -0
  254. data/node_modules/dc/node_modules/d3/src/format/formatPrefix.js +24 -0
  255. data/node_modules/dc/node_modules/d3/src/format/index.js +4 -0
  256. data/node_modules/dc/node_modules/d3/src/format/precision.js +3 -0
  257. data/node_modules/dc/node_modules/d3/src/format/requote.js +5 -0
  258. data/node_modules/dc/node_modules/d3/src/format/round.js +5 -0
  259. data/node_modules/dc/node_modules/d3/src/geo/albers-usa.js +129 -0
  260. data/node_modules/dc/node_modules/d3/src/geo/albers.js +11 -0
  261. data/node_modules/dc/node_modules/d3/src/geo/area.js +69 -0
  262. data/node_modules/dc/node_modules/d3/src/geo/azimuthal-equal-area.js +12 -0
  263. data/node_modules/dc/node_modules/d3/src/geo/azimuthal-equidistant.js +13 -0
  264. data/node_modules/dc/node_modules/d3/src/geo/azimuthal.js +25 -0
  265. data/node_modules/dc/node_modules/d3/src/geo/bounds.js +168 -0
  266. data/node_modules/dc/node_modules/d3/src/geo/cartesian.js +47 -0
  267. data/node_modules/dc/node_modules/d3/src/geo/centroid.js +149 -0
  268. data/node_modules/dc/node_modules/d3/src/geo/circle.js +81 -0
  269. data/node_modules/dc/node_modules/d3/src/geo/clip-antimeridian.js +95 -0
  270. data/node_modules/dc/node_modules/d3/src/geo/clip-circle.js +178 -0
  271. data/node_modules/dc/node_modules/d3/src/geo/clip-extent.js +196 -0
  272. data/node_modules/dc/node_modules/d3/src/geo/clip-polygon.js +104 -0
  273. data/node_modules/dc/node_modules/d3/src/geo/clip.js +149 -0
  274. data/node_modules/dc/node_modules/d3/src/geo/compose.js +12 -0
  275. data/node_modules/dc/node_modules/d3/src/geo/conic-conformal.js +39 -0
  276. data/node_modules/dc/node_modules/d3/src/geo/conic-equal-area.js +33 -0
  277. data/node_modules/dc/node_modules/d3/src/geo/conic-equidistant.js +36 -0
  278. data/node_modules/dc/node_modules/d3/src/geo/conic.js +16 -0
  279. data/node_modules/dc/node_modules/d3/src/geo/distance.js +13 -0
  280. data/node_modules/dc/node_modules/d3/src/geo/equirectangular.js +10 -0
  281. data/node_modules/dc/node_modules/d3/src/geo/geo.js +1 -0
  282. data/node_modules/dc/node_modules/d3/src/geo/gnomonic.js +12 -0
  283. data/node_modules/dc/node_modules/d3/src/geo/graticule.js +103 -0
  284. data/node_modules/dc/node_modules/d3/src/geo/greatArc.js +42 -0
  285. data/node_modules/dc/node_modules/d3/src/geo/index.js +33 -0
  286. data/node_modules/dc/node_modules/d3/src/geo/interpolate.js +38 -0
  287. data/node_modules/dc/node_modules/d3/src/geo/length.js +44 -0
  288. data/node_modules/dc/node_modules/d3/src/geo/mercator.js +48 -0
  289. data/node_modules/dc/node_modules/d3/src/geo/orthographic.js +12 -0
  290. data/node_modules/dc/node_modules/d3/src/geo/path-area.js +41 -0
  291. data/node_modules/dc/node_modules/d3/src/geo/path-bounds.js +21 -0
  292. data/node_modules/dc/node_modules/d3/src/geo/path-buffer.js +59 -0
  293. data/node_modules/dc/node_modules/d3/src/geo/path-centroid.js +78 -0
  294. data/node_modules/dc/node_modules/d3/src/geo/path-context.js +49 -0
  295. data/node_modules/dc/node_modules/d3/src/geo/path.js +87 -0
  296. data/node_modules/dc/node_modules/d3/src/geo/point-in-polygon.js +71 -0
  297. data/node_modules/dc/node_modules/d3/src/geo/projection.js +121 -0
  298. data/node_modules/dc/node_modules/d3/src/geo/resample.js +109 -0
  299. data/node_modules/dc/node_modules/d3/src/geo/rotation.js +79 -0
  300. data/node_modules/dc/node_modules/d3/src/geo/spherical.js +13 -0
  301. data/node_modules/dc/node_modules/d3/src/geo/stereographic.js +12 -0
  302. data/node_modules/dc/node_modules/d3/src/geo/stream.js +71 -0
  303. data/node_modules/dc/node_modules/d3/src/geo/transform.js +36 -0
  304. data/node_modules/dc/node_modules/d3/src/geo/transverse-mercator.js +31 -0
  305. data/node_modules/dc/node_modules/d3/src/geom/clip-line.js +66 -0
  306. data/node_modules/dc/node_modules/d3/src/geom/delaunay.js +6 -0
  307. data/node_modules/dc/node_modules/d3/src/geom/geom.js +1 -0
  308. data/node_modules/dc/node_modules/d3/src/geom/hull.js +91 -0
  309. data/node_modules/dc/node_modules/d3/src/geom/index.js +6 -0
  310. data/node_modules/dc/node_modules/d3/src/geom/point.js +7 -0
  311. data/node_modules/dc/node_modules/d3/src/geom/polygon.js +105 -0
  312. data/node_modules/dc/node_modules/d3/src/geom/quadtree.js +243 -0
  313. data/node_modules/dc/node_modules/d3/src/geom/voronoi.js +110 -0
  314. data/node_modules/dc/node_modules/d3/src/geom/voronoi/beach.js +186 -0
  315. data/node_modules/dc/node_modules/d3/src/geom/voronoi/cell.js +64 -0
  316. data/node_modules/dc/node_modules/d3/src/geom/voronoi/circle.js +73 -0
  317. data/node_modules/dc/node_modules/d3/src/geom/voronoi/clip.js +80 -0
  318. data/node_modules/dc/node_modules/d3/src/geom/voronoi/edge.js +50 -0
  319. data/node_modules/dc/node_modules/d3/src/geom/voronoi/index.js +59 -0
  320. data/node_modules/dc/node_modules/d3/src/geom/voronoi/red-black.js +235 -0
  321. data/node_modules/dc/node_modules/d3/src/interpolate/array.js +19 -0
  322. data/node_modules/dc/node_modules/d3/src/interpolate/ease.js +111 -0
  323. data/node_modules/dc/node_modules/d3/src/interpolate/hcl.js +20 -0
  324. data/node_modules/dc/node_modules/d3/src/interpolate/hsl.js +20 -0
  325. data/node_modules/dc/node_modules/d3/src/interpolate/index.js +14 -0
  326. data/node_modules/dc/node_modules/d3/src/interpolate/interpolate.js +26 -0
  327. data/node_modules/dc/node_modules/d3/src/interpolate/lab.js +17 -0
  328. data/node_modules/dc/node_modules/d3/src/interpolate/number.js +6 -0
  329. data/node_modules/dc/node_modules/d3/src/interpolate/object.js +25 -0
  330. data/node_modules/dc/node_modules/d3/src/interpolate/rgb.js +20 -0
  331. data/node_modules/dc/node_modules/d3/src/interpolate/round.js +6 -0
  332. data/node_modules/dc/node_modules/d3/src/interpolate/string.js +54 -0
  333. data/node_modules/dc/node_modules/d3/src/interpolate/transform.js +59 -0
  334. data/node_modules/dc/node_modules/d3/src/interpolate/uninterpolate.js +9 -0
  335. data/node_modules/dc/node_modules/d3/src/interpolate/zoom.js +53 -0
  336. data/node_modules/dc/node_modules/d3/src/layout/bundle.js +59 -0
  337. data/node_modules/dc/node_modules/d3/src/layout/chord.js +157 -0
  338. data/node_modules/dc/node_modules/d3/src/layout/cluster.js +92 -0
  339. data/node_modules/dc/node_modules/d3/src/layout/force.js +372 -0
  340. data/node_modules/dc/node_modules/d3/src/layout/hierarchy.js +136 -0
  341. data/node_modules/dc/node_modules/d3/src/layout/histogram.js +110 -0
  342. data/node_modules/dc/node_modules/d3/src/layout/index.js +13 -0
  343. data/node_modules/dc/node_modules/d3/src/layout/layout.js +1 -0
  344. data/node_modules/dc/node_modules/d3/src/layout/pack.js +211 -0
  345. data/node_modules/dc/node_modules/d3/src/layout/partition.js +51 -0
  346. data/node_modules/dc/node_modules/d3/src/layout/pie.js +78 -0
  347. data/node_modules/dc/node_modules/d3/src/layout/stack.js +247 -0
  348. data/node_modules/dc/node_modules/d3/src/layout/tree.js +240 -0
  349. data/node_modules/dc/node_modules/d3/src/layout/treemap.js +229 -0
  350. data/node_modules/dc/node_modules/d3/src/locale/ca-ES.js +16 -0
  351. data/node_modules/dc/node_modules/d3/src/locale/de-CH.js +16 -0
  352. data/node_modules/dc/node_modules/d3/src/locale/de-DE.js +16 -0
  353. data/node_modules/dc/node_modules/d3/src/locale/en-CA.js +16 -0
  354. data/node_modules/dc/node_modules/d3/src/locale/en-GB.js +16 -0
  355. data/node_modules/dc/node_modules/d3/src/locale/en-US.js +16 -0
  356. data/node_modules/dc/node_modules/d3/src/locale/es-ES.js +16 -0
  357. data/node_modules/dc/node_modules/d3/src/locale/fi-FI.js +16 -0
  358. data/node_modules/dc/node_modules/d3/src/locale/fr-CA.js +16 -0
  359. data/node_modules/dc/node_modules/d3/src/locale/fr-FR.js +16 -0
  360. data/node_modules/dc/node_modules/d3/src/locale/he-IL.js +16 -0
  361. data/node_modules/dc/node_modules/d3/src/locale/hu-HU.js +16 -0
  362. data/node_modules/dc/node_modules/d3/src/locale/it-IT.js +16 -0
  363. data/node_modules/dc/node_modules/d3/src/locale/ja-JP.js +16 -0
  364. data/node_modules/dc/node_modules/d3/src/locale/ko-KR.js +16 -0
  365. data/node_modules/dc/node_modules/d3/src/locale/locale.js +9 -0
  366. data/node_modules/dc/node_modules/d3/src/locale/mk-MK.js +16 -0
  367. data/node_modules/dc/node_modules/d3/src/locale/nl-NL.js +16 -0
  368. data/node_modules/dc/node_modules/d3/src/locale/number-format.js +155 -0
  369. data/node_modules/dc/node_modules/d3/src/locale/pl-PL.js +16 -0
  370. data/node_modules/dc/node_modules/d3/src/locale/pt-BR.js +16 -0
  371. data/node_modules/dc/node_modules/d3/src/locale/ru-RU.js +16 -0
  372. data/node_modules/dc/node_modules/d3/src/locale/sv-SE.js +16 -0
  373. data/node_modules/dc/node_modules/d3/src/locale/time-format.js +370 -0
  374. data/node_modules/dc/node_modules/d3/src/locale/time-scale.js +0 -0
  375. data/node_modules/dc/node_modules/d3/src/locale/zh-CN.js +16 -0
  376. data/node_modules/dc/node_modules/d3/src/math/abs.js +1 -0
  377. data/node_modules/dc/node_modules/d3/src/math/adder.js +34 -0
  378. data/node_modules/dc/node_modules/d3/src/math/index.js +2 -0
  379. data/node_modules/dc/node_modules/d3/src/math/number.js +7 -0
  380. data/node_modules/dc/node_modules/d3/src/math/random.js +34 -0
  381. data/node_modules/dc/node_modules/d3/src/math/transform.js +64 -0
  382. data/node_modules/dc/node_modules/d3/src/math/trigonometry.js +44 -0
  383. data/node_modules/dc/node_modules/d3/src/scale/bilinear.js +7 -0
  384. data/node_modules/dc/node_modules/d3/src/scale/category.js +58 -0
  385. data/node_modules/dc/node_modules/d3/src/scale/identity.js +33 -0
  386. data/node_modules/dc/node_modules/d3/src/scale/index.js +11 -0
  387. data/node_modules/dc/node_modules/d3/src/scale/linear.js +160 -0
  388. data/node_modules/dc/node_modules/d3/src/scale/log.js +92 -0
  389. data/node_modules/dc/node_modules/d3/src/scale/nice.js +30 -0
  390. data/node_modules/dc/node_modules/d3/src/scale/ordinal.js +102 -0
  391. data/node_modules/dc/node_modules/d3/src/scale/polylinear.js +24 -0
  392. data/node_modules/dc/node_modules/d3/src/scale/pow.js +57 -0
  393. data/node_modules/dc/node_modules/d3/src/scale/quantile.js +55 -0
  394. data/node_modules/dc/node_modules/d3/src/scale/quantize.js +44 -0
  395. data/node_modules/dc/node_modules/d3/src/scale/scale.js +10 -0
  396. data/node_modules/dc/node_modules/d3/src/scale/sqrt.js +6 -0
  397. data/node_modules/dc/node_modules/d3/src/scale/threshold.js +36 -0
  398. data/node_modules/dc/node_modules/d3/src/selection/append.js +28 -0
  399. data/node_modules/dc/node_modules/d3/src/selection/attr.js +62 -0
  400. data/node_modules/dc/node_modules/d3/src/selection/call.js +8 -0
  401. data/node_modules/dc/node_modules/d3/src/selection/classed.js +76 -0
  402. data/node_modules/dc/node_modules/d3/src/selection/data.js +117 -0
  403. data/node_modules/dc/node_modules/d3/src/selection/datum.js +7 -0
  404. data/node_modules/dc/node_modules/d3/src/selection/each.js +16 -0
  405. data/node_modules/dc/node_modules/d3/src/selection/empty.js +5 -0
  406. data/node_modules/dc/node_modules/d3/src/selection/enter-insert.js +20 -0
  407. data/node_modules/dc/node_modules/d3/src/selection/enter-select.js +27 -0
  408. data/node_modules/dc/node_modules/d3/src/selection/enter.js +21 -0
  409. data/node_modules/dc/node_modules/d3/src/selection/filter.js +28 -0
  410. data/node_modules/dc/node_modules/d3/src/selection/html.js +10 -0
  411. data/node_modules/dc/node_modules/d3/src/selection/index.js +1 -0
  412. data/node_modules/dc/node_modules/d3/src/selection/insert.js +9 -0
  413. data/node_modules/dc/node_modules/d3/src/selection/interrupt.js +27 -0
  414. data/node_modules/dc/node_modules/d3/src/selection/node.js +11 -0
  415. data/node_modules/dc/node_modules/d3/src/selection/on.js +106 -0
  416. data/node_modules/dc/node_modules/d3/src/selection/order.js +13 -0
  417. data/node_modules/dc/node_modules/d3/src/selection/property.js +43 -0
  418. data/node_modules/dc/node_modules/d3/src/selection/remove.js +13 -0
  419. data/node_modules/dc/node_modules/d3/src/selection/select.js +32 -0
  420. data/node_modules/dc/node_modules/d3/src/selection/selectAll.js +27 -0
  421. data/node_modules/dc/node_modules/d3/src/selection/selection.js +81 -0
  422. data/node_modules/dc/node_modules/d3/src/selection/size.js +7 -0
  423. data/node_modules/dc/node_modules/d3/src/selection/sort.js +15 -0
  424. data/node_modules/dc/node_modules/d3/src/selection/style.js +59 -0
  425. data/node_modules/dc/node_modules/d3/src/selection/text.js +10 -0
  426. data/node_modules/dc/node_modules/d3/src/selection/transition.js +21 -0
  427. data/node_modules/dc/node_modules/d3/src/start.js +2 -0
  428. data/node_modules/dc/node_modules/d3/src/svg/arc.js +292 -0
  429. data/node_modules/dc/node_modules/d3/src/svg/area-radial.js +14 -0
  430. data/node_modules/dc/node_modules/d3/src/svg/area.js +121 -0
  431. data/node_modules/dc/node_modules/d3/src/svg/axis.js +160 -0
  432. data/node_modules/dc/node_modules/d3/src/svg/brush.js +429 -0
  433. data/node_modules/dc/node_modules/d3/src/svg/chord.js +90 -0
  434. data/node_modules/dc/node_modules/d3/src/svg/diagonal-radial.js +27 -0
  435. data/node_modules/dc/node_modules/d3/src/svg/diagonal.js +43 -0
  436. data/node_modules/dc/node_modules/d3/src/svg/index.js +12 -0
  437. data/node_modules/dc/node_modules/d3/src/svg/line-radial.js +27 -0
  438. data/node_modules/dc/node_modules/d3/src/svg/line.js +432 -0
  439. data/node_modules/dc/node_modules/d3/src/svg/svg.js +1 -0
  440. data/node_modules/dc/node_modules/d3/src/svg/symbol.js +105 -0
  441. data/node_modules/dc/node_modules/d3/src/time/day.js +21 -0
  442. data/node_modules/dc/node_modules/d3/src/time/format-iso.js +19 -0
  443. data/node_modules/dc/node_modules/d3/src/time/format-utc.js +3 -0
  444. data/node_modules/dc/node_modules/d3/src/time/format.js +4 -0
  445. data/node_modules/dc/node_modules/d3/src/time/hour.js +14 -0
  446. data/node_modules/dc/node_modules/d3/src/time/index.js +14 -0
  447. data/node_modules/dc/node_modules/d3/src/time/interval.js +71 -0
  448. data/node_modules/dc/node_modules/d3/src/time/minute.js +13 -0
  449. data/node_modules/dc/node_modules/d3/src/time/month.js +16 -0
  450. data/node_modules/dc/node_modules/d3/src/time/scale-utc.js +25 -0
  451. data/node_modules/dc/node_modules/d3/src/time/scale.js +155 -0
  452. data/node_modules/dc/node_modules/d3/src/time/second.js +13 -0
  453. data/node_modules/dc/node_modules/d3/src/time/time.js +33 -0
  454. data/node_modules/dc/node_modules/d3/src/time/week.js +31 -0
  455. data/node_modules/dc/node_modules/d3/src/time/year.js +16 -0
  456. data/node_modules/dc/node_modules/d3/src/transition/attr.js +58 -0
  457. data/node_modules/dc/node_modules/d3/src/transition/delay.js +10 -0
  458. data/node_modules/dc/node_modules/d3/src/transition/duration.js +10 -0
  459. data/node_modules/dc/node_modules/d3/src/transition/each.js +26 -0
  460. data/node_modules/dc/node_modules/d3/src/transition/ease.js +10 -0
  461. data/node_modules/dc/node_modules/d3/src/transition/filter.js +22 -0
  462. data/node_modules/dc/node_modules/d3/src/transition/index.js +1 -0
  463. data/node_modules/dc/node_modules/d3/src/transition/remove.js +9 -0
  464. data/node_modules/dc/node_modules/d3/src/transition/select.js +28 -0
  465. data/node_modules/dc/node_modules/d3/src/transition/selectAll.js +31 -0
  466. data/node_modules/dc/node_modules/d3/src/transition/style.js +53 -0
  467. data/node_modules/dc/node_modules/d3/src/transition/subtransition.js +25 -0
  468. data/node_modules/dc/node_modules/d3/src/transition/text.js +11 -0
  469. data/node_modules/dc/node_modules/d3/src/transition/transition.js +161 -0
  470. data/node_modules/dc/node_modules/d3/src/transition/tween.js +17 -0
  471. data/node_modules/dc/node_modules/d3/src/xhr/html.js +12 -0
  472. data/node_modules/dc/node_modules/d3/src/xhr/index.js +5 -0
  473. data/node_modules/dc/node_modules/d3/src/xhr/json.js +9 -0
  474. data/node_modules/dc/node_modules/d3/src/xhr/text.js +5 -0
  475. data/node_modules/dc/node_modules/d3/src/xhr/xhr.js +126 -0
  476. data/node_modules/dc/node_modules/d3/src/xhr/xml.js +5 -0
  477. data/node_modules/dc/regression/inject-serializer.js +6 -0
  478. data/node_modules/dc/regression/stock-regression-test.js +140 -0
  479. data/node_modules/dc/spec/bar-chart-spec.js +1230 -0
  480. data/node_modules/dc/spec/base-mixin-spec.js +611 -0
  481. data/node_modules/dc/spec/biggish-data-spec.js +136 -0
  482. data/node_modules/dc/spec/box-plot-spec.js +211 -0
  483. data/node_modules/dc/spec/bubble-chart-spec.js +450 -0
  484. data/node_modules/dc/spec/bubble-overlay-spec.js +102 -0
  485. data/node_modules/dc/spec/color-spec.js +89 -0
  486. data/node_modules/dc/spec/composite-chart-spec.js +691 -0
  487. data/node_modules/dc/spec/coordinate-grid-chart-spec.js +962 -0
  488. data/node_modules/dc/spec/core-spec.js +301 -0
  489. data/node_modules/dc/spec/data-addition-spec.js +122 -0
  490. data/node_modules/dc/spec/data-count-spec.js +180 -0
  491. data/node_modules/dc/spec/data-grid-spec.js +124 -0
  492. data/node_modules/dc/spec/data-table-spec.js +251 -0
  493. data/node_modules/dc/spec/event-spec.js +41 -0
  494. data/node_modules/dc/spec/filter-dates-spec.js +92 -0
  495. data/node_modules/dc/spec/filters-spec.js +140 -0
  496. data/node_modules/dc/spec/geo-choropleth-chart-spec.js +225 -0
  497. data/node_modules/dc/spec/heatmap-spec.js +363 -0
  498. data/node_modules/dc/spec/helpers/custom_matchers.js +213 -0
  499. data/node_modules/dc/spec/helpers/fixtures.js +81 -0
  500. data/node_modules/dc/spec/helpers/geoFixtures.js +113 -0
  501. data/node_modules/dc/spec/helpers/load-jsreporter.js +37 -0
  502. data/node_modules/dc/spec/helpers/spec-helper.js +53 -0
  503. data/node_modules/dc/spec/legend-spec.js +266 -0
  504. data/node_modules/dc/spec/line-chart-spec.js +709 -0
  505. data/node_modules/dc/spec/logger-spec.js +80 -0
  506. data/node_modules/dc/spec/number-display-spec.js +168 -0
  507. data/node_modules/dc/spec/pie-chart-spec.js +677 -0
  508. data/node_modules/dc/spec/row-chart-spec.js +362 -0
  509. data/node_modules/dc/spec/scatter-plot-spec.js +336 -0
  510. data/node_modules/dc/spec/series-chart-spec.js +133 -0
  511. data/node_modules/dc/spec/utils-spec.js +110 -0
  512. data/node_modules/dc/src/banner.js +2 -0
  513. data/node_modules/dc/src/bar-chart.js +374 -0
  514. data/node_modules/dc/src/base-mixin.js +1478 -0
  515. data/node_modules/dc/src/box-plot.js +240 -0
  516. data/node_modules/dc/src/bubble-chart.js +177 -0
  517. data/node_modules/dc/src/bubble-mixin.js +244 -0
  518. data/node_modules/dc/src/bubble-overlay.js +207 -0
  519. data/node_modules/dc/src/cap-mixin.js +151 -0
  520. data/node_modules/dc/src/color-mixin.js +172 -0
  521. data/node_modules/dc/src/composite-chart.js +544 -0
  522. data/node_modules/dc/src/coordinate-grid-mixin.js +1300 -0
  523. data/node_modules/dc/src/core.js +425 -0
  524. data/node_modules/dc/src/d3.box.js +317 -0
  525. data/node_modules/dc/src/data-count.js +110 -0
  526. data/node_modules/dc/src/data-grid.js +243 -0
  527. data/node_modules/dc/src/data-table.js +419 -0
  528. data/node_modules/dc/src/errors.js +28 -0
  529. data/node_modules/dc/src/events.js +37 -0
  530. data/node_modules/dc/src/filters.js +124 -0
  531. data/node_modules/dc/src/footer.js +35 -0
  532. data/node_modules/dc/src/geo-choropleth-chart.js +279 -0
  533. data/node_modules/dc/src/heatmap.js +378 -0
  534. data/node_modules/dc/src/legend.js +277 -0
  535. data/node_modules/dc/src/line-chart.js +504 -0
  536. data/node_modules/dc/src/logger.js +40 -0
  537. data/node_modules/dc/src/margin-mixin.js +44 -0
  538. data/node_modules/dc/src/number-display.js +141 -0
  539. data/node_modules/dc/src/pie-chart.js +571 -0
  540. data/node_modules/dc/src/row-chart.js +425 -0
  541. data/node_modules/dc/src/scatter-plot.js +338 -0
  542. data/node_modules/dc/src/series-chart.js +192 -0
  543. data/node_modules/dc/src/stack-mixin.js +319 -0
  544. data/node_modules/dc/src/utils.js +290 -0
  545. data/node_modules/dc/web/docs/html/scripts/docstrap.lib.js +11 -0
  546. data/node_modules/dc/web/docs/html/scripts/fulltext-search-ui.js +89 -0
  547. data/node_modules/dc/web/docs/html/scripts/fulltext-search.js +36 -0
  548. data/node_modules/dc/web/docs/html/scripts/lunr.min.js +7 -0
  549. data/node_modules/dc/web/docs/html/scripts/prettify/jquery.min.js +6 -0
  550. data/node_modules/dc/web/docs/html/scripts/prettify/lang-css.js +21 -0
  551. data/node_modules/dc/web/docs/html/scripts/prettify/prettify.js +496 -0
  552. data/node_modules/dc/web/docs/html/scripts/sunlight.js +1157 -0
  553. data/node_modules/dc/web/docs/html/scripts/toc.js +203 -0
  554. data/node_modules/dc/web/ep/list.js +106 -0
  555. data/node_modules/dc/web/examples/lysenko-interval-tree.js +447 -0
  556. data/node_modules/dc/web/highlighter/shAutoloader.js +17 -0
  557. data/node_modules/dc/web/highlighter/shBrushJScript.js +52 -0
  558. data/node_modules/dc/web/highlighter/shBrushXml.js +69 -0
  559. data/node_modules/dc/web/highlighter/shCore.js +17 -0
  560. data/node_modules/dc/web/js/colorbrewer.js +1 -0
  561. data/node_modules/dc/web/js/crossfilter.js +1401 -0
  562. data/node_modules/dc/web/js/d3.js +9554 -0
  563. data/node_modules/dc/web/js/dc.js +10477 -0
  564. data/node_modules/dc/web/js/dc.min.js +23 -0
  565. data/node_modules/dc/web/js/env-data.js +218 -0
  566. data/node_modules/dc/web/js/jasmine-jsreporter.js +394 -0
  567. data/node_modules/dc/web/stock.js +685 -0
  568. data/node_modules/dc/web/transitions/transition-test.js +45 -0
  569. data/node_modules/jquery/dist/jquery.js +9814 -0
  570. data/node_modules/jquery/dist/jquery.min.js +4 -0
  571. data/node_modules/jquery/external/sizzle/dist/sizzle.js +2143 -0
  572. data/node_modules/jquery/external/sizzle/dist/sizzle.min.js +3 -0
  573. data/node_modules/jquery/src/ajax.js +845 -0
  574. data/node_modules/jquery/src/ajax/jsonp.js +100 -0
  575. data/node_modules/jquery/src/ajax/load.js +83 -0
  576. data/node_modules/jquery/src/ajax/parseJSON.js +13 -0
  577. data/node_modules/jquery/src/ajax/parseXML.js +27 -0
  578. data/node_modules/jquery/src/ajax/script.js +68 -0
  579. data/node_modules/jquery/src/ajax/var/location.js +3 -0
  580. data/node_modules/jquery/src/ajax/var/nonce.js +5 -0
  581. data/node_modules/jquery/src/ajax/var/rquery.js +3 -0
  582. data/node_modules/jquery/src/ajax/xhr.js +167 -0
  583. data/node_modules/jquery/src/attributes.js +11 -0
  584. data/node_modules/jquery/src/attributes/attr.js +142 -0
  585. data/node_modules/jquery/src/attributes/classes.js +177 -0
  586. data/node_modules/jquery/src/attributes/prop.js +125 -0
  587. data/node_modules/jquery/src/attributes/support.js +36 -0
  588. data/node_modules/jquery/src/attributes/val.js +177 -0
  589. data/node_modules/jquery/src/callbacks.js +232 -0
  590. data/node_modules/jquery/src/core.js +494 -0
  591. data/node_modules/jquery/src/core/access.js +65 -0
  592. data/node_modules/jquery/src/core/init.js +134 -0
  593. data/node_modules/jquery/src/core/parseHTML.js +41 -0
  594. data/node_modules/jquery/src/core/ready.js +103 -0
  595. data/node_modules/jquery/src/core/var/rsingleTag.js +5 -0
  596. data/node_modules/jquery/src/css.js +502 -0
  597. data/node_modules/jquery/src/css/addGetHookIf.js +24 -0
  598. data/node_modules/jquery/src/css/adjustCSS.js +65 -0
  599. data/node_modules/jquery/src/css/curCSS.js +60 -0
  600. data/node_modules/jquery/src/css/defaultDisplay.js +72 -0
  601. data/node_modules/jquery/src/css/hiddenVisibleSelectors.js +18 -0
  602. data/node_modules/jquery/src/css/showHide.js +48 -0
  603. data/node_modules/jquery/src/css/support.js +121 -0
  604. data/node_modules/jquery/src/css/var/cssExpand.js +3 -0
  605. data/node_modules/jquery/src/css/var/getStyles.js +15 -0
  606. data/node_modules/jquery/src/css/var/isHidden.js +16 -0
  607. data/node_modules/jquery/src/css/var/rmargin.js +3 -0
  608. data/node_modules/jquery/src/css/var/rnumnonpx.js +5 -0
  609. data/node_modules/jquery/src/css/var/swap.js +24 -0
  610. data/node_modules/jquery/src/data.js +187 -0
  611. data/node_modules/jquery/src/data/Data.js +200 -0
  612. data/node_modules/jquery/src/data/var/acceptData.js +18 -0
  613. data/node_modules/jquery/src/data/var/dataPriv.js +5 -0
  614. data/node_modules/jquery/src/data/var/dataUser.js +5 -0
  615. data/node_modules/jquery/src/deferred.js +158 -0
  616. data/node_modules/jquery/src/deprecated.js +32 -0
  617. data/node_modules/jquery/src/dimensions.js +54 -0
  618. data/node_modules/jquery/src/effects.js +629 -0
  619. data/node_modules/jquery/src/effects/Tween.js +121 -0
  620. data/node_modules/jquery/src/effects/animatedSelector.js +13 -0
  621. data/node_modules/jquery/src/event.js +711 -0
  622. data/node_modules/jquery/src/event/ajax.js +20 -0
  623. data/node_modules/jquery/src/event/alias.js +27 -0
  624. data/node_modules/jquery/src/event/focusin.js +53 -0
  625. data/node_modules/jquery/src/event/support.js +9 -0
  626. data/node_modules/jquery/src/event/trigger.js +183 -0
  627. data/node_modules/jquery/src/exports/amd.js +24 -0
  628. data/node_modules/jquery/src/exports/global.js +26 -0
  629. data/node_modules/jquery/src/intro.js +44 -0
  630. data/node_modules/jquery/src/jquery.js +37 -0
  631. data/node_modules/jquery/src/manipulation.js +481 -0
  632. data/node_modules/jquery/src/manipulation/_evalUrl.js +20 -0
  633. data/node_modules/jquery/src/manipulation/buildFragment.js +102 -0
  634. data/node_modules/jquery/src/manipulation/getAll.js +21 -0
  635. data/node_modules/jquery/src/manipulation/setGlobalEval.js +20 -0
  636. data/node_modules/jquery/src/manipulation/support.js +33 -0
  637. data/node_modules/jquery/src/manipulation/var/rcheckableType.js +3 -0
  638. data/node_modules/jquery/src/manipulation/var/rscriptType.js +3 -0
  639. data/node_modules/jquery/src/manipulation/var/rtagName.js +3 -0
  640. data/node_modules/jquery/src/manipulation/wrapMap.js +27 -0
  641. data/node_modules/jquery/src/offset.js +218 -0
  642. data/node_modules/jquery/src/outro.js +2 -0
  643. data/node_modules/jquery/src/queue.js +143 -0
  644. data/node_modules/jquery/src/queue/delay.js +22 -0
  645. data/node_modules/jquery/src/selector-native.js +211 -0
  646. data/node_modules/jquery/src/selector-sizzle.js +14 -0
  647. data/node_modules/jquery/src/selector.js +1 -0
  648. data/node_modules/jquery/src/serialize.js +125 -0
  649. data/node_modules/jquery/src/traversing.js +175 -0
  650. data/node_modules/jquery/src/traversing/findFilter.js +100 -0
  651. data/node_modules/jquery/src/traversing/var/dir.js +20 -0
  652. data/node_modules/jquery/src/traversing/var/rneedsContext.js +6 -0
  653. data/node_modules/jquery/src/traversing/var/siblings.js +15 -0
  654. data/node_modules/jquery/src/var/arr.js +3 -0
  655. data/node_modules/jquery/src/var/class2type.js +5 -0
  656. data/node_modules/jquery/src/var/concat.js +5 -0
  657. data/node_modules/jquery/src/var/document.js +3 -0
  658. data/node_modules/jquery/src/var/documentElement.js +5 -0
  659. data/node_modules/jquery/src/var/hasOwn.js +5 -0
  660. data/node_modules/jquery/src/var/indexOf.js +5 -0
  661. data/node_modules/jquery/src/var/pnum.js +3 -0
  662. data/node_modules/jquery/src/var/push.js +5 -0
  663. data/node_modules/jquery/src/var/rcssNum.js +7 -0
  664. data/node_modules/jquery/src/var/rnotwhite.js +3 -0
  665. data/node_modules/jquery/src/var/slice.js +5 -0
  666. data/node_modules/jquery/src/var/support.js +5 -0
  667. data/node_modules/jquery/src/var/toString.js +5 -0
  668. data/node_modules/jquery/src/wrap.js +79 -0
  669. data/target/mdarray_sol.jar +0 -0
  670. data/test/jx/test_complete.rb +35 -0
  671. data/test/jx/test_js.rb +543 -0
  672. data/test/jx/test_proxy_array.rb +239 -0
  673. data/test/jx/test_proxy_hash.rb +160 -0
  674. data/test/jx/test_proxy_lambda.rb +80 -0
  675. data/test/jx/test_rb_js_compat.rb +135 -0
  676. data/test/jx/test_style_sheets.rb +90 -0
  677. data/test/mdarray/test_mdarray.rb +75 -0
  678. data/util/cacert.pem +4095 -0
  679. data/util/download.rb +256 -0
  680. data/vendor/jxbrowser-6.8.jar +0 -0
  681. data/vendor/licence.jar +0 -0
  682. data/version.rb +2 -0
  683. metadata +817 -0
@@ -0,0 +1 @@
1
+ !function(r){function n(r){return r}function t(r,n){for(var t=0,e=n.length,u=Array(e);e>t;++t)u[t]=r[n[t]];return u}function e(r){function n(n,t,e,u){for(;u>e;){var f=e+u>>>1;r(n[f])<t?e=f+1:u=f}return e}function t(n,t,e,u){for(;u>e;){var f=e+u>>>1;t<r(n[f])?u=f:e=f+1}return e}return t.right=t,t.left=n,t}function u(r){function n(r,n,t){for(var u=t-n,f=(u>>>1)+1;--f>0;)e(r,f,u,n);return r}function t(r,n,t){for(var u,f=t-n;--f>0;)u=r[n],r[n]=r[n+f],r[n+f]=u,e(r,1,f,n);return r}function e(n,t,e,u){for(var f,o=n[--u+t],i=r(o);(f=t<<1)<=e&&(e>f&&r(n[u+f])>r(n[u+f+1])&&f++,!(i<=r(n[u+f])));)n[u+t]=n[u+f],t=f;n[u+t]=o}return n.sort=t,n}function f(r){function n(n,e,u,f){var o,i,a,c,l=Array(f=Math.min(u-e,f));for(i=0;f>i;++i)l[i]=n[e++];if(t(l,0,f),u>e){o=r(l[0]);do(a=r(c=n[e])>o)&&(l[0]=c,o=r(t(l,0,f)[0]));while(++e<u)}return l}var t=u(r);return n}function o(r){function n(n,t,e){for(var u=t+1;e>u;++u){for(var f=u,o=n[u],i=r(o);f>t&&r(n[f-1])>i;--f)n[f]=n[f-1];n[f]=o}return n}return n}function i(r){function n(r,n,u){return(N>u-n?e:t)(r,n,u)}function t(t,e,u){var f,o=0|(u-e)/6,i=e+o,a=u-1-o,c=e+u-1>>1,l=c-o,v=c+o,s=t[i],h=r(s),d=t[l],p=r(d),g=t[c],y=r(g),m=t[v],x=r(m),b=t[a],A=r(b);h>p&&(f=s,s=d,d=f,f=h,h=p,p=f),x>A&&(f=m,m=b,b=f,f=x,x=A,A=f),h>y&&(f=s,s=g,g=f,f=h,h=y,y=f),p>y&&(f=d,d=g,g=f,f=p,p=y,y=f),h>x&&(f=s,s=m,m=f,f=h,h=x,x=f),y>x&&(f=g,g=m,m=f,f=y,y=x,x=f),p>A&&(f=d,d=b,b=f,f=p,p=A,A=f),p>y&&(f=d,d=g,g=f,f=p,p=y,y=f),x>A&&(f=m,m=b,b=f,f=x,x=A,A=f);var k=d,O=p,w=m,E=x;t[i]=s,t[l]=t[e],t[c]=g,t[v]=t[u-1],t[a]=b;var M=e+1,U=u-2,z=E>=O&&O>=E;if(z)for(var N=M;U>=N;++N){var C=t[N],S=r(C);if(O>S)N!==M&&(t[N]=t[M],t[M]=C),++M;else if(S>O)for(;;){var q=r(t[U]);{if(!(q>O)){if(O>q){t[N]=t[M],t[M++]=t[U],t[U--]=C;break}t[N]=t[U],t[U--]=C;break}U--}}}else for(var N=M;U>=N;N++){var C=t[N],S=r(C);if(O>S)N!==M&&(t[N]=t[M],t[M]=C),++M;else if(S>E)for(;;){var q=r(t[U]);{if(!(q>E)){O>q?(t[N]=t[M],t[M++]=t[U],t[U--]=C):(t[N]=t[U],t[U--]=C);break}if(U--,N>U)break}}}if(t[e]=t[M-1],t[M-1]=k,t[u-1]=t[U+1],t[U+1]=w,n(t,e,M-1),n(t,U+2,u),z)return t;if(i>M&&U>a){for(var F,q;(F=r(t[M]))<=O&&F>=O;)++M;for(;(q=r(t[U]))<=E&&q>=E;)--U;for(var N=M;U>=N;N++){var C=t[N],S=r(C);if(O>=S&&S>=O)N!==M&&(t[N]=t[M],t[M]=C),M++;else if(E>=S&&S>=E)for(;;){var q=r(t[U]);{if(!(E>=q&&q>=E)){O>q?(t[N]=t[M],t[M++]=t[U],t[U--]=C):(t[N]=t[U],t[U--]=C);break}if(U--,N>U)break}}}}return n(t,M,U+1)}var e=o(r);return n}function a(r){for(var n=Array(r),t=-1;++t<r;)n[t]=0;return n}function c(r,n){for(var t=r.length;n>t;)r[t++]=0;return r}function l(r,n){if(n>32)throw Error("invalid array width!");return r}function v(r,n){return function(t){var e=t.length;return[r.left(t,n,0,e),r.right(t,n,0,e)]}}function s(r,n){var t=n[0],e=n[1];return function(n){var u=n.length;return[r.left(n,t,0,u),r.left(n,e,0,u)]}}function h(r){return[0,r.length]}function d(){return null}function p(){return 0}function g(r){return r+1}function y(r){return r-1}function m(r){return function(n,t){return n+ +r(t)}}function x(r){return function(n,t){return n-r(t)}}function b(){function r(r){var n=E,t=r.length;return t&&(b=b.concat(r),z=F(z,E+=t),S.forEach(function(e){e(r,n,t)})),l}function e(){for(var r=A(E,E),n=[],t=0,e=0;E>t;++t)z[t]?r[t]=e++:n.push(t);N.forEach(function(r){r(0,[],n)}),q.forEach(function(n){n(r)});for(var u,t=0,e=0;E>t;++t)(u=z[t])&&(t!==e&&(z[e]=u,b[e]=b[t]),++e);for(b.length=e;E>e;)z[--E]=0}function o(r){function e(n,e,u){T=n.map(r),V=$(k(u),0,u),T=t(T,V);var f,o=_(T),i=o[0],a=o[1];if(W)for(f=0;u>f;++f)W(T[f],f)||(z[V[f]+e]|=Y);else{for(f=0;i>f;++f)z[V[f]+e]|=Y;for(f=a;u>f;++f)z[V[f]+e]|=Y}if(!e)return P=T,Q=V,tn=i,en=a,void 0;var c=P,l=Q,v=0,s=0;for(P=Array(E),Q=A(E,E),f=0;e>v&&u>s;++f)c[v]<T[s]?(P[f]=c[v],Q[f]=l[v++]):(P[f]=T[s],Q[f]=V[s++]+e);for(;e>v;++v,++f)P[f]=c[v],Q[f]=l[v];for(;u>s;++s,++f)P[f]=T[s],Q[f]=V[s]+e;o=_(P),tn=o[0],en=o[1]}function o(r,n,t){rn.forEach(function(r){r(T,V,n,t)}),T=V=null}function a(r){for(var n,t=0,e=0;E>t;++t)z[n=Q[t]]&&(t!==e&&(P[e]=P[t]),Q[e]=r[n],++e);for(P.length=e;E>e;)Q[e++]=0;var u=_(P);tn=u[0],en=u[1]}function c(r){var n=r[0],t=r[1];if(W)return W=null,G(function(r,e){return e>=n&&t>e}),tn=n,en=t,X;var e,u,f,o=[],i=[];if(tn>n)for(e=n,u=Math.min(tn,t);u>e;++e)z[f=Q[e]]^=Y,o.push(f);else if(n>tn)for(e=tn,u=Math.min(n,en);u>e;++e)z[f=Q[e]]^=Y,i.push(f);if(t>en)for(e=Math.max(n,en),u=t;u>e;++e)z[f=Q[e]]^=Y,o.push(f);else if(en>t)for(e=Math.max(tn,t),u=en;u>e;++e)z[f=Q[e]]^=Y,i.push(f);return tn=n,en=t,N.forEach(function(r){r(Y,o,i)}),X}function l(r){return null==r?B():Array.isArray(r)?j(r):"function"==typeof r?D(r):C(r)}function C(r){return c((_=v(w,r))(P))}function j(r){return c((_=s(w,r))(P))}function B(){return c((_=h)(P))}function D(r){return _=h,G(W=r),tn=0,en=E,X}function G(r){var n,t,e,u=[],f=[];for(n=0;E>n;++n)!(z[t=Q[n]]&Y)^!!(e=r(P[n],n))&&(e?(z[t]&=Z,u.push(t)):(z[t]|=Y,f.push(t)));N.forEach(function(r){r(Y,u,f)})}function H(r){for(var n,t=[],e=en;--e>=tn&&r>0;)z[n=Q[e]]||(t.push(b[n]),--r);return t}function I(r){for(var n,t=[],e=tn;en>e&&r>0;)z[n=Q[e]]||(t.push(b[n]),--r),e++;return t}function J(r){function t(n,t,e,u){function f(){++T===L&&(m=R(m,K<<=1),B=R(B,K),L=O(K))}var l,v,s,h,p,g,y=j,m=A(T,L),x=H,k=J,w=T,M=0,U=0;for(X&&(x=k=d),j=Array(T),T=0,B=w>1?F(B,E):A(E,L),w&&(s=(v=y[0]).key);u>U&&!((h=r(n[U]))>=h);)++U;for(;u>U;){for(v&&h>=s?(p=v,g=s,m[M]=T,(v=y[++M])&&(s=v.key)):(p={key:h,value:k()},g=h),j[T]=p;!(h>g||(B[l=t[U]+e]=T,z[l]&Z||(p.value=x(p.value,b[l])),++U>=u));)h=r(n[U]);f()}for(;w>M;)j[m[M]=T]=y[M++],f();if(T>M)for(M=0;e>M;++M)B[M]=m[B[M]];l=N.indexOf(V),T>1?(V=o,W=a):(!T&&$&&(T=1,j=[{key:null,value:k()}]),1===T?(V=i,W=c):(V=d,W=d),B=null),N[l]=V}function e(){if(T>1){for(var r=T,n=j,t=A(r,r),e=0,u=0;E>e;++e)z[e]&&(t[B[u]=B[e]]=1,++u);for(j=[],T=0,e=0;r>e;++e)t[e]&&(t[e]=T++,j.push(n[e]));if(T>1)for(var e=0;u>e;++e)B[e]=t[B[e]];else B=null;N[N.indexOf(V)]=T>1?(W=a,V=o):1===T?(W=c,V=i):W=V=d}else if(1===T){if($)return;for(var e=0;E>e;++e)if(z[e])return;j=[],T=0,N[N.indexOf(V)]=V=W=d}}function o(r,n,t){if(r!==Y&&!X){var e,u,f,o;for(e=0,f=n.length;f>e;++e)z[u=n[e]]&Z||(o=j[B[u]],o.value=H(o.value,b[u]));for(e=0,f=t.length;f>e;++e)(z[u=t[e]]&Z)===r&&(o=j[B[u]],o.value=I(o.value,b[u]))}}function i(r,n,t){if(r!==Y&&!X){var e,u,f,o=j[0];for(e=0,f=n.length;f>e;++e)z[u=n[e]]&Z||(o.value=H(o.value,b[u]));for(e=0,f=t.length;f>e;++e)(z[u=t[e]]&Z)===r&&(o.value=I(o.value,b[u]))}}function a(){var r,n;for(r=0;T>r;++r)j[r].value=J();for(r=0;E>r;++r)z[r]&Z||(n=j[B[r]],n.value=H(n.value,b[r]))}function c(){var r,n=j[0];for(n.value=J(),r=0;E>r;++r)z[r]&Z||(n.value=H(n.value,b[r]))}function l(){return X&&(W(),X=!1),j}function v(r){var n=D(l(),0,j.length,r);return G.sort(n,0,n.length)}function s(r,n,t){return H=r,I=n,J=t,X=!0,S}function h(){return s(g,y,p)}function k(r){return s(m(r),x(r),p)}function w(r){function n(n){return r(n.value)}return D=f(n),G=u(n),S}function M(){return w(n)}function U(){return T}function C(){var r=N.indexOf(V);return r>=0&&N.splice(r,1),r=rn.indexOf(t),r>=0&&rn.splice(r,1),r=q.indexOf(e),r>=0&&q.splice(r,1),S}var S={top:v,all:l,reduce:s,reduceCount:h,reduceSum:k,order:w,orderNatural:M,size:U,dispose:C,remove:C};nn.push(S);var j,B,D,G,H,I,J,K=8,L=O(K),T=0,V=d,W=d,X=!0,$=r===d;return arguments.length<1&&(r=n),N.push(V),rn.push(t),q.push(e),t(P,Q,0,E),h().orderNatural()}function K(){var r=J(d),n=r.all;return delete r.all,delete r.top,delete r.order,delete r.orderNatural,delete r.size,r.value=function(){return n()[0].value},r}function L(){nn.forEach(function(r){r.dispose()});var r=S.indexOf(e);return r>=0&&S.splice(r,1),r=S.indexOf(o),r>=0&&S.splice(r,1),r=q.indexOf(a),r>=0&&q.splice(r,1),M&=Z,B()}var P,Q,T,V,W,X={filter:l,filterExact:C,filterRange:j,filterFunction:D,filterAll:B,top:H,bottom:I,group:J,groupAll:K,dispose:L,remove:L},Y=~M&-~M,Z=~Y,$=i(function(r){return T[r]}),_=h,rn=[],nn=[],tn=0,en=0;return S.unshift(e),S.push(o),q.push(a),M|=Y,(U>=32?!Y:M&-(1<<U))&&(z=R(z,U<<=1)),e(b,0,E),o(b,0,E),X}function a(){function r(r,n){var t;if(!h)for(t=n;E>t;++t)z[t]||(a=c(a,b[t]))}function n(r,n,t){var e,u,f;if(!h){for(e=0,f=n.length;f>e;++e)z[u=n[e]]||(a=c(a,b[u]));for(e=0,f=t.length;f>e;++e)z[u=t[e]]===r&&(a=l(a,b[u]))}}function t(){var r;for(a=v(),r=0;E>r;++r)z[r]||(a=c(a,b[r]))}function e(r,n,t){return c=r,l=n,v=t,h=!0,s}function u(){return e(g,y,p)}function f(r){return e(m(r),x(r),p)}function o(){return h&&(t(),h=!1),a}function i(){var t=N.indexOf(n);return t>=0&&N.splice(t),t=S.indexOf(r),t>=0&&S.splice(t),s}var a,c,l,v,s={reduce:e,reduceCount:u,reduceSum:f,value:o,dispose:i,remove:i},h=!0;return N.push(n),S.push(r),r(b,0,E),u()}function c(){return E}var l={add:r,remove:e,dimension:o,groupAll:a,size:c},b=[],E=0,M=0,U=8,z=C(0),N=[],S=[],q=[];return arguments.length?r(arguments[0]):l}function A(r,n){return(257>n?C:65537>n?S:q)(r)}function k(r){for(var n=A(r,r),t=-1;++t<r;)n[t]=t;return n}function O(r){return 8===r?256:16===r?65536:4294967296}b.version="1.3.14",b.permute=t;var w=b.bisect=e(n);w.by=e;var E=b.heap=u(n);E.by=u;var M=b.heapselect=f(n);M.by=f;var U=b.insertionsort=o(n);U.by=o;var z=b.quicksort=i(n);z.by=i;var N=32,C=a,S=a,q=a,F=c,R=l;"undefined"!=typeof Uint8Array&&(C=function(r){return new Uint8Array(r)},S=function(r){return new Uint16Array(r)},q=function(r){return new Uint32Array(r)},F=function(r,n){if(r.length>=n)return r;var t=new r.constructor(n);return t.set(r),t},R=function(r,n){var t;switch(n){case 16:t=S(r.length);break;case 32:t=q(r.length);break;default:throw Error("invalid array width!")}return t.set(r),t}),r.crossfilter=b}("undefined"!=typeof exports&&exports||this);
@@ -0,0 +1 @@
1
+ module.exports = require("./crossfilter").crossfilter;
@@ -0,0 +1,46 @@
1
+ var crossfilter_array8 = crossfilter_arrayUntyped,
2
+ crossfilter_array16 = crossfilter_arrayUntyped,
3
+ crossfilter_array32 = crossfilter_arrayUntyped,
4
+ crossfilter_arrayLengthen = crossfilter_arrayLengthenUntyped,
5
+ crossfilter_arrayWiden = crossfilter_arrayWidenUntyped;
6
+
7
+ if (typeof Uint8Array !== "undefined") {
8
+ crossfilter_array8 = function(n) { return new Uint8Array(n); };
9
+ crossfilter_array16 = function(n) { return new Uint16Array(n); };
10
+ crossfilter_array32 = function(n) { return new Uint32Array(n); };
11
+
12
+ crossfilter_arrayLengthen = function(array, length) {
13
+ if (array.length >= length) return array;
14
+ var copy = new array.constructor(length);
15
+ copy.set(array);
16
+ return copy;
17
+ };
18
+
19
+ crossfilter_arrayWiden = function(array, width) {
20
+ var copy;
21
+ switch (width) {
22
+ case 16: copy = crossfilter_array16(array.length); break;
23
+ case 32: copy = crossfilter_array32(array.length); break;
24
+ default: throw new Error("invalid array width!");
25
+ }
26
+ copy.set(array);
27
+ return copy;
28
+ };
29
+ }
30
+
31
+ function crossfilter_arrayUntyped(n) {
32
+ var array = new Array(n), i = -1;
33
+ while (++i < n) array[i] = 0;
34
+ return array;
35
+ }
36
+
37
+ function crossfilter_arrayLengthenUntyped(array, length) {
38
+ var n = array.length;
39
+ while (n < length) array[n++] = 0;
40
+ return array;
41
+ }
42
+
43
+ function crossfilter_arrayWidenUntyped(array, width) {
44
+ if (width > 32) throw new Error("invalid array width!");
45
+ return array;
46
+ }
@@ -0,0 +1,44 @@
1
+ var bisect = crossfilter.bisect = bisect_by(crossfilter_identity);
2
+
3
+ bisect.by = bisect_by;
4
+
5
+ function bisect_by(f) {
6
+
7
+ // Locate the insertion point for x in a to maintain sorted order. The
8
+ // arguments lo and hi may be used to specify a subset of the array which
9
+ // should be considered; by default the entire array is used. If x is already
10
+ // present in a, the insertion point will be before (to the left of) any
11
+ // existing entries. The return value is suitable for use as the first
12
+ // argument to `array.splice` assuming that a is already sorted.
13
+ //
14
+ // The returned insertion point i partitions the array a into two halves so
15
+ // that all v < x for v in a[lo:i] for the left side and all v >= x for v in
16
+ // a[i:hi] for the right side.
17
+ function bisectLeft(a, x, lo, hi) {
18
+ while (lo < hi) {
19
+ var mid = lo + hi >>> 1;
20
+ if (f(a[mid]) < x) lo = mid + 1;
21
+ else hi = mid;
22
+ }
23
+ return lo;
24
+ }
25
+
26
+ // Similar to bisectLeft, but returns an insertion point which comes after (to
27
+ // the right of) any existing entries of x in a.
28
+ //
29
+ // The returned insertion point i partitions the array into two halves so that
30
+ // all v <= x for v in a[lo:i] for the left side and all v > x for v in
31
+ // a[i:hi] for the right side.
32
+ function bisectRight(a, x, lo, hi) {
33
+ while (lo < hi) {
34
+ var mid = lo + hi >>> 1;
35
+ if (x < f(a[mid])) hi = mid;
36
+ else lo = mid + 1;
37
+ }
38
+ return lo;
39
+ }
40
+
41
+ bisectRight.right = bisectRight;
42
+ bisectRight.left = bisectLeft;
43
+ return bisectRight;
44
+ }
@@ -0,0 +1,872 @@
1
+ exports.crossfilter = crossfilter;
2
+
3
+ function crossfilter() {
4
+ var crossfilter = {
5
+ add: add,
6
+ remove: removeData,
7
+ dimension: dimension,
8
+ groupAll: groupAll,
9
+ size: size
10
+ };
11
+
12
+ var data = [], // the records
13
+ n = 0, // the number of records; data.length
14
+ m = 0, // a bit mask representing which dimensions are in use
15
+ M = 8, // number of dimensions that can fit in `filters`
16
+ filters = crossfilter_array8(0), // M bits per record; 1 is filtered out
17
+ filterListeners = [], // when the filters change
18
+ dataListeners = [], // when data is added
19
+ removeDataListeners = []; // when data is removed
20
+
21
+ // Adds the specified new records to this crossfilter.
22
+ function add(newData) {
23
+ var n0 = n,
24
+ n1 = newData.length;
25
+
26
+ // If there's actually new data to add…
27
+ // Merge the new data into the existing data.
28
+ // Lengthen the filter bitset to handle the new records.
29
+ // Notify listeners (dimensions and groups) that new data is available.
30
+ if (n1) {
31
+ data = data.concat(newData);
32
+ filters = crossfilter_arrayLengthen(filters, n += n1);
33
+ dataListeners.forEach(function(l) { l(newData, n0, n1); });
34
+ }
35
+
36
+ return crossfilter;
37
+ }
38
+
39
+ // Removes all records that match the current filters.
40
+ function removeData() {
41
+ var newIndex = crossfilter_index(n, n),
42
+ removed = [];
43
+ for (var i = 0, j = 0; i < n; ++i) {
44
+ if (filters[i]) newIndex[i] = j++;
45
+ else removed.push(i);
46
+ }
47
+
48
+ // Remove all matching records from groups.
49
+ filterListeners.forEach(function(l) { l(0, [], removed); });
50
+
51
+ // Update indexes.
52
+ removeDataListeners.forEach(function(l) { l(newIndex); });
53
+
54
+ // Remove old filters and data by overwriting.
55
+ for (var i = 0, j = 0, k; i < n; ++i) {
56
+ if (k = filters[i]) {
57
+ if (i !== j) filters[j] = k, data[j] = data[i];
58
+ ++j;
59
+ }
60
+ }
61
+ data.length = j;
62
+ while (n > j) filters[--n] = 0;
63
+ }
64
+
65
+ // Adds a new dimension with the specified value accessor function.
66
+ function dimension(value) {
67
+ var dimension = {
68
+ filter: filter,
69
+ filterExact: filterExact,
70
+ filterRange: filterRange,
71
+ filterFunction: filterFunction,
72
+ filterAll: filterAll,
73
+ top: top,
74
+ bottom: bottom,
75
+ group: group,
76
+ groupAll: groupAll,
77
+ dispose: dispose,
78
+ remove: dispose // for backwards-compatibility
79
+ };
80
+
81
+ var one = ~m & -~m, // lowest unset bit as mask, e.g., 00001000
82
+ zero = ~one, // inverted one, e.g., 11110111
83
+ values, // sorted, cached array
84
+ index, // value rank ↦ object id
85
+ newValues, // temporary array storing newly-added values
86
+ newIndex, // temporary array storing newly-added index
87
+ sort = quicksort_by(function(i) { return newValues[i]; }),
88
+ refilter = crossfilter_filterAll, // for recomputing filter
89
+ refilterFunction, // the custom filter function in use
90
+ indexListeners = [], // when data is added
91
+ dimensionGroups = [],
92
+ lo0 = 0,
93
+ hi0 = 0;
94
+
95
+ // Updating a dimension is a two-stage process. First, we must update the
96
+ // associated filters for the newly-added records. Once all dimensions have
97
+ // updated their filters, the groups are notified to update.
98
+ dataListeners.unshift(preAdd);
99
+ dataListeners.push(postAdd);
100
+
101
+ removeDataListeners.push(removeData);
102
+
103
+ // Incorporate any existing data into this dimension, and make sure that the
104
+ // filter bitset is wide enough to handle the new dimension.
105
+ m |= one;
106
+ if (M >= 32 ? !one : m & -(1 << M)) {
107
+ filters = crossfilter_arrayWiden(filters, M <<= 1);
108
+ }
109
+ preAdd(data, 0, n);
110
+ postAdd(data, 0, n);
111
+
112
+ // Incorporates the specified new records into this dimension.
113
+ // This function is responsible for updating filters, values, and index.
114
+ function preAdd(newData, n0, n1) {
115
+
116
+ // Permute new values into natural order using a sorted index.
117
+ newValues = newData.map(value);
118
+ newIndex = sort(crossfilter_range(n1), 0, n1);
119
+ newValues = permute(newValues, newIndex);
120
+
121
+ // Bisect newValues to determine which new records are selected.
122
+ var bounds = refilter(newValues), lo1 = bounds[0], hi1 = bounds[1], i;
123
+ if (refilterFunction) {
124
+ for (i = 0; i < n1; ++i) {
125
+ if (!refilterFunction(newValues[i], i)) filters[newIndex[i] + n0] |= one;
126
+ }
127
+ } else {
128
+ for (i = 0; i < lo1; ++i) filters[newIndex[i] + n0] |= one;
129
+ for (i = hi1; i < n1; ++i) filters[newIndex[i] + n0] |= one;
130
+ }
131
+
132
+ // If this dimension previously had no data, then we don't need to do the
133
+ // more expensive merge operation; use the new values and index as-is.
134
+ if (!n0) {
135
+ values = newValues;
136
+ index = newIndex;
137
+ lo0 = lo1;
138
+ hi0 = hi1;
139
+ return;
140
+ }
141
+
142
+ var oldValues = values,
143
+ oldIndex = index,
144
+ i0 = 0,
145
+ i1 = 0;
146
+
147
+ // Otherwise, create new arrays into which to merge new and old.
148
+ values = new Array(n);
149
+ index = crossfilter_index(n, n);
150
+
151
+ // Merge the old and new sorted values, and old and new index.
152
+ for (i = 0; i0 < n0 && i1 < n1; ++i) {
153
+ if (oldValues[i0] < newValues[i1]) {
154
+ values[i] = oldValues[i0];
155
+ index[i] = oldIndex[i0++];
156
+ } else {
157
+ values[i] = newValues[i1];
158
+ index[i] = newIndex[i1++] + n0;
159
+ }
160
+ }
161
+
162
+ // Add any remaining old values.
163
+ for (; i0 < n0; ++i0, ++i) {
164
+ values[i] = oldValues[i0];
165
+ index[i] = oldIndex[i0];
166
+ }
167
+
168
+ // Add any remaining new values.
169
+ for (; i1 < n1; ++i1, ++i) {
170
+ values[i] = newValues[i1];
171
+ index[i] = newIndex[i1] + n0;
172
+ }
173
+
174
+ // Bisect again to recompute lo0 and hi0.
175
+ bounds = refilter(values), lo0 = bounds[0], hi0 = bounds[1];
176
+ }
177
+
178
+ // When all filters have updated, notify index listeners of the new values.
179
+ function postAdd(newData, n0, n1) {
180
+ indexListeners.forEach(function(l) { l(newValues, newIndex, n0, n1); });
181
+ newValues = newIndex = null;
182
+ }
183
+
184
+ function removeData(reIndex) {
185
+ for (var i = 0, j = 0, k; i < n; ++i) {
186
+ if (filters[k = index[i]]) {
187
+ if (i !== j) values[j] = values[i];
188
+ index[j] = reIndex[k];
189
+ ++j;
190
+ }
191
+ }
192
+ values.length = j;
193
+ while (j < n) index[j++] = 0;
194
+
195
+ // Bisect again to recompute lo0 and hi0.
196
+ var bounds = refilter(values);
197
+ lo0 = bounds[0], hi0 = bounds[1];
198
+ }
199
+
200
+ // Updates the selected values based on the specified bounds [lo, hi].
201
+ // This implementation is used by all the public filter methods.
202
+ function filterIndexBounds(bounds) {
203
+ var lo1 = bounds[0],
204
+ hi1 = bounds[1];
205
+
206
+ if (refilterFunction) {
207
+ refilterFunction = null;
208
+ filterIndexFunction(function(d, i) { return lo1 <= i && i < hi1; });
209
+ lo0 = lo1;
210
+ hi0 = hi1;
211
+ return dimension;
212
+ }
213
+
214
+ var i,
215
+ j,
216
+ k,
217
+ added = [],
218
+ removed = [];
219
+
220
+ // Fast incremental update based on previous lo index.
221
+ if (lo1 < lo0) {
222
+ for (i = lo1, j = Math.min(lo0, hi1); i < j; ++i) {
223
+ filters[k = index[i]] ^= one;
224
+ added.push(k);
225
+ }
226
+ } else if (lo1 > lo0) {
227
+ for (i = lo0, j = Math.min(lo1, hi0); i < j; ++i) {
228
+ filters[k = index[i]] ^= one;
229
+ removed.push(k);
230
+ }
231
+ }
232
+
233
+ // Fast incremental update based on previous hi index.
234
+ if (hi1 > hi0) {
235
+ for (i = Math.max(lo1, hi0), j = hi1; i < j; ++i) {
236
+ filters[k = index[i]] ^= one;
237
+ added.push(k);
238
+ }
239
+ } else if (hi1 < hi0) {
240
+ for (i = Math.max(lo0, hi1), j = hi0; i < j; ++i) {
241
+ filters[k = index[i]] ^= one;
242
+ removed.push(k);
243
+ }
244
+ }
245
+
246
+ lo0 = lo1;
247
+ hi0 = hi1;
248
+ filterListeners.forEach(function(l) { l(one, added, removed); });
249
+ return dimension;
250
+ }
251
+
252
+ // Filters this dimension using the specified range, value, or null.
253
+ // If the range is null, this is equivalent to filterAll.
254
+ // If the range is an array, this is equivalent to filterRange.
255
+ // Otherwise, this is equivalent to filterExact.
256
+ function filter(range) {
257
+ return range == null
258
+ ? filterAll() : Array.isArray(range)
259
+ ? filterRange(range) : typeof range === "function"
260
+ ? filterFunction(range)
261
+ : filterExact(range);
262
+ }
263
+
264
+ // Filters this dimension to select the exact value.
265
+ function filterExact(value) {
266
+ return filterIndexBounds((refilter = crossfilter_filterExact(bisect, value))(values));
267
+ }
268
+
269
+ // Filters this dimension to select the specified range [lo, hi].
270
+ // The lower bound is inclusive, and the upper bound is exclusive.
271
+ function filterRange(range) {
272
+ return filterIndexBounds((refilter = crossfilter_filterRange(bisect, range))(values));
273
+ }
274
+
275
+ // Clears any filters on this dimension.
276
+ function filterAll() {
277
+ return filterIndexBounds((refilter = crossfilter_filterAll)(values));
278
+ }
279
+
280
+ // Filters this dimension using an arbitrary function.
281
+ function filterFunction(f) {
282
+ refilter = crossfilter_filterAll;
283
+
284
+ filterIndexFunction(refilterFunction = f);
285
+
286
+ lo0 = 0;
287
+ hi0 = n;
288
+
289
+ return dimension;
290
+ }
291
+
292
+ function filterIndexFunction(f) {
293
+ var i,
294
+ k,
295
+ x,
296
+ added = [],
297
+ removed = [];
298
+
299
+ for (i = 0; i < n; ++i) {
300
+ if (!(filters[k = index[i]] & one) ^ !!(x = f(values[i], i))) {
301
+ if (x) filters[k] &= zero, added.push(k);
302
+ else filters[k] |= one, removed.push(k);
303
+ }
304
+ }
305
+ filterListeners.forEach(function(l) { l(one, added, removed); });
306
+ }
307
+
308
+ // Returns the top K selected records based on this dimension's order.
309
+ // Note: observes this dimension's filter, unlike group and groupAll.
310
+ function top(k) {
311
+ var array = [],
312
+ i = hi0,
313
+ j;
314
+
315
+ while (--i >= lo0 && k > 0) {
316
+ if (!filters[j = index[i]]) {
317
+ array.push(data[j]);
318
+ --k;
319
+ }
320
+ }
321
+
322
+ return array;
323
+ }
324
+
325
+ // Returns the bottom K selected records based on this dimension's order.
326
+ // Note: observes this dimension's filter, unlike group and groupAll.
327
+ function bottom(k) {
328
+ var array = [],
329
+ i = lo0,
330
+ j;
331
+
332
+ while (i < hi0 && k > 0) {
333
+ if (!filters[j = index[i]]) {
334
+ array.push(data[j]);
335
+ --k;
336
+ }
337
+ i++;
338
+ }
339
+
340
+ return array;
341
+ }
342
+
343
+ // Adds a new group to this dimension, using the specified key function.
344
+ function group(key) {
345
+ var group = {
346
+ top: top,
347
+ all: all,
348
+ reduce: reduce,
349
+ reduceCount: reduceCount,
350
+ reduceSum: reduceSum,
351
+ order: order,
352
+ orderNatural: orderNatural,
353
+ size: size,
354
+ dispose: dispose,
355
+ remove: dispose // for backwards-compatibility
356
+ };
357
+
358
+ // Ensure that this group will be removed when the dimension is removed.
359
+ dimensionGroups.push(group);
360
+
361
+ var groups, // array of {key, value}
362
+ groupIndex, // object id ↦ group id
363
+ groupWidth = 8,
364
+ groupCapacity = crossfilter_capacity(groupWidth),
365
+ k = 0, // cardinality
366
+ select,
367
+ heap,
368
+ reduceAdd,
369
+ reduceRemove,
370
+ reduceInitial,
371
+ update = crossfilter_null,
372
+ reset = crossfilter_null,
373
+ resetNeeded = true,
374
+ groupAll = key === crossfilter_null;
375
+
376
+ if (arguments.length < 1) key = crossfilter_identity;
377
+
378
+ // The group listens to the crossfilter for when any dimension changes, so
379
+ // that it can update the associated reduce values. It must also listen to
380
+ // the parent dimension for when data is added, and compute new keys.
381
+ filterListeners.push(update);
382
+ indexListeners.push(add);
383
+ removeDataListeners.push(removeData);
384
+
385
+ // Incorporate any existing data into the grouping.
386
+ add(values, index, 0, n);
387
+
388
+ // Incorporates the specified new values into this group.
389
+ // This function is responsible for updating groups and groupIndex.
390
+ function add(newValues, newIndex, n0, n1) {
391
+ var oldGroups = groups,
392
+ reIndex = crossfilter_index(k, groupCapacity),
393
+ add = reduceAdd,
394
+ initial = reduceInitial,
395
+ k0 = k, // old cardinality
396
+ i0 = 0, // index of old group
397
+ i1 = 0, // index of new record
398
+ j, // object id
399
+ g0, // old group
400
+ x0, // old key
401
+ x1, // new key
402
+ g, // group to add
403
+ x; // key of group to add
404
+
405
+ // If a reset is needed, we don't need to update the reduce values.
406
+ if (resetNeeded) add = initial = crossfilter_null;
407
+
408
+ // Reset the new groups (k is a lower bound).
409
+ // Also, make sure that groupIndex exists and is long enough.
410
+ groups = new Array(k), k = 0;
411
+ groupIndex = k0 > 1 ? crossfilter_arrayLengthen(groupIndex, n) : crossfilter_index(n, groupCapacity);
412
+
413
+ // Get the first old key (x0 of g0), if it exists.
414
+ if (k0) x0 = (g0 = oldGroups[0]).key;
415
+
416
+ // Find the first new key (x1), skipping NaN keys.
417
+ while (i1 < n1 && !((x1 = key(newValues[i1])) >= x1)) ++i1;
418
+
419
+ // While new keys remain…
420
+ while (i1 < n1) {
421
+
422
+ // Determine the lesser of the two current keys; new and old.
423
+ // If there are no old keys remaining, then always add the new key.
424
+ if (g0 && x0 <= x1) {
425
+ g = g0, x = x0;
426
+
427
+ // Record the new index of the old group.
428
+ reIndex[i0] = k;
429
+
430
+ // Retrieve the next old key.
431
+ if (g0 = oldGroups[++i0]) x0 = g0.key;
432
+ } else {
433
+ g = {key: x1, value: initial()}, x = x1;
434
+ }
435
+
436
+ // Add the lesser group.
437
+ groups[k] = g;
438
+
439
+ // Add any selected records belonging to the added group, while
440
+ // advancing the new key and populating the associated group index.
441
+ while (!(x1 > x)) {
442
+ groupIndex[j = newIndex[i1] + n0] = k;
443
+ if (!(filters[j] & zero)) g.value = add(g.value, data[j]);
444
+ if (++i1 >= n1) break;
445
+ x1 = key(newValues[i1]);
446
+ }
447
+
448
+ groupIncrement();
449
+ }
450
+
451
+ // Add any remaining old groups that were greater than all new keys.
452
+ // No incremental reduce is needed; these groups have no new records.
453
+ // Also record the new index of the old group.
454
+ while (i0 < k0) {
455
+ groups[reIndex[i0] = k] = oldGroups[i0++];
456
+ groupIncrement();
457
+ }
458
+
459
+ // If we added any new groups before any old groups,
460
+ // update the group index of all the old records.
461
+ if (k > i0) for (i0 = 0; i0 < n0; ++i0) {
462
+ groupIndex[i0] = reIndex[groupIndex[i0]];
463
+ }
464
+
465
+ // Modify the update and reset behavior based on the cardinality.
466
+ // If the cardinality is less than or equal to one, then the groupIndex
467
+ // is not needed. If the cardinality is zero, then there are no records
468
+ // and therefore no groups to update or reset. Note that we also must
469
+ // change the registered listener to point to the new method.
470
+ j = filterListeners.indexOf(update);
471
+ if (k > 1) {
472
+ update = updateMany;
473
+ reset = resetMany;
474
+ } else {
475
+ if (!k && groupAll) {
476
+ k = 1;
477
+ groups = [{key: null, value: initial()}];
478
+ }
479
+ if (k === 1) {
480
+ update = updateOne;
481
+ reset = resetOne;
482
+ } else {
483
+ update = crossfilter_null;
484
+ reset = crossfilter_null;
485
+ }
486
+ groupIndex = null;
487
+ }
488
+ filterListeners[j] = update;
489
+
490
+ // Count the number of added groups,
491
+ // and widen the group index as needed.
492
+ function groupIncrement() {
493
+ if (++k === groupCapacity) {
494
+ reIndex = crossfilter_arrayWiden(reIndex, groupWidth <<= 1);
495
+ groupIndex = crossfilter_arrayWiden(groupIndex, groupWidth);
496
+ groupCapacity = crossfilter_capacity(groupWidth);
497
+ }
498
+ }
499
+ }
500
+
501
+ function removeData() {
502
+ if (k > 1) {
503
+ var oldK = k,
504
+ oldGroups = groups,
505
+ seenGroups = crossfilter_index(oldK, oldK);
506
+
507
+ // Filter out non-matches by copying matching group index entries to
508
+ // the beginning of the array.
509
+ for (var i = 0, j = 0; i < n; ++i) {
510
+ if (filters[i]) {
511
+ seenGroups[groupIndex[j] = groupIndex[i]] = 1;
512
+ ++j;
513
+ }
514
+ }
515
+
516
+ // Reassemble groups including only those groups that were referred
517
+ // to by matching group index entries. Note the new group index in
518
+ // seenGroups.
519
+ groups = [], k = 0;
520
+ for (i = 0; i < oldK; ++i) {
521
+ if (seenGroups[i]) {
522
+ seenGroups[i] = k++;
523
+ groups.push(oldGroups[i]);
524
+ }
525
+ }
526
+
527
+ if (k > 1) {
528
+ // Reindex the group index using seenGroups to find the new index.
529
+ for (var i = 0; i < j; ++i) groupIndex[i] = seenGroups[groupIndex[i]];
530
+ } else {
531
+ groupIndex = null;
532
+ }
533
+ filterListeners[filterListeners.indexOf(update)] = k > 1
534
+ ? (reset = resetMany, update = updateMany)
535
+ : k === 1 ? (reset = resetOne, update = updateOne)
536
+ : reset = update = crossfilter_null;
537
+ } else if (k === 1) {
538
+ if (groupAll) return;
539
+ for (var i = 0; i < n; ++i) if (filters[i]) return;
540
+ groups = [], k = 0;
541
+ filterListeners[filterListeners.indexOf(update)] =
542
+ update = reset = crossfilter_null;
543
+ }
544
+ }
545
+
546
+ // Reduces the specified selected or deselected records.
547
+ // This function is only used when the cardinality is greater than 1.
548
+ function updateMany(filterOne, added, removed) {
549
+ if (filterOne === one || resetNeeded) return;
550
+
551
+ var i,
552
+ k,
553
+ n,
554
+ g;
555
+
556
+ // Add the added values.
557
+ for (i = 0, n = added.length; i < n; ++i) {
558
+ if (!(filters[k = added[i]] & zero)) {
559
+ g = groups[groupIndex[k]];
560
+ g.value = reduceAdd(g.value, data[k]);
561
+ }
562
+ }
563
+
564
+ // Remove the removed values.
565
+ for (i = 0, n = removed.length; i < n; ++i) {
566
+ if ((filters[k = removed[i]] & zero) === filterOne) {
567
+ g = groups[groupIndex[k]];
568
+ g.value = reduceRemove(g.value, data[k]);
569
+ }
570
+ }
571
+ }
572
+
573
+ // Reduces the specified selected or deselected records.
574
+ // This function is only used when the cardinality is 1.
575
+ function updateOne(filterOne, added, removed) {
576
+ if (filterOne === one || resetNeeded) return;
577
+
578
+ var i,
579
+ k,
580
+ n,
581
+ g = groups[0];
582
+
583
+ // Add the added values.
584
+ for (i = 0, n = added.length; i < n; ++i) {
585
+ if (!(filters[k = added[i]] & zero)) {
586
+ g.value = reduceAdd(g.value, data[k]);
587
+ }
588
+ }
589
+
590
+ // Remove the removed values.
591
+ for (i = 0, n = removed.length; i < n; ++i) {
592
+ if ((filters[k = removed[i]] & zero) === filterOne) {
593
+ g.value = reduceRemove(g.value, data[k]);
594
+ }
595
+ }
596
+ }
597
+
598
+ // Recomputes the group reduce values from scratch.
599
+ // This function is only used when the cardinality is greater than 1.
600
+ function resetMany() {
601
+ var i,
602
+ g;
603
+
604
+ // Reset all group values.
605
+ for (i = 0; i < k; ++i) {
606
+ groups[i].value = reduceInitial();
607
+ }
608
+
609
+ // Add any selected records.
610
+ for (i = 0; i < n; ++i) {
611
+ if (!(filters[i] & zero)) {
612
+ g = groups[groupIndex[i]];
613
+ g.value = reduceAdd(g.value, data[i]);
614
+ }
615
+ }
616
+ }
617
+
618
+ // Recomputes the group reduce values from scratch.
619
+ // This function is only used when the cardinality is 1.
620
+ function resetOne() {
621
+ var i,
622
+ g = groups[0];
623
+
624
+ // Reset the singleton group values.
625
+ g.value = reduceInitial();
626
+
627
+ // Add any selected records.
628
+ for (i = 0; i < n; ++i) {
629
+ if (!(filters[i] & zero)) {
630
+ g.value = reduceAdd(g.value, data[i]);
631
+ }
632
+ }
633
+ }
634
+
635
+ // Returns the array of group values, in the dimension's natural order.
636
+ function all() {
637
+ if (resetNeeded) reset(), resetNeeded = false;
638
+ return groups;
639
+ }
640
+
641
+ // Returns a new array containing the top K group values, in reduce order.
642
+ function top(k) {
643
+ var top = select(all(), 0, groups.length, k);
644
+ return heap.sort(top, 0, top.length);
645
+ }
646
+
647
+ // Sets the reduce behavior for this group to use the specified functions.
648
+ // This method lazily recomputes the reduce values, waiting until needed.
649
+ function reduce(add, remove, initial) {
650
+ reduceAdd = add;
651
+ reduceRemove = remove;
652
+ reduceInitial = initial;
653
+ resetNeeded = true;
654
+ return group;
655
+ }
656
+
657
+ // A convenience method for reducing by count.
658
+ function reduceCount() {
659
+ return reduce(crossfilter_reduceIncrement, crossfilter_reduceDecrement, crossfilter_zero);
660
+ }
661
+
662
+ // A convenience method for reducing by sum(value).
663
+ function reduceSum(value) {
664
+ return reduce(crossfilter_reduceAdd(value), crossfilter_reduceSubtract(value), crossfilter_zero);
665
+ }
666
+
667
+ // Sets the reduce order, using the specified accessor.
668
+ function order(value) {
669
+ select = heapselect_by(valueOf);
670
+ heap = heap_by(valueOf);
671
+ function valueOf(d) { return value(d.value); }
672
+ return group;
673
+ }
674
+
675
+ // A convenience method for natural ordering by reduce value.
676
+ function orderNatural() {
677
+ return order(crossfilter_identity);
678
+ }
679
+
680
+ // Returns the cardinality of this group, irrespective of any filters.
681
+ function size() {
682
+ return k;
683
+ }
684
+
685
+ // Removes this group and associated event listeners.
686
+ function dispose() {
687
+ var i = filterListeners.indexOf(update);
688
+ if (i >= 0) filterListeners.splice(i, 1);
689
+ i = indexListeners.indexOf(add);
690
+ if (i >= 0) indexListeners.splice(i, 1);
691
+ i = removeDataListeners.indexOf(removeData);
692
+ if (i >= 0) removeDataListeners.splice(i, 1);
693
+ return group;
694
+ }
695
+
696
+ return reduceCount().orderNatural();
697
+ }
698
+
699
+ // A convenience function for generating a singleton group.
700
+ function groupAll() {
701
+ var g = group(crossfilter_null), all = g.all;
702
+ delete g.all;
703
+ delete g.top;
704
+ delete g.order;
705
+ delete g.orderNatural;
706
+ delete g.size;
707
+ g.value = function() { return all()[0].value; };
708
+ return g;
709
+ }
710
+
711
+ // Removes this dimension and associated groups and event listeners.
712
+ function dispose() {
713
+ dimensionGroups.forEach(function(group) { group.dispose(); });
714
+ var i = dataListeners.indexOf(preAdd);
715
+ if (i >= 0) dataListeners.splice(i, 1);
716
+ i = dataListeners.indexOf(postAdd);
717
+ if (i >= 0) dataListeners.splice(i, 1);
718
+ i = removeDataListeners.indexOf(removeData);
719
+ if (i >= 0) removeDataListeners.splice(i, 1);
720
+ m &= zero;
721
+ return filterAll();
722
+ }
723
+
724
+ return dimension;
725
+ }
726
+
727
+ // A convenience method for groupAll on a dummy dimension.
728
+ // This implementation can be optimized since it always has cardinality 1.
729
+ function groupAll() {
730
+ var group = {
731
+ reduce: reduce,
732
+ reduceCount: reduceCount,
733
+ reduceSum: reduceSum,
734
+ value: value,
735
+ dispose: dispose,
736
+ remove: dispose // for backwards-compatibility
737
+ };
738
+
739
+ var reduceValue,
740
+ reduceAdd,
741
+ reduceRemove,
742
+ reduceInitial,
743
+ resetNeeded = true;
744
+
745
+ // The group listens to the crossfilter for when any dimension changes, so
746
+ // that it can update the reduce value. It must also listen to the parent
747
+ // dimension for when data is added.
748
+ filterListeners.push(update);
749
+ dataListeners.push(add);
750
+
751
+ // For consistency; actually a no-op since resetNeeded is true.
752
+ add(data, 0, n);
753
+
754
+ // Incorporates the specified new values into this group.
755
+ function add(newData, n0) {
756
+ var i;
757
+
758
+ if (resetNeeded) return;
759
+
760
+ // Add the added values.
761
+ for (i = n0; i < n; ++i) {
762
+ if (!filters[i]) {
763
+ reduceValue = reduceAdd(reduceValue, data[i]);
764
+ }
765
+ }
766
+ }
767
+
768
+ // Reduces the specified selected or deselected records.
769
+ function update(filterOne, added, removed) {
770
+ var i,
771
+ k,
772
+ n;
773
+
774
+ if (resetNeeded) return;
775
+
776
+ // Add the added values.
777
+ for (i = 0, n = added.length; i < n; ++i) {
778
+ if (!filters[k = added[i]]) {
779
+ reduceValue = reduceAdd(reduceValue, data[k]);
780
+ }
781
+ }
782
+
783
+ // Remove the removed values.
784
+ for (i = 0, n = removed.length; i < n; ++i) {
785
+ if (filters[k = removed[i]] === filterOne) {
786
+ reduceValue = reduceRemove(reduceValue, data[k]);
787
+ }
788
+ }
789
+ }
790
+
791
+ // Recomputes the group reduce value from scratch.
792
+ function reset() {
793
+ var i;
794
+
795
+ reduceValue = reduceInitial();
796
+
797
+ for (i = 0; i < n; ++i) {
798
+ if (!filters[i]) {
799
+ reduceValue = reduceAdd(reduceValue, data[i]);
800
+ }
801
+ }
802
+ }
803
+
804
+ // Sets the reduce behavior for this group to use the specified functions.
805
+ // This method lazily recomputes the reduce value, waiting until needed.
806
+ function reduce(add, remove, initial) {
807
+ reduceAdd = add;
808
+ reduceRemove = remove;
809
+ reduceInitial = initial;
810
+ resetNeeded = true;
811
+ return group;
812
+ }
813
+
814
+ // A convenience method for reducing by count.
815
+ function reduceCount() {
816
+ return reduce(crossfilter_reduceIncrement, crossfilter_reduceDecrement, crossfilter_zero);
817
+ }
818
+
819
+ // A convenience method for reducing by sum(value).
820
+ function reduceSum(value) {
821
+ return reduce(crossfilter_reduceAdd(value), crossfilter_reduceSubtract(value), crossfilter_zero);
822
+ }
823
+
824
+ // Returns the computed reduce value.
825
+ function value() {
826
+ if (resetNeeded) reset(), resetNeeded = false;
827
+ return reduceValue;
828
+ }
829
+
830
+ // Removes this group and associated event listeners.
831
+ function dispose() {
832
+ var i = filterListeners.indexOf(update);
833
+ if (i >= 0) filterListeners.splice(i);
834
+ i = dataListeners.indexOf(add);
835
+ if (i >= 0) dataListeners.splice(i);
836
+ return group;
837
+ }
838
+
839
+ return reduceCount();
840
+ }
841
+
842
+ // Returns the number of records in this crossfilter, irrespective of any filters.
843
+ function size() {
844
+ return n;
845
+ }
846
+
847
+ return arguments.length
848
+ ? add(arguments[0])
849
+ : crossfilter;
850
+ }
851
+
852
+ // Returns an array of size n, big enough to store ids up to m.
853
+ function crossfilter_index(n, m) {
854
+ return (m < 0x101
855
+ ? crossfilter_array8 : m < 0x10001
856
+ ? crossfilter_array16
857
+ : crossfilter_array32)(n);
858
+ }
859
+
860
+ // Constructs a new array of size n, with sequential values from 0 to n - 1.
861
+ function crossfilter_range(n) {
862
+ var range = crossfilter_index(n, n);
863
+ for (var i = -1; ++i < n;) range[i] = i;
864
+ return range;
865
+ }
866
+
867
+ function crossfilter_capacity(w) {
868
+ return w === 8
869
+ ? 0x100 : w === 16
870
+ ? 0x10000
871
+ : 0x100000000;
872
+ }