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,103 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Dot Plot</title>
|
5
|
+
<script type="text/javascript" src="../../d3.js"></script>
|
6
|
+
<style type="text/css">
|
7
|
+
|
8
|
+
body {
|
9
|
+
font: 10px sans-serif;
|
10
|
+
}
|
11
|
+
|
12
|
+
path.dot {
|
13
|
+
fill: white;
|
14
|
+
stroke-width: 1.5px;
|
15
|
+
}
|
16
|
+
|
17
|
+
rect {
|
18
|
+
fill: none;
|
19
|
+
stroke: black;
|
20
|
+
shape-rendering: crispEdges;
|
21
|
+
}
|
22
|
+
|
23
|
+
.x line, .y line {
|
24
|
+
stroke: #ccc;
|
25
|
+
shape-rendering: crispEdges;
|
26
|
+
}
|
27
|
+
|
28
|
+
</style>
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<script type="text/javascript">
|
32
|
+
|
33
|
+
var data = d3.range(100).map(function(i) {
|
34
|
+
return {x: i / 99, y: Math.random()};
|
35
|
+
});
|
36
|
+
|
37
|
+
var w = 450,
|
38
|
+
h = 450,
|
39
|
+
p = 20,
|
40
|
+
x = d3.scale.linear().range([0, w]),
|
41
|
+
y = d3.scale.linear().range([h, 0]),
|
42
|
+
symbol = d3.scale.ordinal().range(d3.svg.symbolTypes),
|
43
|
+
color = d3.scale.category10();
|
44
|
+
|
45
|
+
var vis = d3.select("body")
|
46
|
+
.append("svg:svg")
|
47
|
+
.attr("width", w + p * 2)
|
48
|
+
.attr("height", h + p * 2)
|
49
|
+
.append("svg:g")
|
50
|
+
.attr("transform", "translate(" + p + "," + p + ")");
|
51
|
+
|
52
|
+
var xrule = vis.selectAll("g.x")
|
53
|
+
.data(x.ticks(10))
|
54
|
+
.enter().append("svg:g")
|
55
|
+
.attr("class", "x");
|
56
|
+
|
57
|
+
xrule.append("svg:line")
|
58
|
+
.attr("x1", x)
|
59
|
+
.attr("x2", x)
|
60
|
+
.attr("y1", 0)
|
61
|
+
.attr("y2", h);
|
62
|
+
|
63
|
+
xrule.append("svg:text")
|
64
|
+
.attr("x", x)
|
65
|
+
.attr("y", h + 3)
|
66
|
+
.attr("dy", ".71em")
|
67
|
+
.attr("text-anchor", "middle")
|
68
|
+
.text(x.tickFormat(10));
|
69
|
+
|
70
|
+
var yrule = vis.selectAll("g.y")
|
71
|
+
.data(y.ticks(10))
|
72
|
+
.enter().append("svg:g")
|
73
|
+
.attr("class", "y");
|
74
|
+
|
75
|
+
yrule.append("svg:line")
|
76
|
+
.attr("x1", 0)
|
77
|
+
.attr("x2", w)
|
78
|
+
.attr("y1", y)
|
79
|
+
.attr("y2", y);
|
80
|
+
|
81
|
+
yrule.append("svg:text")
|
82
|
+
.attr("x", -3)
|
83
|
+
.attr("y", y)
|
84
|
+
.attr("dy", ".35em")
|
85
|
+
.attr("text-anchor", "end")
|
86
|
+
.text(y.tickFormat(10));
|
87
|
+
|
88
|
+
vis.append("svg:rect")
|
89
|
+
.attr("width", w)
|
90
|
+
.attr("height", h);
|
91
|
+
|
92
|
+
vis.selectAll("path.dot")
|
93
|
+
.data(data)
|
94
|
+
.enter().append("svg:path")
|
95
|
+
.attr("class", "dot")
|
96
|
+
.attr("stroke", function(d, i) { return color(i); })
|
97
|
+
.attr("transform", function(d) { return "translate(" + x(d.x) + "," + y(d.y) + ")"; })
|
98
|
+
.attr("d", d3.svg.symbol()
|
99
|
+
.type(function(d, i) { return symbol(i); }));
|
100
|
+
|
101
|
+
</script>
|
102
|
+
</body>
|
103
|
+
</html>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
The miserables.json file contains the weighted network of coappearances of
|
2
|
+
characters in Victor Hugo's novel /Les Miserables/. Nodes represent characters
|
3
|
+
as indicated by the labels, and edges connect any pair of characters that
|
4
|
+
appear in the same chapter of the book. The values on the edges are the number
|
5
|
+
of such coappearances. The data on coappearances were taken from D. E. Knuth,
|
6
|
+
"The Stanford GraphBase: A Platform for Combinatorial Computing",
|
7
|
+
Addison-Wesley, Reading, MA (1993).
|
8
|
+
|
9
|
+
The group labels were transcribed from "Finding and evaluating community
|
10
|
+
structure in networks" by M. E. J. Newman and M. Girvan.
|
@@ -0,0 +1,70 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Force-Directed Layout</title>
|
5
|
+
<script type="text/javascript" src="../../d3.js"></script>
|
6
|
+
<script type="text/javascript" src="../../d3.geom.js"></script>
|
7
|
+
<script type="text/javascript" src="../../d3.layout.js"></script>
|
8
|
+
<style type="text/css">
|
9
|
+
|
10
|
+
circle {
|
11
|
+
stroke-width: 1.5px;
|
12
|
+
}
|
13
|
+
|
14
|
+
line {
|
15
|
+
stroke: #999;
|
16
|
+
}
|
17
|
+
|
18
|
+
</style>
|
19
|
+
</head>
|
20
|
+
<body>
|
21
|
+
<script type="text/javascript">
|
22
|
+
|
23
|
+
var w = 960,
|
24
|
+
h = 500,
|
25
|
+
r = 6,
|
26
|
+
fill = d3.scale.category20();
|
27
|
+
|
28
|
+
var force = d3.layout.force()
|
29
|
+
.gravity(.01)
|
30
|
+
.charge(-120)
|
31
|
+
.linkDistance(30)
|
32
|
+
.size([w, h]);
|
33
|
+
|
34
|
+
var svg = d3.select("body").append("svg:svg")
|
35
|
+
.attr("width", w)
|
36
|
+
.attr("height", h);
|
37
|
+
|
38
|
+
d3.json("miserables.json", function(json) {
|
39
|
+
var link = svg.selectAll("line")
|
40
|
+
.data(json.links)
|
41
|
+
.enter().append("svg:line");
|
42
|
+
|
43
|
+
var node = svg.selectAll("circle")
|
44
|
+
.data(json.nodes)
|
45
|
+
.enter().append("svg:circle")
|
46
|
+
.attr("r", r - .75)
|
47
|
+
.style("fill", function(d) { return fill(d.group); })
|
48
|
+
.style("stroke", function(d) { return d3.rgb(fill(d.group)).darker(); })
|
49
|
+
.call(force.drag);
|
50
|
+
|
51
|
+
force
|
52
|
+
.nodes(json.nodes)
|
53
|
+
.links(json.links)
|
54
|
+
.on("tick", tick)
|
55
|
+
.start();
|
56
|
+
|
57
|
+
function tick() {
|
58
|
+
node.attr("cx", function(d) { return d.x = Math.max(r, Math.min(w - r, d.x)); })
|
59
|
+
.attr("cy", function(d) { return d.y = Math.max(r, Math.min(h - r, d.y)); });
|
60
|
+
|
61
|
+
link.attr("x1", function(d) { return d.source.x; })
|
62
|
+
.attr("y1", function(d) { return d.source.y; })
|
63
|
+
.attr("x2", function(d) { return d.target.x; })
|
64
|
+
.attr("y2", function(d) { return d.target.y; });
|
65
|
+
}
|
66
|
+
});
|
67
|
+
|
68
|
+
</script>
|
69
|
+
</body>
|
70
|
+
</html>
|
@@ -0,0 +1,251 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Clustered Network</title>
|
5
|
+
<script type="text/javascript" src="../../d3.js"></script>
|
6
|
+
<script type="text/javascript" src="../../d3.geom.js"></script>
|
7
|
+
<script type="text/javascript" src="../../d3.layout.js"></script>
|
8
|
+
<style type="text/css">
|
9
|
+
svg {
|
10
|
+
border: 1px solid #ccc;
|
11
|
+
}
|
12
|
+
body {
|
13
|
+
font: 10px sans-serif;
|
14
|
+
}
|
15
|
+
circle.node {
|
16
|
+
fill: lightsteelblue;
|
17
|
+
stroke: #fff;
|
18
|
+
stroke-width: 1.5px;
|
19
|
+
}
|
20
|
+
path.hull {
|
21
|
+
fill: lightsteelblue;
|
22
|
+
fill-opacity: 0.3;
|
23
|
+
}
|
24
|
+
line.link {
|
25
|
+
stroke: #333;
|
26
|
+
stroke-opacity: 0.5;
|
27
|
+
pointer-events: none;
|
28
|
+
}
|
29
|
+
</style>
|
30
|
+
</head>
|
31
|
+
<body>
|
32
|
+
<script type="text/javascript">
|
33
|
+
var w = 960, // svg width
|
34
|
+
h = 600, // svg height
|
35
|
+
dr = 4, // default point radius
|
36
|
+
off = 15, // cluster hull offset
|
37
|
+
expand = {}, // expanded clusters
|
38
|
+
data, net, force, hullg, hull, linkg, link, nodeg, node,
|
39
|
+
curve = d3.svg.line().interpolate("cardinal-closed").tension(.85),
|
40
|
+
fill = d3.scale.category20();
|
41
|
+
|
42
|
+
function noop() { return false; }
|
43
|
+
|
44
|
+
function nodeid(n) {
|
45
|
+
return n.size ? "_g_"+n.group : n.name;
|
46
|
+
}
|
47
|
+
|
48
|
+
function linkid(l) {
|
49
|
+
var u = nodeid(l.source),
|
50
|
+
v = nodeid(l.target);
|
51
|
+
return u<v ? u+"|"+v : v+"|"+u;
|
52
|
+
}
|
53
|
+
|
54
|
+
function getGroup(n) { return n.group; }
|
55
|
+
|
56
|
+
// constructs the network to visualize
|
57
|
+
function network(data, prev, index, expand) {
|
58
|
+
expand = expand || {};
|
59
|
+
var gm = {}, // group map
|
60
|
+
nm = {}, // node map
|
61
|
+
lm = {}, // link map
|
62
|
+
gn = {}, // previous group nodes
|
63
|
+
gc = {}, // previous group centroids
|
64
|
+
nodes = [], // output nodes
|
65
|
+
links = []; // output links
|
66
|
+
|
67
|
+
// process previous nodes for reuse or centroid calculation
|
68
|
+
if (prev) {
|
69
|
+
prev.nodes.forEach(function(n) {
|
70
|
+
var i = index(n), o;
|
71
|
+
if (n.size > 0) {
|
72
|
+
gn[i] = n;
|
73
|
+
n.size = 0;
|
74
|
+
} else {
|
75
|
+
o = gc[i] || (gc[i] = {x:0,y:0,count:0});
|
76
|
+
o.x += n.x;
|
77
|
+
o.y += n.y;
|
78
|
+
o.count += 1;
|
79
|
+
}
|
80
|
+
});
|
81
|
+
}
|
82
|
+
|
83
|
+
// determine nodes
|
84
|
+
for (var k=0; k<data.nodes.length; ++k) {
|
85
|
+
var n = data.nodes[k],
|
86
|
+
i = index(n);
|
87
|
+
|
88
|
+
if (expand[i]) {
|
89
|
+
// the node should be directly visible
|
90
|
+
nm[n.name] = nodes.length;
|
91
|
+
nodes.push(n);
|
92
|
+
if (gn[i]) {
|
93
|
+
// place new nodes at cluster location (plus jitter)
|
94
|
+
n.x = gn[i].x + Math.random();
|
95
|
+
n.y = gn[i].y + Math.random();
|
96
|
+
}
|
97
|
+
} else {
|
98
|
+
// the node is part of a collapsed cluster
|
99
|
+
var l = gm[i] || (gm[i]=gn[i]) || (gm[i]={group:i, size:0, nodes:[]});
|
100
|
+
if (l.size == 0) {
|
101
|
+
// if new cluster, add to set and position at centroid of leaf nodes
|
102
|
+
nm[i] = nodes.length;
|
103
|
+
nodes.push(l);
|
104
|
+
if (gc[i]) {
|
105
|
+
l.x = gc[i].x / gc[i].count;
|
106
|
+
l.y = gc[i].y / gc[i].count;
|
107
|
+
}
|
108
|
+
}
|
109
|
+
l.size += 1;
|
110
|
+
l.nodes.push(n);
|
111
|
+
}
|
112
|
+
}
|
113
|
+
|
114
|
+
// determine links
|
115
|
+
for (k=0; k<data.links.length; ++k) {
|
116
|
+
var e = data.links[k],
|
117
|
+
u = index(e.source),
|
118
|
+
v = index(e.target);
|
119
|
+
u = expand[u] ? nm[e.source.name] : nm[u];
|
120
|
+
v = expand[v] ? nm[e.target.name] : nm[v];
|
121
|
+
var i = (u<v ? u+"|"+v : v+"|"+u),
|
122
|
+
l = lm[i] || (lm[i] = {source:u, target:v, size:0});
|
123
|
+
l.size += 1;
|
124
|
+
}
|
125
|
+
for (i in lm) { links.push(lm[i]); }
|
126
|
+
|
127
|
+
return {nodes: nodes, links: links};
|
128
|
+
}
|
129
|
+
|
130
|
+
function convexHulls(nodes, index, offset) {
|
131
|
+
var h = {};
|
132
|
+
|
133
|
+
// create point sets
|
134
|
+
for (var k=0; k<nodes.length; ++k) {
|
135
|
+
var n = nodes[k];
|
136
|
+
if (n.size) continue;
|
137
|
+
var i = index(n),
|
138
|
+
l = h[i] || (h[i] = []);
|
139
|
+
l.push([n.x-offset, n.y-offset]);
|
140
|
+
l.push([n.x-offset, n.y+offset]);
|
141
|
+
l.push([n.x+offset, n.y-offset]);
|
142
|
+
l.push([n.x+offset, n.y+offset]);
|
143
|
+
}
|
144
|
+
|
145
|
+
// create convex hulls
|
146
|
+
var hulls = [];
|
147
|
+
for (i in h) {
|
148
|
+
hulls.push({group: i, path: d3.geom.hull(h[i])});
|
149
|
+
}
|
150
|
+
|
151
|
+
return hulls;
|
152
|
+
}
|
153
|
+
|
154
|
+
function drawCluster(d) {
|
155
|
+
return curve(d.path); // 0.8
|
156
|
+
}
|
157
|
+
|
158
|
+
// --------------------------------------------------------
|
159
|
+
|
160
|
+
var body = d3.select("body");
|
161
|
+
|
162
|
+
var vis = body.append("svg:svg")
|
163
|
+
.attr("width", w)
|
164
|
+
.attr("height", h);
|
165
|
+
|
166
|
+
d3.json("miserables.json", function(json) {
|
167
|
+
data = json;
|
168
|
+
for (var i=0; i<data.links.length; ++i) {
|
169
|
+
o = data.links[i];
|
170
|
+
o.source = data.nodes[o.source];
|
171
|
+
o.target = data.nodes[o.target];
|
172
|
+
}
|
173
|
+
|
174
|
+
hullg = vis.append("svg:g");
|
175
|
+
linkg = vis.append("svg:g");
|
176
|
+
nodeg = vis.append("svg:g");
|
177
|
+
|
178
|
+
init();
|
179
|
+
|
180
|
+
vis.attr("opacity", 1e-6)
|
181
|
+
.transition()
|
182
|
+
.duration(1000)
|
183
|
+
.attr("opacity", 1);
|
184
|
+
});
|
185
|
+
|
186
|
+
function init() {
|
187
|
+
if (force) force.stop();
|
188
|
+
|
189
|
+
net = network(data, net, getGroup, expand);
|
190
|
+
|
191
|
+
force = d3.layout.force()
|
192
|
+
.nodes(net.nodes)
|
193
|
+
.links(net.links)
|
194
|
+
.size([w, h])
|
195
|
+
.linkDistance(50)
|
196
|
+
.start();
|
197
|
+
|
198
|
+
hullg.selectAll("path.hull").remove();
|
199
|
+
hull = hullg.selectAll("path.hull")
|
200
|
+
.data(convexHulls(net.nodes, getGroup, off))
|
201
|
+
.enter().append("svg:path")
|
202
|
+
.attr("class", "hull")
|
203
|
+
.attr("d", drawCluster)
|
204
|
+
.style("fill", function(d) { return fill(d.group); })
|
205
|
+
.on("dblclick", function(d) { expand[d.group] = false; init(); });
|
206
|
+
|
207
|
+
link = linkg.selectAll("line.link").data(net.links, linkid);
|
208
|
+
link.exit().remove();
|
209
|
+
link.enter().append("svg:line")
|
210
|
+
.attr("class", "link")
|
211
|
+
.attr("x1", function(d) { return d.source.x; })
|
212
|
+
.attr("y1", function(d) { return d.source.y; })
|
213
|
+
.attr("x2", function(d) { return d.target.x; })
|
214
|
+
.attr("y2", function(d) { return d.target.y; })
|
215
|
+
.style("stroke-width", function(d) { return d.size || 1; });
|
216
|
+
link = linkg.selectAll("line.link");
|
217
|
+
|
218
|
+
node = nodeg.selectAll("circle.node").data(net.nodes, nodeid);
|
219
|
+
node.exit().remove();
|
220
|
+
node.enter().append("svg:circle")
|
221
|
+
.attr("class", function(d) { return "node" + (d.size?"":" leaf"); })
|
222
|
+
.attr("r", function(d) { return d.size ? d.size + dr : dr+1; })
|
223
|
+
.attr("cx", function(d) { return d.x; })
|
224
|
+
.attr("cy", function(d) { return d.y; })
|
225
|
+
.style("fill", function(d) { return fill(d.group); })
|
226
|
+
.on("dblclick", function(d) {
|
227
|
+
if (d.size) { expand[d.group] = true; init(); }
|
228
|
+
});
|
229
|
+
|
230
|
+
node = nodeg.selectAll("circle.node")
|
231
|
+
.call(force.drag);
|
232
|
+
|
233
|
+
force.on("tick", function() {
|
234
|
+
if (!hull.empty()) {
|
235
|
+
hull.data(convexHulls(net.nodes, getGroup, off))
|
236
|
+
.attr("d", drawCluster);
|
237
|
+
}
|
238
|
+
|
239
|
+
link.attr("x1", function(d) { return d.source.x; })
|
240
|
+
.attr("y1", function(d) { return d.source.y; })
|
241
|
+
.attr("x2", function(d) { return d.target.x; })
|
242
|
+
.attr("y2", function(d) { return d.target.y; });
|
243
|
+
|
244
|
+
node.attr("cx", function(d) { return d.x; })
|
245
|
+
.attr("cy", function(d) { return d.y; });
|
246
|
+
});
|
247
|
+
}
|
248
|
+
|
249
|
+
</script>
|
250
|
+
</body>
|
251
|
+
</html>
|
@@ -0,0 +1,118 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Force-Directed Layout (Dynamic)</title>
|
5
|
+
<script type="text/javascript" src="../../d3.js"></script>
|
6
|
+
<script type="text/javascript" src="../../d3.geom.js"></script>
|
7
|
+
<script type="text/javascript" src="../../d3.layout.js"></script>
|
8
|
+
<style type="text/css">
|
9
|
+
|
10
|
+
rect {
|
11
|
+
fill: #fff;
|
12
|
+
}
|
13
|
+
|
14
|
+
.node {
|
15
|
+
fill: #000;
|
16
|
+
}
|
17
|
+
|
18
|
+
.cursor {
|
19
|
+
fill: none;
|
20
|
+
stroke: brown;
|
21
|
+
pointer-events: none;
|
22
|
+
}
|
23
|
+
|
24
|
+
.link {
|
25
|
+
stroke: #999;
|
26
|
+
}
|
27
|
+
|
28
|
+
</style>
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="chart"></div>
|
32
|
+
<script type="text/javascript">
|
33
|
+
|
34
|
+
var w = 960,
|
35
|
+
h = 500,
|
36
|
+
fill = d3.scale.category20(),
|
37
|
+
nodes = [],
|
38
|
+
links = [];
|
39
|
+
|
40
|
+
var vis = d3.select("#chart").append("svg:svg")
|
41
|
+
.attr("width", w)
|
42
|
+
.attr("height", h);
|
43
|
+
|
44
|
+
vis.append("svg:rect")
|
45
|
+
.attr("width", w)
|
46
|
+
.attr("height", h);
|
47
|
+
|
48
|
+
var force = d3.layout.force()
|
49
|
+
.distance(30)
|
50
|
+
.nodes(nodes)
|
51
|
+
.links(links)
|
52
|
+
.size([w, h]);
|
53
|
+
|
54
|
+
var cursor = vis.append("svg:circle")
|
55
|
+
.attr("r", 30)
|
56
|
+
.attr("transform", "translate(-100,-100)")
|
57
|
+
.attr("class", "cursor");
|
58
|
+
|
59
|
+
force.on("tick", function() {
|
60
|
+
vis.selectAll("line.link")
|
61
|
+
.attr("x1", function(d) { return d.source.x; })
|
62
|
+
.attr("y1", function(d) { return d.source.y; })
|
63
|
+
.attr("x2", function(d) { return d.target.x; })
|
64
|
+
.attr("y2", function(d) { return d.target.y; });
|
65
|
+
|
66
|
+
vis.selectAll("circle.node")
|
67
|
+
.attr("cx", function(d) { return d.x; })
|
68
|
+
.attr("cy", function(d) { return d.y; });
|
69
|
+
});
|
70
|
+
|
71
|
+
vis.on("mousemove", function() {
|
72
|
+
cursor.attr("transform", "translate(" + d3.svg.mouse(this) + ")");
|
73
|
+
});
|
74
|
+
|
75
|
+
vis.on("mousedown", function() {
|
76
|
+
var point = d3.svg.mouse(this),
|
77
|
+
node = {x: point[0], y: point[1]},
|
78
|
+
n = nodes.push(node);
|
79
|
+
|
80
|
+
// add links to any nearby nodes
|
81
|
+
nodes.forEach(function(target) {
|
82
|
+
var x = target.x - node.x,
|
83
|
+
y = target.y - node.y;
|
84
|
+
if (Math.sqrt(x * x + y * y) < 30) {
|
85
|
+
links.push({source: node, target: target});
|
86
|
+
}
|
87
|
+
});
|
88
|
+
|
89
|
+
restart();
|
90
|
+
});
|
91
|
+
|
92
|
+
restart();
|
93
|
+
|
94
|
+
function restart() {
|
95
|
+
force.start();
|
96
|
+
|
97
|
+
vis.selectAll("line.link")
|
98
|
+
.data(links)
|
99
|
+
.enter().insert("svg:line", "circle.node")
|
100
|
+
.attr("class", "link")
|
101
|
+
.attr("x1", function(d) { return d.source.x; })
|
102
|
+
.attr("y1", function(d) { return d.source.y; })
|
103
|
+
.attr("x2", function(d) { return d.target.x; })
|
104
|
+
.attr("y2", function(d) { return d.target.y; });
|
105
|
+
|
106
|
+
vis.selectAll("circle.node")
|
107
|
+
.data(nodes)
|
108
|
+
.enter().insert("svg:circle", "circle.cursor")
|
109
|
+
.attr("class", "node")
|
110
|
+
.attr("cx", function(d) { return d.x; })
|
111
|
+
.attr("cy", function(d) { return d.y; })
|
112
|
+
.attr("r", 4.5)
|
113
|
+
.call(force.drag);
|
114
|
+
}
|
115
|
+
|
116
|
+
</script>
|
117
|
+
</body>
|
118
|
+
</html>
|