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,11 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Line Chart</title>
|
5
|
+
<link type="text/css" rel="stylesheet" href="line.css"/>
|
6
|
+
<script type="text/javascript" src="../../d3.js"></script>
|
7
|
+
</head>
|
8
|
+
<body>
|
9
|
+
<script type="text/javascript" src="line.js"></script>
|
10
|
+
</body>
|
11
|
+
</html>
|
@@ -0,0 +1,63 @@
|
|
1
|
+
var data = d3.range(20).map(function(i) {
|
2
|
+
return {x: i / 19, y: (Math.sin(i / 3) + 1) / 2};
|
3
|
+
});
|
4
|
+
|
5
|
+
var w = 450,
|
6
|
+
h = 275,
|
7
|
+
p = 20,
|
8
|
+
x = d3.scale.linear().domain([0, 1]).range([0, w]),
|
9
|
+
y = d3.scale.linear().domain([0, 1]).range([h, 0]);
|
10
|
+
|
11
|
+
var vis = d3.select("body")
|
12
|
+
.data([data])
|
13
|
+
.append("svg:svg")
|
14
|
+
.attr("width", w + p * 2)
|
15
|
+
.attr("height", h + p * 2)
|
16
|
+
.append("svg:g")
|
17
|
+
.attr("transform", "translate(" + p + "," + p + ")");
|
18
|
+
|
19
|
+
var rules = vis.selectAll("g.rule")
|
20
|
+
.data(x.ticks(10))
|
21
|
+
.enter().append("svg:g")
|
22
|
+
.attr("class", "rule");
|
23
|
+
|
24
|
+
rules.append("svg:line")
|
25
|
+
.attr("x1", x)
|
26
|
+
.attr("x2", x)
|
27
|
+
.attr("y1", 0)
|
28
|
+
.attr("y2", h - 1);
|
29
|
+
|
30
|
+
rules.append("svg:line")
|
31
|
+
.attr("class", function(d) { return d ? null : "axis"; })
|
32
|
+
.attr("y1", y)
|
33
|
+
.attr("y2", y)
|
34
|
+
.attr("x1", 0)
|
35
|
+
.attr("x2", w + 1);
|
36
|
+
|
37
|
+
rules.append("svg:text")
|
38
|
+
.attr("x", x)
|
39
|
+
.attr("y", h + 3)
|
40
|
+
.attr("dy", ".71em")
|
41
|
+
.attr("text-anchor", "middle")
|
42
|
+
.text(x.tickFormat(10));
|
43
|
+
|
44
|
+
rules.append("svg:text")
|
45
|
+
.attr("y", y)
|
46
|
+
.attr("x", -3)
|
47
|
+
.attr("dy", ".35em")
|
48
|
+
.attr("text-anchor", "end")
|
49
|
+
.text(y.tickFormat(10));
|
50
|
+
|
51
|
+
vis.append("svg:path")
|
52
|
+
.attr("class", "line")
|
53
|
+
.attr("d", d3.svg.line()
|
54
|
+
.x(function(d) { return x(d.x); })
|
55
|
+
.y(function(d) { return y(d.y); }));
|
56
|
+
|
57
|
+
vis.selectAll("circle.line")
|
58
|
+
.data(data)
|
59
|
+
.enter().append("svg:circle")
|
60
|
+
.attr("class", "line")
|
61
|
+
.attr("cx", function(d) { return x(d.x); })
|
62
|
+
.attr("cy", function(d) { return y(d.y); })
|
63
|
+
.attr("r", 3.5);
|
@@ -0,0 +1,116 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Marimekko Chart</title>
|
5
|
+
<script type="text/javascript" src="../../d3.js"></script>
|
6
|
+
<script type="text/javascript" src="../../d3.layout.js"></script>
|
7
|
+
<style type="text/css">
|
8
|
+
|
9
|
+
body {
|
10
|
+
font: 10px sans-serif;
|
11
|
+
}
|
12
|
+
|
13
|
+
rect {
|
14
|
+
stroke: #000;
|
15
|
+
}
|
16
|
+
|
17
|
+
svg {
|
18
|
+
shape-rendering: crispEdges;
|
19
|
+
}
|
20
|
+
|
21
|
+
</style>
|
22
|
+
</head>
|
23
|
+
<body>
|
24
|
+
<script type="text/javascript">
|
25
|
+
|
26
|
+
var w = 960,
|
27
|
+
h = 500,
|
28
|
+
m = 20,
|
29
|
+
x = d3.scale.linear().range([0, w - 3 * m]),
|
30
|
+
y = d3.scale.linear().range([0, h - 2 * m]),
|
31
|
+
z = d3.scale.category10(),
|
32
|
+
n = d3.format(",d"),
|
33
|
+
p = d3.format("%");
|
34
|
+
|
35
|
+
var svg = d3.select("body").append("svg:svg")
|
36
|
+
.attr("width", w)
|
37
|
+
.attr("height", h)
|
38
|
+
.append("svg:g")
|
39
|
+
.attr("transform", "translate(" + 2 * m + "," + m + ")");
|
40
|
+
|
41
|
+
d3.json("marimekko.json", function(data) {
|
42
|
+
var offset = 0;
|
43
|
+
|
44
|
+
// Nest values by segment. We assume each segment+market is unique.
|
45
|
+
var segments = d3.nest()
|
46
|
+
.key(function(d) { return d.segment; })
|
47
|
+
.entries(data);
|
48
|
+
|
49
|
+
// Compute the total sum, the per-segment sum, and the per-market offset.
|
50
|
+
// You can use reduce rather than reduceRight to reverse the ordering.
|
51
|
+
// We also record a reference to the parent segment for each market.
|
52
|
+
var sum = segments.reduce(function(v, p) {
|
53
|
+
return (p.offset = v) + (p.sum = p.values.reduceRight(function(v, d) {
|
54
|
+
d.parent = p;
|
55
|
+
return (d.offset = v) + d.value;
|
56
|
+
}, 0));
|
57
|
+
}, 0);
|
58
|
+
|
59
|
+
// Add x-axis ticks.
|
60
|
+
var xtick = svg.selectAll(".x")
|
61
|
+
.data(x.ticks(10))
|
62
|
+
.enter().append("svg:g")
|
63
|
+
.attr("class", "x")
|
64
|
+
.attr("transform", function(d) { return "translate(" + x(d) + "," + y(1) + ")"; });
|
65
|
+
|
66
|
+
xtick.append("svg:line")
|
67
|
+
.attr("y2", 6)
|
68
|
+
.style("stroke", "#000");
|
69
|
+
|
70
|
+
xtick.append("svg:text")
|
71
|
+
.attr("y", 8)
|
72
|
+
.attr("text-anchor", "middle")
|
73
|
+
.attr("dy", ".71em")
|
74
|
+
.text(p);
|
75
|
+
|
76
|
+
// Add y-axis ticks.
|
77
|
+
var ytick = svg.selectAll(".y")
|
78
|
+
.data(y.ticks(10))
|
79
|
+
.enter().append("svg:g")
|
80
|
+
.attr("class", "y")
|
81
|
+
.attr("transform", function(d) { return "translate(0," + y(1 - d) + ")"; });
|
82
|
+
|
83
|
+
ytick.append("svg:line")
|
84
|
+
.attr("x1", -6)
|
85
|
+
.style("stroke", "#000");
|
86
|
+
|
87
|
+
ytick.append("svg:text")
|
88
|
+
.attr("x", -8)
|
89
|
+
.attr("text-anchor", "end")
|
90
|
+
.attr("dy", ".35em")
|
91
|
+
.text(p);
|
92
|
+
|
93
|
+
// Add a group for each segment.
|
94
|
+
var segments = svg.selectAll(".segment")
|
95
|
+
.data(segments)
|
96
|
+
.enter().append("svg:g")
|
97
|
+
.attr("class", "segment")
|
98
|
+
.attr("xlink:title", function(d) { return d.key; })
|
99
|
+
.attr("transform", function(d) { return "translate(" + x(d.offset / sum) + ")"; });
|
100
|
+
|
101
|
+
// Add a rect for each market.
|
102
|
+
var markets = segments.selectAll(".market")
|
103
|
+
.data(function(d) { return d.values; })
|
104
|
+
.enter().append("svg:a")
|
105
|
+
.attr("class", "market")
|
106
|
+
.attr("xlink:title", function(d) { return d.market + " " + d.parent.key + ": " + n(d.value); })
|
107
|
+
.append("svg:rect")
|
108
|
+
.attr("y", function(d) { return y(d.offset / d.parent.sum); })
|
109
|
+
.attr("height", function(d) { return y(d.value / d.parent.sum); })
|
110
|
+
.attr("width", function(d) { return x(d.parent.sum / sum); })
|
111
|
+
.style("fill", function(d) { return z(d.market); });
|
112
|
+
});
|
113
|
+
|
114
|
+
</script>
|
115
|
+
</body>
|
116
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
[
|
2
|
+
{"market": "Auburn, AL", "segment": "Almond lovers", "value": 3840},
|
3
|
+
{"market": "Auburn, AL", "segment": "Berry buyers", "value": 1920},
|
4
|
+
{"market": "Auburn, AL", "segment": "Carrots-n-more", "value": 960},
|
5
|
+
{"market": "Auburn, AL", "segment": "Delicious-n-new", "value": 400},
|
6
|
+
{"market": "Birmingham, AL", "segment": "Almond lovers", "value": 1600},
|
7
|
+
{"market": "Birmingham, AL", "segment": "Berry buyers", "value": 1440},
|
8
|
+
{"market": "Birmingham, AL", "segment": "Carrots-n-more", "value": 960},
|
9
|
+
{"market": "Birmingham, AL", "segment": "Delicious-n-new", "value": 400},
|
10
|
+
{"market": "Gainesville, FL", "segment": "Almond lovers", "value": 640},
|
11
|
+
{"market": "Gainesville, FL", "segment": "Berry buyers", "value": 960},
|
12
|
+
{"market": "Gainesville, FL", "segment": "Carrots-n-more", "value": 640},
|
13
|
+
{"market": "Gainesville, FL", "segment": "Delicious-n-new", "value": 400},
|
14
|
+
{"market": "Durham, NC", "segment": "Almond lovers", "value": 320},
|
15
|
+
{"market": "Durham, NC", "segment": "Berry buyers", "value": 480},
|
16
|
+
{"market": "Durham, NC", "segment": "Carrots-n-more", "value": 640},
|
17
|
+
{"market": "Durham, NC", "segment": "Delicious-n-new", "value": 400}
|
18
|
+
]
|
@@ -0,0 +1,169 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
5
|
+
<title>Mobile Patent Suits</title>
|
6
|
+
<script type="text/javascript" src="../../d3.js"></script>
|
7
|
+
<script type="text/javascript" src="../../d3.geom.js"></script>
|
8
|
+
<script type="text/javascript" src="../../d3.layout.js"></script>
|
9
|
+
<style type="text/css">
|
10
|
+
|
11
|
+
path.link {
|
12
|
+
fill: none;
|
13
|
+
stroke: #666;
|
14
|
+
stroke-width: 1.5px;
|
15
|
+
}
|
16
|
+
|
17
|
+
marker#licensing {
|
18
|
+
fill: green;
|
19
|
+
}
|
20
|
+
|
21
|
+
path.link.licensing {
|
22
|
+
stroke: green;
|
23
|
+
}
|
24
|
+
|
25
|
+
path.link.resolved {
|
26
|
+
stroke-dasharray: 0,2 1;
|
27
|
+
}
|
28
|
+
|
29
|
+
circle {
|
30
|
+
fill: #ccc;
|
31
|
+
stroke: #333;
|
32
|
+
stroke-width: 1.5px;
|
33
|
+
}
|
34
|
+
|
35
|
+
text {
|
36
|
+
font: 10px sans-serif;
|
37
|
+
pointer-events: none;
|
38
|
+
}
|
39
|
+
|
40
|
+
text.shadow {
|
41
|
+
stroke: #fff;
|
42
|
+
stroke-width: 3px;
|
43
|
+
stroke-opacity: .8;
|
44
|
+
}
|
45
|
+
|
46
|
+
</style>
|
47
|
+
</head>
|
48
|
+
<body>
|
49
|
+
<script type="text/javascript">
|
50
|
+
|
51
|
+
// http://blog.thomsonreuters.com/index.php/mobile-patent-suits-graphic-of-the-day/
|
52
|
+
var links = [
|
53
|
+
{source: "Microsoft", target: "Amazon", type: "licensing"},
|
54
|
+
{source: "Microsoft", target: "HTC", type: "licensing"},
|
55
|
+
{source: "Samsung", target: "Apple", type: "suit"},
|
56
|
+
{source: "Motorola", target: "Apple", type: "suit"},
|
57
|
+
{source: "Nokia", target: "Apple", type: "resolved"},
|
58
|
+
{source: "HTC", target: "Apple", type: "suit"},
|
59
|
+
{source: "Kodak", target: "Apple", type: "suit"},
|
60
|
+
{source: "Microsoft", target: "Barnes & Noble", type: "suit"},
|
61
|
+
{source: "Microsoft", target: "Foxconn", type: "suit"},
|
62
|
+
{source: "Oracle", target: "Google", type: "suit"},
|
63
|
+
{source: "Apple", target: "HTC", type: "suit"},
|
64
|
+
{source: "Microsoft", target: "Inventec", type: "suit"},
|
65
|
+
{source: "Samsung", target: "Kodak", type: "resolved"},
|
66
|
+
{source: "LG", target: "Kodak", type: "resolved"},
|
67
|
+
{source: "RIM", target: "Kodak", type: "suit"},
|
68
|
+
{source: "Sony", target: "LG", type: "suit"},
|
69
|
+
{source: "Kodak", target: "LG", type: "resolved"},
|
70
|
+
{source: "Apple", target: "Nokia", type: "resolved"},
|
71
|
+
{source: "Qualcomm", target: "Nokia", type: "resolved"},
|
72
|
+
{source: "Apple", target: "Motorola", type: "suit"},
|
73
|
+
{source: "Microsoft", target: "Motorola", type: "suit"},
|
74
|
+
{source: "Motorola", target: "Microsoft", type: "suit"},
|
75
|
+
{source: "Huawei", target: "ZTE", type: "suit"},
|
76
|
+
{source: "Ericsson", target: "ZTE", type: "suit"},
|
77
|
+
{source: "Kodak", target: "Samsung", type: "resolved"},
|
78
|
+
{source: "Apple", target: "Samsung", type: "suit"},
|
79
|
+
{source: "Kodak", target: "RIM", type: "suit"},
|
80
|
+
{source: "Nokia", target: "Qualcomm", type: "suit"}
|
81
|
+
];
|
82
|
+
|
83
|
+
var nodes = {};
|
84
|
+
|
85
|
+
// Compute the distinct nodes from the links.
|
86
|
+
links.forEach(function(link) {
|
87
|
+
link.source = nodes[link.source] || (nodes[link.source] = {name: link.source});
|
88
|
+
link.target = nodes[link.target] || (nodes[link.target] = {name: link.target});
|
89
|
+
});
|
90
|
+
|
91
|
+
var w = 960,
|
92
|
+
h = 500;
|
93
|
+
|
94
|
+
var force = d3.layout.force()
|
95
|
+
.nodes(d3.values(nodes))
|
96
|
+
.links(links)
|
97
|
+
.size([w, h])
|
98
|
+
.linkDistance(60)
|
99
|
+
.charge(-300)
|
100
|
+
.on("tick", tick)
|
101
|
+
.start();
|
102
|
+
|
103
|
+
var svg = d3.select("body").append("svg:svg")
|
104
|
+
.attr("width", w)
|
105
|
+
.attr("height", h);
|
106
|
+
|
107
|
+
// Per-type markers, as they don't inherit styles.
|
108
|
+
svg.append("svg:defs").selectAll("marker")
|
109
|
+
.data(["suit", "licensing", "resolved"])
|
110
|
+
.enter().append("svg:marker")
|
111
|
+
.attr("id", String)
|
112
|
+
.attr("viewBox", "0 -5 10 10")
|
113
|
+
.attr("refX", 15)
|
114
|
+
.attr("refY", -1.5)
|
115
|
+
.attr("markerWidth", 6)
|
116
|
+
.attr("markerHeight", 6)
|
117
|
+
.attr("orient", "auto")
|
118
|
+
.append("svg:path")
|
119
|
+
.attr("d", "M0,-5L10,0L0,5");
|
120
|
+
|
121
|
+
var path = svg.append("svg:g").selectAll("path")
|
122
|
+
.data(force.links())
|
123
|
+
.enter().append("svg:path")
|
124
|
+
.attr("class", function(d) { return "link " + d.type; })
|
125
|
+
.attr("marker-end", function(d) { return "url(#" + d.type + ")"; });
|
126
|
+
|
127
|
+
var circle = svg.append("svg:g").selectAll("circle")
|
128
|
+
.data(force.nodes())
|
129
|
+
.enter().append("svg:circle")
|
130
|
+
.attr("r", 6)
|
131
|
+
.call(force.drag);
|
132
|
+
|
133
|
+
var text = svg.append("svg:g").selectAll("g")
|
134
|
+
.data(force.nodes())
|
135
|
+
.enter().append("svg:g");
|
136
|
+
|
137
|
+
// A copy of the text with a thick white stroke for legibility.
|
138
|
+
text.append("svg:text")
|
139
|
+
.attr("x", 8)
|
140
|
+
.attr("y", ".31em")
|
141
|
+
.attr("class", "shadow")
|
142
|
+
.text(function(d) { return d.name; });
|
143
|
+
|
144
|
+
text.append("svg:text")
|
145
|
+
.attr("x", 8)
|
146
|
+
.attr("y", ".31em")
|
147
|
+
.text(function(d) { return d.name; });
|
148
|
+
|
149
|
+
// Use elliptical arc path segments to doubly-encode directionality.
|
150
|
+
function tick() {
|
151
|
+
path.attr("d", function(d) {
|
152
|
+
var dx = d.target.x - d.source.x,
|
153
|
+
dy = d.target.y - d.source.y,
|
154
|
+
dr = Math.sqrt(dx * dx + dy * dy);
|
155
|
+
return "M" + d.source.x + "," + d.source.y + "A" + dr + "," + dr + " 0 0,1 " + d.target.x + "," + d.target.y;
|
156
|
+
});
|
157
|
+
|
158
|
+
circle.attr("transform", function(d) {
|
159
|
+
return "translate(" + d.x + "," + d.y + ")";
|
160
|
+
});
|
161
|
+
|
162
|
+
text.attr("transform", function(d) {
|
163
|
+
return "translate(" + d.x + "," + d.y + ")";
|
164
|
+
});
|
165
|
+
}
|
166
|
+
|
167
|
+
</script>
|
168
|
+
</body>
|
169
|
+
</html>
|
@@ -0,0 +1,133 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
5
|
+
<title>Mercator Projection</title>
|
6
|
+
<script type="text/javascript" src="../../d3.js"></script>
|
7
|
+
<script type="text/javascript" src="../../d3.geo.js"></script>
|
8
|
+
<script type="text/javascript" src="../../lib/jquery/jquery.min.js"></script>
|
9
|
+
<script type="text/javascript" src="../../lib/jquery-ui/jquery-ui.min.js"></script>
|
10
|
+
<style type="text/css">
|
11
|
+
|
12
|
+
@import url("../../lib/jquery-ui/jquery-ui.css");
|
13
|
+
|
14
|
+
body, .ui-widget {
|
15
|
+
font: 14px Helvetica Neue;
|
16
|
+
}
|
17
|
+
|
18
|
+
svg {
|
19
|
+
width: 960px;
|
20
|
+
height: 500px;
|
21
|
+
border: solid 1px #ccc;
|
22
|
+
background: #eee;
|
23
|
+
}
|
24
|
+
|
25
|
+
line {
|
26
|
+
stroke: brown;
|
27
|
+
stroke-dasharray: 4,2;
|
28
|
+
}
|
29
|
+
|
30
|
+
path {
|
31
|
+
fill: #ccc;
|
32
|
+
stroke: #fff;
|
33
|
+
}
|
34
|
+
|
35
|
+
div {
|
36
|
+
width: 960px;
|
37
|
+
}
|
38
|
+
|
39
|
+
</style>
|
40
|
+
</head>
|
41
|
+
<body>
|
42
|
+
<h3>Mercator Projection</h3>
|
43
|
+
<script type="text/javascript">
|
44
|
+
|
45
|
+
// Our projection.
|
46
|
+
var xy = d3.geo.mercator(),
|
47
|
+
path = d3.geo.path().projection(xy);
|
48
|
+
|
49
|
+
var states = d3.select("body")
|
50
|
+
.append("svg:svg")
|
51
|
+
.append("svg:g")
|
52
|
+
.attr("id", "states");
|
53
|
+
|
54
|
+
var equator = d3.select("svg")
|
55
|
+
.append("svg:line")
|
56
|
+
.attr("x1", "0%")
|
57
|
+
.attr("x2", "100%");
|
58
|
+
|
59
|
+
d3.json("../data/world-countries.json", function(collection) {
|
60
|
+
|
61
|
+
states
|
62
|
+
.selectAll("path")
|
63
|
+
.data(collection.features)
|
64
|
+
.enter().append("svg:path")
|
65
|
+
.attr("d", path)
|
66
|
+
.append("svg:title")
|
67
|
+
.text(function(d) { return d.properties.name; });
|
68
|
+
|
69
|
+
equator
|
70
|
+
.attr("y1", xy([0, 0])[1])
|
71
|
+
.attr("y2", xy([0, 0])[1])
|
72
|
+
});
|
73
|
+
|
74
|
+
function refresh() {
|
75
|
+
states
|
76
|
+
.selectAll("path")
|
77
|
+
.attr("d", path);
|
78
|
+
|
79
|
+
equator
|
80
|
+
.attr("y1", xy([0, 0])[1])
|
81
|
+
.attr("y2", xy([0, 0])[1])
|
82
|
+
|
83
|
+
d3.select("#scale span")
|
84
|
+
.text(xy.scale());
|
85
|
+
d3.select("#translate-x span")
|
86
|
+
.text(xy.translate()[0]);
|
87
|
+
d3.select("#translate-y span")
|
88
|
+
.text(xy.translate()[1]);
|
89
|
+
}
|
90
|
+
|
91
|
+
</script><p>
|
92
|
+
<div id="scale">scale: <span>500</span></div><p>
|
93
|
+
<div id="translate-x">translate.x: <span>480</span></div>
|
94
|
+
<div id="translate-y">translate.y: <span>250</span></div>
|
95
|
+
<script type="text/javascript">
|
96
|
+
|
97
|
+
$("#scale").slider({
|
98
|
+
min: 0,
|
99
|
+
max: 3000,
|
100
|
+
value: 500,
|
101
|
+
slide: function(event, ui) {
|
102
|
+
xy.scale(ui.value);
|
103
|
+
refresh();
|
104
|
+
}
|
105
|
+
});
|
106
|
+
|
107
|
+
$("#translate-x").slider({
|
108
|
+
min: -2000,
|
109
|
+
max: 2000,
|
110
|
+
value: 480,
|
111
|
+
slide: function(event, ui) {
|
112
|
+
var translate = xy.translate();
|
113
|
+
translate[0] = ui.value;
|
114
|
+
xy.translate(translate);
|
115
|
+
refresh();
|
116
|
+
}
|
117
|
+
});
|
118
|
+
|
119
|
+
$("#translate-y").slider({
|
120
|
+
min: -2000,
|
121
|
+
max: 2000,
|
122
|
+
value: 250,
|
123
|
+
slide: function(event, ui) {
|
124
|
+
var translate = xy.translate();
|
125
|
+
translate[1] = ui.value;
|
126
|
+
xy.translate(translate);
|
127
|
+
refresh();
|
128
|
+
}
|
129
|
+
});
|
130
|
+
|
131
|
+
</script>
|
132
|
+
</body>
|
133
|
+
</html>
|