bum 0.0.4 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/README +0 -12
- data/bin/bum +16 -49
- data/bin/bum_master +20 -0
- data/lib/actor.rb +0 -0
- data/lib/app_role.rb +83 -0
- data/lib/client.rb +104 -0
- data/lib/db_crap.rb +85 -0
- data/lib/db_role.rb +107 -0
- data/lib/demo_socket.rb +51 -0
- data/lib/master.rb +109 -0
- data/lib/master_web.rb +81 -0
- data/lib/nice_socket.rb +77 -0
- data/lib/node.rb +96 -0
- data/lib/proxy_role.rb +132 -0
- data/lib/role.rb +99 -0
- data/lib/scenario.rb +186 -0
- data/lib/server.rb +30 -0
- data/lib/stats_role.rb +89 -0
- data/public/app.css +91 -0
- data/public/css/light.css +105 -0
- data/public/d3/LICENSE +26 -0
- data/public/d3/Makefile +247 -0
- data/public/d3/README.md +51 -0
- data/public/d3/d3.chart.js +984 -0
- data/public/d3/d3.chart.min.js +1 -0
- data/public/d3/d3.csv.js +92 -0
- data/public/d3/d3.csv.min.js +1 -0
- data/public/d3/d3.geo.js +692 -0
- data/public/d3/d3.geo.min.js +1 -0
- data/public/d3/d3.geom.js +825 -0
- data/public/d3/d3.geom.min.js +1 -0
- data/public/d3/d3.js +4013 -0
- data/public/d3/d3.layout.js +1865 -0
- data/public/d3/d3.layout.min.js +1 -0
- data/public/d3/d3.min.js +2 -0
- data/public/d3/d3.time.js +663 -0
- data/public/d3/d3.time.min.js +1 -0
- data/public/d3/examples/albers/albers.html +168 -0
- data/public/d3/examples/area/area-radial.html +48 -0
- data/public/d3/examples/area/area.html +113 -0
- data/public/d3/examples/axis/axis-alternating.html +50 -0
- data/public/d3/examples/axis/axis-ggplot2.html +68 -0
- data/public/d3/examples/axis/axis-multiples.html +117 -0
- data/public/d3/examples/axis/axis-orientations.html +63 -0
- data/public/d3/examples/axis/axis-transition.html +153 -0
- data/public/d3/examples/azimuthal/azimuthal.css +21 -0
- data/public/d3/examples/azimuthal/azimuthal.html +84 -0
- data/public/d3/examples/azimuthal/azimuthal.js +27 -0
- data/public/d3/examples/bar/bar.html +93 -0
- data/public/d3/examples/box/box.css +4 -0
- data/public/d3/examples/box/box.html +19 -0
- data/public/d3/examples/box/box.js +68 -0
- data/public/d3/examples/bubble/bubble.css +8 -0
- data/public/d3/examples/bubble/bubble.html +14 -0
- data/public/d3/examples/bubble/bubble.js +46 -0
- data/public/d3/examples/bullet/bullet.css +10 -0
- data/public/d3/examples/bullet/bullet.html +18 -0
- data/public/d3/examples/bullet/bullet.js +53 -0
- data/public/d3/examples/bullet/bullets.json +7 -0
- data/public/d3/examples/bundle/bundle-radial.css +9 -0
- data/public/d3/examples/bundle/bundle-radial.html +15 -0
- data/public/d3/examples/bundle/bundle-radial.js +50 -0
- data/public/d3/examples/bundle/bundle-treemap.css +14 -0
- data/public/d3/examples/bundle/bundle-treemap.html +16 -0
- data/public/d3/examples/bundle/bundle-treemap.js +53 -0
- data/public/d3/examples/bundle/packages.js +49 -0
- data/public/d3/examples/button.css +35 -0
- data/public/d3/examples/calendar/calendar.css +16 -0
- data/public/d3/examples/calendar/calendar.js +50 -0
- data/public/d3/examples/calendar/dji.csv +5233 -0
- data/public/d3/examples/calendar/dji.html +16 -0
- data/public/d3/examples/calendar/dji.js +61 -0
- data/public/d3/examples/calendar/vix.csv +5231 -0
- data/public/d3/examples/calendar/vix.html +16 -0
- data/public/d3/examples/calendar/vix.js +60 -0
- data/public/d3/examples/cartogram/cartogram.css +20 -0
- data/public/d3/examples/cartogram/cartogram.html +15 -0
- data/public/d3/examples/cartogram/cartogram.js +51 -0
- data/public/d3/examples/cartogram/demers.css +9 -0
- data/public/d3/examples/cartogram/demers.html +16 -0
- data/public/d3/examples/cartogram/demers.js +79 -0
- data/public/d3/examples/cartogram/dorling.css +9 -0
- data/public/d3/examples/cartogram/dorling.html +16 -0
- data/public/d3/examples/cartogram/dorling.js +80 -0
- data/public/d3/examples/chord/chord-flare.html +109 -0
- data/public/d3/examples/chord/chord.css +9 -0
- data/public/d3/examples/chord/chord.html +14 -0
- data/public/d3/examples/chord/chord.js +98 -0
- data/public/d3/examples/choropleth/choropleth-area.html +51 -0
- data/public/d3/examples/choropleth/choropleth-bounds.html +46 -0
- data/public/d3/examples/choropleth/choropleth.css +16 -0
- data/public/d3/examples/choropleth/choropleth.html +15 -0
- data/public/d3/examples/choropleth/choropleth.js +38 -0
- data/public/d3/examples/choropleth/unemployment.json +1 -0
- data/public/d3/examples/clock/clock.css +23 -0
- data/public/d3/examples/clock/clock.html +17 -0
- data/public/d3/examples/clock/clock.js +87 -0
- data/public/d3/examples/cluster/cluster-radial.html +14 -0
- data/public/d3/examples/cluster/cluster-radial.js +39 -0
- data/public/d3/examples/cluster/cluster.css +15 -0
- data/public/d3/examples/cluster/cluster.html +14 -0
- data/public/d3/examples/cluster/cluster.js +39 -0
- data/public/d3/examples/contour/contour.html +108 -0
- data/public/d3/examples/crimea/crimea-stacked-area.html +109 -0
- data/public/d3/examples/crimea/crimea-stacked-bar.html +98 -0
- data/public/d3/examples/crimea/crimea.csv +24 -0
- data/public/d3/examples/data/README +5 -0
- data/public/d3/examples/data/faithful.json +8 -0
- data/public/d3/examples/data/flare-imports.json +222 -0
- data/public/d3/examples/data/flare.json +380 -0
- data/public/d3/examples/data/morley.csv +101 -0
- data/public/d3/examples/data/sample.csv +2 -0
- data/public/d3/examples/data/sample.html +5 -0
- data/public/d3/examples/data/sample.json +1 -0
- data/public/d3/examples/data/sample.txt +1 -0
- data/public/d3/examples/data/sample.xml +4 -0
- data/public/d3/examples/data/stocks.csv +807 -0
- data/public/d3/examples/data/unemployment.csv +1709 -0
- data/public/d3/examples/data/us-borders.json +1 -0
- data/public/d3/examples/data/us-counties.json +3216 -0
- data/public/d3/examples/data/us-state-centroids.json +1 -0
- data/public/d3/examples/data/us-states.json +54 -0
- data/public/d3/examples/data/world-countries.json +246 -0
- data/public/d3/examples/delaunay/delaunay.html +44 -0
- data/public/d3/examples/donut/donut.html +124 -0
- data/public/d3/examples/dot/dot.html +103 -0
- data/public/d3/examples/force/README +10 -0
- data/public/d3/examples/force/force-bounds.html +70 -0
- data/public/d3/examples/force/force-cluster.html +251 -0
- data/public/d3/examples/force/force-dynamic.html +118 -0
- data/public/d3/examples/force/force-interactive.html +136 -0
- data/public/d3/examples/force/force-map.html +104 -0
- data/public/d3/examples/force/force-multi-foci.html +68 -0
- data/public/d3/examples/force/force.css +9 -0
- data/public/d3/examples/force/force.html +14 -0
- data/public/d3/examples/force/force.js +56 -0
- data/public/d3/examples/force/miserables.json +1 -0
- data/public/d3/examples/hello-world/hello-data-key.html +60 -0
- data/public/d3/examples/hello-world/hello-data-nested-key.html +75 -0
- data/public/d3/examples/hello-world/hello-data-nested.html +77 -0
- data/public/d3/examples/hello-world/hello-data.html +46 -0
- data/public/d3/examples/hello-world/hello-event.html +53 -0
- data/public/d3/examples/hello-world/hello-node-key.html +25 -0
- data/public/d3/examples/hello-world/hello-sort.html +75 -0
- data/public/d3/examples/hello-world/hello-transform.html +41 -0
- data/public/d3/examples/hello-world/hello-transition-undefined.html +43 -0
- data/public/d3/examples/hello-world/hello-transition.html +47 -0
- data/public/d3/examples/hello-world/hello-webkit-transition.html +64 -0
- data/public/d3/examples/hello-world/select-enter-add.html +29 -0
- data/public/d3/examples/hello-world/selectAll-enter-add.html +20 -0
- data/public/d3/examples/histogram/histogram.html +80 -0
- data/public/d3/examples/horizon/horizon.css +9 -0
- data/public/d3/examples/horizon/horizon.html +25 -0
- data/public/d3/examples/horizon/horizon.js +43 -0
- data/public/d3/examples/horizon/unemployment.json +1 -0
- data/public/d3/examples/hull/hull.html +75 -0
- data/public/d3/examples/kde/kde.css +9 -0
- data/public/d3/examples/kde/kde.html +14 -0
- data/public/d3/examples/kde/kde.js +40 -0
- data/public/d3/examples/line/line.css +22 -0
- data/public/d3/examples/line/line.html +11 -0
- data/public/d3/examples/line/line.js +63 -0
- data/public/d3/examples/marimekko/marimekko.html +116 -0
- data/public/d3/examples/marimekko/marimekko.json +18 -0
- data/public/d3/examples/marker/marker.html +169 -0
- data/public/d3/examples/mercator/mercator.html +133 -0
- data/public/d3/examples/moire/moire.html +53 -0
- data/public/d3/examples/pack/pack.css +15 -0
- data/public/d3/examples/pack/pack.html +14 -0
- data/public/d3/examples/pack/pack.js +33 -0
- data/public/d3/examples/partition/partition-icicle-zoom.html +59 -0
- data/public/d3/examples/partition/partition-icicle.html +45 -0
- data/public/d3/examples/partition/partition-sunburst-zoom.html +72 -0
- data/public/d3/examples/partition/partition-sunburst.html +21 -0
- data/public/d3/examples/partition/partition-sunburst.js +72 -0
- data/public/d3/examples/pie/pie-transition.html +70 -0
- data/public/d3/examples/pie/pie.html +51 -0
- data/public/d3/examples/population/population.css +28 -0
- data/public/d3/examples/population/population.csv +571 -0
- data/public/d3/examples/population/population.html +13 -0
- data/public/d3/examples/population/population.js +126 -0
- data/public/d3/examples/qq/qq.css +18 -0
- data/public/d3/examples/qq/qq.html +21 -0
- data/public/d3/examples/qq/qq.js +66 -0
- data/public/d3/examples/qq/stats.js +28 -0
- data/public/d3/examples/qq/turkers.json +1 -0
- data/public/d3/examples/quadtree/quadtree.html +114 -0
- data/public/d3/examples/sizzle/sizzle.html +27 -0
- data/public/d3/examples/sort/sort.css +4 -0
- data/public/d3/examples/sort/sort.html +12 -0
- data/public/d3/examples/sort/sort.js +112 -0
- data/public/d3/examples/spline/spline.css +30 -0
- data/public/d3/examples/spline/spline.html +14 -0
- data/public/d3/examples/spline/spline.js +113 -0
- data/public/d3/examples/splom/cross.js +7 -0
- data/public/d3/examples/splom/flowers.json +1 -0
- data/public/d3/examples/splom/splom.css +8 -0
- data/public/d3/examples/splom/splom.html +14 -0
- data/public/d3/examples/splom/splom.js +149 -0
- data/public/d3/examples/stream/stack.css +7 -0
- data/public/d3/examples/stream/stack.html +22 -0
- data/public/d3/examples/stream/stack.js +119 -0
- data/public/d3/examples/stream/stream.css +3 -0
- data/public/d3/examples/stream/stream.html +19 -0
- data/public/d3/examples/stream/stream.js +42 -0
- data/public/d3/examples/stream/stream_layers.js +33 -0
- data/public/d3/examples/superformula/dot.html +104 -0
- data/public/d3/examples/superformula/explorer.html +120 -0
- data/public/d3/examples/superformula/superformula.html +70 -0
- data/public/d3/examples/superformula/superformula.js +98 -0
- data/public/d3/examples/symbol-map/symbol-map.html +67 -0
- data/public/d3/examples/touch/touch.html +65 -0
- data/public/d3/examples/tree/tree-dynamic.html +111 -0
- data/public/d3/examples/tree/tree-interactive.html +139 -0
- data/public/d3/examples/tree/tree-radial.html +14 -0
- data/public/d3/examples/tree/tree-radial.js +40 -0
- data/public/d3/examples/tree/tree.css +15 -0
- data/public/d3/examples/tree/tree.html +14 -0
- data/public/d3/examples/tree/tree.js +39 -0
- data/public/d3/examples/treemap/treemap-svg.html +22 -0
- data/public/d3/examples/treemap/treemap-svg.js +34 -0
- data/public/d3/examples/treemap/treemap.css +8 -0
- data/public/d3/examples/treemap/treemap.html +22 -0
- data/public/d3/examples/treemap/treemap.js +53 -0
- data/public/d3/examples/voroboids/boid.js +235 -0
- data/public/d3/examples/voroboids/voroboids.css +15 -0
- data/public/d3/examples/voroboids/voroboids.html +14 -0
- data/public/d3/examples/voroboids/voroboids.js +65 -0
- data/public/d3/examples/voronoi/voronoi.css +16 -0
- data/public/d3/examples/voronoi/voronoi.html +15 -0
- data/public/d3/examples/voronoi/voronoi.js +34 -0
- data/public/d3/examples/zoom-pan/zoom-pan-transform.html +95 -0
- data/public/d3/examples/zoom-pan/zoom-pan.html +119 -0
- data/public/d3/examples/zoom/dji.csv +5233 -0
- data/public/d3/examples/zoom/zoom.html +162 -0
- data/public/d3/lib/colorbrewer/LICENSE +38 -0
- data/public/d3/lib/colorbrewer/colorbrewer.css +1327 -0
- data/public/d3/lib/colorbrewer/colorbrewer.js +32 -0
- data/public/d3/lib/jit/LICENSE +27 -0
- data/public/d3/lib/jquery-ui/LICENSE +25 -0
- data/public/d3/lib/jquery-ui/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/public/d3/lib/jquery-ui/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/public/d3/lib/jquery-ui/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/public/d3/lib/jquery-ui/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/public/d3/lib/jquery-ui/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/public/d3/lib/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/d3/lib/jquery-ui/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/public/d3/lib/jquery-ui/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/public/d3/lib/jquery-ui/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/public/d3/lib/jquery-ui/images/ui-icons_222222_256x240.png +0 -0
- data/public/d3/lib/jquery-ui/images/ui-icons_228ef1_256x240.png +0 -0
- data/public/d3/lib/jquery-ui/images/ui-icons_ef8c08_256x240.png +0 -0
- data/public/d3/lib/jquery-ui/images/ui-icons_ffd27a_256x240.png +0 -0
- data/public/d3/lib/jquery-ui/images/ui-icons_ffffff_256x240.png +0 -0
- data/public/d3/lib/jquery-ui/jquery-ui.css +318 -0
- data/public/d3/lib/jquery-ui/jquery-ui.min.js +83 -0
- data/public/d3/lib/jquery/LICENSE +20 -0
- data/public/d3/lib/jquery/jquery.js +6883 -0
- data/public/d3/lib/jquery/jquery.min.js +166 -0
- data/public/d3/lib/polymaps/LICENSE +28 -0
- data/public/d3/lib/protovis/LICENSE +27 -0
- data/public/d3/lib/science/LICENSE +26 -0
- data/public/d3/lib/science/science.js +5 -0
- data/public/d3/lib/science/science.min.js +1 -0
- data/public/d3/lib/science/science.stats.js +166 -0
- data/public/d3/lib/science/science.stats.min.js +1 -0
- data/public/d3/lib/sizzle/LICENSE +24 -0
- data/public/d3/lib/sizzle/sizzle.js +1376 -0
- data/public/d3/lib/sizzle/sizzle.min.js +28 -0
- data/public/d3/package.json +14 -0
- data/public/d3/src/behavior/behavior.js +1 -0
- data/public/d3/src/behavior/drag.js +106 -0
- data/public/d3/src/behavior/zoom.js +212 -0
- data/public/d3/src/chart/box.js +297 -0
- data/public/d3/src/chart/bullet.js +237 -0
- data/public/d3/src/chart/chart.js +1 -0
- data/public/d3/src/chart/horizon.js +203 -0
- data/public/d3/src/chart/qq.js +245 -0
- data/public/d3/src/compat/date.js +3 -0
- data/public/d3/src/compat/style.js +9 -0
- data/public/d3/src/core/array.js +11 -0
- data/public/d3/src/core/ascending.js +3 -0
- data/public/d3/src/core/bisect.js +38 -0
- data/public/d3/src/core/collapse.js +3 -0
- data/public/d3/src/core/core.js +1 -0
- data/public/d3/src/core/descending.js +3 -0
- data/public/d3/src/core/dispatch.js +45 -0
- data/public/d3/src/core/ease.js +128 -0
- data/public/d3/src/core/entries.js +5 -0
- data/public/d3/src/core/event.js +1 -0
- data/public/d3/src/core/first.js +13 -0
- data/public/d3/src/core/format.js +85 -0
- data/public/d3/src/core/functor.js +3 -0
- data/public/d3/src/core/hsl.js +62 -0
- data/public/d3/src/core/html.js +10 -0
- data/public/d3/src/core/interpolate.js +180 -0
- data/public/d3/src/core/json.js +5 -0
- data/public/d3/src/core/keys.js +5 -0
- data/public/d3/src/core/last.js +13 -0
- data/public/d3/src/core/max.js +14 -0
- data/public/d3/src/core/merge.js +3 -0
- data/public/d3/src/core/min.js +14 -0
- data/public/d3/src/core/nest.js +87 -0
- data/public/d3/src/core/noop.js +1 -0
- data/public/d3/src/core/ns.js +19 -0
- data/public/d3/src/core/permute.js +7 -0
- data/public/d3/src/core/quantile.js +8 -0
- data/public/d3/src/core/range.js +21 -0
- data/public/d3/src/core/rebind.js +7 -0
- data/public/d3/src/core/requote.js +5 -0
- data/public/d3/src/core/rgb.js +284 -0
- data/public/d3/src/core/round.js +5 -0
- data/public/d3/src/core/selection-append.js +15 -0
- data/public/d3/src/core/selection-attr.js +44 -0
- data/public/d3/src/core/selection-call.js +13 -0
- data/public/d3/src/core/selection-classed.js +46 -0
- data/public/d3/src/core/selection-data.js +110 -0
- data/public/d3/src/core/selection-each.js +9 -0
- data/public/d3/src/core/selection-empty.js +3 -0
- data/public/d3/src/core/selection-enter-select.js +24 -0
- data/public/d3/src/core/selection-enter.js +10 -0
- data/public/d3/src/core/selection-filter.js +19 -0
- data/public/d3/src/core/selection-html.js +6 -0
- data/public/d3/src/core/selection-insert.js +20 -0
- data/public/d3/src/core/selection-map.js +5 -0
- data/public/d3/src/core/selection-node.js +9 -0
- data/public/d3/src/core/selection-on.js +34 -0
- data/public/d3/src/core/selection-property.js +23 -0
- data/public/d3/src/core/selection-remove.js +9 -0
- data/public/d3/src/core/selection-root.js +16 -0
- data/public/d3/src/core/selection-select.js +30 -0
- data/public/d3/src/core/selection-selectAll.js +24 -0
- data/public/d3/src/core/selection-sort.js +20 -0
- data/public/d3/src/core/selection-style.js +26 -0
- data/public/d3/src/core/selection-text.js +6 -0
- data/public/d3/src/core/selection-transition.js +14 -0
- data/public/d3/src/core/selection.js +21 -0
- data/public/d3/src/core/split.js +21 -0
- data/public/d3/src/core/sum.js +14 -0
- data/public/d3/src/core/text.js +10 -0
- data/public/d3/src/core/this.js +3 -0
- data/public/d3/src/core/timer.js +104 -0
- data/public/d3/src/core/transition-attr.js +23 -0
- data/public/d3/src/core/transition-delay.js +6 -0
- data/public/d3/src/core/transition-duration.js +6 -0
- data/public/d3/src/core/transition-each.js +9 -0
- data/public/d3/src/core/transition-remove.js +6 -0
- data/public/d3/src/core/transition-select.js +22 -0
- data/public/d3/src/core/transition-selectAll.js +20 -0
- data/public/d3/src/core/transition-style.js +14 -0
- data/public/d3/src/core/transition-text.js +7 -0
- data/public/d3/src/core/transition-transition.js +3 -0
- data/public/d3/src/core/transition.js +105 -0
- data/public/d3/src/core/uninterpolate.js +9 -0
- data/public/d3/src/core/values.js +5 -0
- data/public/d3/src/core/xhr.js +10 -0
- data/public/d3/src/core/xml.js +10 -0
- data/public/d3/src/core/zip.js +13 -0
- data/public/d3/src/csv/csv.js +5 -0
- data/public/d3/src/csv/format.js +13 -0
- data/public/d3/src/csv/parse.js +73 -0
- data/public/d3/src/end.js +1 -0
- data/public/d3/src/externs.js +6 -0
- data/public/d3/src/geo/albers.js +128 -0
- data/public/d3/src/geo/azimuthal.js +70 -0
- data/public/d3/src/geo/bounds.js +76 -0
- data/public/d3/src/geo/geo.js +1 -0
- data/public/d3/src/geo/greatCircle.js +91 -0
- data/public/d3/src/geo/mercator.js +36 -0
- data/public/d3/src/geo/path.js +289 -0
- data/public/d3/src/geom/contour.js +78 -0
- data/public/d3/src/geom/delaunay.js +31 -0
- data/public/d3/src/geom/geom.js +1 -0
- data/public/d3/src/geom/hull.js +98 -0
- data/public/d3/src/geom/polygon.js +88 -0
- data/public/d3/src/geom/quadtree.js +129 -0
- data/public/d3/src/geom/voronoi.js +399 -0
- data/public/d3/src/layout/bundle.js +57 -0
- data/public/d3/src/layout/chord.js +148 -0
- data/public/d3/src/layout/cluster.js +77 -0
- data/public/d3/src/layout/force.js +332 -0
- data/public/d3/src/layout/hierarchy.js +120 -0
- data/public/d3/src/layout/histogram.js +102 -0
- data/public/d3/src/layout/layout.js +1 -0
- data/public/d3/src/layout/pack.js +200 -0
- data/public/d3/src/layout/partition.js +48 -0
- data/public/d3/src/layout/pie.js +95 -0
- data/public/d3/src/layout/stack.js +237 -0
- data/public/d3/src/layout/tree.js +234 -0
- data/public/d3/src/layout/treemap.js +213 -0
- data/public/d3/src/scale/bilinear.js +7 -0
- data/public/d3/src/scale/category.js +54 -0
- data/public/d3/src/scale/linear.js +115 -0
- data/public/d3/src/scale/log.js +80 -0
- data/public/d3/src/scale/nice.js +21 -0
- data/public/d3/src/scale/ordinal.js +74 -0
- data/public/d3/src/scale/polylinear.js +16 -0
- data/public/d3/src/scale/pow.js +54 -0
- data/public/d3/src/scale/quantile.js +43 -0
- data/public/d3/src/scale/quantize.js +36 -0
- data/public/d3/src/scale/scale.js +6 -0
- data/public/d3/src/scale/sqrt.js +3 -0
- data/public/d3/src/start.js +1 -0
- data/public/d3/src/svg/arc.js +95 -0
- data/public/d3/src/svg/area-radial.js +10 -0
- data/public/d3/src/svg/area.js +84 -0
- data/public/d3/src/svg/axis.js +182 -0
- data/public/d3/src/svg/chord.js +99 -0
- data/public/d3/src/svg/diagonal-radial.js +22 -0
- data/public/d3/src/svg/diagonal.js +38 -0
- data/public/d3/src/svg/line-radial.js +22 -0
- data/public/d3/src/svg/line.js +419 -0
- data/public/d3/src/svg/mouse.js +29 -0
- data/public/d3/src/svg/svg.js +1 -0
- data/public/d3/src/svg/symbol.js +98 -0
- data/public/d3/src/svg/touches.js +8 -0
- data/public/d3/src/time/day.js +7 -0
- data/public/d3/src/time/days.js +11 -0
- data/public/d3/src/time/format-iso.js +1 -0
- data/public/d3/src/time/format-utc.js +48 -0
- data/public/d3/src/time/format.js +315 -0
- data/public/d3/src/time/hour.js +8 -0
- data/public/d3/src/time/hours.js +11 -0
- data/public/d3/src/time/minute.js +5 -0
- data/public/d3/src/time/minutes.js +11 -0
- data/public/d3/src/time/month.js +7 -0
- data/public/d3/src/time/months.js +11 -0
- data/public/d3/src/time/range.js +16 -0
- data/public/d3/src/time/scale-utc.js +36 -0
- data/public/d3/src/time/scale.js +123 -0
- data/public/d3/src/time/second.js +5 -0
- data/public/d3/src/time/seconds.js +7 -0
- data/public/d3/src/time/time.js +3 -0
- data/public/d3/src/time/week.js +9 -0
- data/public/d3/src/time/weeks.js +11 -0
- data/public/d3/src/time/year.js +7 -0
- data/public/d3/src/time/years.js +11 -0
- data/public/d3/test/core/ascending-test.js +47 -0
- data/public/d3/test/core/bisect-test.js +103 -0
- data/public/d3/test/core/descending-test.js +47 -0
- data/public/d3/test/core/dispatch-test.js +116 -0
- data/public/d3/test/core/ease-test.js +129 -0
- data/public/d3/test/core/entries-test.js +43 -0
- data/public/d3/test/core/first-test.js +42 -0
- data/public/d3/test/core/format-test.js +204 -0
- data/public/d3/test/core/functor-test.js +29 -0
- data/public/d3/test/core/hsl-test.js +87 -0
- data/public/d3/test/core/html-test.js +37 -0
- data/public/d3/test/core/interpolate-test.js +203 -0
- data/public/d3/test/core/json-test.js +37 -0
- data/public/d3/test/core/keys-test.js +31 -0
- data/public/d3/test/core/last-test.js +42 -0
- data/public/d3/test/core/max-test.js +50 -0
- data/public/d3/test/core/merge-test.js +27 -0
- data/public/d3/test/core/min-test.js +50 -0
- data/public/d3/test/core/nest-test.js +236 -0
- data/public/d3/test/core/ns-test.js +53 -0
- data/public/d3/test/core/permute-test.js +53 -0
- data/public/d3/test/core/quantile-test.js +50 -0
- data/public/d3/test/core/range-test.js +93 -0
- data/public/d3/test/core/rebind-test.js +38 -0
- data/public/d3/test/core/requote-test.js +53 -0
- data/public/d3/test/core/rgb-test.js +89 -0
- data/public/d3/test/core/round-test.js +70 -0
- data/public/d3/test/core/select-test.js +42 -0
- data/public/d3/test/core/selectAll-test.js +42 -0
- data/public/d3/test/core/selection-append-test.js +119 -0
- data/public/d3/test/core/selection-attr-test.js +153 -0
- data/public/d3/test/core/selection-call-test.js +71 -0
- data/public/d3/test/core/selection-classed-test.js +200 -0
- data/public/d3/test/core/selection-data-test.js +165 -0
- data/public/d3/test/core/selection-each-test.js +83 -0
- data/public/d3/test/core/selection-empty-test.js +51 -0
- data/public/d3/test/core/selection-filter-test.js +63 -0
- data/public/d3/test/core/selection-html-test.js +121 -0
- data/public/d3/test/core/selection-insert-test.js +132 -0
- data/public/d3/test/core/selection-map-test.js +47 -0
- data/public/d3/test/core/selection-node-test.js +50 -0
- data/public/d3/test/core/selection-on-test.js +95 -0
- data/public/d3/test/core/selection-property-test.js +91 -0
- data/public/d3/test/core/selection-remove-test.js +39 -0
- data/public/d3/test/core/selection-select-test.js +125 -0
- data/public/d3/test/core/selection-selectAll-test.js +127 -0
- data/public/d3/test/core/selection-sort-test.js +59 -0
- data/public/d3/test/core/selection-style-test.js +100 -0
- data/public/d3/test/core/selection-test.js +35 -0
- data/public/d3/test/core/selection-text-test.js +109 -0
- data/public/d3/test/core/split-test.js +34 -0
- data/public/d3/test/core/sum-test.js +47 -0
- data/public/d3/test/core/text-test.js +48 -0
- data/public/d3/test/core/timer-test.js +62 -0
- data/public/d3/test/core/transition-test-attr.js +33 -0
- data/public/d3/test/core/transition-test-attrTween.js +67 -0
- data/public/d3/test/core/transition-test-call.js +33 -0
- data/public/d3/test/core/transition-test-delay.js +41 -0
- data/public/d3/test/core/transition-test-duration.js +41 -0
- data/public/d3/test/core/transition-test-each.js +166 -0
- data/public/d3/test/core/transition-test-id.js +20 -0
- data/public/d3/test/core/transition-test-remove.js +46 -0
- data/public/d3/test/core/transition-test-select.js +63 -0
- data/public/d3/test/core/transition-test-selectAll.js +55 -0
- data/public/d3/test/core/transition-test-style.js +38 -0
- data/public/d3/test/core/transition-test-styleTween.js +73 -0
- data/public/d3/test/core/transition-test-text.js +30 -0
- data/public/d3/test/core/transition-test-transition.js +60 -0
- data/public/d3/test/core/transition-test-tween.js +71 -0
- data/public/d3/test/core/transition-test.js +65 -0
- data/public/d3/test/core/values-test.js +35 -0
- data/public/d3/test/core/version-test.js +18 -0
- data/public/d3/test/core/xhr-test.js +56 -0
- data/public/d3/test/core/xml-test.js +48 -0
- data/public/d3/test/core/zip-test.js +32 -0
- data/public/d3/test/csv/csv-test.js +38 -0
- data/public/d3/test/csv/format-test.js +39 -0
- data/public/d3/test/csv/parse-test.js +101 -0
- data/public/d3/test/env-assert.js +96 -0
- data/public/d3/test/env-fragment.js +8 -0
- data/public/d3/test/env-xhr.js +56 -0
- data/public/d3/test/env.js +13 -0
- data/public/d3/test/geo/albers-test.js +57 -0
- data/public/d3/test/geo/azimuthal-test.js +89 -0
- data/public/d3/test/geo/greatCircle-test.js +42 -0
- data/public/d3/test/geo/mercator-test.js +57 -0
- data/public/d3/test/layout/histogram-test.js +91 -0
- data/public/d3/test/layout/partition-test.js +39 -0
- data/public/d3/test/layout/tree-test.js +21 -0
- data/public/d3/test/layout/treemap-test.js +180 -0
- data/public/d3/test/scale/category-test.js +74 -0
- data/public/d3/test/scale/linear-test.js +239 -0
- data/public/d3/test/scale/log-test.js +220 -0
- data/public/d3/test/scale/ordinal-test.js +193 -0
- data/public/d3/test/scale/pow-test.js +259 -0
- data/public/d3/test/scale/quantile-test.js +64 -0
- data/public/d3/test/scale/quantize-test.js +69 -0
- data/public/d3/test/scale/sqrt-test.js +256 -0
- data/public/d3/test/svg/arc-test.js +147 -0
- data/public/d3/test/svg/area-radial-test.js +200 -0
- data/public/d3/test/svg/area-test.js +191 -0
- data/public/d3/test/svg/axis-test.js +347 -0
- data/public/d3/test/svg/line-radial-test.js +125 -0
- data/public/d3/test/svg/line-test.js +189 -0
- data/public/d3/test/svg/symbol-test.js +96 -0
- data/public/d3/test/time/day-test.js +65 -0
- data/public/d3/test/time/days-test.js +105 -0
- data/public/d3/test/time/format-test.js +430 -0
- data/public/d3/test/time/hour-test.js +103 -0
- data/public/d3/test/time/hours-test.js +135 -0
- data/public/d3/test/time/minute-test.js +43 -0
- data/public/d3/test/time/minutes-test.js +101 -0
- data/public/d3/test/time/month-test.js +53 -0
- data/public/d3/test/time/months-test.js +105 -0
- data/public/d3/test/time/scale-test.js +525 -0
- data/public/d3/test/time/second-test.js +41 -0
- data/public/d3/test/time/seconds-test.js +101 -0
- data/public/d3/test/time/week-test.js +59 -0
- data/public/d3/test/time/weeks-test.js +105 -0
- data/public/d3/test/time/year-test.js +41 -0
- data/public/d3/test/time/years-test.js +73 -0
- data/public/graph.js +42 -0
- data/public/jquery.min.js +4 -0
- data/public/test.html +36 -0
- data/public/testdata/bigfucker.js +212 -0
- data/public/testdata/names_and_enabled.js +232 -0
- data/public/testdata/one.js +79 -0
- data/public/testdata/withnames.js +198 -0
- data/public/viz.js +289 -0
- data/views/graph.erb +15 -0
- data/views/one.erb +34 -0
- data/views/two.erb +44 -0
- data/views/vis.erb +47 -0
- metadata +594 -18
- data/lib/bum.rb +0 -385
- data/lib/client.rb.erb +0 -7
- data/lib/dhcpd.rb +0 -84
- data/lib/hosts.rb +0 -61
- data/lib/vmx.rb +0 -24
@@ -0,0 +1,41 @@
|
|
1
|
+
require("../env");
|
2
|
+
require("../../d3");
|
3
|
+
|
4
|
+
var assert = require("assert");
|
5
|
+
|
6
|
+
module.exports = {
|
7
|
+
topic: function() {
|
8
|
+
return d3.select("body").selectAll()
|
9
|
+
.data(["foo", "bar"])
|
10
|
+
.enter().append("div")
|
11
|
+
.attr("class", String);
|
12
|
+
},
|
13
|
+
"defaults to 250 milliseconds": function(selection) {
|
14
|
+
var t = selection.transition();
|
15
|
+
assert.strictEqual(t[0][0].duration, 250);
|
16
|
+
assert.strictEqual(t[0][1].duration, 250);
|
17
|
+
},
|
18
|
+
"can specify duration as a number": function(selection) {
|
19
|
+
var t = selection.transition().duration(150);
|
20
|
+
assert.strictEqual(t[0][0].duration, 150);
|
21
|
+
assert.strictEqual(t[0][1].duration, 150);
|
22
|
+
t.duration(50);
|
23
|
+
assert.strictEqual(t[0][0].duration, 50);
|
24
|
+
assert.strictEqual(t[0][1].duration, 50);
|
25
|
+
},
|
26
|
+
"can specify duration as a function": function(selection) {
|
27
|
+
var dd = [], ii = [], tt = [], t = selection.transition().duration(f);
|
28
|
+
function f(d, i) { dd.push(d); ii.push(i); tt.push(this); return i * 20; }
|
29
|
+
assert.strictEqual(t[0][0].duration, 0);
|
30
|
+
assert.strictEqual(t[0][1].duration, 20);
|
31
|
+
assert.deepEqual(dd, ["foo", "bar"], "expected data, got {actual}");
|
32
|
+
assert.deepEqual(ii, [0, 1], "expected index, got {actual}");
|
33
|
+
assert.domEqual(tt[0], t[0][0].node, "expected this, got {actual}");
|
34
|
+
assert.domEqual(tt[1], t[0][1].node, "expected this, got {actual}");
|
35
|
+
},
|
36
|
+
"coerces duration to a number": function(selection) {
|
37
|
+
var t = selection.transition().duration("150");
|
38
|
+
assert.strictEqual(t[0][0].duration, 150);
|
39
|
+
assert.strictEqual(t[0][1].duration, 150);
|
40
|
+
}
|
41
|
+
};
|
@@ -0,0 +1,166 @@
|
|
1
|
+
require("../env");
|
2
|
+
require("../../d3");
|
3
|
+
|
4
|
+
var assert = require("assert");
|
5
|
+
|
6
|
+
module.exports = {
|
7
|
+
"start": {
|
8
|
+
topic: function() {
|
9
|
+
var cb = this.callback,
|
10
|
+
div = d3.select("body").selectAll().data(["foo", "bar"]).enter().append("div").attr("class", String),
|
11
|
+
transition = div.transition().delay(150),
|
12
|
+
then = Date.now(),
|
13
|
+
n = 0,
|
14
|
+
calls = [],
|
15
|
+
context = [],
|
16
|
+
data = [],
|
17
|
+
index = [],
|
18
|
+
count = [],
|
19
|
+
delay = [];
|
20
|
+
|
21
|
+
// A callback to verify that multiple callbacks are allowed.
|
22
|
+
transition.each("start", function() {
|
23
|
+
++n;
|
24
|
+
});
|
25
|
+
|
26
|
+
// A callback which captures arguments and context.
|
27
|
+
transition.each("start", function(d, i) {
|
28
|
+
context.push(this);
|
29
|
+
data.push(d);
|
30
|
+
index.push(i);
|
31
|
+
count.push(++n);
|
32
|
+
delay.push(Date.now() - then);
|
33
|
+
if (n >= 4) cb(null, {
|
34
|
+
selection: div,
|
35
|
+
delay: delay,
|
36
|
+
context: context,
|
37
|
+
data: data,
|
38
|
+
index: index,
|
39
|
+
count: count,
|
40
|
+
id: transition.id
|
41
|
+
});
|
42
|
+
});
|
43
|
+
},
|
44
|
+
|
45
|
+
"invokes the listener after the specified delay": function(result) {
|
46
|
+
assert.inDelta(result.delay, [150, 150], 20);
|
47
|
+
},
|
48
|
+
"invokes each listener exactly once, in order": function(result) {
|
49
|
+
assert.deepEqual(result.count, [2, 4]);
|
50
|
+
},
|
51
|
+
|
52
|
+
// For the same node, listeners will be called back in order, according to
|
53
|
+
// the implementation of d3.dispatch. However, the order of callbacks across
|
54
|
+
// nodes is not guaranteed; currently, callbacks are in reverse order if
|
55
|
+
// they share the same delay, because of the timer queue. I suppose it'd be
|
56
|
+
// slightly better if the callbacks were invoked in node order (consistent
|
57
|
+
// with selections), but since these callbacks happen asynchronously I don't
|
58
|
+
// think the API needs to guarantee the order of callbacks.
|
59
|
+
|
60
|
+
"uses the node as the context": function(result) {
|
61
|
+
assert.domEqual(result.context[1], result.selection[0][0]);
|
62
|
+
assert.domEqual(result.context[0], result.selection[0][1]);
|
63
|
+
},
|
64
|
+
"passes the data and index to the function": function(result) {
|
65
|
+
assert.deepEqual(result.data, ["bar", "foo"], "expected data, got {actual}");
|
66
|
+
assert.deepEqual(result.index, [1, 0], "expected index, got {actual}");
|
67
|
+
},
|
68
|
+
|
69
|
+
"sets an exclusive lock on transitioning nodes": function(result) {
|
70
|
+
var id = result.id;
|
71
|
+
assert.isTrue(id > 0);
|
72
|
+
assert.equal(result.selection[0][0].__transition__.count, 1);
|
73
|
+
assert.equal(result.selection[0][1].__transition__.count, 1);
|
74
|
+
assert.equal(result.selection[0][0].__transition__.active, id);
|
75
|
+
assert.equal(result.selection[0][1].__transition__.active, id);
|
76
|
+
}
|
77
|
+
},
|
78
|
+
|
79
|
+
"end": {
|
80
|
+
topic: function() {
|
81
|
+
var cb = this.callback,
|
82
|
+
div = d3.select("body").selectAll().data(["foo", "bar"]).enter().append("div").attr("class", String),
|
83
|
+
transition = div.transition().duration(150),
|
84
|
+
then = Date.now(),
|
85
|
+
n = 0,
|
86
|
+
calls = [],
|
87
|
+
context = [],
|
88
|
+
data = [],
|
89
|
+
index = [],
|
90
|
+
count = [],
|
91
|
+
delay = [];
|
92
|
+
|
93
|
+
// A callback to verify that multiple callbacks are allowed.
|
94
|
+
transition.each("end", function() {
|
95
|
+
++n;
|
96
|
+
});
|
97
|
+
|
98
|
+
// A callback which captures arguments and context.
|
99
|
+
transition.each("end", function(d, i) {
|
100
|
+
context.push(this);
|
101
|
+
data.push(d);
|
102
|
+
index.push(i);
|
103
|
+
count.push(++n);
|
104
|
+
delay.push(Date.now() - then);
|
105
|
+
if (n >= 4) cb(null, {
|
106
|
+
selection: div,
|
107
|
+
delay: delay,
|
108
|
+
context: context,
|
109
|
+
data: data,
|
110
|
+
index: index,
|
111
|
+
count: count,
|
112
|
+
id: transition.id
|
113
|
+
});
|
114
|
+
});
|
115
|
+
},
|
116
|
+
|
117
|
+
"invokes the listener after the specified delay": function(result) {
|
118
|
+
assert.inDelta(result.delay, [150, 150], 20);
|
119
|
+
},
|
120
|
+
"invokes each listener exactly once, in order": function(result) {
|
121
|
+
assert.deepEqual(result.count, [2, 4]);
|
122
|
+
},
|
123
|
+
|
124
|
+
// For the same node, listeners will be called back in order, according to
|
125
|
+
// the implementation of d3.dispatch. However, the order of callbacks across
|
126
|
+
// nodes is not guaranteed; currently, callbacks are in reverse order if
|
127
|
+
// they share the same delay, because of the timer queue. I suppose it'd be
|
128
|
+
// slightly better if the callbacks were invoked in node order (consistent
|
129
|
+
// with selections), but since these callbacks happen asynchronously I don't
|
130
|
+
// think the API needs to guarantee the order of callbacks.
|
131
|
+
|
132
|
+
"uses the node as the context": function(result) {
|
133
|
+
assert.domEqual(result.context[1], result.selection[0][0]);
|
134
|
+
assert.domEqual(result.context[0], result.selection[0][1]);
|
135
|
+
},
|
136
|
+
"passes the data and index to the function": function(result) {
|
137
|
+
assert.deepEqual(result.data, ["bar", "foo"], "expected data, got {actual}");
|
138
|
+
assert.deepEqual(result.index, [1, 0], "expected index, got {actual}");
|
139
|
+
},
|
140
|
+
|
141
|
+
"deletes the transition lock after end": function(result) {
|
142
|
+
assert.isFalse("__transition__" in result.selection[0][0]);
|
143
|
+
assert.isFalse("__transition__" in result.selection[0][1]);
|
144
|
+
},
|
145
|
+
|
146
|
+
// I'd like to test d3.timer.flush here, but unfortunately there's a bug in
|
147
|
+
// Vows where it really doesn't like to receive multiple callbacks from
|
148
|
+
// different tests at the same time!
|
149
|
+
|
150
|
+
"sequenced": {
|
151
|
+
topic: function(result) {
|
152
|
+
var cb = this.callback,
|
153
|
+
node = result.selection[0][0],
|
154
|
+
id = result.id;
|
155
|
+
d3.select(node).transition().delay(150).each("start", function() {
|
156
|
+
cb(null, {id: id, node: this});
|
157
|
+
});
|
158
|
+
},
|
159
|
+
"inherits the same transition id": function(result) {
|
160
|
+
assert.isTrue(result.id > 0);
|
161
|
+
assert.equal(result.node.__transition__.count, 1);
|
162
|
+
assert.equal(result.node.__transition__.active, result.id);
|
163
|
+
}
|
164
|
+
}
|
165
|
+
}
|
166
|
+
};
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require("../env");
|
2
|
+
require("../../d3");
|
3
|
+
|
4
|
+
var assert = require("assert");
|
5
|
+
|
6
|
+
module.exports = {
|
7
|
+
topic: function() {
|
8
|
+
return d3.select("body").append("div").transition();
|
9
|
+
},
|
10
|
+
"has a positive integer id": function(transition) {
|
11
|
+
var id = transition.id;
|
12
|
+
assert.isTrue(id > 0);
|
13
|
+
assert.equal(~~id, id);
|
14
|
+
},
|
15
|
+
"increases monotonically across transitions": function(transition) {
|
16
|
+
var t0 = d3.select("body").append("div").transition(),
|
17
|
+
t1 = d3.select("body").append("div").transition();
|
18
|
+
assert.isTrue(t1.id > t0.id);
|
19
|
+
}
|
20
|
+
};
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require("../env");
|
2
|
+
require("../../d3");
|
3
|
+
|
4
|
+
var assert = require("assert");
|
5
|
+
|
6
|
+
module.exports = {
|
7
|
+
topic: function() {
|
8
|
+
var cb = this.callback,
|
9
|
+
t = d3.select("body").append("div").transition().remove();
|
10
|
+
t.each("end", function() { cb(null, t); });
|
11
|
+
},
|
12
|
+
"removes the selected elements": function(transition) {
|
13
|
+
assert.domEqual(transition[0][0].node.parentNode, null);
|
14
|
+
},
|
15
|
+
|
16
|
+
"when the element is already removed": {
|
17
|
+
topic: function() {
|
18
|
+
var cb = this.callback,
|
19
|
+
t = d3.select("body").append("div").remove().transition().remove();
|
20
|
+
t.each("end", function() { cb(null, t); });
|
21
|
+
},
|
22
|
+
"does nothing": function(transition) {
|
23
|
+
assert.domEqual(transition[0][0].node.parentNode, null);
|
24
|
+
}
|
25
|
+
},
|
26
|
+
|
27
|
+
// Since these tests are triggered inside the end event of the above topic,
|
28
|
+
// transitions will inherit ids from the original transition. But we want to
|
29
|
+
// test concurrent transitions, so we use timeouts to avoid inheritance. This
|
30
|
+
// test also verifies that if multiple transitions are created at the same
|
31
|
+
// time, the last transition becomes the owner.
|
32
|
+
|
33
|
+
"when another transition is scheduled": {
|
34
|
+
topic: function() {
|
35
|
+
var cb = this.callback,
|
36
|
+
s = d3.select("body").append("div");
|
37
|
+
setTimeout(function() {
|
38
|
+
s.transition().duration(150).remove().each("end", function() { cb(null, s); });
|
39
|
+
s.transition().delay(250);
|
40
|
+
}, 10);
|
41
|
+
},
|
42
|
+
"does nothing": function(selection) {
|
43
|
+
assert.domEqual(selection[0][0].parentNode, document.body);
|
44
|
+
}
|
45
|
+
}
|
46
|
+
};
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require("../env");
|
2
|
+
require("../../d3");
|
3
|
+
|
4
|
+
var assert = require("assert");
|
5
|
+
|
6
|
+
module.exports = {
|
7
|
+
topic: function() {
|
8
|
+
var s = d3.select("body").append("div").selectAll("div")
|
9
|
+
.data(["one", "two", "three", "four"])
|
10
|
+
.enter().append("div")
|
11
|
+
.attr("class", String);
|
12
|
+
|
13
|
+
s.filter(function(d, i) { return i > 0; }).append("span");
|
14
|
+
s[0][3] = null;
|
15
|
+
|
16
|
+
return s.transition()
|
17
|
+
.delay(function(d, i) { return i * 13; })
|
18
|
+
.duration(function(d, i) { return i * 21; });
|
19
|
+
},
|
20
|
+
|
21
|
+
"selects the first matching element": function(transition) {
|
22
|
+
var t = transition.select("span");
|
23
|
+
assert.domEqual(t[0][1].node.parentNode, transition[0][1].node);
|
24
|
+
assert.domEqual(t[0][2].node.parentNode, transition[0][2].node);
|
25
|
+
},
|
26
|
+
"ignores null elements": function(transition) {
|
27
|
+
var t = transition.select("span");
|
28
|
+
assert.isNull(t[0][3]);
|
29
|
+
},
|
30
|
+
"propagates data to the selected elements": function(transition) {
|
31
|
+
var t = transition.select("span");
|
32
|
+
assert.equal(t[0][1].node.__data__, "two");
|
33
|
+
assert.equal(t[0][2].node.__data__, "three");
|
34
|
+
},
|
35
|
+
"propagates delay to the selected elements": function(transition) {
|
36
|
+
var t = transition.select("span");
|
37
|
+
assert.equal(t[0][1].delay, 13);
|
38
|
+
assert.equal(t[0][2].delay, 26);
|
39
|
+
},
|
40
|
+
"propagates duration to the selected elements": function(transition) {
|
41
|
+
var t = transition.select("span");
|
42
|
+
assert.equal(t[0][1].duration, 21);
|
43
|
+
assert.equal(t[0][2].duration, 42);
|
44
|
+
},
|
45
|
+
"does not propagate data if no data was specified": function(transition) {
|
46
|
+
delete transition[0][1].node.__data__;
|
47
|
+
delete transition[0][1].node.firstChild.__data__;
|
48
|
+
var t = transition.select("span");
|
49
|
+
assert.isUndefined(t[0][1].node.__data__);
|
50
|
+
assert.equal(t[0][2].node.__data__, "three");
|
51
|
+
},
|
52
|
+
"returns null if no match is found": function(transition) {
|
53
|
+
var t = transition.select("span");
|
54
|
+
assert.isNull(t[0][0]);
|
55
|
+
},
|
56
|
+
"inherits transition id": function(transition) {
|
57
|
+
var id = transition.id,
|
58
|
+
t0 = transition.select("span"),
|
59
|
+
t1 = transition.select("span");
|
60
|
+
assert.equal(t0.id, id);
|
61
|
+
assert.equal(t1.id, id);
|
62
|
+
}
|
63
|
+
};
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require("../env");
|
2
|
+
require("../../d3");
|
3
|
+
|
4
|
+
var assert = require("assert");
|
5
|
+
|
6
|
+
module.exports = {
|
7
|
+
topic: function() {
|
8
|
+
var s = d3.select("body").append("div").selectAll("div")
|
9
|
+
.data(["one", "two", "three", "four"])
|
10
|
+
.enter().append("div")
|
11
|
+
.attr("class", String);
|
12
|
+
|
13
|
+
s.filter(function(d, i) { return i > 0; }).append("span");
|
14
|
+
s.filter(function(d, i) { return i > 1; }).append("span");
|
15
|
+
s[0][3] = null;
|
16
|
+
|
17
|
+
return s.transition()
|
18
|
+
.delay(function(d, i) { return i * 13; })
|
19
|
+
.duration(function(d, i) { return i * 21; });
|
20
|
+
},
|
21
|
+
|
22
|
+
"selects all matching elements": function(transition) {
|
23
|
+
var t = transition.selectAll("span");
|
24
|
+
assert.domEqual(t[1][0].node.parentNode, transition[0][1].node);
|
25
|
+
assert.domEqual(t[2][0].node.parentNode, transition[0][2].node);
|
26
|
+
assert.domEqual(t[2][1].node.parentNode, transition[0][2].node);
|
27
|
+
},
|
28
|
+
"ignores null elements": function(transition) {
|
29
|
+
var t = transition.selectAll("span");
|
30
|
+
assert.equal(t.length, 3);
|
31
|
+
},
|
32
|
+
"propagates delay to the selected elements": function(transition) {
|
33
|
+
var t = transition.selectAll("span");
|
34
|
+
assert.domEqual(t[1][0].delay, 13);
|
35
|
+
assert.domEqual(t[2][0].delay, 26);
|
36
|
+
assert.domEqual(t[2][1].delay, 26);
|
37
|
+
},
|
38
|
+
"propagates duration to the selected elements": function(transition) {
|
39
|
+
var t = transition.selectAll("span");
|
40
|
+
assert.domEqual(t[1][0].duration, 21);
|
41
|
+
assert.domEqual(t[2][0].duration, 42);
|
42
|
+
assert.domEqual(t[2][1].duration, 42);
|
43
|
+
},
|
44
|
+
"returns empty if no match is found": function(transition) {
|
45
|
+
var t = transition.selectAll("span");
|
46
|
+
assert.isEmpty(t[0]);
|
47
|
+
},
|
48
|
+
"inherits transition id": function(transition) {
|
49
|
+
var id = transition.id,
|
50
|
+
t0 = transition.selectAll("span"),
|
51
|
+
t1 = transition.selectAll("span");
|
52
|
+
assert.equal(t0.id, id);
|
53
|
+
assert.equal(t1.id, id);
|
54
|
+
}
|
55
|
+
};
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require("../env");
|
2
|
+
require("../../d3");
|
3
|
+
|
4
|
+
var assert = require("assert");
|
5
|
+
|
6
|
+
module.exports = {
|
7
|
+
topic: function() {
|
8
|
+
var cb = this.callback;
|
9
|
+
|
10
|
+
var s = d3.select("body").append("div")
|
11
|
+
.style("background-color", "white")
|
12
|
+
.style("color", "red");
|
13
|
+
|
14
|
+
var t = s.transition()
|
15
|
+
.style("background-color", "green")
|
16
|
+
.style("background-color", "red")
|
17
|
+
.style("color", function() { return "green"; }, "important")
|
18
|
+
.each("end", function() { cb(null, {selection: s, transition: t}); });
|
19
|
+
},
|
20
|
+
"defines the corresponding style tween": function(result) {
|
21
|
+
assert.typeOf(result.transition.tween("style.background-color"), "function");
|
22
|
+
assert.typeOf(result.transition.tween("style.color"), "function");
|
23
|
+
},
|
24
|
+
"the last style operator takes precedence": function(result) {
|
25
|
+
assert.equal(result.selection.style("background-color"), "rgb(255,0,0)");
|
26
|
+
},
|
27
|
+
"sets a property as a string": function(result) {
|
28
|
+
assert.equal(result.selection.style("background-color"), "rgb(255,0,0)");
|
29
|
+
},
|
30
|
+
"sets a property as a function": function(result) {
|
31
|
+
assert.equal(result.selection.style("color"), "rgb(0,128,0)");
|
32
|
+
},
|
33
|
+
"observes the specified priority": function(result) {
|
34
|
+
var style = result.selection.node().style;
|
35
|
+
assert.equal(style.getPropertyPriority("background-color"), "");
|
36
|
+
assert.equal(style.getPropertyPriority("color"), "important");
|
37
|
+
}
|
38
|
+
};
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require("../env");
|
2
|
+
require("../../d3");
|
3
|
+
|
4
|
+
var assert = require("assert");
|
5
|
+
|
6
|
+
module.exports = {
|
7
|
+
topic: function() {
|
8
|
+
var cb = this.callback,
|
9
|
+
dd = [],
|
10
|
+
ii = [],
|
11
|
+
tt = [],
|
12
|
+
vv = [],
|
13
|
+
fails = 0;
|
14
|
+
|
15
|
+
var s = d3.select("body").append("div").selectAll("div")
|
16
|
+
.data(["red", "green"])
|
17
|
+
.enter().append("div")
|
18
|
+
.style("background-color", function(d) { return d3.rgb(d)+""; });
|
19
|
+
|
20
|
+
var t = s.transition()
|
21
|
+
.styleTween("background-color", function() { ++fails; })
|
22
|
+
.styleTween("background-color", tween);
|
23
|
+
|
24
|
+
function tween(d, i, v) {
|
25
|
+
dd.push(d);
|
26
|
+
ii.push(i);
|
27
|
+
vv.push(v);
|
28
|
+
if (tt.push(this) >= 2) cb(null, {
|
29
|
+
selection: s,
|
30
|
+
transition: t,
|
31
|
+
data: dd,
|
32
|
+
index: ii,
|
33
|
+
value: vv,
|
34
|
+
context: tt,
|
35
|
+
fails: fails
|
36
|
+
});
|
37
|
+
return i && d3.interpolateHsl(v, "blue");
|
38
|
+
}
|
39
|
+
},
|
40
|
+
|
41
|
+
// The order here is a bit brittle: because the transition has zero delay,
|
42
|
+
// it's invoking the start event immediately for all nodes, rather than
|
43
|
+
// pushing each node onto the timer queue (which would reverse the order of
|
44
|
+
// callbacks). The order in which tweens are invoked is undefined, so perhaps
|
45
|
+
// we should sort the expected and actual values before comparing.
|
46
|
+
|
47
|
+
"defines the corresponding style tween": function(result) {
|
48
|
+
assert.typeOf(result.transition.tween("style.background-color"), "function");
|
49
|
+
},
|
50
|
+
"the last style tween takes precedence": function(result) {
|
51
|
+
assert.equal(result.fails, 0);
|
52
|
+
},
|
53
|
+
"invokes the tween function": function(result) {
|
54
|
+
assert.deepEqual(result.data, ["red", "green"], "expected data, got {actual}");
|
55
|
+
assert.deepEqual(result.index, [0, 1], "expected data, got {actual}");
|
56
|
+
assert.deepEqual(result.value, ["#ff0000", "#008000"], "expected value, got {actual}");
|
57
|
+
assert.domEqual(result.context[0], result.selection[0][0], "expected this, got {actual}");
|
58
|
+
assert.domEqual(result.context[1], result.selection[0][1], "expected this, got {actual}");
|
59
|
+
},
|
60
|
+
|
61
|
+
"end": {
|
62
|
+
topic: function(result) {
|
63
|
+
var cb = this.callback;
|
64
|
+
result.transition.each("end", function(d, i) { if (i >= 1) cb(null, result); });
|
65
|
+
},
|
66
|
+
"uses the returned interpolator": function(result) {
|
67
|
+
assert.equal(result.selection[0][1].style.getPropertyValue("background-color"), "#0000ff");
|
68
|
+
},
|
69
|
+
"does nothing if the interpolator is falsey": function(result) {
|
70
|
+
assert.equal(result.selection[0][0].style.getPropertyValue("background-color"), "#ff0000");
|
71
|
+
}
|
72
|
+
}
|
73
|
+
};
|