bum 0.0.16 → 0.0.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/bum +1 -1
  2. data/public/viz.js +16 -0
  3. metadata +4 -4
data/bin/bum CHANGED
@@ -4,7 +4,7 @@ $: << File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
4
4
 
5
5
  require 'rubygems'
6
6
 
7
- master_address = ARGV[1] || 'Francis.local'
7
+ master_address = ARGV[0] || 'Francis.local'
8
8
 
9
9
  require 'node'
10
10
  node = Node.new(master_address, 9125)
@@ -107,9 +107,25 @@ function addNode(n) {
107
107
  .attr("r", nodeRadius)
108
108
  .call(force.drag);
109
109
 
110
+ var newName = vis.selectAll("text.name")
111
+ .data(data.nodes)
112
+ .enter().append('svg:text')
113
+ .attr('class', 'name')
114
+ .attr('x', function(d) { return d.x; })
115
+ .attr('y', function(d) { return d.y; })
116
+ .attr('text-anchor', 'middle')
117
+ .attr('dy', -(nodeRadius+8))
118
+ .attr('data-index', function(d, i) { return i; })
119
+ .text(function(d) {
120
+ return d.name;
121
+ })
122
+ .call(force.drag);
123
+
110
124
  force.on("tick", function() {
111
125
  newNode.attr("cx", function(d) { return d.x; })
112
126
  .attr("cy", function(d) { return d.y; });
127
+ newName.attr("x", function(d) { return d.x; })
128
+ .attr("y", function(d) { return d.y; });
113
129
  });
114
130
  }
115
131
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bum
3
3
  version: !ruby/object:Gem::Version
4
- hash: 63
4
+ hash: 61
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 16
10
- version: 0.0.16
9
+ - 17
10
+ version: 0.0.17
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tyler McMullen
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-15 00:00:00 -07:00
18
+ date: 2011-09-16 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency