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,13 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>U.S. Population</title>
|
5
|
+
<script type="text/javascript" src="../../d3.js"></script>
|
6
|
+
<script type="text/javascript" src="../../d3.csv.js"></script>
|
7
|
+
<link type="text/css" rel="stylesheet" href="population.css"/>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<div id="chart"></div>
|
11
|
+
<script type="text/javascript" src="population.js"></script>
|
12
|
+
</body>
|
13
|
+
</html>
|
@@ -0,0 +1,126 @@
|
|
1
|
+
var w = 960,
|
2
|
+
h = 500,
|
3
|
+
x = d3.scale.linear().range([0, w]),
|
4
|
+
y = d3.scale.linear().range([0, h - 40]);
|
5
|
+
|
6
|
+
// An SVG element with a bottom-right origin.
|
7
|
+
var svg = d3.select("#chart").append("svg:svg")
|
8
|
+
.attr("width", w)
|
9
|
+
.attr("height", h)
|
10
|
+
.style("padding-right", "30px")
|
11
|
+
.append("svg:g")
|
12
|
+
.attr("transform", "translate(" + x(1) + "," + (h - 20) + ")scale(-1,-1)");
|
13
|
+
|
14
|
+
// A sliding container to hold the bars.
|
15
|
+
var body = svg.append("svg:g")
|
16
|
+
.attr("transform", "translate(0,0)");
|
17
|
+
|
18
|
+
// A container to hold the y-axis rules.
|
19
|
+
var rules = svg.append("svg:g");
|
20
|
+
|
21
|
+
// A label for the current year.
|
22
|
+
var title = svg.append("svg:text")
|
23
|
+
.attr("class", "title")
|
24
|
+
.attr("dy", ".71em")
|
25
|
+
.attr("transform", "translate(" + x(1) + "," + y(1) + ")scale(-1,-1)")
|
26
|
+
.text(2000);
|
27
|
+
|
28
|
+
d3.csv("population.csv", function(data) {
|
29
|
+
|
30
|
+
// Convert strings to numbers.
|
31
|
+
data.forEach(function(d) {
|
32
|
+
d.people = +d.people;
|
33
|
+
d.year = +d.year;
|
34
|
+
d.age = +d.age;
|
35
|
+
});
|
36
|
+
|
37
|
+
// Compute the extent of the data set in age and years.
|
38
|
+
var age0 = 0,
|
39
|
+
age1 = d3.max(data, function(d) { return d.age; }),
|
40
|
+
year0 = d3.min(data, function(d) { return d.year; }),
|
41
|
+
year1 = d3.max(data, function(d) { return d.year; }),
|
42
|
+
year = year1;
|
43
|
+
|
44
|
+
// Update the scale domains.
|
45
|
+
x.domain([0, age1 + 5]);
|
46
|
+
y.domain([0, d3.max(data, function(d) { return d.people; })]);
|
47
|
+
|
48
|
+
// Add rules to show the population values.
|
49
|
+
rules = rules.selectAll(".rule")
|
50
|
+
.data(y.ticks(10))
|
51
|
+
.enter().append("svg:g")
|
52
|
+
.attr("class", "rule")
|
53
|
+
.attr("transform", function(d) { return "translate(0," + y(d) + ")"; });
|
54
|
+
|
55
|
+
rules.append("svg:line")
|
56
|
+
.attr("x2", w);
|
57
|
+
|
58
|
+
rules.append("svg:text")
|
59
|
+
.attr("x", 6)
|
60
|
+
.attr("dy", ".35em")
|
61
|
+
.attr("transform", "rotate(180)")
|
62
|
+
.text(function(d) { return Math.round(d / 1e6) + "M"; });
|
63
|
+
|
64
|
+
// Add labeled rects for each birthyear.
|
65
|
+
var years = body.selectAll("g")
|
66
|
+
.data(d3.range(year0 - age1, year1 + 5, 5))
|
67
|
+
.enter().append("svg:g")
|
68
|
+
.attr("transform", function(d) { return "translate(" + x(year1 - d) + ",0)"; });
|
69
|
+
|
70
|
+
years.selectAll("rect")
|
71
|
+
.data(d3.range(2))
|
72
|
+
.enter().append("svg:rect")
|
73
|
+
.attr("x", 1)
|
74
|
+
.attr("width", x(5) - 2)
|
75
|
+
.attr("height", 1e-6);
|
76
|
+
|
77
|
+
years.append("svg:text")
|
78
|
+
.attr("y", -6)
|
79
|
+
.attr("x", -x(5) / 2)
|
80
|
+
.attr("transform", "rotate(180)")
|
81
|
+
.attr("text-anchor", "middle")
|
82
|
+
.style("fill", "#fff")
|
83
|
+
.text(String);
|
84
|
+
|
85
|
+
// Add labels to show the age.
|
86
|
+
svg.append("svg:g").selectAll("text")
|
87
|
+
.data(d3.range(0, age1 + 5, 5))
|
88
|
+
.enter().append("svg:text")
|
89
|
+
.attr("text-anchor", "middle")
|
90
|
+
.attr("transform", function(d) { return "translate(" + (x(d) + x(5) / 2) + ",-4)scale(-1,-1)"; })
|
91
|
+
.attr("dy", ".71em")
|
92
|
+
.text(String);
|
93
|
+
|
94
|
+
// Nest by year then birthyear.
|
95
|
+
data = d3.nest()
|
96
|
+
.key(function(d) { return d.year; })
|
97
|
+
.key(function(d) { return d.year - d.age; })
|
98
|
+
.rollup(function(v) { return v.map(function(d) { return d.people; }); })
|
99
|
+
.map(data);
|
100
|
+
|
101
|
+
// Allow the arrow keys to change the displayed year.
|
102
|
+
d3.select(window).on("keydown", function() {
|
103
|
+
switch (d3.event.keyCode) {
|
104
|
+
case 37: year = Math.max(year0, year - 10); break;
|
105
|
+
case 39: year = Math.min(year1, year + 10); break;
|
106
|
+
}
|
107
|
+
redraw();
|
108
|
+
});
|
109
|
+
|
110
|
+
redraw();
|
111
|
+
|
112
|
+
function redraw() {
|
113
|
+
if (!(year in data)) return;
|
114
|
+
title.text(year);
|
115
|
+
|
116
|
+
body.transition()
|
117
|
+
.duration(750)
|
118
|
+
.attr("transform", function(d) { return "translate(" + x(year - year1) + ",0)"; });
|
119
|
+
|
120
|
+
years.selectAll("rect")
|
121
|
+
.data(function(d) { return data[year][d] || [0, 0]; })
|
122
|
+
.transition()
|
123
|
+
.duration(750)
|
124
|
+
.attr("height", y);
|
125
|
+
}
|
126
|
+
});
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#chart {
|
2
|
+
font: 10px sans-serif;
|
3
|
+
width: 960px;
|
4
|
+
height: 310px;
|
5
|
+
}
|
6
|
+
|
7
|
+
.qq .box, .qq .tick line, .qq .quantile, .qq .diagonal {
|
8
|
+
stroke: #aaa;
|
9
|
+
fill: none;
|
10
|
+
}
|
11
|
+
|
12
|
+
.qq .quantile {
|
13
|
+
stroke: #000;
|
14
|
+
}
|
15
|
+
|
16
|
+
.qq g + g .y.tick {
|
17
|
+
display: none;
|
18
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Q-Q Plots</title>
|
5
|
+
<script type="text/javascript" src="../../d3.js"></script>
|
6
|
+
<script type="text/javascript" src="../../d3.chart.js"></script>
|
7
|
+
<script type="text/javascript" src="../../lib/science/science.js"></script>
|
8
|
+
<script type="text/javascript" src="../../lib/science/science.stats.js"></script>
|
9
|
+
<link type="text/css" rel="stylesheet" href="../button.css"/>
|
10
|
+
<link type="text/css" rel="stylesheet" href="qq.css"/>
|
11
|
+
</head>
|
12
|
+
<body>
|
13
|
+
<div id="chart">
|
14
|
+
<button class="first last" onclick="transition()">
|
15
|
+
Update
|
16
|
+
</button>
|
17
|
+
</div>
|
18
|
+
<script type="text/javascript" src="stats.js"></script>
|
19
|
+
<script type="text/javascript" src="qq.js"></script>
|
20
|
+
</body>
|
21
|
+
</html>
|
@@ -0,0 +1,66 @@
|
|
1
|
+
var w = 280,
|
2
|
+
h = 280,
|
3
|
+
m = [10, 0, 20, 35], // top right bottom left
|
4
|
+
n = 10000; // number of samples to generate
|
5
|
+
|
6
|
+
var chart = d3.chart.qq()
|
7
|
+
.width(w)
|
8
|
+
.height(h)
|
9
|
+
.domain([-.1, 1.1])
|
10
|
+
.tickFormat(function(d) { return ~~(d * 100); });
|
11
|
+
|
12
|
+
var vis = d3.select("#chart")
|
13
|
+
.append("svg:svg")
|
14
|
+
.append("svg:g")
|
15
|
+
.attr("transform", "translate(" + m[3] + "," + m[0] + ")");
|
16
|
+
|
17
|
+
d3.json("turkers.json", function(turkers) {
|
18
|
+
var tm = science.stats.mean(turkers),
|
19
|
+
td = Math.sqrt(science.stats.variance(turkers)),
|
20
|
+
dd = [
|
21
|
+
[0.10306430789206111, 0.0036139086950272735, 0.30498647327844536],
|
22
|
+
[0.5924252668569606, 0.0462763685758622, 0.4340870312025223],
|
23
|
+
[0.9847627827855167, 2.352350767874714e-4, 0.2609264955190324]
|
24
|
+
];
|
25
|
+
|
26
|
+
var g = vis.selectAll("g")
|
27
|
+
.data([{
|
28
|
+
x: d3.range(n).map(Math.random),
|
29
|
+
y: turkers,
|
30
|
+
label: "Uniform Distribution"
|
31
|
+
}, {
|
32
|
+
x: d3.range(n).map(normal1(tm, td)),
|
33
|
+
y: turkers,
|
34
|
+
label: "Gaussian (Normal) Distribution"
|
35
|
+
}, {
|
36
|
+
x: d3.range(n).map(normal3(dd)),
|
37
|
+
y: turkers,
|
38
|
+
label: "Mixture of 3 Gaussians"
|
39
|
+
}])
|
40
|
+
.enter().append("svg:g")
|
41
|
+
.attr("class", "qq")
|
42
|
+
.attr("transform", function(d, i) { return "translate(" + (w + m[1] + m[3]) * i + ")"; });
|
43
|
+
|
44
|
+
g.append("svg:rect")
|
45
|
+
.attr("class", "box")
|
46
|
+
.attr("width", w)
|
47
|
+
.attr("height", h);
|
48
|
+
|
49
|
+
g.call(chart);
|
50
|
+
|
51
|
+
g.append("svg:text")
|
52
|
+
.attr("dy", "1.3em")
|
53
|
+
.attr("dx", ".6em")
|
54
|
+
.text(function(d) { return d.label; });
|
55
|
+
|
56
|
+
chart.duration(1000);
|
57
|
+
|
58
|
+
window.transition = function() {
|
59
|
+
g.map(randomize).call(chart);
|
60
|
+
};
|
61
|
+
});
|
62
|
+
|
63
|
+
function randomize(d) {
|
64
|
+
d.y = d3.range(n).map(Math.random);
|
65
|
+
return d;
|
66
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
// Sample from a normal distribution with mean 0, stddev 1.
|
2
|
+
function normal() {
|
3
|
+
var x = 0, y = 0, rds, c;
|
4
|
+
do {
|
5
|
+
x = Math.random() * 2 - 1;
|
6
|
+
y = Math.random() * 2 - 1;
|
7
|
+
rds = x * x + y * y;
|
8
|
+
} while (rds == 0 || rds > 1);
|
9
|
+
c = Math.sqrt(-2 * Math.log(rds) / rds); // Box-Muller transform
|
10
|
+
return x * c; // throw away extra sample y * c
|
11
|
+
}
|
12
|
+
|
13
|
+
// Simple 1D Gaussian (normal) distribution
|
14
|
+
function normal1(mean, deviation) {
|
15
|
+
return function() {
|
16
|
+
return mean + deviation * normal();
|
17
|
+
};
|
18
|
+
}
|
19
|
+
|
20
|
+
// Gaussian Mixture Model (k=3) fit using E-M algorithm
|
21
|
+
function normal3(dd) {
|
22
|
+
return function() {
|
23
|
+
var r = Math.random(),
|
24
|
+
i = r < dd[0][2] ? 0 : r < dd[0][2] + dd[1][2] ? 1 : 2,
|
25
|
+
d = dd[i];
|
26
|
+
return d[0] + Math.sqrt(d[1]) * normal();
|
27
|
+
}
|
28
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
[0.009259259,0.014285714,0.014285714,0.016666667,0.016666667,0.017857143,0.018518519,0.027777778,0.028571429,0.028571429,0.028571429,0.033333333,0.033333333,0.035714286,0.0375,0.041666667,0.041666667,0.041666667,0.041666667,0.042857143,0.042857143,0.042857143,0.05,0.055555556,0.069444444,0.083333333,0.083333333,0.083333333,0.083333333,0.083333333,0.083333333,0.085714286,0.1,0.1,0.101851852,0.104166667,0.111111111,0.111111111,0.114285714,0.114285714,0.116666667,0.12037037,0.125,0.125,0.128571429,0.133333333,0.138888889,0.141666667,0.142857143,0.142857143,0.15,0.152777778,0.158333333,0.166666667,0.171428571,0.183333333,0.185714286,0.185714286,0.1875,0.190140845,0.194444444,0.2,0.204545455,0.208333333,0.214285714,0.214285714,0.253521127,0.271428571,0.277777778,0.291666667,0.3,0.3,0.307017544,0.324074074,0.328571429,0.333333333,0.333333333,0.342857143,0.357142857,0.358333333,0.378787879,0.381355932,0.395833333,0.4,0.414285714,0.414285714,0.414285714,0.414285714,0.43,0.433333333,0.4375,0.445833333,0.450704225,0.453333333,0.458333333,0.466666667,0.476666667,0.494736842,0.5,0.516666667,0.533333333,0.55,0.557142857,0.56884058,0.569444444,0.571428571,0.585714286,0.61,0.622222222,0.657407407,0.666666667,0.678947368,0.685714286,0.685714286,0.69047619,0.7,0.7,0.7,0.711538462,0.763888889,0.771428571,0.788888889,0.8,0.8,0.808333333,0.824712644,0.828571429,0.836842105,0.839285714,0.839285714,0.84,0.842857143,0.842857143,0.842857143,0.85,0.859649123,0.869791667,0.871428571,0.871428571,0.892344498,0.914285714,0.928571429,0.933908046,0.953703704,0.973684211,0.975,0.981481481,0.983333333,0.985714286,0.985714286,0.985714286,0.985714286,0.985714286,0.985714286,0.985714286,0.985714286,0.985714286,0.985714286,0.985714286,0.985714286,0.985714286,0.985714286,0.987096774,0.990740741,0.991666667,0.992,0.994047619,0.996666667,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
|
@@ -0,0 +1,114 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Quadtree</title>
|
5
|
+
<script type="text/javascript" src="../../d3.js"></script>
|
6
|
+
<script type="text/javascript" src="../../d3.geom.js"></script>
|
7
|
+
<style type="text/css">
|
8
|
+
|
9
|
+
svg {
|
10
|
+
padding: 2px;
|
11
|
+
}
|
12
|
+
|
13
|
+
circle {
|
14
|
+
fill: lightsteelblue;
|
15
|
+
stroke: steelblue;
|
16
|
+
stroke-width: 1.5px;
|
17
|
+
}
|
18
|
+
|
19
|
+
rect {
|
20
|
+
fill: none;
|
21
|
+
stroke: #000;
|
22
|
+
stroke-opacity: .3;
|
23
|
+
}
|
24
|
+
|
25
|
+
</style>
|
26
|
+
</head>
|
27
|
+
<body>
|
28
|
+
<script type="text/javascript">
|
29
|
+
|
30
|
+
var w = 500;
|
31
|
+
|
32
|
+
// Generate random points.
|
33
|
+
var data = d3.range(500).map(function() {
|
34
|
+
return {
|
35
|
+
x: Math.random() * w,
|
36
|
+
y: Math.random() * w
|
37
|
+
};
|
38
|
+
});
|
39
|
+
|
40
|
+
// Generate a quadtree of the specified data.
|
41
|
+
var quadtree = d3.geom.quadtree(data, 0, w);
|
42
|
+
|
43
|
+
var vis = d3.select("body").append("svg:svg")
|
44
|
+
.attr("width", w)
|
45
|
+
.attr("height", w)
|
46
|
+
.style("pointer-events", "all");
|
47
|
+
|
48
|
+
vis.selectAll("rect")
|
49
|
+
.data(nodes(quadtree))
|
50
|
+
.enter().append("svg:rect")
|
51
|
+
.attr("x", function(d) { return d.x; })
|
52
|
+
.attr("y", function(d) { return d.y; })
|
53
|
+
.attr("width", function(d) { return d.width; })
|
54
|
+
.attr("height", function(d) { return d.height; });
|
55
|
+
|
56
|
+
vis.selectAll("circle")
|
57
|
+
.data(data)
|
58
|
+
.enter().append("svg:circle")
|
59
|
+
.attr("cx", function(d) { return d.x; })
|
60
|
+
.attr("cy", function(d) { return d.y; })
|
61
|
+
.attr("r", 4.5);
|
62
|
+
|
63
|
+
// Highlight selected nodes using the quadtree.
|
64
|
+
vis.on("mousedown", function() {
|
65
|
+
var m0 = d3.svg.mouse(this);
|
66
|
+
|
67
|
+
var rect = d3.select(this).append("svg:rect")
|
68
|
+
.style("fill", "#999")
|
69
|
+
.style("fill-opacity", .5);
|
70
|
+
|
71
|
+
d3.select(window).on("mousemove", function() {
|
72
|
+
var m1 = d3.svg.mouse(rect.node()),
|
73
|
+
x0 = Math.min(w, m0[0], m1[0]),
|
74
|
+
y0 = Math.min(w, m0[1], m1[1]),
|
75
|
+
x1 = Math.max(0, m0[0], m1[0]),
|
76
|
+
y1 = Math.max(0, m0[1], m1[1]);
|
77
|
+
|
78
|
+
data.forEach(function(d) { d.z = 0; })
|
79
|
+
find(quadtree, x0, y0, x1, y1).forEach(function(d) { d.z = 1; });
|
80
|
+
vis.selectAll("circle").style("fill", function(d) { return d.z ? "red" : null; });
|
81
|
+
rect.attr("x", x0).attr("y", y0).attr("width", x1 - x0).attr("height", y1 - y0);
|
82
|
+
});
|
83
|
+
|
84
|
+
d3.select(window).on("mouseup", function() {
|
85
|
+
rect.remove();
|
86
|
+
d3.select(window).on("mousemove", null).on("mouseup", null);
|
87
|
+
});
|
88
|
+
|
89
|
+
d3.event.preventDefault();
|
90
|
+
});
|
91
|
+
|
92
|
+
// Collapse the quadtree into an array of rectangles.
|
93
|
+
function nodes(quadtree) {
|
94
|
+
var nodes = [];
|
95
|
+
quadtree.visit(function(node, x1, y1, x2, y2) {
|
96
|
+
nodes.push({x: x1, y: y1, width: x2 - x1, height: y2 - y1});
|
97
|
+
});
|
98
|
+
return nodes;
|
99
|
+
}
|
100
|
+
|
101
|
+
// Find the nodes within the specified rectangle.
|
102
|
+
function find(quadtree, x0, y0, x3, y3) {
|
103
|
+
var points = [];
|
104
|
+
quadtree.visit(function(node, x1, y1, x2, y2) {
|
105
|
+
var p = node.point;
|
106
|
+
if (p && (p.x >= x0) && (p.x < x3) && (p.y >= y0) && (p.y < y3)) points.push(p);
|
107
|
+
return x1 >= x3 || y1 >= y3 || x2 < x0 || y2 < y0;
|
108
|
+
});
|
109
|
+
return points;
|
110
|
+
}
|
111
|
+
|
112
|
+
</script>
|
113
|
+
</body>
|
114
|
+
</html>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Sizzle</title>
|
5
|
+
<script type="text/javascript" src="../../lib/sizzle/sizzle.js"></script>
|
6
|
+
<script type="text/javascript" src="../../d3.js"></script>
|
7
|
+
<style type="text/css">
|
8
|
+
|
9
|
+
body {
|
10
|
+
margin: 2em;
|
11
|
+
text-align: center;
|
12
|
+
font: 300 36px helvetica neue;
|
13
|
+
}
|
14
|
+
|
15
|
+
</style>
|
16
|
+
</head>
|
17
|
+
<body>
|
18
|
+
Sizzle.js disabled.
|
19
|
+
<script type="text/javascript">
|
20
|
+
|
21
|
+
// The :first pseudo-class is a custom Sizzle extension.
|
22
|
+
d3.select("body:first")
|
23
|
+
.html("Sizzle.js enabled!");
|
24
|
+
|
25
|
+
</script>
|
26
|
+
</body>
|
27
|
+
</html>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Merge Sort</title>
|
5
|
+
<script type="text/javascript" src="../../d3.js"></script>
|
6
|
+
<link type="text/css" rel="stylesheet" href="sort.css"/>
|
7
|
+
</head>
|
8
|
+
<body>
|
9
|
+
<div id="chart"></div>
|
10
|
+
<script type="text/javascript" src="sort.js"></script>
|
11
|
+
</body>
|
12
|
+
</html>
|
@@ -0,0 +1,112 @@
|
|
1
|
+
// Based on http://vis.stanford.edu/protovis/ex/sort.html
|
2
|
+
// Based on work by Robert Sedgewick
|
3
|
+
|
4
|
+
var w = 960,
|
5
|
+
h = 50,
|
6
|
+
n = 240,
|
7
|
+
x = d3.scale.linear().domain([0, n]).range([h, w - h]),
|
8
|
+
a = d3.scale.linear().domain([0, n - 1]).range([90 + 60, 270 - 60]),
|
9
|
+
data = shuffle(d3.range(n)),
|
10
|
+
duration = 250;
|
11
|
+
|
12
|
+
var vis = d3.select("#chart").append("svg:svg")
|
13
|
+
.attr("width", w)
|
14
|
+
.attr("height", h);
|
15
|
+
|
16
|
+
var line = vis.selectAll("line")
|
17
|
+
.data(data)
|
18
|
+
.enter().append("svg:line")
|
19
|
+
.attr("x1", 0)
|
20
|
+
.attr("y1", 0)
|
21
|
+
.attr("x2", 0)
|
22
|
+
.attr("y2", h)
|
23
|
+
.attr("transform", transform);
|
24
|
+
|
25
|
+
start();
|
26
|
+
|
27
|
+
// Start the animation!
|
28
|
+
function start() {
|
29
|
+
var passes = mergesort(data).reverse();
|
30
|
+
|
31
|
+
update();
|
32
|
+
|
33
|
+
function update() {
|
34
|
+
var pass = passes.pop();
|
35
|
+
|
36
|
+
line.data(pass, Number)
|
37
|
+
.transition()
|
38
|
+
.duration(duration)
|
39
|
+
.attr("transform", transform);
|
40
|
+
|
41
|
+
if (passes.length) {
|
42
|
+
setTimeout(update, duration);
|
43
|
+
} else {
|
44
|
+
shuffle(data);
|
45
|
+
setTimeout(start, duration + 4000);
|
46
|
+
}
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
function transform(d, i) {
|
51
|
+
return "translate(" + x(i) + "," + h + ")rotate(" + a(d) + ")";
|
52
|
+
}
|
53
|
+
|
54
|
+
// Fisher-Yates shuffle
|
55
|
+
function shuffle(array) {
|
56
|
+
var i = array.length, j, t;
|
57
|
+
while (--i > 0) {
|
58
|
+
j = ~~(Math.random() * (i + 1));
|
59
|
+
t = array[j];
|
60
|
+
array[j] = array[i];
|
61
|
+
array[i] = t;
|
62
|
+
}
|
63
|
+
return array;
|
64
|
+
}
|
65
|
+
|
66
|
+
//
|
67
|
+
// Sorts the specified array using bottom-up mergesort, returning an array of
|
68
|
+
// arrays representing the state of the specified array after each insertion for
|
69
|
+
// each parallel pass. The first pass is performed at size = 2.
|
70
|
+
//
|
71
|
+
function mergesort(array) {
|
72
|
+
var passes = [],
|
73
|
+
i,
|
74
|
+
j,
|
75
|
+
n = array.length,
|
76
|
+
m = 1;
|
77
|
+
|
78
|
+
// double the size each pass
|
79
|
+
while (m < array.length) {
|
80
|
+
i = j = 0; while (i < array.length) j += merge(i, i += m, i += m);
|
81
|
+
if (j) passes.push(array.slice());
|
82
|
+
else m <<= 1;
|
83
|
+
}
|
84
|
+
|
85
|
+
// Merges two adjacent sorted arrays in-place.
|
86
|
+
function merge(start, middle, end) {
|
87
|
+
middle = Math.min(array.length, middle);
|
88
|
+
end = Math.min(array.length, end);
|
89
|
+
for (; start < middle; start++) {
|
90
|
+
if (array[start] > array[middle]) {
|
91
|
+
var v = array[start];
|
92
|
+
array[start] = array[middle];
|
93
|
+
insert(middle, end, v);
|
94
|
+
return true;
|
95
|
+
}
|
96
|
+
}
|
97
|
+
return false;
|
98
|
+
}
|
99
|
+
|
100
|
+
// Inserts the value v into the subarray specified by start and end.
|
101
|
+
function insert(start, end, v) {
|
102
|
+
while (start + 1 < end && array[start + 1] < v) {
|
103
|
+
var tmp = array[start];
|
104
|
+
array[start] = array[start + 1];
|
105
|
+
array[start + 1] = tmp;
|
106
|
+
start++;
|
107
|
+
}
|
108
|
+
array[start] = v;
|
109
|
+
}
|
110
|
+
|
111
|
+
return passes;
|
112
|
+
}
|