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,237 @@
|
|
1
|
+
// Chart design based on the recommendations of Stephen Few. Implementation
|
2
|
+
// based on the work of Clint Ivy, Jamie Love, and Jason Davies.
|
3
|
+
// http://projects.instantcognition.com/protovis/bulletchart/
|
4
|
+
d3.chart.bullet = function() {
|
5
|
+
var orient = "left", // TODO top & bottom
|
6
|
+
reverse = false,
|
7
|
+
duration = 0,
|
8
|
+
ranges = d3_chart_bulletRanges,
|
9
|
+
markers = d3_chart_bulletMarkers,
|
10
|
+
measures = d3_chart_bulletMeasures,
|
11
|
+
width = 380,
|
12
|
+
height = 30,
|
13
|
+
tickFormat = null;
|
14
|
+
|
15
|
+
// For each small multiple…
|
16
|
+
function bullet(g) {
|
17
|
+
g.each(function(d, i) {
|
18
|
+
var rangez = ranges.call(this, d, i).slice().sort(d3.descending),
|
19
|
+
markerz = markers.call(this, d, i).slice().sort(d3.descending),
|
20
|
+
measurez = measures.call(this, d, i).slice().sort(d3.descending),
|
21
|
+
g = d3.select(this);
|
22
|
+
|
23
|
+
// Compute the new x-scale.
|
24
|
+
var x1 = d3.scale.linear()
|
25
|
+
.domain([0, Math.max(rangez[0], markerz[0], measurez[0])])
|
26
|
+
.range(reverse ? [width, 0] : [0, width]);
|
27
|
+
|
28
|
+
// Retrieve the old x-scale, if this is an update.
|
29
|
+
var x0 = this.__chart__ || d3.scale.linear()
|
30
|
+
.domain([0, Infinity])
|
31
|
+
.range(x1.range());
|
32
|
+
|
33
|
+
// Stash the new scale.
|
34
|
+
this.__chart__ = x1;
|
35
|
+
|
36
|
+
// Derive width-scales from the x-scales.
|
37
|
+
var w0 = d3_chart_bulletWidth(x0),
|
38
|
+
w1 = d3_chart_bulletWidth(x1);
|
39
|
+
|
40
|
+
// Update the range rects.
|
41
|
+
var range = g.selectAll("rect.range")
|
42
|
+
.data(rangez);
|
43
|
+
|
44
|
+
range.enter().append("svg:rect")
|
45
|
+
.attr("class", function(d, i) { return "range s" + i; })
|
46
|
+
.attr("width", w0)
|
47
|
+
.attr("height", height)
|
48
|
+
.attr("x", reverse ? x0 : 0)
|
49
|
+
.transition()
|
50
|
+
.duration(duration)
|
51
|
+
.attr("width", w1)
|
52
|
+
.attr("x", reverse ? x1 : 0);
|
53
|
+
|
54
|
+
range.transition()
|
55
|
+
.duration(duration)
|
56
|
+
.attr("x", reverse ? x1 : 0)
|
57
|
+
.attr("width", w1)
|
58
|
+
.attr("height", height);
|
59
|
+
|
60
|
+
// Update the measure rects.
|
61
|
+
var measure = g.selectAll("rect.measure")
|
62
|
+
.data(measurez);
|
63
|
+
|
64
|
+
measure.enter().append("svg:rect")
|
65
|
+
.attr("class", function(d, i) { return "measure s" + i; })
|
66
|
+
.attr("width", w0)
|
67
|
+
.attr("height", height / 3)
|
68
|
+
.attr("x", reverse ? x0 : 0)
|
69
|
+
.attr("y", height / 3)
|
70
|
+
.transition()
|
71
|
+
.duration(duration)
|
72
|
+
.attr("width", w1)
|
73
|
+
.attr("x", reverse ? x1 : 0);
|
74
|
+
|
75
|
+
measure.transition()
|
76
|
+
.duration(duration)
|
77
|
+
.attr("width", w1)
|
78
|
+
.attr("height", height / 3)
|
79
|
+
.attr("x", reverse ? x1 : 0)
|
80
|
+
.attr("y", height / 3);
|
81
|
+
|
82
|
+
// Update the marker lines.
|
83
|
+
var marker = g.selectAll("line.marker")
|
84
|
+
.data(markerz);
|
85
|
+
|
86
|
+
marker.enter().append("svg:line")
|
87
|
+
.attr("class", "marker")
|
88
|
+
.attr("x1", x0)
|
89
|
+
.attr("x2", x0)
|
90
|
+
.attr("y1", height / 6)
|
91
|
+
.attr("y2", height * 5 / 6)
|
92
|
+
.transition()
|
93
|
+
.duration(duration)
|
94
|
+
.attr("x1", x1)
|
95
|
+
.attr("x2", x1);
|
96
|
+
|
97
|
+
marker.transition()
|
98
|
+
.duration(duration)
|
99
|
+
.attr("x1", x1)
|
100
|
+
.attr("x2", x1)
|
101
|
+
.attr("y1", height / 6)
|
102
|
+
.attr("y2", height * 5 / 6);
|
103
|
+
|
104
|
+
// Compute the tick format.
|
105
|
+
var format = tickFormat || x1.tickFormat(8);
|
106
|
+
|
107
|
+
// Update the tick groups.
|
108
|
+
var tick = g.selectAll("g.tick")
|
109
|
+
.data(x1.ticks(8), function(d) {
|
110
|
+
return this.textContent || format(d);
|
111
|
+
});
|
112
|
+
|
113
|
+
// Initialize the ticks with the old scale, x0.
|
114
|
+
var tickEnter = tick.enter().append("svg:g")
|
115
|
+
.attr("class", "tick")
|
116
|
+
.attr("transform", d3_chart_bulletTranslate(x0))
|
117
|
+
.style("opacity", 1e-6);
|
118
|
+
|
119
|
+
tickEnter.append("svg:line")
|
120
|
+
.attr("y1", height)
|
121
|
+
.attr("y2", height * 7 / 6);
|
122
|
+
|
123
|
+
tickEnter.append("svg:text")
|
124
|
+
.attr("text-anchor", "middle")
|
125
|
+
.attr("dy", "1em")
|
126
|
+
.attr("y", height * 7 / 6)
|
127
|
+
.text(format);
|
128
|
+
|
129
|
+
// Transition the entering ticks to the new scale, x1.
|
130
|
+
tickEnter.transition()
|
131
|
+
.duration(duration)
|
132
|
+
.attr("transform", d3_chart_bulletTranslate(x1))
|
133
|
+
.style("opacity", 1);
|
134
|
+
|
135
|
+
// Transition the updating ticks to the new scale, x1.
|
136
|
+
var tickUpdate = tick.transition()
|
137
|
+
.duration(duration)
|
138
|
+
.attr("transform", d3_chart_bulletTranslate(x1))
|
139
|
+
.style("opacity", 1);
|
140
|
+
|
141
|
+
tickUpdate.select("line")
|
142
|
+
.attr("y1", height)
|
143
|
+
.attr("y2", height * 7 / 6);
|
144
|
+
|
145
|
+
tickUpdate.select("text")
|
146
|
+
.attr("y", height * 7 / 6);
|
147
|
+
|
148
|
+
// Transition the exiting ticks to the new scale, x1.
|
149
|
+
tick.exit().transition()
|
150
|
+
.duration(duration)
|
151
|
+
.attr("transform", d3_chart_bulletTranslate(x1))
|
152
|
+
.style("opacity", 1e-6)
|
153
|
+
.remove();
|
154
|
+
});
|
155
|
+
d3.timer.flush();
|
156
|
+
}
|
157
|
+
|
158
|
+
// left, right, top, bottom
|
159
|
+
bullet.orient = function(x) {
|
160
|
+
if (!arguments.length) return orient;
|
161
|
+
orient = x;
|
162
|
+
reverse = orient == "right" || orient == "bottom";
|
163
|
+
return bullet;
|
164
|
+
};
|
165
|
+
|
166
|
+
// ranges (bad, satisfactory, good)
|
167
|
+
bullet.ranges = function(x) {
|
168
|
+
if (!arguments.length) return ranges;
|
169
|
+
ranges = x;
|
170
|
+
return bullet;
|
171
|
+
};
|
172
|
+
|
173
|
+
// markers (previous, goal)
|
174
|
+
bullet.markers = function(x) {
|
175
|
+
if (!arguments.length) return markers;
|
176
|
+
markers = x;
|
177
|
+
return bullet;
|
178
|
+
};
|
179
|
+
|
180
|
+
// measures (actual, forecast)
|
181
|
+
bullet.measures = function(x) {
|
182
|
+
if (!arguments.length) return measures;
|
183
|
+
measures = x;
|
184
|
+
return bullet;
|
185
|
+
};
|
186
|
+
|
187
|
+
bullet.width = function(x) {
|
188
|
+
if (!arguments.length) return width;
|
189
|
+
width = x;
|
190
|
+
return bullet;
|
191
|
+
};
|
192
|
+
|
193
|
+
bullet.height = function(x) {
|
194
|
+
if (!arguments.length) return height;
|
195
|
+
height = x;
|
196
|
+
return bullet;
|
197
|
+
};
|
198
|
+
|
199
|
+
bullet.tickFormat = function(x) {
|
200
|
+
if (!arguments.length) return tickFormat;
|
201
|
+
tickFormat = x;
|
202
|
+
return bullet;
|
203
|
+
};
|
204
|
+
|
205
|
+
bullet.duration = function(x) {
|
206
|
+
if (!arguments.length) return duration;
|
207
|
+
duration = x;
|
208
|
+
return bullet;
|
209
|
+
};
|
210
|
+
|
211
|
+
return bullet;
|
212
|
+
};
|
213
|
+
|
214
|
+
function d3_chart_bulletRanges(d) {
|
215
|
+
return d.ranges;
|
216
|
+
}
|
217
|
+
|
218
|
+
function d3_chart_bulletMarkers(d) {
|
219
|
+
return d.markers;
|
220
|
+
}
|
221
|
+
|
222
|
+
function d3_chart_bulletMeasures(d) {
|
223
|
+
return d.measures;
|
224
|
+
}
|
225
|
+
|
226
|
+
function d3_chart_bulletTranslate(x) {
|
227
|
+
return function(d) {
|
228
|
+
return "translate(" + x(d) + ",0)";
|
229
|
+
};
|
230
|
+
}
|
231
|
+
|
232
|
+
function d3_chart_bulletWidth(x) {
|
233
|
+
var x0 = x(0);
|
234
|
+
return function(d) {
|
235
|
+
return Math.abs(x(d) - x0);
|
236
|
+
};
|
237
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
d3.chart = {};
|
@@ -0,0 +1,203 @@
|
|
1
|
+
// Implements a horizon layout, which is a variation of a single-series
|
2
|
+
// area chart where the area is folded into multiple bands. Color is used to
|
3
|
+
// encode band, allowing the size of the chart to be reduced significantly
|
4
|
+
// without impeding readability. This layout algorithm is based on the work of
|
5
|
+
// J. Heer, N. Kong and M. Agrawala in "Sizing the Horizon: The Effects of Chart
|
6
|
+
// Size and Layering on the Graphical Perception of Time Series Visualizations",
|
7
|
+
// CHI 2009. http://hci.stanford.edu/publications/2009/heer-horizon-chi09.pdf
|
8
|
+
d3.chart.horizon = function() {
|
9
|
+
var bands = 1, // between 1 and 5, typically
|
10
|
+
mode = "offset", // or mirror
|
11
|
+
interpolate = "linear", // or basis, monotone, step-before, etc.
|
12
|
+
x = d3_chart_horizonX,
|
13
|
+
y = d3_chart_horizonY,
|
14
|
+
w = 960,
|
15
|
+
h = 40,
|
16
|
+
duration = 0;
|
17
|
+
|
18
|
+
var color = d3.scale.linear()
|
19
|
+
.domain([-1, 0, 1])
|
20
|
+
.range(["#d62728", "#fff", "#1f77b4"]);
|
21
|
+
|
22
|
+
// For each small multiple…
|
23
|
+
function horizon(g) {
|
24
|
+
g.each(function(d, i) {
|
25
|
+
var g = d3.select(this),
|
26
|
+
n = 2 * bands + 1,
|
27
|
+
xMin = Infinity,
|
28
|
+
xMax = -Infinity,
|
29
|
+
yMax = -Infinity,
|
30
|
+
x0, // old x-scale
|
31
|
+
y0, // old y-scale
|
32
|
+
id; // unique id for paths
|
33
|
+
|
34
|
+
// Compute x- and y-values along with extents.
|
35
|
+
var data = d.map(function(d, i) {
|
36
|
+
var xv = x.call(this, d, i),
|
37
|
+
yv = y.call(this, d, i);
|
38
|
+
if (xv < xMin) xMin = xv;
|
39
|
+
if (xv > xMax) xMax = xv;
|
40
|
+
if (-yv > yMax) yMax = -yv;
|
41
|
+
if (yv > yMax) yMax = yv;
|
42
|
+
return [xv, yv];
|
43
|
+
});
|
44
|
+
|
45
|
+
// Compute the new x- and y-scales.
|
46
|
+
var x1 = d3.scale.linear().domain([xMin, xMax]).range([0, w]),
|
47
|
+
y1 = d3.scale.linear().domain([0, yMax]).range([0, h * bands]);
|
48
|
+
|
49
|
+
// Retrieve the old scales, if this is an update.
|
50
|
+
if (this.__chart__) {
|
51
|
+
x0 = this.__chart__.x;
|
52
|
+
y0 = this.__chart__.y;
|
53
|
+
id = this.__chart__.id;
|
54
|
+
} else {
|
55
|
+
x0 = d3.scale.linear().domain([0, Infinity]).range(x1.range());
|
56
|
+
y0 = d3.scale.linear().domain([0, Infinity]).range(y1.range());
|
57
|
+
id = ++d3_chart_horizonId;
|
58
|
+
}
|
59
|
+
|
60
|
+
// We'll use a defs to store the area path and the clip path.
|
61
|
+
var defs = g.selectAll("defs")
|
62
|
+
.data([data]);
|
63
|
+
|
64
|
+
var defsEnter = defs.enter().append("svg:defs");
|
65
|
+
|
66
|
+
// The clip path is a simple rect.
|
67
|
+
defsEnter.append("svg:clipPath")
|
68
|
+
.attr("id", "d3_chart_horizon_clip" + id)
|
69
|
+
.append("svg:rect")
|
70
|
+
.attr("width", w)
|
71
|
+
.attr("height", h);
|
72
|
+
|
73
|
+
defs.select("rect").transition()
|
74
|
+
.duration(duration)
|
75
|
+
.attr("width", w)
|
76
|
+
.attr("height", h);
|
77
|
+
|
78
|
+
// The area path is rendered with our resuable d3.svg.area.
|
79
|
+
defsEnter.append("svg:path")
|
80
|
+
.attr("id", "d3_chart_horizon_path" + id)
|
81
|
+
.attr("d", d3_chart_horizonArea
|
82
|
+
.interpolate(interpolate)
|
83
|
+
.x(function(d) { return x0(d[0]); })
|
84
|
+
.y0(h * bands)
|
85
|
+
.y1(function(d) { return h * bands - y0(d[1]); }))
|
86
|
+
.transition()
|
87
|
+
.duration(duration)
|
88
|
+
.attr("d", d3_chart_horizonArea
|
89
|
+
.x(function(d) { return x1(d[0]); })
|
90
|
+
.y1(function(d) { return h * bands - y1(d[1]); }));
|
91
|
+
|
92
|
+
defs.select("path").transition()
|
93
|
+
.duration(duration)
|
94
|
+
.attr("d", d3_chart_horizonArea);
|
95
|
+
|
96
|
+
// We'll use a container to clip all horizon layers at once.
|
97
|
+
g.selectAll("g")
|
98
|
+
.data([null])
|
99
|
+
.enter().append("svg:g")
|
100
|
+
.attr("clip-path", "url(#d3_chart_horizon_clip" + id + ")");
|
101
|
+
|
102
|
+
// Define the transform function based on the mode.
|
103
|
+
var transform = mode == "offset"
|
104
|
+
? function(d) { return "translate(0," + (d + (d < 0) - bands) * h + ")"; }
|
105
|
+
: function(d) { return (d < 0 ? "scale(1,-1)" : "") + "translate(0," + (d - bands) * h + ")"; };
|
106
|
+
|
107
|
+
// Instantiate each copy of the path with different transforms.
|
108
|
+
var u = g.select("g").selectAll("use")
|
109
|
+
.data(d3.range(-1, -bands - 1, -1).concat(d3.range(1, bands + 1)), Number);
|
110
|
+
|
111
|
+
// TODO don't fudge the enter transition
|
112
|
+
u.enter().append("svg:use")
|
113
|
+
.attr("xlink:href", "#d3_chart_horizon_path" + id)
|
114
|
+
.attr("transform", function(d) { return transform(d + (d > 0 ? 1 : -1)); })
|
115
|
+
.style("fill", color)
|
116
|
+
.transition()
|
117
|
+
.duration(duration)
|
118
|
+
.attr("transform", transform);
|
119
|
+
|
120
|
+
u.transition()
|
121
|
+
.duration(duration)
|
122
|
+
.attr("transform", transform)
|
123
|
+
.style("fill", color);
|
124
|
+
|
125
|
+
u.exit().transition()
|
126
|
+
.duration(duration)
|
127
|
+
.attr("transform", transform)
|
128
|
+
.remove();
|
129
|
+
|
130
|
+
// Stash the new scales.
|
131
|
+
this.__chart__ = {x: x1, y: y1, id: id};
|
132
|
+
});
|
133
|
+
d3.timer.flush();
|
134
|
+
}
|
135
|
+
|
136
|
+
horizon.duration = function(x) {
|
137
|
+
if (!arguments.length) return duration;
|
138
|
+
duration = +x;
|
139
|
+
return horizon;
|
140
|
+
};
|
141
|
+
|
142
|
+
horizon.bands = function(x) {
|
143
|
+
if (!arguments.length) return bands;
|
144
|
+
bands = +x;
|
145
|
+
color.domain([-bands, 0, bands]);
|
146
|
+
return horizon;
|
147
|
+
};
|
148
|
+
|
149
|
+
horizon.mode = function(x) {
|
150
|
+
if (!arguments.length) return mode;
|
151
|
+
mode = x + "";
|
152
|
+
return horizon;
|
153
|
+
};
|
154
|
+
|
155
|
+
horizon.colors = function(x) {
|
156
|
+
if (!arguments.length) return color.range();
|
157
|
+
color.range(x);
|
158
|
+
return horizon;
|
159
|
+
};
|
160
|
+
|
161
|
+
horizon.interpolate = function(x) {
|
162
|
+
if (!arguments.length) return interpolate;
|
163
|
+
interpolate = x + "";
|
164
|
+
return horizon;
|
165
|
+
};
|
166
|
+
|
167
|
+
horizon.x = function(z) {
|
168
|
+
if (!arguments.length) return x;
|
169
|
+
x = z;
|
170
|
+
return horizon;
|
171
|
+
};
|
172
|
+
|
173
|
+
horizon.y = function(z) {
|
174
|
+
if (!arguments.length) return y;
|
175
|
+
y = z;
|
176
|
+
return horizon;
|
177
|
+
};
|
178
|
+
|
179
|
+
horizon.width = function(x) {
|
180
|
+
if (!arguments.length) return w;
|
181
|
+
w = +x;
|
182
|
+
return horizon;
|
183
|
+
};
|
184
|
+
|
185
|
+
horizon.height = function(x) {
|
186
|
+
if (!arguments.length) return h;
|
187
|
+
h = +x;
|
188
|
+
return horizon;
|
189
|
+
};
|
190
|
+
|
191
|
+
return horizon;
|
192
|
+
};
|
193
|
+
|
194
|
+
var d3_chart_horizonArea = d3.svg.area(),
|
195
|
+
d3_chart_horizonId = 0;
|
196
|
+
|
197
|
+
function d3_chart_horizonX(d) {
|
198
|
+
return d[0];
|
199
|
+
}
|
200
|
+
|
201
|
+
function d3_chart_horizonY(d) {
|
202
|
+
return d[1];
|
203
|
+
}
|
@@ -0,0 +1,245 @@
|
|
1
|
+
// Based on http://vis.stanford.edu/protovis/ex/qqplot.html
|
2
|
+
d3.chart.qq = function() {
|
3
|
+
var width = 1,
|
4
|
+
height = 1,
|
5
|
+
duration = 0,
|
6
|
+
domain = null,
|
7
|
+
tickFormat = null,
|
8
|
+
n = 100,
|
9
|
+
x = d3_chart_qqX,
|
10
|
+
y = d3_chart_qqY;
|
11
|
+
|
12
|
+
// For each small multiple…
|
13
|
+
function qq(g) {
|
14
|
+
g.each(function(d, i) {
|
15
|
+
var g = d3.select(this),
|
16
|
+
qx = d3_chart_qqQuantiles(n, x.call(this, d, i)),
|
17
|
+
qy = d3_chart_qqQuantiles(n, y.call(this, d, i)),
|
18
|
+
xd = domain && domain.call(this, d, i) || [d3.min(qx), d3.max(qx)], // new x-domain
|
19
|
+
yd = domain && domain.call(this, d, i) || [d3.min(qy), d3.max(qy)], // new y-domain
|
20
|
+
x0, // old x-scale
|
21
|
+
y0; // old y-scale
|
22
|
+
|
23
|
+
// Compute the new x-scale.
|
24
|
+
var x1 = d3.scale.linear()
|
25
|
+
.domain(xd)
|
26
|
+
.range([0, width]);
|
27
|
+
|
28
|
+
// Compute the new y-scale.
|
29
|
+
var y1 = d3.scale.linear()
|
30
|
+
.domain(yd)
|
31
|
+
.range([height, 0]);
|
32
|
+
|
33
|
+
// Retrieve the old scales, if this is an update.
|
34
|
+
if (this.__chart__) {
|
35
|
+
x0 = this.__chart__.x;
|
36
|
+
y0 = this.__chart__.y;
|
37
|
+
} else {
|
38
|
+
x0 = d3.scale.linear().domain([0, Infinity]).range(x1.range());
|
39
|
+
y0 = d3.scale.linear().domain([0, Infinity]).range(y1.range());
|
40
|
+
}
|
41
|
+
|
42
|
+
// Stash the new scales.
|
43
|
+
this.__chart__ = {x: x1, y: y1};
|
44
|
+
|
45
|
+
// Update diagonal line.
|
46
|
+
var diagonal = g.selectAll("line.diagonal")
|
47
|
+
.data([null]);
|
48
|
+
|
49
|
+
diagonal.enter().append("svg:line")
|
50
|
+
.attr("class", "diagonal")
|
51
|
+
.attr("x1", x1(yd[0]))
|
52
|
+
.attr("y1", y1(xd[0]))
|
53
|
+
.attr("x2", x1(yd[1]))
|
54
|
+
.attr("y2", y1(xd[1]));
|
55
|
+
|
56
|
+
diagonal.transition()
|
57
|
+
.duration(duration)
|
58
|
+
.attr("x1", x1(yd[0]))
|
59
|
+
.attr("y1", y1(xd[0]))
|
60
|
+
.attr("x2", x1(yd[1]))
|
61
|
+
.attr("y2", y1(xd[1]));
|
62
|
+
|
63
|
+
// Update quantile plots.
|
64
|
+
var circle = g.selectAll("circle")
|
65
|
+
.data(d3.range(n).map(function(i) {
|
66
|
+
return {x: qx[i], y: qy[i]};
|
67
|
+
}));
|
68
|
+
|
69
|
+
circle.enter().append("svg:circle")
|
70
|
+
.attr("class", "quantile")
|
71
|
+
.attr("r", 4.5)
|
72
|
+
.attr("cx", function(d) { return x0(d.x); })
|
73
|
+
.attr("cy", function(d) { return y0(d.y); })
|
74
|
+
.style("opacity", 1e-6)
|
75
|
+
.transition()
|
76
|
+
.duration(duration)
|
77
|
+
.attr("cx", function(d) { return x1(d.x); })
|
78
|
+
.attr("cy", function(d) { return y1(d.y); })
|
79
|
+
.style("opacity", 1);
|
80
|
+
|
81
|
+
circle.transition()
|
82
|
+
.duration(duration)
|
83
|
+
.attr("cx", function(d) { return x1(d.x); })
|
84
|
+
.attr("cy", function(d) { return y1(d.y); })
|
85
|
+
.style("opacity", 1);
|
86
|
+
|
87
|
+
circle.exit().transition()
|
88
|
+
.duration(duration)
|
89
|
+
.attr("cx", function(d) { return x1(d.x); })
|
90
|
+
.attr("cy", function(d) { return y1(d.y); })
|
91
|
+
.style("opacity", 1e-6)
|
92
|
+
.remove();
|
93
|
+
|
94
|
+
var xformat = tickFormat || x1.tickFormat(4),
|
95
|
+
yformat = tickFormat || y1.tickFormat(4),
|
96
|
+
tx = function(d) { return "translate(" + x1(d) + "," + height + ")"; },
|
97
|
+
ty = function(d) { return "translate(0," + y1(d) + ")"; };
|
98
|
+
|
99
|
+
// Update x-ticks.
|
100
|
+
var xtick = g.selectAll("g.x.tick")
|
101
|
+
.data(x1.ticks(4), function(d) {
|
102
|
+
return this.textContent || xformat(d);
|
103
|
+
});
|
104
|
+
|
105
|
+
var xtickEnter = xtick.enter().append("svg:g")
|
106
|
+
.attr("class", "x tick")
|
107
|
+
.attr("transform", function(d) { return "translate(" + x0(d) + "," + height + ")"; })
|
108
|
+
.style("opacity", 1e-6);
|
109
|
+
|
110
|
+
xtickEnter.append("svg:line")
|
111
|
+
.attr("y1", 0)
|
112
|
+
.attr("y2", -6);
|
113
|
+
|
114
|
+
xtickEnter.append("svg:text")
|
115
|
+
.attr("text-anchor", "middle")
|
116
|
+
.attr("dy", "1em")
|
117
|
+
.text(xformat);
|
118
|
+
|
119
|
+
// Transition the entering ticks to the new scale, x1.
|
120
|
+
xtickEnter.transition()
|
121
|
+
.duration(duration)
|
122
|
+
.attr("transform", tx)
|
123
|
+
.style("opacity", 1);
|
124
|
+
|
125
|
+
// Transition the updating ticks to the new scale, x1.
|
126
|
+
xtick.transition()
|
127
|
+
.duration(duration)
|
128
|
+
.attr("transform", tx)
|
129
|
+
.style("opacity", 1);
|
130
|
+
|
131
|
+
// Transition the exiting ticks to the new scale, x1.
|
132
|
+
xtick.exit().transition()
|
133
|
+
.duration(duration)
|
134
|
+
.attr("transform", tx)
|
135
|
+
.style("opacity", 1e-6)
|
136
|
+
.remove();
|
137
|
+
|
138
|
+
// Update ticks.
|
139
|
+
var ytick = g.selectAll("g.y.tick")
|
140
|
+
.data(y1.ticks(4), function(d) {
|
141
|
+
return this.textContent || yformat(d);
|
142
|
+
});
|
143
|
+
|
144
|
+
var ytickEnter = ytick.enter().append("svg:g")
|
145
|
+
.attr("class", "y tick")
|
146
|
+
.attr("transform", function(d) { return "translate(0," + y0(d) + ")"; })
|
147
|
+
.style("opacity", 1e-6);
|
148
|
+
|
149
|
+
ytickEnter.append("svg:line")
|
150
|
+
.attr("x1", 0)
|
151
|
+
.attr("x2", 6);
|
152
|
+
|
153
|
+
ytickEnter.append("svg:text")
|
154
|
+
.attr("text-anchor", "end")
|
155
|
+
.attr("dx", "-.5em")
|
156
|
+
.attr("dy", ".3em")
|
157
|
+
.text(yformat);
|
158
|
+
|
159
|
+
// Transition the entering ticks to the new scale, y1.
|
160
|
+
ytickEnter.transition()
|
161
|
+
.duration(duration)
|
162
|
+
.attr("transform", ty)
|
163
|
+
.style("opacity", 1);
|
164
|
+
|
165
|
+
// Transition the updating ticks to the new scale, y1.
|
166
|
+
ytick.transition()
|
167
|
+
.duration(duration)
|
168
|
+
.attr("transform", ty)
|
169
|
+
.style("opacity", 1);
|
170
|
+
|
171
|
+
// Transition the exiting ticks to the new scale, y1.
|
172
|
+
ytick.exit().transition()
|
173
|
+
.duration(duration)
|
174
|
+
.attr("transform", ty)
|
175
|
+
.style("opacity", 1e-6)
|
176
|
+
.remove();
|
177
|
+
});
|
178
|
+
}
|
179
|
+
|
180
|
+
qq.width = function(x) {
|
181
|
+
if (!arguments.length) return width;
|
182
|
+
width = x;
|
183
|
+
return qq;
|
184
|
+
};
|
185
|
+
|
186
|
+
qq.height = function(x) {
|
187
|
+
if (!arguments.length) return height;
|
188
|
+
height = x;
|
189
|
+
return qq;
|
190
|
+
};
|
191
|
+
|
192
|
+
qq.duration = function(x) {
|
193
|
+
if (!arguments.length) return duration;
|
194
|
+
duration = x;
|
195
|
+
return qq;
|
196
|
+
};
|
197
|
+
|
198
|
+
qq.domain = function(x) {
|
199
|
+
if (!arguments.length) return domain;
|
200
|
+
domain = x == null ? x : d3.functor(x);
|
201
|
+
return qq;
|
202
|
+
};
|
203
|
+
|
204
|
+
qq.count = function(z) {
|
205
|
+
if (!arguments.length) return n;
|
206
|
+
n = z;
|
207
|
+
return qq;
|
208
|
+
};
|
209
|
+
|
210
|
+
qq.x = function(z) {
|
211
|
+
if (!arguments.length) return x;
|
212
|
+
x = z;
|
213
|
+
return qq;
|
214
|
+
};
|
215
|
+
|
216
|
+
qq.y = function(z) {
|
217
|
+
if (!arguments.length) return y;
|
218
|
+
y = z;
|
219
|
+
return qq;
|
220
|
+
};
|
221
|
+
|
222
|
+
qq.tickFormat = function(x) {
|
223
|
+
if (!arguments.length) return tickFormat;
|
224
|
+
tickFormat = x;
|
225
|
+
return qq;
|
226
|
+
};
|
227
|
+
|
228
|
+
return qq;
|
229
|
+
};
|
230
|
+
|
231
|
+
function d3_chart_qqQuantiles(n, values) {
|
232
|
+
var m = values.length - 1;
|
233
|
+
values = values.slice().sort(d3.ascending);
|
234
|
+
return d3.range(n).map(function(i) {
|
235
|
+
return values[~~(i * m / n)];
|
236
|
+
});
|
237
|
+
}
|
238
|
+
|
239
|
+
function d3_chart_qqX(d) {
|
240
|
+
return d.x;
|
241
|
+
}
|
242
|
+
|
243
|
+
function d3_chart_qqY(d) {
|
244
|
+
return d.y;
|
245
|
+
}
|