mdarray-sol 0.1.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +35 -0
- data/LICENSE.txt~ +73 -0
- data/README.md +140 -0
- data/README.md~ +290 -0
- data/Rakefile +80 -0
- data/config.rb +223 -0
- data/doc/Nashorn.html +1406 -0
- data/doc/Sol.html +692 -0
- data/doc/Sol/BarChart.html +181 -0
- data/doc/Sol/BaseChart.html +799 -0
- data/doc/Sol/Bootstrap.html +1134 -0
- data/doc/Sol/Bridge.html +448 -0
- data/doc/Sol/Chart.html +1162 -0
- data/doc/Sol/CoordinateChart.html +673 -0
- data/doc/Sol/DCFX.html +807 -0
- data/doc/Sol/Dashboard.html +1967 -0
- data/doc/Sol/ExecMessages.html +332 -0
- data/doc/Sol/GuiCommunication.html +230 -0
- data/doc/Sol/Interval.html +1213 -0
- data/doc/Sol/JS.html +448 -0
- data/doc/Sol/LineChart.html +344 -0
- data/doc/Sol/LinearScale.html +334 -0
- data/doc/Sol/Margins.html +219 -0
- data/doc/Sol/OrdinalScale.html +263 -0
- data/doc/Sol/ReadBuffer.html +302 -0
- data/doc/Sol/Scale.html +462 -0
- data/doc/Sol/Stack.html +199 -0
- data/doc/Sol/TimeScale.html +396 -0
- data/doc/_index.html +362 -0
- data/doc/class_list.html +58 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +339 -0
- data/doc/file.README.html +95 -0
- data/doc/file_list.html +60 -0
- data/doc/frames.html +26 -0
- data/doc/index.html +95 -0
- data/doc/js/app.js +219 -0
- data/doc/js/full_list.js +181 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +849 -0
- data/doc/top-level-namespace.html +135 -0
- data/examples/bar_chart/bar_chart.rb +268 -0
- data/examples/bar_plot.rb +96 -0
- data/examples/charts/area.rb +25 -0
- data/examples/charts/area_script.rb +69 -0
- data/examples/charts/env.rb +8 -0
- data/examples/charts/monthly-move.csv +6725 -0
- data/examples/charts/morley.csv +101 -0
- data/examples/charts/morley2.csv +81 -0
- data/examples/charts/morley3.csv +121 -0
- data/examples/d3_tutorial.rb +98 -0
- data/examples/sc_plot.rb +57 -0
- data/examples/scatterplot/axes.rb +111 -0
- data/examples/scatterplot/scatterplot.rb +221 -0
- data/examples/us_states/map.rb +90 -0
- data/examples/us_states/us-ag-productivity2004.csv +49 -0
- data/examples/us_states/us-cities.csv +51 -0
- data/examples/util/linear_scale.rb +83 -0
- data/examples/util/ordinal_scale.rb +72 -0
- data/init.rb +39 -0
- data/lib/jx/array_handler.js +70 -0
- data/lib/jx/callback.rb +255 -0
- data/lib/jx/hash_handler.js +87 -0
- data/lib/jx/irbobject.rb +121 -0
- data/lib/jx/js.rb +442 -0
- data/lib/jx/js_array.rb +31 -0
- data/lib/jx/js_hash.rb +76 -0
- data/lib/jx/js_init.rb +62 -0
- data/lib/jx/jsarray.rb +66 -0
- data/lib/jx/jsfunction.rb +73 -0
- data/lib/jx/jsobject.rb +188 -0
- data/lib/jx/jsstyle_sheet.rb +231 -0
- data/lib/jx/jsundefined.rb +46 -0
- data/lib/jx/proxy_array.rb +62 -0
- data/lib/jx/rbobject.rb +80 -0
- data/lib/jx/ruby_proxy.js +176 -0
- data/lib/jx/ruby_rich.js +70 -0
- data/lib/jx/sol.rb +109 -0
- data/lib/mdarray-sol.rb +34 -0
- data/lib/mdarray/jsmdarray.rb +39 -0
- data/lib/ruby_rich/bootstrap.rb +230 -0
- data/lib/ruby_rich/config.html +22 -0
- data/lib/ruby_rich/dashboard.rb +299 -0
- data/lib/ruby_rich/ruby_rich.rb +120 -0
- data/lib/sol/bar_chart.rb +35 -0
- data/lib/sol/base_chart.rb +148 -0
- data/lib/sol/chart.rb +138 -0
- data/lib/sol/coordinate_chart.rb +128 -0
- data/lib/sol/interval.rb +156 -0
- data/lib/sol/line_chart.rb +58 -0
- data/lib/sol/margins.rb +52 -0
- data/lib/sol/scale.rb +212 -0
- data/lib/sol/stack.rb +44 -0
- data/node_modules/bootstrap/Gruntfile.js +533 -0
- data/node_modules/bootstrap/dist/js/bootstrap.js +2363 -0
- data/node_modules/bootstrap/dist/js/bootstrap.min.js +7 -0
- data/node_modules/bootstrap/dist/js/npm.js +13 -0
- data/node_modules/bootstrap/grunt/bs-commonjs-generator.js +30 -0
- data/node_modules/bootstrap/grunt/bs-glyphicons-data-generator.js +42 -0
- data/node_modules/bootstrap/grunt/bs-lessdoc-parser.js +237 -0
- data/node_modules/bootstrap/grunt/bs-raw-files-generator.js +44 -0
- data/node_modules/bootstrap/js/affix.js +162 -0
- data/node_modules/bootstrap/js/alert.js +94 -0
- data/node_modules/bootstrap/js/button.js +120 -0
- data/node_modules/bootstrap/js/carousel.js +237 -0
- data/node_modules/bootstrap/js/collapse.js +211 -0
- data/node_modules/bootstrap/js/dropdown.js +165 -0
- data/node_modules/bootstrap/js/modal.js +337 -0
- data/node_modules/bootstrap/js/popover.js +108 -0
- data/node_modules/bootstrap/js/scrollspy.js +172 -0
- data/node_modules/bootstrap/js/tab.js +155 -0
- data/node_modules/bootstrap/js/tooltip.js +514 -0
- data/node_modules/bootstrap/js/transition.js +59 -0
- data/node_modules/chai/chai.js +6142 -0
- data/node_modules/chai/index.js +1 -0
- data/node_modules/chai/karma.conf.js +28 -0
- data/node_modules/chai/karma.sauce.js +41 -0
- data/node_modules/chai/lib/chai.js +93 -0
- data/node_modules/chai/lib/chai/assertion.js +131 -0
- data/node_modules/chai/lib/chai/config.js +55 -0
- data/node_modules/chai/lib/chai/core/assertions.js +1860 -0
- data/node_modules/chai/lib/chai/interface/assert.js +1645 -0
- data/node_modules/chai/lib/chai/interface/expect.js +34 -0
- data/node_modules/chai/lib/chai/interface/should.js +201 -0
- data/node_modules/chai/lib/chai/utils/addChainableMethod.js +112 -0
- data/node_modules/chai/lib/chai/utils/addMethod.js +44 -0
- data/node_modules/chai/lib/chai/utils/addProperty.js +48 -0
- data/node_modules/chai/lib/chai/utils/expectTypes.js +42 -0
- data/node_modules/chai/lib/chai/utils/flag.js +33 -0
- data/node_modules/chai/lib/chai/utils/getActual.js +20 -0
- data/node_modules/chai/lib/chai/utils/getEnumerableProperties.js +26 -0
- data/node_modules/chai/lib/chai/utils/getMessage.js +51 -0
- data/node_modules/chai/lib/chai/utils/getName.js +22 -0
- data/node_modules/chai/lib/chai/utils/getPathInfo.js +111 -0
- data/node_modules/chai/lib/chai/utils/getPathValue.js +43 -0
- data/node_modules/chai/lib/chai/utils/getProperties.js +36 -0
- data/node_modules/chai/lib/chai/utils/hasProperty.js +64 -0
- data/node_modules/chai/lib/chai/utils/index.js +130 -0
- data/node_modules/chai/lib/chai/utils/inspect.js +335 -0
- data/node_modules/chai/lib/chai/utils/objDisplay.js +50 -0
- data/node_modules/chai/lib/chai/utils/overwriteChainableMethod.js +54 -0
- data/node_modules/chai/lib/chai/utils/overwriteMethod.js +52 -0
- data/node_modules/chai/lib/chai/utils/overwriteProperty.js +55 -0
- data/node_modules/chai/lib/chai/utils/test.js +28 -0
- data/node_modules/chai/lib/chai/utils/transferFlags.js +45 -0
- data/node_modules/chai/node_modules/assertion-error/index.js +116 -0
- data/node_modules/chai/node_modules/deep-eql/index.js +1 -0
- data/node_modules/chai/node_modules/deep-eql/karma.conf.js +20 -0
- data/node_modules/chai/node_modules/deep-eql/lib/eql.js +257 -0
- data/node_modules/chai/node_modules/deep-eql/node_modules/type-detect/index.js +1 -0
- data/node_modules/chai/node_modules/deep-eql/node_modules/type-detect/lib/type.js +142 -0
- data/node_modules/chai/node_modules/type-detect/index.js +1 -0
- data/node_modules/chai/node_modules/type-detect/lib/type.js +134 -0
- data/node_modules/chai/sauce.browsers.js +128 -0
- data/node_modules/dc/Gruntfile.js +437 -0
- data/node_modules/dc/dc.js +10477 -0
- data/node_modules/dc/dc.min.js +23 -0
- data/node_modules/dc/docs/coverage.js +203 -0
- data/node_modules/dc/grunt/format-file-list.js +33 -0
- data/node_modules/dc/index.js +5 -0
- data/node_modules/dc/node_modules/crossfilter2/crossfilter.js +1401 -0
- data/node_modules/dc/node_modules/crossfilter2/crossfilter.min.js +1 -0
- data/node_modules/dc/node_modules/crossfilter2/index.js +1 -0
- data/node_modules/dc/node_modules/crossfilter2/src/array.js +46 -0
- data/node_modules/dc/node_modules/crossfilter2/src/bisect.js +44 -0
- data/node_modules/dc/node_modules/crossfilter2/src/crossfilter.js +872 -0
- data/node_modules/dc/node_modules/crossfilter2/src/filter.js +19 -0
- data/node_modules/dc/node_modules/crossfilter2/src/heap.js +44 -0
- data/node_modules/dc/node_modules/crossfilter2/src/heapselect.js +36 -0
- data/node_modules/dc/node_modules/crossfilter2/src/identity.js +3 -0
- data/node_modules/dc/node_modules/crossfilter2/src/insertionsort.js +18 -0
- data/node_modules/dc/node_modules/crossfilter2/src/null.js +3 -0
- data/node_modules/dc/node_modules/crossfilter2/src/permute.js +8 -0
- data/node_modules/dc/node_modules/crossfilter2/src/quicksort.js +283 -0
- data/node_modules/dc/node_modules/crossfilter2/src/reduce.js +19 -0
- data/node_modules/dc/node_modules/crossfilter2/src/zero.js +3 -0
- data/node_modules/dc/node_modules/d3/d3.js +9554 -0
- data/node_modules/dc/node_modules/d3/d3.min.js +5 -0
- data/node_modules/dc/node_modules/d3/package.js +13 -0
- data/node_modules/dc/node_modules/d3/src/arrays/ascending.js +5 -0
- data/node_modules/dc/node_modules/d3/src/arrays/bisect.js +36 -0
- data/node_modules/dc/node_modules/d3/src/arrays/descending.js +3 -0
- data/node_modules/dc/node_modules/d3/src/arrays/deviation.js +6 -0
- data/node_modules/dc/node_modules/d3/src/arrays/entries.js +5 -0
- data/node_modules/dc/node_modules/d3/src/arrays/extent.js +21 -0
- data/node_modules/dc/node_modules/d3/src/arrays/index.js +25 -0
- data/node_modules/dc/node_modules/d3/src/arrays/keys.js +5 -0
- data/node_modules/dc/node_modules/d3/src/arrays/map.js +84 -0
- data/node_modules/dc/node_modules/d3/src/arrays/max.js +14 -0
- data/node_modules/dc/node_modules/d3/src/arrays/mean.js +15 -0
- data/node_modules/dc/node_modules/d3/src/arrays/median.js +16 -0
- data/node_modules/dc/node_modules/d3/src/arrays/merge.js +21 -0
- data/node_modules/dc/node_modules/d3/src/arrays/min.js +14 -0
- data/node_modules/dc/node_modules/d3/src/arrays/nest.js +97 -0
- data/node_modules/dc/node_modules/d3/src/arrays/pairs.js +5 -0
- data/node_modules/dc/node_modules/d3/src/arrays/permute.js +5 -0
- data/node_modules/dc/node_modules/d3/src/arrays/quantile.js +8 -0
- data/node_modules/dc/node_modules/d3/src/arrays/range.js +26 -0
- data/node_modules/dc/node_modules/d3/src/arrays/set.js +27 -0
- data/node_modules/dc/node_modules/d3/src/arrays/shuffle.js +9 -0
- data/node_modules/dc/node_modules/d3/src/arrays/sum.js +14 -0
- data/node_modules/dc/node_modules/d3/src/arrays/transpose.js +15 -0
- data/node_modules/dc/node_modules/d3/src/arrays/values.js +5 -0
- data/node_modules/dc/node_modules/d3/src/arrays/variance.js +29 -0
- data/node_modules/dc/node_modules/d3/src/arrays/zip.js +5 -0
- data/node_modules/dc/node_modules/d3/src/behavior/behavior.js +1 -0
- data/node_modules/dc/node_modules/d3/src/behavior/drag.js +88 -0
- data/node_modules/dc/node_modules/d3/src/behavior/index.js +3 -0
- data/node_modules/dc/node_modules/d3/src/behavior/zoom.js +348 -0
- data/node_modules/dc/node_modules/d3/src/color/color.js +7 -0
- data/node_modules/dc/node_modules/d3/src/color/hcl.js +34 -0
- data/node_modules/dc/node_modules/d3/src/color/hsl.js +56 -0
- data/node_modules/dc/node_modules/d3/src/color/index.js +6 -0
- data/node_modules/dc/node_modules/d3/src/color/lab.js +60 -0
- data/node_modules/dc/node_modules/d3/src/color/rgb.js +301 -0
- data/node_modules/dc/node_modules/d3/src/color/xyz.js +7 -0
- data/node_modules/dc/node_modules/d3/src/compat/array.js +15 -0
- data/node_modules/dc/node_modules/d3/src/compat/date.js +3 -0
- data/node_modules/dc/node_modules/d3/src/compat/index.js +3 -0
- data/node_modules/dc/node_modules/d3/src/compat/style.js +23 -0
- data/node_modules/dc/node_modules/d3/src/core/array.js +2 -0
- data/node_modules/dc/node_modules/d3/src/core/class.js +8 -0
- data/node_modules/dc/node_modules/d3/src/core/document.js +15 -0
- data/node_modules/dc/node_modules/d3/src/core/functor.js +5 -0
- data/node_modules/dc/node_modules/d3/src/core/identity.js +3 -0
- data/node_modules/dc/node_modules/d3/src/core/index.js +3 -0
- data/node_modules/dc/node_modules/d3/src/core/noop.js +1 -0
- data/node_modules/dc/node_modules/d3/src/core/ns.js +18 -0
- data/node_modules/dc/node_modules/d3/src/core/rebind.js +16 -0
- data/node_modules/dc/node_modules/d3/src/core/source.js +3 -0
- data/node_modules/dc/node_modules/d3/src/core/subclass.js +11 -0
- data/node_modules/dc/node_modules/d3/src/core/target.js +3 -0
- data/node_modules/dc/node_modules/d3/src/core/true.js +3 -0
- data/node_modules/dc/node_modules/d3/src/core/vendor.js +10 -0
- data/node_modules/dc/node_modules/d3/src/core/zero.js +3 -0
- data/node_modules/dc/node_modules/d3/src/d3.js +23 -0
- data/node_modules/dc/node_modules/d3/src/dsv/csv.js +3 -0
- data/node_modules/dc/node_modules/d3/src/dsv/dsv.js +136 -0
- data/node_modules/dc/node_modules/d3/src/dsv/index.js +3 -0
- data/node_modules/dc/node_modules/d3/src/dsv/tsv.js +3 -0
- data/node_modules/dc/node_modules/d3/src/end.js +4 -0
- data/node_modules/dc/node_modules/d3/src/event/dispatch.js +69 -0
- data/node_modules/dc/node_modules/d3/src/event/drag.js +36 -0
- data/node_modules/dc/node_modules/d3/src/event/event.js +50 -0
- data/node_modules/dc/node_modules/d3/src/event/index.js +6 -0
- data/node_modules/dc/node_modules/d3/src/event/mouse.js +39 -0
- data/node_modules/dc/node_modules/d3/src/event/timer.js +82 -0
- data/node_modules/dc/node_modules/d3/src/event/touch.js +11 -0
- data/node_modules/dc/node_modules/d3/src/event/touches.js +12 -0
- data/node_modules/dc/node_modules/d3/src/format/collapse.js +3 -0
- data/node_modules/dc/node_modules/d3/src/format/format.js +3 -0
- data/node_modules/dc/node_modules/d3/src/format/formatPrefix.js +24 -0
- data/node_modules/dc/node_modules/d3/src/format/index.js +4 -0
- data/node_modules/dc/node_modules/d3/src/format/precision.js +3 -0
- data/node_modules/dc/node_modules/d3/src/format/requote.js +5 -0
- data/node_modules/dc/node_modules/d3/src/format/round.js +5 -0
- data/node_modules/dc/node_modules/d3/src/geo/albers-usa.js +129 -0
- data/node_modules/dc/node_modules/d3/src/geo/albers.js +11 -0
- data/node_modules/dc/node_modules/d3/src/geo/area.js +69 -0
- data/node_modules/dc/node_modules/d3/src/geo/azimuthal-equal-area.js +12 -0
- data/node_modules/dc/node_modules/d3/src/geo/azimuthal-equidistant.js +13 -0
- data/node_modules/dc/node_modules/d3/src/geo/azimuthal.js +25 -0
- data/node_modules/dc/node_modules/d3/src/geo/bounds.js +168 -0
- data/node_modules/dc/node_modules/d3/src/geo/cartesian.js +47 -0
- data/node_modules/dc/node_modules/d3/src/geo/centroid.js +149 -0
- data/node_modules/dc/node_modules/d3/src/geo/circle.js +81 -0
- data/node_modules/dc/node_modules/d3/src/geo/clip-antimeridian.js +95 -0
- data/node_modules/dc/node_modules/d3/src/geo/clip-circle.js +178 -0
- data/node_modules/dc/node_modules/d3/src/geo/clip-extent.js +196 -0
- data/node_modules/dc/node_modules/d3/src/geo/clip-polygon.js +104 -0
- data/node_modules/dc/node_modules/d3/src/geo/clip.js +149 -0
- data/node_modules/dc/node_modules/d3/src/geo/compose.js +12 -0
- data/node_modules/dc/node_modules/d3/src/geo/conic-conformal.js +39 -0
- data/node_modules/dc/node_modules/d3/src/geo/conic-equal-area.js +33 -0
- data/node_modules/dc/node_modules/d3/src/geo/conic-equidistant.js +36 -0
- data/node_modules/dc/node_modules/d3/src/geo/conic.js +16 -0
- data/node_modules/dc/node_modules/d3/src/geo/distance.js +13 -0
- data/node_modules/dc/node_modules/d3/src/geo/equirectangular.js +10 -0
- data/node_modules/dc/node_modules/d3/src/geo/geo.js +1 -0
- data/node_modules/dc/node_modules/d3/src/geo/gnomonic.js +12 -0
- data/node_modules/dc/node_modules/d3/src/geo/graticule.js +103 -0
- data/node_modules/dc/node_modules/d3/src/geo/greatArc.js +42 -0
- data/node_modules/dc/node_modules/d3/src/geo/index.js +33 -0
- data/node_modules/dc/node_modules/d3/src/geo/interpolate.js +38 -0
- data/node_modules/dc/node_modules/d3/src/geo/length.js +44 -0
- data/node_modules/dc/node_modules/d3/src/geo/mercator.js +48 -0
- data/node_modules/dc/node_modules/d3/src/geo/orthographic.js +12 -0
- data/node_modules/dc/node_modules/d3/src/geo/path-area.js +41 -0
- data/node_modules/dc/node_modules/d3/src/geo/path-bounds.js +21 -0
- data/node_modules/dc/node_modules/d3/src/geo/path-buffer.js +59 -0
- data/node_modules/dc/node_modules/d3/src/geo/path-centroid.js +78 -0
- data/node_modules/dc/node_modules/d3/src/geo/path-context.js +49 -0
- data/node_modules/dc/node_modules/d3/src/geo/path.js +87 -0
- data/node_modules/dc/node_modules/d3/src/geo/point-in-polygon.js +71 -0
- data/node_modules/dc/node_modules/d3/src/geo/projection.js +121 -0
- data/node_modules/dc/node_modules/d3/src/geo/resample.js +109 -0
- data/node_modules/dc/node_modules/d3/src/geo/rotation.js +79 -0
- data/node_modules/dc/node_modules/d3/src/geo/spherical.js +13 -0
- data/node_modules/dc/node_modules/d3/src/geo/stereographic.js +12 -0
- data/node_modules/dc/node_modules/d3/src/geo/stream.js +71 -0
- data/node_modules/dc/node_modules/d3/src/geo/transform.js +36 -0
- data/node_modules/dc/node_modules/d3/src/geo/transverse-mercator.js +31 -0
- data/node_modules/dc/node_modules/d3/src/geom/clip-line.js +66 -0
- data/node_modules/dc/node_modules/d3/src/geom/delaunay.js +6 -0
- data/node_modules/dc/node_modules/d3/src/geom/geom.js +1 -0
- data/node_modules/dc/node_modules/d3/src/geom/hull.js +91 -0
- data/node_modules/dc/node_modules/d3/src/geom/index.js +6 -0
- data/node_modules/dc/node_modules/d3/src/geom/point.js +7 -0
- data/node_modules/dc/node_modules/d3/src/geom/polygon.js +105 -0
- data/node_modules/dc/node_modules/d3/src/geom/quadtree.js +243 -0
- data/node_modules/dc/node_modules/d3/src/geom/voronoi.js +110 -0
- data/node_modules/dc/node_modules/d3/src/geom/voronoi/beach.js +186 -0
- data/node_modules/dc/node_modules/d3/src/geom/voronoi/cell.js +64 -0
- data/node_modules/dc/node_modules/d3/src/geom/voronoi/circle.js +73 -0
- data/node_modules/dc/node_modules/d3/src/geom/voronoi/clip.js +80 -0
- data/node_modules/dc/node_modules/d3/src/geom/voronoi/edge.js +50 -0
- data/node_modules/dc/node_modules/d3/src/geom/voronoi/index.js +59 -0
- data/node_modules/dc/node_modules/d3/src/geom/voronoi/red-black.js +235 -0
- data/node_modules/dc/node_modules/d3/src/interpolate/array.js +19 -0
- data/node_modules/dc/node_modules/d3/src/interpolate/ease.js +111 -0
- data/node_modules/dc/node_modules/d3/src/interpolate/hcl.js +20 -0
- data/node_modules/dc/node_modules/d3/src/interpolate/hsl.js +20 -0
- data/node_modules/dc/node_modules/d3/src/interpolate/index.js +14 -0
- data/node_modules/dc/node_modules/d3/src/interpolate/interpolate.js +26 -0
- data/node_modules/dc/node_modules/d3/src/interpolate/lab.js +17 -0
- data/node_modules/dc/node_modules/d3/src/interpolate/number.js +6 -0
- data/node_modules/dc/node_modules/d3/src/interpolate/object.js +25 -0
- data/node_modules/dc/node_modules/d3/src/interpolate/rgb.js +20 -0
- data/node_modules/dc/node_modules/d3/src/interpolate/round.js +6 -0
- data/node_modules/dc/node_modules/d3/src/interpolate/string.js +54 -0
- data/node_modules/dc/node_modules/d3/src/interpolate/transform.js +59 -0
- data/node_modules/dc/node_modules/d3/src/interpolate/uninterpolate.js +9 -0
- data/node_modules/dc/node_modules/d3/src/interpolate/zoom.js +53 -0
- data/node_modules/dc/node_modules/d3/src/layout/bundle.js +59 -0
- data/node_modules/dc/node_modules/d3/src/layout/chord.js +157 -0
- data/node_modules/dc/node_modules/d3/src/layout/cluster.js +92 -0
- data/node_modules/dc/node_modules/d3/src/layout/force.js +372 -0
- data/node_modules/dc/node_modules/d3/src/layout/hierarchy.js +136 -0
- data/node_modules/dc/node_modules/d3/src/layout/histogram.js +110 -0
- data/node_modules/dc/node_modules/d3/src/layout/index.js +13 -0
- data/node_modules/dc/node_modules/d3/src/layout/layout.js +1 -0
- data/node_modules/dc/node_modules/d3/src/layout/pack.js +211 -0
- data/node_modules/dc/node_modules/d3/src/layout/partition.js +51 -0
- data/node_modules/dc/node_modules/d3/src/layout/pie.js +78 -0
- data/node_modules/dc/node_modules/d3/src/layout/stack.js +247 -0
- data/node_modules/dc/node_modules/d3/src/layout/tree.js +240 -0
- data/node_modules/dc/node_modules/d3/src/layout/treemap.js +229 -0
- data/node_modules/dc/node_modules/d3/src/locale/ca-ES.js +16 -0
- data/node_modules/dc/node_modules/d3/src/locale/de-CH.js +16 -0
- data/node_modules/dc/node_modules/d3/src/locale/de-DE.js +16 -0
- data/node_modules/dc/node_modules/d3/src/locale/en-CA.js +16 -0
- data/node_modules/dc/node_modules/d3/src/locale/en-GB.js +16 -0
- data/node_modules/dc/node_modules/d3/src/locale/en-US.js +16 -0
- data/node_modules/dc/node_modules/d3/src/locale/es-ES.js +16 -0
- data/node_modules/dc/node_modules/d3/src/locale/fi-FI.js +16 -0
- data/node_modules/dc/node_modules/d3/src/locale/fr-CA.js +16 -0
- data/node_modules/dc/node_modules/d3/src/locale/fr-FR.js +16 -0
- data/node_modules/dc/node_modules/d3/src/locale/he-IL.js +16 -0
- data/node_modules/dc/node_modules/d3/src/locale/hu-HU.js +16 -0
- data/node_modules/dc/node_modules/d3/src/locale/it-IT.js +16 -0
- data/node_modules/dc/node_modules/d3/src/locale/ja-JP.js +16 -0
- data/node_modules/dc/node_modules/d3/src/locale/ko-KR.js +16 -0
- data/node_modules/dc/node_modules/d3/src/locale/locale.js +9 -0
- data/node_modules/dc/node_modules/d3/src/locale/mk-MK.js +16 -0
- data/node_modules/dc/node_modules/d3/src/locale/nl-NL.js +16 -0
- data/node_modules/dc/node_modules/d3/src/locale/number-format.js +155 -0
- data/node_modules/dc/node_modules/d3/src/locale/pl-PL.js +16 -0
- data/node_modules/dc/node_modules/d3/src/locale/pt-BR.js +16 -0
- data/node_modules/dc/node_modules/d3/src/locale/ru-RU.js +16 -0
- data/node_modules/dc/node_modules/d3/src/locale/sv-SE.js +16 -0
- data/node_modules/dc/node_modules/d3/src/locale/time-format.js +370 -0
- data/node_modules/dc/node_modules/d3/src/locale/time-scale.js +0 -0
- data/node_modules/dc/node_modules/d3/src/locale/zh-CN.js +16 -0
- data/node_modules/dc/node_modules/d3/src/math/abs.js +1 -0
- data/node_modules/dc/node_modules/d3/src/math/adder.js +34 -0
- data/node_modules/dc/node_modules/d3/src/math/index.js +2 -0
- data/node_modules/dc/node_modules/d3/src/math/number.js +7 -0
- data/node_modules/dc/node_modules/d3/src/math/random.js +34 -0
- data/node_modules/dc/node_modules/d3/src/math/transform.js +64 -0
- data/node_modules/dc/node_modules/d3/src/math/trigonometry.js +44 -0
- data/node_modules/dc/node_modules/d3/src/scale/bilinear.js +7 -0
- data/node_modules/dc/node_modules/d3/src/scale/category.js +58 -0
- data/node_modules/dc/node_modules/d3/src/scale/identity.js +33 -0
- data/node_modules/dc/node_modules/d3/src/scale/index.js +11 -0
- data/node_modules/dc/node_modules/d3/src/scale/linear.js +160 -0
- data/node_modules/dc/node_modules/d3/src/scale/log.js +92 -0
- data/node_modules/dc/node_modules/d3/src/scale/nice.js +30 -0
- data/node_modules/dc/node_modules/d3/src/scale/ordinal.js +102 -0
- data/node_modules/dc/node_modules/d3/src/scale/polylinear.js +24 -0
- data/node_modules/dc/node_modules/d3/src/scale/pow.js +57 -0
- data/node_modules/dc/node_modules/d3/src/scale/quantile.js +55 -0
- data/node_modules/dc/node_modules/d3/src/scale/quantize.js +44 -0
- data/node_modules/dc/node_modules/d3/src/scale/scale.js +10 -0
- data/node_modules/dc/node_modules/d3/src/scale/sqrt.js +6 -0
- data/node_modules/dc/node_modules/d3/src/scale/threshold.js +36 -0
- data/node_modules/dc/node_modules/d3/src/selection/append.js +28 -0
- data/node_modules/dc/node_modules/d3/src/selection/attr.js +62 -0
- data/node_modules/dc/node_modules/d3/src/selection/call.js +8 -0
- data/node_modules/dc/node_modules/d3/src/selection/classed.js +76 -0
- data/node_modules/dc/node_modules/d3/src/selection/data.js +117 -0
- data/node_modules/dc/node_modules/d3/src/selection/datum.js +7 -0
- data/node_modules/dc/node_modules/d3/src/selection/each.js +16 -0
- data/node_modules/dc/node_modules/d3/src/selection/empty.js +5 -0
- data/node_modules/dc/node_modules/d3/src/selection/enter-insert.js +20 -0
- data/node_modules/dc/node_modules/d3/src/selection/enter-select.js +27 -0
- data/node_modules/dc/node_modules/d3/src/selection/enter.js +21 -0
- data/node_modules/dc/node_modules/d3/src/selection/filter.js +28 -0
- data/node_modules/dc/node_modules/d3/src/selection/html.js +10 -0
- data/node_modules/dc/node_modules/d3/src/selection/index.js +1 -0
- data/node_modules/dc/node_modules/d3/src/selection/insert.js +9 -0
- data/node_modules/dc/node_modules/d3/src/selection/interrupt.js +27 -0
- data/node_modules/dc/node_modules/d3/src/selection/node.js +11 -0
- data/node_modules/dc/node_modules/d3/src/selection/on.js +106 -0
- data/node_modules/dc/node_modules/d3/src/selection/order.js +13 -0
- data/node_modules/dc/node_modules/d3/src/selection/property.js +43 -0
- data/node_modules/dc/node_modules/d3/src/selection/remove.js +13 -0
- data/node_modules/dc/node_modules/d3/src/selection/select.js +32 -0
- data/node_modules/dc/node_modules/d3/src/selection/selectAll.js +27 -0
- data/node_modules/dc/node_modules/d3/src/selection/selection.js +81 -0
- data/node_modules/dc/node_modules/d3/src/selection/size.js +7 -0
- data/node_modules/dc/node_modules/d3/src/selection/sort.js +15 -0
- data/node_modules/dc/node_modules/d3/src/selection/style.js +59 -0
- data/node_modules/dc/node_modules/d3/src/selection/text.js +10 -0
- data/node_modules/dc/node_modules/d3/src/selection/transition.js +21 -0
- data/node_modules/dc/node_modules/d3/src/start.js +2 -0
- data/node_modules/dc/node_modules/d3/src/svg/arc.js +292 -0
- data/node_modules/dc/node_modules/d3/src/svg/area-radial.js +14 -0
- data/node_modules/dc/node_modules/d3/src/svg/area.js +121 -0
- data/node_modules/dc/node_modules/d3/src/svg/axis.js +160 -0
- data/node_modules/dc/node_modules/d3/src/svg/brush.js +429 -0
- data/node_modules/dc/node_modules/d3/src/svg/chord.js +90 -0
- data/node_modules/dc/node_modules/d3/src/svg/diagonal-radial.js +27 -0
- data/node_modules/dc/node_modules/d3/src/svg/diagonal.js +43 -0
- data/node_modules/dc/node_modules/d3/src/svg/index.js +12 -0
- data/node_modules/dc/node_modules/d3/src/svg/line-radial.js +27 -0
- data/node_modules/dc/node_modules/d3/src/svg/line.js +432 -0
- data/node_modules/dc/node_modules/d3/src/svg/svg.js +1 -0
- data/node_modules/dc/node_modules/d3/src/svg/symbol.js +105 -0
- data/node_modules/dc/node_modules/d3/src/time/day.js +21 -0
- data/node_modules/dc/node_modules/d3/src/time/format-iso.js +19 -0
- data/node_modules/dc/node_modules/d3/src/time/format-utc.js +3 -0
- data/node_modules/dc/node_modules/d3/src/time/format.js +4 -0
- data/node_modules/dc/node_modules/d3/src/time/hour.js +14 -0
- data/node_modules/dc/node_modules/d3/src/time/index.js +14 -0
- data/node_modules/dc/node_modules/d3/src/time/interval.js +71 -0
- data/node_modules/dc/node_modules/d3/src/time/minute.js +13 -0
- data/node_modules/dc/node_modules/d3/src/time/month.js +16 -0
- data/node_modules/dc/node_modules/d3/src/time/scale-utc.js +25 -0
- data/node_modules/dc/node_modules/d3/src/time/scale.js +155 -0
- data/node_modules/dc/node_modules/d3/src/time/second.js +13 -0
- data/node_modules/dc/node_modules/d3/src/time/time.js +33 -0
- data/node_modules/dc/node_modules/d3/src/time/week.js +31 -0
- data/node_modules/dc/node_modules/d3/src/time/year.js +16 -0
- data/node_modules/dc/node_modules/d3/src/transition/attr.js +58 -0
- data/node_modules/dc/node_modules/d3/src/transition/delay.js +10 -0
- data/node_modules/dc/node_modules/d3/src/transition/duration.js +10 -0
- data/node_modules/dc/node_modules/d3/src/transition/each.js +26 -0
- data/node_modules/dc/node_modules/d3/src/transition/ease.js +10 -0
- data/node_modules/dc/node_modules/d3/src/transition/filter.js +22 -0
- data/node_modules/dc/node_modules/d3/src/transition/index.js +1 -0
- data/node_modules/dc/node_modules/d3/src/transition/remove.js +9 -0
- data/node_modules/dc/node_modules/d3/src/transition/select.js +28 -0
- data/node_modules/dc/node_modules/d3/src/transition/selectAll.js +31 -0
- data/node_modules/dc/node_modules/d3/src/transition/style.js +53 -0
- data/node_modules/dc/node_modules/d3/src/transition/subtransition.js +25 -0
- data/node_modules/dc/node_modules/d3/src/transition/text.js +11 -0
- data/node_modules/dc/node_modules/d3/src/transition/transition.js +161 -0
- data/node_modules/dc/node_modules/d3/src/transition/tween.js +17 -0
- data/node_modules/dc/node_modules/d3/src/xhr/html.js +12 -0
- data/node_modules/dc/node_modules/d3/src/xhr/index.js +5 -0
- data/node_modules/dc/node_modules/d3/src/xhr/json.js +9 -0
- data/node_modules/dc/node_modules/d3/src/xhr/text.js +5 -0
- data/node_modules/dc/node_modules/d3/src/xhr/xhr.js +126 -0
- data/node_modules/dc/node_modules/d3/src/xhr/xml.js +5 -0
- data/node_modules/dc/regression/inject-serializer.js +6 -0
- data/node_modules/dc/regression/stock-regression-test.js +140 -0
- data/node_modules/dc/spec/bar-chart-spec.js +1230 -0
- data/node_modules/dc/spec/base-mixin-spec.js +611 -0
- data/node_modules/dc/spec/biggish-data-spec.js +136 -0
- data/node_modules/dc/spec/box-plot-spec.js +211 -0
- data/node_modules/dc/spec/bubble-chart-spec.js +450 -0
- data/node_modules/dc/spec/bubble-overlay-spec.js +102 -0
- data/node_modules/dc/spec/color-spec.js +89 -0
- data/node_modules/dc/spec/composite-chart-spec.js +691 -0
- data/node_modules/dc/spec/coordinate-grid-chart-spec.js +962 -0
- data/node_modules/dc/spec/core-spec.js +301 -0
- data/node_modules/dc/spec/data-addition-spec.js +122 -0
- data/node_modules/dc/spec/data-count-spec.js +180 -0
- data/node_modules/dc/spec/data-grid-spec.js +124 -0
- data/node_modules/dc/spec/data-table-spec.js +251 -0
- data/node_modules/dc/spec/event-spec.js +41 -0
- data/node_modules/dc/spec/filter-dates-spec.js +92 -0
- data/node_modules/dc/spec/filters-spec.js +140 -0
- data/node_modules/dc/spec/geo-choropleth-chart-spec.js +225 -0
- data/node_modules/dc/spec/heatmap-spec.js +363 -0
- data/node_modules/dc/spec/helpers/custom_matchers.js +213 -0
- data/node_modules/dc/spec/helpers/fixtures.js +81 -0
- data/node_modules/dc/spec/helpers/geoFixtures.js +113 -0
- data/node_modules/dc/spec/helpers/load-jsreporter.js +37 -0
- data/node_modules/dc/spec/helpers/spec-helper.js +53 -0
- data/node_modules/dc/spec/legend-spec.js +266 -0
- data/node_modules/dc/spec/line-chart-spec.js +709 -0
- data/node_modules/dc/spec/logger-spec.js +80 -0
- data/node_modules/dc/spec/number-display-spec.js +168 -0
- data/node_modules/dc/spec/pie-chart-spec.js +677 -0
- data/node_modules/dc/spec/row-chart-spec.js +362 -0
- data/node_modules/dc/spec/scatter-plot-spec.js +336 -0
- data/node_modules/dc/spec/series-chart-spec.js +133 -0
- data/node_modules/dc/spec/utils-spec.js +110 -0
- data/node_modules/dc/src/banner.js +2 -0
- data/node_modules/dc/src/bar-chart.js +374 -0
- data/node_modules/dc/src/base-mixin.js +1478 -0
- data/node_modules/dc/src/box-plot.js +240 -0
- data/node_modules/dc/src/bubble-chart.js +177 -0
- data/node_modules/dc/src/bubble-mixin.js +244 -0
- data/node_modules/dc/src/bubble-overlay.js +207 -0
- data/node_modules/dc/src/cap-mixin.js +151 -0
- data/node_modules/dc/src/color-mixin.js +172 -0
- data/node_modules/dc/src/composite-chart.js +544 -0
- data/node_modules/dc/src/coordinate-grid-mixin.js +1300 -0
- data/node_modules/dc/src/core.js +425 -0
- data/node_modules/dc/src/d3.box.js +317 -0
- data/node_modules/dc/src/data-count.js +110 -0
- data/node_modules/dc/src/data-grid.js +243 -0
- data/node_modules/dc/src/data-table.js +419 -0
- data/node_modules/dc/src/errors.js +28 -0
- data/node_modules/dc/src/events.js +37 -0
- data/node_modules/dc/src/filters.js +124 -0
- data/node_modules/dc/src/footer.js +35 -0
- data/node_modules/dc/src/geo-choropleth-chart.js +279 -0
- data/node_modules/dc/src/heatmap.js +378 -0
- data/node_modules/dc/src/legend.js +277 -0
- data/node_modules/dc/src/line-chart.js +504 -0
- data/node_modules/dc/src/logger.js +40 -0
- data/node_modules/dc/src/margin-mixin.js +44 -0
- data/node_modules/dc/src/number-display.js +141 -0
- data/node_modules/dc/src/pie-chart.js +571 -0
- data/node_modules/dc/src/row-chart.js +425 -0
- data/node_modules/dc/src/scatter-plot.js +338 -0
- data/node_modules/dc/src/series-chart.js +192 -0
- data/node_modules/dc/src/stack-mixin.js +319 -0
- data/node_modules/dc/src/utils.js +290 -0
- data/node_modules/dc/web/docs/html/scripts/docstrap.lib.js +11 -0
- data/node_modules/dc/web/docs/html/scripts/fulltext-search-ui.js +89 -0
- data/node_modules/dc/web/docs/html/scripts/fulltext-search.js +36 -0
- data/node_modules/dc/web/docs/html/scripts/lunr.min.js +7 -0
- data/node_modules/dc/web/docs/html/scripts/prettify/jquery.min.js +6 -0
- data/node_modules/dc/web/docs/html/scripts/prettify/lang-css.js +21 -0
- data/node_modules/dc/web/docs/html/scripts/prettify/prettify.js +496 -0
- data/node_modules/dc/web/docs/html/scripts/sunlight.js +1157 -0
- data/node_modules/dc/web/docs/html/scripts/toc.js +203 -0
- data/node_modules/dc/web/ep/list.js +106 -0
- data/node_modules/dc/web/examples/lysenko-interval-tree.js +447 -0
- data/node_modules/dc/web/highlighter/shAutoloader.js +17 -0
- data/node_modules/dc/web/highlighter/shBrushJScript.js +52 -0
- data/node_modules/dc/web/highlighter/shBrushXml.js +69 -0
- data/node_modules/dc/web/highlighter/shCore.js +17 -0
- data/node_modules/dc/web/js/colorbrewer.js +1 -0
- data/node_modules/dc/web/js/crossfilter.js +1401 -0
- data/node_modules/dc/web/js/d3.js +9554 -0
- data/node_modules/dc/web/js/dc.js +10477 -0
- data/node_modules/dc/web/js/dc.min.js +23 -0
- data/node_modules/dc/web/js/env-data.js +218 -0
- data/node_modules/dc/web/js/jasmine-jsreporter.js +394 -0
- data/node_modules/dc/web/stock.js +685 -0
- data/node_modules/dc/web/transitions/transition-test.js +45 -0
- data/node_modules/jquery/dist/jquery.js +9814 -0
- data/node_modules/jquery/dist/jquery.min.js +4 -0
- data/node_modules/jquery/external/sizzle/dist/sizzle.js +2143 -0
- data/node_modules/jquery/external/sizzle/dist/sizzle.min.js +3 -0
- data/node_modules/jquery/src/ajax.js +845 -0
- data/node_modules/jquery/src/ajax/jsonp.js +100 -0
- data/node_modules/jquery/src/ajax/load.js +83 -0
- data/node_modules/jquery/src/ajax/parseJSON.js +13 -0
- data/node_modules/jquery/src/ajax/parseXML.js +27 -0
- data/node_modules/jquery/src/ajax/script.js +68 -0
- data/node_modules/jquery/src/ajax/var/location.js +3 -0
- data/node_modules/jquery/src/ajax/var/nonce.js +5 -0
- data/node_modules/jquery/src/ajax/var/rquery.js +3 -0
- data/node_modules/jquery/src/ajax/xhr.js +167 -0
- data/node_modules/jquery/src/attributes.js +11 -0
- data/node_modules/jquery/src/attributes/attr.js +142 -0
- data/node_modules/jquery/src/attributes/classes.js +177 -0
- data/node_modules/jquery/src/attributes/prop.js +125 -0
- data/node_modules/jquery/src/attributes/support.js +36 -0
- data/node_modules/jquery/src/attributes/val.js +177 -0
- data/node_modules/jquery/src/callbacks.js +232 -0
- data/node_modules/jquery/src/core.js +494 -0
- data/node_modules/jquery/src/core/access.js +65 -0
- data/node_modules/jquery/src/core/init.js +134 -0
- data/node_modules/jquery/src/core/parseHTML.js +41 -0
- data/node_modules/jquery/src/core/ready.js +103 -0
- data/node_modules/jquery/src/core/var/rsingleTag.js +5 -0
- data/node_modules/jquery/src/css.js +502 -0
- data/node_modules/jquery/src/css/addGetHookIf.js +24 -0
- data/node_modules/jquery/src/css/adjustCSS.js +65 -0
- data/node_modules/jquery/src/css/curCSS.js +60 -0
- data/node_modules/jquery/src/css/defaultDisplay.js +72 -0
- data/node_modules/jquery/src/css/hiddenVisibleSelectors.js +18 -0
- data/node_modules/jquery/src/css/showHide.js +48 -0
- data/node_modules/jquery/src/css/support.js +121 -0
- data/node_modules/jquery/src/css/var/cssExpand.js +3 -0
- data/node_modules/jquery/src/css/var/getStyles.js +15 -0
- data/node_modules/jquery/src/css/var/isHidden.js +16 -0
- data/node_modules/jquery/src/css/var/rmargin.js +3 -0
- data/node_modules/jquery/src/css/var/rnumnonpx.js +5 -0
- data/node_modules/jquery/src/css/var/swap.js +24 -0
- data/node_modules/jquery/src/data.js +187 -0
- data/node_modules/jquery/src/data/Data.js +200 -0
- data/node_modules/jquery/src/data/var/acceptData.js +18 -0
- data/node_modules/jquery/src/data/var/dataPriv.js +5 -0
- data/node_modules/jquery/src/data/var/dataUser.js +5 -0
- data/node_modules/jquery/src/deferred.js +158 -0
- data/node_modules/jquery/src/deprecated.js +32 -0
- data/node_modules/jquery/src/dimensions.js +54 -0
- data/node_modules/jquery/src/effects.js +629 -0
- data/node_modules/jquery/src/effects/Tween.js +121 -0
- data/node_modules/jquery/src/effects/animatedSelector.js +13 -0
- data/node_modules/jquery/src/event.js +711 -0
- data/node_modules/jquery/src/event/ajax.js +20 -0
- data/node_modules/jquery/src/event/alias.js +27 -0
- data/node_modules/jquery/src/event/focusin.js +53 -0
- data/node_modules/jquery/src/event/support.js +9 -0
- data/node_modules/jquery/src/event/trigger.js +183 -0
- data/node_modules/jquery/src/exports/amd.js +24 -0
- data/node_modules/jquery/src/exports/global.js +26 -0
- data/node_modules/jquery/src/intro.js +44 -0
- data/node_modules/jquery/src/jquery.js +37 -0
- data/node_modules/jquery/src/manipulation.js +481 -0
- data/node_modules/jquery/src/manipulation/_evalUrl.js +20 -0
- data/node_modules/jquery/src/manipulation/buildFragment.js +102 -0
- data/node_modules/jquery/src/manipulation/getAll.js +21 -0
- data/node_modules/jquery/src/manipulation/setGlobalEval.js +20 -0
- data/node_modules/jquery/src/manipulation/support.js +33 -0
- data/node_modules/jquery/src/manipulation/var/rcheckableType.js +3 -0
- data/node_modules/jquery/src/manipulation/var/rscriptType.js +3 -0
- data/node_modules/jquery/src/manipulation/var/rtagName.js +3 -0
- data/node_modules/jquery/src/manipulation/wrapMap.js +27 -0
- data/node_modules/jquery/src/offset.js +218 -0
- data/node_modules/jquery/src/outro.js +2 -0
- data/node_modules/jquery/src/queue.js +143 -0
- data/node_modules/jquery/src/queue/delay.js +22 -0
- data/node_modules/jquery/src/selector-native.js +211 -0
- data/node_modules/jquery/src/selector-sizzle.js +14 -0
- data/node_modules/jquery/src/selector.js +1 -0
- data/node_modules/jquery/src/serialize.js +125 -0
- data/node_modules/jquery/src/traversing.js +175 -0
- data/node_modules/jquery/src/traversing/findFilter.js +100 -0
- data/node_modules/jquery/src/traversing/var/dir.js +20 -0
- data/node_modules/jquery/src/traversing/var/rneedsContext.js +6 -0
- data/node_modules/jquery/src/traversing/var/siblings.js +15 -0
- data/node_modules/jquery/src/var/arr.js +3 -0
- data/node_modules/jquery/src/var/class2type.js +5 -0
- data/node_modules/jquery/src/var/concat.js +5 -0
- data/node_modules/jquery/src/var/document.js +3 -0
- data/node_modules/jquery/src/var/documentElement.js +5 -0
- data/node_modules/jquery/src/var/hasOwn.js +5 -0
- data/node_modules/jquery/src/var/indexOf.js +5 -0
- data/node_modules/jquery/src/var/pnum.js +3 -0
- data/node_modules/jquery/src/var/push.js +5 -0
- data/node_modules/jquery/src/var/rcssNum.js +7 -0
- data/node_modules/jquery/src/var/rnotwhite.js +3 -0
- data/node_modules/jquery/src/var/slice.js +5 -0
- data/node_modules/jquery/src/var/support.js +5 -0
- data/node_modules/jquery/src/var/toString.js +5 -0
- data/node_modules/jquery/src/wrap.js +79 -0
- data/target/mdarray_sol.jar +0 -0
- data/test/jx/test_complete.rb +35 -0
- data/test/jx/test_js.rb +543 -0
- data/test/jx/test_proxy_array.rb +239 -0
- data/test/jx/test_proxy_hash.rb +160 -0
- data/test/jx/test_proxy_lambda.rb +80 -0
- data/test/jx/test_rb_js_compat.rb +135 -0
- data/test/jx/test_style_sheets.rb +90 -0
- data/test/mdarray/test_mdarray.rb +75 -0
- data/util/cacert.pem +4095 -0
- data/util/download.rb +256 -0
- data/vendor/jxbrowser-6.8.jar +0 -0
- data/vendor/licence.jar +0 -0
- data/version.rb +2 -0
- metadata +817 -0
Binary file
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
##########################################################################################
|
4
|
+
# Copyright © 2013 Rodrigo Botafogo. All Rights Reserved. Permission to use, copy, modify,
|
5
|
+
# and distribute this software and its documentation, without fee and without a signed
|
6
|
+
# licensing agreement, is hereby granted, provided that the above copyright notice, this
|
7
|
+
# paragraph and the following two paragraphs appear in all copies, modifications, and
|
8
|
+
# distributions.
|
9
|
+
#
|
10
|
+
# IN NO EVENT SHALL RODRIGO BOTAFOGO BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
|
11
|
+
# INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF
|
12
|
+
# THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF RODRIGO BOTAFOGO HAS BEEN ADVISED OF THE
|
13
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
14
|
+
#
|
15
|
+
# RODRIGO BOTAFOGO SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
16
|
+
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
|
17
|
+
# SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS".
|
18
|
+
# RODRIGO BOTAFOGO HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
|
19
|
+
# OR MODIFICATIONS.
|
20
|
+
##########################################################################################
|
21
|
+
|
22
|
+
require 'rubygems'
|
23
|
+
require "test/unit"
|
24
|
+
require 'shoulda'
|
25
|
+
|
26
|
+
require '../../config' if @platform == nil
|
27
|
+
require 'mdarray-sol'
|
28
|
+
|
29
|
+
require_relative 'test_js'
|
30
|
+
|
31
|
+
# test proxies
|
32
|
+
require_relative 'test_proxy_array'
|
33
|
+
require_relative 'test_proxy_hash'
|
34
|
+
# require_relative 'test_proxy_lambda'
|
35
|
+
|
data/test/jx/test_js.rb
ADDED
@@ -0,0 +1,543 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
##########################################################################################
|
4
|
+
# Copyright © 2013 Rodrigo Botafogo. All Rights Reserved. Permission to use, copy, modify,
|
5
|
+
# and distribute this software and its documentation, without fee and without a signed
|
6
|
+
# licensing agreement, is hereby granted, provided that the above copyright notice, this
|
7
|
+
# paragraph and the following two paragraphs appear in all copies, modifications, and
|
8
|
+
# distributions.
|
9
|
+
#
|
10
|
+
# IN NO EVENT SHALL RODRIGO BOTAFOGO BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
|
11
|
+
# INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF
|
12
|
+
# THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF RODRIGO BOTAFOGO HAS BEEN ADVISED OF THE
|
13
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
14
|
+
#
|
15
|
+
# RODRIGO BOTAFOGO SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
16
|
+
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
|
17
|
+
# SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS".
|
18
|
+
# RODRIGO BOTAFOGO HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
|
19
|
+
# OR MODIFICATIONS.
|
20
|
+
##########################################################################################
|
21
|
+
|
22
|
+
require 'rubygems'
|
23
|
+
require "test/unit"
|
24
|
+
require 'shoulda'
|
25
|
+
|
26
|
+
require '../../config' if @platform == nil
|
27
|
+
require 'mdarray-sol'
|
28
|
+
|
29
|
+
|
30
|
+
class MDArraySolTest < Test::Unit::TestCase
|
31
|
+
|
32
|
+
context "B environment" do
|
33
|
+
|
34
|
+
#--------------------------------------------------------------------------------------
|
35
|
+
#
|
36
|
+
#--------------------------------------------------------------------------------------
|
37
|
+
|
38
|
+
setup do
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
#--------------------------------------------------------------------------------------
|
44
|
+
#
|
45
|
+
#--------------------------------------------------------------------------------------
|
46
|
+
|
47
|
+
should "interface with numbers" do
|
48
|
+
|
49
|
+
# Evaluate and return numbers
|
50
|
+
assert_equal(1, B.eval("1"))
|
51
|
+
assert_equal(1.345, B.eval("1.345"))
|
52
|
+
assert_equal(10.345, B.eval("10.345"))
|
53
|
+
assert_equal(1234567890987654321, B.eval("1234567890987654321"))
|
54
|
+
|
55
|
+
assert_equal(true, (B.eval("1.35").is_a? Numeric))
|
56
|
+
assert_equal(false, (B.eval("1.35").is_a? Array))
|
57
|
+
|
58
|
+
# Store a number into a javascript object
|
59
|
+
B.num = 1.234
|
60
|
+
assert_equal(1.234, B.num)
|
61
|
+
|
62
|
+
end
|
63
|
+
|
64
|
+
#--------------------------------------------------------------------------------------
|
65
|
+
# A javascript NumberObject will be converted to a Number.
|
66
|
+
#--------------------------------------------------------------------------------------
|
67
|
+
|
68
|
+
should "interface with number objects" do
|
69
|
+
|
70
|
+
B.eval(<<-EOT)
|
71
|
+
var n1 = new Number(2.35)
|
72
|
+
var n2 = new Number(4.567)
|
73
|
+
EOT
|
74
|
+
|
75
|
+
assert_equal(2.35, B.n1)
|
76
|
+
assert_equal(4.567, B.n2)
|
77
|
+
|
78
|
+
assert_equal(true, (B.n2.is_a? Numeric))
|
79
|
+
|
80
|
+
# use the 'new' constructor function on function 'Number', but at the end of all
|
81
|
+
# this we are just setting num to a numeric.
|
82
|
+
num = B.Number.new(2.35)
|
83
|
+
assert_equal(2.35, num)
|
84
|
+
|
85
|
+
# num is a Number variable in the browser.
|
86
|
+
B.num = B.Number.new(5.77345)
|
87
|
+
assert_equal(5.77345, B.num)
|
88
|
+
|
89
|
+
assert_equal(1.3345, B.push(1.3345))
|
90
|
+
|
91
|
+
end
|
92
|
+
|
93
|
+
#--------------------------------------------------------------------------------------
|
94
|
+
#
|
95
|
+
#--------------------------------------------------------------------------------------
|
96
|
+
|
97
|
+
should "interface with boolean" do
|
98
|
+
|
99
|
+
assert_equal(true, B.eval("true"))
|
100
|
+
assert_equal(false, B.eval("false"))
|
101
|
+
assert_equal(true, (B.eval("false").is_a? FalseClass))
|
102
|
+
|
103
|
+
B.logt = true
|
104
|
+
B.logf = false
|
105
|
+
|
106
|
+
assert_equal(true, B.logt)
|
107
|
+
assert_equal(false, B.logf)
|
108
|
+
assert_equal(true, (B.logt.is_a? TrueClass))
|
109
|
+
assert_equal(true, (B.logf.is_a? FalseClass))
|
110
|
+
|
111
|
+
assert_equal(true, B.push(true))
|
112
|
+
assert_equal(false, B.push(false))
|
113
|
+
|
114
|
+
end
|
115
|
+
|
116
|
+
#--------------------------------------------------------------------------------------
|
117
|
+
#
|
118
|
+
#--------------------------------------------------------------------------------------
|
119
|
+
|
120
|
+
should "interface with boolean objects" do
|
121
|
+
|
122
|
+
B.eval(<<-EOT)
|
123
|
+
var t = new Boolean(true)
|
124
|
+
var f = new Boolean(false)
|
125
|
+
EOT
|
126
|
+
|
127
|
+
t = B.pull("t")
|
128
|
+
f = B.pull("f")
|
129
|
+
|
130
|
+
assert_equal(true, t)
|
131
|
+
assert_equal(false, f)
|
132
|
+
|
133
|
+
assert_equal(true, (t.is_a? TrueClass))
|
134
|
+
assert_equal(false, t.nil?)
|
135
|
+
|
136
|
+
assert_equal(true, B.t)
|
137
|
+
assert_equal(false, B.f)
|
138
|
+
|
139
|
+
end
|
140
|
+
|
141
|
+
#--------------------------------------------------------------------------------------
|
142
|
+
#
|
143
|
+
#--------------------------------------------------------------------------------------
|
144
|
+
|
145
|
+
should "interface with strings" do
|
146
|
+
|
147
|
+
B.str = "this is a string"
|
148
|
+
assert_equal("this is a string", B.str)
|
149
|
+
|
150
|
+
assert_equal(true, (B.str.is_a? String))
|
151
|
+
|
152
|
+
# in order to evaluate a string, we need to double quote it, since the first quote
|
153
|
+
# if for the javascript script
|
154
|
+
str2 = B.eval("'this is a string'")
|
155
|
+
assert_equal("this is a string", str2)
|
156
|
+
|
157
|
+
assert_equal("this is a string", B.push("this is a string"))
|
158
|
+
|
159
|
+
end
|
160
|
+
|
161
|
+
#--------------------------------------------------------------------------------------
|
162
|
+
#
|
163
|
+
#--------------------------------------------------------------------------------------
|
164
|
+
|
165
|
+
should "interface with string objects" do
|
166
|
+
|
167
|
+
B.eval(<<-EOT)
|
168
|
+
var str = new String("this is a string")
|
169
|
+
EOT
|
170
|
+
|
171
|
+
assert_equal("this is a string", B.str)
|
172
|
+
assert_equal(true, (B.str.is_a? String))
|
173
|
+
|
174
|
+
# str is a Ruby variable that points to data in the Browser
|
175
|
+
str = B.push("this is a string")
|
176
|
+
assert_equal("this is a string", str)
|
177
|
+
|
178
|
+
# No need to use B.push for the string, since str2 is in the Browser, the string
|
179
|
+
# is automatically converted, just checking that this actually works.
|
180
|
+
B.str2 = B.push("this is also a string")
|
181
|
+
assert_equal("this is also a string", B.str2)
|
182
|
+
|
183
|
+
end
|
184
|
+
|
185
|
+
#--------------------------------------------------------------------------------------
|
186
|
+
#
|
187
|
+
#--------------------------------------------------------------------------------------
|
188
|
+
|
189
|
+
should "interface with functions" do
|
190
|
+
|
191
|
+
# functions f and f2 are defined in the B namespace
|
192
|
+
B.eval(<<-EOT)
|
193
|
+
var f = function sum(x, y) { return x + y; };
|
194
|
+
var f2 = function myFunc() { return 1; }
|
195
|
+
EOT
|
196
|
+
|
197
|
+
# pulling function 'f' from the B namespace to the Ruby namespace
|
198
|
+
f = B.pull("f")
|
199
|
+
|
200
|
+
# To call a javascript function we need to call 'send' on the method with
|
201
|
+
# the necessary parameters
|
202
|
+
assert_equal(5, f.send(2, 3))
|
203
|
+
|
204
|
+
# Access function through '.' Functions f and f2 are defined in the B namespace
|
205
|
+
assert_equal(true, B.f2.function?)
|
206
|
+
assert_equal(17, B.f(8, 9))
|
207
|
+
|
208
|
+
# In order to call a function with no arguments in javascript we need to either
|
209
|
+
# use the send method or call with nil as argument
|
210
|
+
assert_equal(1, B.f2(nil))
|
211
|
+
|
212
|
+
# Instead of using send, we can also use '[]' to call a javascript function.
|
213
|
+
# This looks more like a function call
|
214
|
+
assert_equal(1, B.f2[])
|
215
|
+
|
216
|
+
# Define a function f3 in javascript. This is equivalent to the above
|
217
|
+
# B.eval...
|
218
|
+
B.f3 = B.function(<<-EOF)
|
219
|
+
add(x, y) { return x + y; }
|
220
|
+
EOF
|
221
|
+
|
222
|
+
# use standard notation for method call in the B namespace
|
223
|
+
assert_equal(9, B.f3(4, 5))
|
224
|
+
# or use '[]'
|
225
|
+
assert_equal(9, B.f[4, 5])
|
226
|
+
|
227
|
+
# We can also create a javascript function with the notation bellow. In
|
228
|
+
# this case the function f4 lives in the Ruby namespace.
|
229
|
+
f4 = B.function("(x, y) { return x + y; }")
|
230
|
+
assert_equal(9, f4.send(4, 5))
|
231
|
+
assert_equal(9, f4[4, 5])
|
232
|
+
|
233
|
+
# in the Ruby namespace, standard '()' function call does not work
|
234
|
+
assert_raise (NoMethodError) { f4(4,5) }
|
235
|
+
|
236
|
+
# Just making sure that the creation of a new method does not affect
|
237
|
+
# the previous one.
|
238
|
+
f5 = B.function("(x, y) { return x - y; }")
|
239
|
+
assert_equal(1, f5[5, 4])
|
240
|
+
assert_equal(9, f4[5, 4])
|
241
|
+
|
242
|
+
# Javascript function that receives a JSObject as argument
|
243
|
+
f6 = B.function(<<-EOT)
|
244
|
+
(x) { text = ""
|
245
|
+
for (i = 0; i < x.length; i++) {
|
246
|
+
text += x[i];
|
247
|
+
}
|
248
|
+
return text
|
249
|
+
}
|
250
|
+
EOT
|
251
|
+
|
252
|
+
# add variable 'a' into the B namespace
|
253
|
+
# B.dup(:a, [1, 2, 3])
|
254
|
+
B.a = B.dup([1, 2, 3])
|
255
|
+
|
256
|
+
# call function f6 passign a JSObject
|
257
|
+
assert_equal("123", f6[B.a])
|
258
|
+
|
259
|
+
# use the B.dup function to duplicate a Ruby array to javascript
|
260
|
+
assert_equal("123", f6[B.dup([1, 2, 3])])
|
261
|
+
|
262
|
+
end
|
263
|
+
|
264
|
+
#--------------------------------------------------------------------------------------
|
265
|
+
#
|
266
|
+
#--------------------------------------------------------------------------------------
|
267
|
+
|
268
|
+
should "interface with js arrays" do
|
269
|
+
|
270
|
+
# cars is a js array
|
271
|
+
B.eval(<<-EOT)
|
272
|
+
var cars = ["Saab", "Volvo", "BMW"];
|
273
|
+
EOT
|
274
|
+
|
275
|
+
js_array = B.pull("cars")
|
276
|
+
assert_equal("Saab", js_array.get(0))
|
277
|
+
assert_equal("Volvo", js_array.get(1))
|
278
|
+
assert_equal("BMW", js_array.get(2))
|
279
|
+
|
280
|
+
a2 = B.cars
|
281
|
+
assert_equal("Saab", a2.get(0))
|
282
|
+
assert_equal("Volvo", a2.get(1))
|
283
|
+
assert_equal("BMW", a2.get(2))
|
284
|
+
|
285
|
+
assert_equal("Saab", a2[0])
|
286
|
+
assert_equal("Volvo", a2[1])
|
287
|
+
assert_equal("BMW", a2[2])
|
288
|
+
|
289
|
+
end
|
290
|
+
|
291
|
+
#--------------------------------------------------------------------------------------
|
292
|
+
#
|
293
|
+
#--------------------------------------------------------------------------------------
|
294
|
+
|
295
|
+
should "access javascript objects" do
|
296
|
+
|
297
|
+
B.eval(<<-EOF)
|
298
|
+
var car = {
|
299
|
+
type: "Fiat",
|
300
|
+
model: 500,
|
301
|
+
color: "white",
|
302
|
+
sold: true,
|
303
|
+
info: [1, 2, 3, 4],
|
304
|
+
print: function(a, b) {return this.type + a + b;},
|
305
|
+
no_args: function() {return "no args given";}
|
306
|
+
}
|
307
|
+
|
308
|
+
var out = {
|
309
|
+
data: car
|
310
|
+
}
|
311
|
+
|
312
|
+
EOF
|
313
|
+
|
314
|
+
rcar = B.pull("car")
|
315
|
+
|
316
|
+
assert_equal("Fiat", rcar.type)
|
317
|
+
assert_equal(500, rcar.model)
|
318
|
+
assert_equal("white", rcar.color)
|
319
|
+
assert_equal(true, rcar.sold)
|
320
|
+
|
321
|
+
# check the type of the object by calling B.typeof
|
322
|
+
assert_equal("object", B.typeof(rcar))
|
323
|
+
assert_equal(true, (rcar.type.is_a? String))
|
324
|
+
assert_equal(true, (rcar.model.is_a? Numeric))
|
325
|
+
assert_equal(true, (rcar.sold.is_a? TrueClass))
|
326
|
+
assert_equal("function", B.typeof(rcar.print))
|
327
|
+
|
328
|
+
# check the type of the object directly
|
329
|
+
assert_equal("object", rcar.typeof)
|
330
|
+
assert_equal("function", rcar.print.typeof)
|
331
|
+
|
332
|
+
# call function on a native javascript object
|
333
|
+
assert_equal(4, rcar.info.length)
|
334
|
+
|
335
|
+
# call the print function by passing parameters to it
|
336
|
+
assert_equal("Fiat_500", rcar.print("_", "500"))
|
337
|
+
|
338
|
+
# Get the print function. Change this so that rcar.print and rcar.print()
|
339
|
+
# will both execute the fucntion and rcar.print(nil) returns the
|
340
|
+
# function. The latter case is less commom than the former.
|
341
|
+
p_f = rcar.print
|
342
|
+
|
343
|
+
# Execute the p_f function. It should still be in the proper scope, i.e,
|
344
|
+
# this still executes in the scope of object 'car', so 'type' should be
|
345
|
+
# Fiat
|
346
|
+
assert_equal("Fiat_500", p_f["_", "500"])
|
347
|
+
|
348
|
+
# note that to call a method with no arguments
|
349
|
+
assert_equal("no args given", rcar.no_args(nil))
|
350
|
+
|
351
|
+
# access a deep structure
|
352
|
+
assert_equal("Fiat", B.out.data.type)
|
353
|
+
assert_equal("Fiat_500", B.out.data.print("_", "500"))
|
354
|
+
|
355
|
+
end
|
356
|
+
|
357
|
+
#--------------------------------------------------------------------------------------
|
358
|
+
#
|
359
|
+
#--------------------------------------------------------------------------------------
|
360
|
+
|
361
|
+
should "allow the use of javascript constructors" do
|
362
|
+
|
363
|
+
Const = B.function(<<-EOT)
|
364
|
+
(x, y) {
|
365
|
+
this.number = new Number(x);
|
366
|
+
this.value = y;
|
367
|
+
this.str = arguments[2];
|
368
|
+
}
|
369
|
+
EOT
|
370
|
+
|
371
|
+
const = Const.new(2, 3, "Hello Constructor")
|
372
|
+
|
373
|
+
assert_equal(2, const.number)
|
374
|
+
assert_equal(3, const.value)
|
375
|
+
assert_equal("Hello Constructor", const.str)
|
376
|
+
|
377
|
+
end
|
378
|
+
|
379
|
+
#--------------------------------------------------------------------------------------
|
380
|
+
#
|
381
|
+
#--------------------------------------------------------------------------------------
|
382
|
+
|
383
|
+
should "properly return instanceof" do
|
384
|
+
|
385
|
+
# The instanceof operator tests presence of constructor.prototype in object's
|
386
|
+
# prototype chain.
|
387
|
+
|
388
|
+
# We are using here the javascript convention of writing constructor functions
|
389
|
+
# with a capital letter. In Ruby, this indicates a constant, which is not the
|
390
|
+
# case here...
|
391
|
+
# Defining constructors in the Browser
|
392
|
+
C = B.function("(){}")
|
393
|
+
D = B.function("(){}")
|
394
|
+
|
395
|
+
# ...; however, this looks like a new class creation in Ruby and it is
|
396
|
+
# actually creating a new javascript object from the C function.
|
397
|
+
o = C.new
|
398
|
+
# true, because: Object.getPrototypeOf(o) === C.prototype
|
399
|
+
assert_equal(true, o.instanceof(C))
|
400
|
+
|
401
|
+
# false, since D.prototype is not in the prototype chain of 'o'
|
402
|
+
assert_equal(false, o.instanceof(D))
|
403
|
+
|
404
|
+
# 'o' is an instance of a JSObject
|
405
|
+
assert_equal(true, o.instanceof(B.Object))
|
406
|
+
|
407
|
+
# C.prototype is also an instance of a JSObject
|
408
|
+
assert_equal(true, C.prototype.instanceof(B.Object))
|
409
|
+
|
410
|
+
C.prototype = B.dup({})
|
411
|
+
o2 = C.new
|
412
|
+
|
413
|
+
assert_equal(true, o2.instanceof(C))
|
414
|
+
|
415
|
+
# false, because C.prototype is nowhere in o's prototype chain anymore
|
416
|
+
assert_equal(false, o.instanceof(C))
|
417
|
+
|
418
|
+
# use inheritance
|
419
|
+
D.prototype = C.new
|
420
|
+
o3 = D.new
|
421
|
+
assert_equal(true, o3.instanceof(D))
|
422
|
+
assert_equal(true, o3.instanceof(C))
|
423
|
+
|
424
|
+
# simpleStr = B.eval("This is a simple string")
|
425
|
+
myString = B.String.new
|
426
|
+
newStr = B.String.new("String created with constructor")
|
427
|
+
myDate = B.Date.new;
|
428
|
+
# myObj = {}.jsdup
|
429
|
+
# p myObj
|
430
|
+
|
431
|
+
# returns false, checks the prototype chain, finds undefined
|
432
|
+
# p simpleStr.instanceof(B.String).v
|
433
|
+
# returns true, despite an undefined prototype
|
434
|
+
# p myObj.instanceof(B.Object).v
|
435
|
+
assert_equal(true, myDate.instanceof(B.Date))
|
436
|
+
assert_equal(true, myDate.instanceof(B.Object))
|
437
|
+
assert_equal(false, myDate.instanceof(B.String))
|
438
|
+
|
439
|
+
# ({}) instanceof Object; // returns true, same case as above
|
440
|
+
end
|
441
|
+
|
442
|
+
#--------------------------------------------------------------------------------------
|
443
|
+
#
|
444
|
+
#--------------------------------------------------------------------------------------
|
445
|
+
|
446
|
+
should "add data to a javascript object" do
|
447
|
+
|
448
|
+
B.eval(<<-EOT)
|
449
|
+
var car = {}
|
450
|
+
EOT
|
451
|
+
|
452
|
+
rcar = B.pull("car")
|
453
|
+
rcar.type = "VW"
|
454
|
+
assert_equal("VW", rcar.type)
|
455
|
+
|
456
|
+
end
|
457
|
+
|
458
|
+
#--------------------------------------------------------------------------------------
|
459
|
+
#
|
460
|
+
#--------------------------------------------------------------------------------------
|
461
|
+
|
462
|
+
should "copy Ruby objects to javascript" do
|
463
|
+
|
464
|
+
# Create a Ruby Array
|
465
|
+
cars = ["Saab", "Volvo", "BMW"]
|
466
|
+
|
467
|
+
# Duplicate (copy) the Ruby Array as a javascript array
|
468
|
+
# B.dup(:cars, cars)
|
469
|
+
B.cars = B.dup(cars)
|
470
|
+
|
471
|
+
assert_equal("Saab", B.cars[0])
|
472
|
+
assert_equal("Volvo", B.cars[1])
|
473
|
+
assert_equal("BMW", B.cars[2])
|
474
|
+
|
475
|
+
# A more complex array
|
476
|
+
data = [
|
477
|
+
{date: "2011-11-14T16:17:54Z", quantity: 2, total: 190, tip: 100, type: "tab"},
|
478
|
+
{date: "2011-11-14T16:20:19Z", quantity: 2, total: 190, tip: 100, type: "tab"},
|
479
|
+
{date: "2011-11-14T16:28:54Z", quantity: 1, total: 300, tip: 200, type: "visa"},
|
480
|
+
{date: "2011-11-14T16:30:43Z", quantity: 2, total: 90, tip: 0, type: "tab"},
|
481
|
+
{date: "2011-11-14T16:48:46Z", quantity: 2, total: 90, tip: 0, type: "tab"},
|
482
|
+
{date: "2011-11-14T16:53:41Z", quantity: 2, total: 90, tip: 0, type: "tab"},
|
483
|
+
{date: "2011-11-14T16:54:06Z", quantity: 1, total: 100, tip: 0, type: "cash"},
|
484
|
+
{date: "2011-11-14T16:58:03Z", quantity: 2, total: 90, tip: 0, type: "tab"},
|
485
|
+
{date: "2011-11-14T17:07:21Z", quantity: 2, total: 90, tip: 0, type: "tab"},
|
486
|
+
{date: "2011-11-14T17:22:59Z", quantity: 2, total: 90, tip: 0, type: "tab"},
|
487
|
+
{date: "2011-11-14T17:25:45Z", quantity: 2, total: 200, tip: 0, type: "cash"},
|
488
|
+
{date: "2011-11-14T17:29:52Z", quantity: 1, total: 200, tip: 100, type: "visa"}
|
489
|
+
]
|
490
|
+
|
491
|
+
# Copy the data array to "data" element in javascript
|
492
|
+
# B.dup(:data, data)
|
493
|
+
B.data = B.dup(data)
|
494
|
+
|
495
|
+
assert_equal("2011-11-14T16:17:54Z", B.data[0].date)
|
496
|
+
assert_equal(1, B.data[2].quantity)
|
497
|
+
assert_equal(0, B.data[4].tip)
|
498
|
+
|
499
|
+
end
|
500
|
+
|
501
|
+
#--------------------------------------------------------------------------------------
|
502
|
+
#
|
503
|
+
#--------------------------------------------------------------------------------------
|
504
|
+
|
505
|
+
should "Create javascript objects from a Ruby hash" do
|
506
|
+
|
507
|
+
car = {
|
508
|
+
type: "Fiat",
|
509
|
+
model: 500,
|
510
|
+
color: "white",
|
511
|
+
sold: true,
|
512
|
+
info: [1, 2, 3, 4]
|
513
|
+
}
|
514
|
+
|
515
|
+
# B.dup(:jscar, car)
|
516
|
+
B.jscar = B.dup(car)
|
517
|
+
jscar = B.jscar
|
518
|
+
|
519
|
+
# Add a function to the jscar object. Functions cannot be create in the
|
520
|
+
# ruby hash above.
|
521
|
+
jscar.print =
|
522
|
+
B.function(<<-EOT)
|
523
|
+
(x, y) { return x + y; }
|
524
|
+
EOT
|
525
|
+
|
526
|
+
assert_equal("Fiat", jscar.type)
|
527
|
+
assert_equal(500, jscar.model)
|
528
|
+
assert_equal("white", jscar.color)
|
529
|
+
assert_equal(true, jscar.sold)
|
530
|
+
assert_equal(1, jscar.info[0])
|
531
|
+
assert_equal(8, jscar.print(3, 5))
|
532
|
+
assert_equal(8, jscar.print[3, 5])
|
533
|
+
|
534
|
+
# Call the method in two steps: first get the method then call the method
|
535
|
+
# passing the arguments
|
536
|
+
f = jscar.print
|
537
|
+
assert_equal(8, f[3, 5])
|
538
|
+
|
539
|
+
end
|
540
|
+
|
541
|
+
end
|
542
|
+
|
543
|
+
end
|