d3_rails 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -14,8 +14,8 @@ or you can use it to build dynamic pages (like jQuery).
14
14
 
15
15
  # D3 Version
16
16
 
17
- The current release of this gem is using **D3 v=2.7.1**
18
- **Last Updated 12-30-2011**
17
+ The current release of this gem is using **D3 v=2.7.2**
18
+ **Last Updated 1-19-2012**
19
19
 
20
20
  # Included Javascripts
21
21
  **minified js files are not included, since the rails asset pipeline sorta necessitates the compiling (and likely minifying) your js files for production**
@@ -1,3 +1,3 @@
1
1
  module D3Rails
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -10,7 +10,7 @@ try {
10
10
  d3_style_setProperty.call(this, name, value + "", priority);
11
11
  };
12
12
  }
13
- d3 = {version: "2.7.1"}; // semver
13
+ d3 = {version: "2.7.2"}; // semver
14
14
  var d3_array = d3_arraySlice; // conversion for NodeLists
15
15
 
16
16
  function d3_arrayCopy(pseudoarray) {
@@ -1777,7 +1777,7 @@ d3_selectionPrototype.order = function() {
1777
1777
  for (var j = -1, m = this.length; ++j < m;) {
1778
1778
  for (var group = this[j], i = group.length - 1, next = group[i], node; --i >= 0;) {
1779
1779
  if (node = group[i]) {
1780
- if (next) next.parentNode.insertBefore(node, next);
1780
+ if (next && next !== node.nextSibling) next.parentNode.insertBefore(node, next);
1781
1781
  next = node;
1782
1782
  }
1783
1783
  }
@@ -2578,11 +2578,11 @@ function d3_scale_log(linear, log) {
2578
2578
  var d3_scale_logFormat = d3.format(".0e");
2579
2579
 
2580
2580
  function d3_scale_logp(x) {
2581
- return Math.log(x) / Math.LN10;
2581
+ return Math.log(x < 0 ? 0 : x) / Math.LN10;
2582
2582
  }
2583
2583
 
2584
2584
  function d3_scale_logn(x) {
2585
- return -Math.log(-x) / Math.LN10;
2585
+ return -Math.log(x > 0 ? 0 : -x) / Math.LN10;
2586
2586
  }
2587
2587
 
2588
2588
  d3_scale_logp.pow = function(x) {
@@ -3855,7 +3855,10 @@ d3.svg.axis = function() {
3855
3855
  switch (orient) {
3856
3856
  case "bottom": {
3857
3857
  tickTransform = d3_svg_axisX;
3858
+ subtickEnter.attr("y2", tickMinorSize);
3858
3859
  subtickUpdate.attr("x2", 0).attr("y2", tickMinorSize);
3860
+ tickEnter.select("line").attr("y2", tickMajorSize);
3861
+ tickEnter.select("text").attr("y", Math.max(tickMajorSize, 0) + tickPadding);
3859
3862
  tickUpdate.select("line").attr("x2", 0).attr("y2", tickMajorSize);
3860
3863
  tickUpdate.select("text").attr("x", 0).attr("y", Math.max(tickMajorSize, 0) + tickPadding).attr("dy", ".71em").attr("text-anchor", "middle");
3861
3864
  pathUpdate.attr("d", "M" + range[0] + "," + tickEndSize + "V0H" + range[1] + "V" + tickEndSize);
@@ -3863,7 +3866,10 @@ d3.svg.axis = function() {
3863
3866
  }
3864
3867
  case "top": {
3865
3868
  tickTransform = d3_svg_axisX;
3869
+ subtickEnter.attr("y2", -tickMinorSize);
3866
3870
  subtickUpdate.attr("x2", 0).attr("y2", -tickMinorSize);
3871
+ tickEnter.select("line").attr("y2", -tickMajorSize);
3872
+ tickEnter.select("text").attr("y", -(Math.max(tickMajorSize, 0) + tickPadding));
3867
3873
  tickUpdate.select("line").attr("x2", 0).attr("y2", -tickMajorSize);
3868
3874
  tickUpdate.select("text").attr("x", 0).attr("y", -(Math.max(tickMajorSize, 0) + tickPadding)).attr("dy", "0em").attr("text-anchor", "middle");
3869
3875
  pathUpdate.attr("d", "M" + range[0] + "," + -tickEndSize + "V0H" + range[1] + "V" + -tickEndSize);
@@ -3871,7 +3877,10 @@ d3.svg.axis = function() {
3871
3877
  }
3872
3878
  case "left": {
3873
3879
  tickTransform = d3_svg_axisY;
3880
+ subtickEnter.attr("x2", -tickMinorSize);
3874
3881
  subtickUpdate.attr("x2", -tickMinorSize).attr("y2", 0);
3882
+ tickEnter.select("line").attr("x2", -tickMajorSize);
3883
+ tickEnter.select("text").attr("x", -(Math.max(tickMajorSize, 0) + tickPadding));
3875
3884
  tickUpdate.select("line").attr("x2", -tickMajorSize).attr("y2", 0);
3876
3885
  tickUpdate.select("text").attr("x", -(Math.max(tickMajorSize, 0) + tickPadding)).attr("y", 0).attr("dy", ".32em").attr("text-anchor", "end");
3877
3886
  pathUpdate.attr("d", "M" + -tickEndSize + "," + range[0] + "H0V" + range[1] + "H" + -tickEndSize);
@@ -3879,7 +3888,10 @@ d3.svg.axis = function() {
3879
3888
  }
3880
3889
  case "right": {
3881
3890
  tickTransform = d3_svg_axisY;
3891
+ subtickEnter.attr("x2", tickMinorSize);
3882
3892
  subtickUpdate.attr("x2", tickMinorSize).attr("y2", 0);
3893
+ tickEnter.select("line").attr("x2", tickMajorSize);
3894
+ tickEnter.select("text").attr("x", Math.max(tickMajorSize, 0) + tickPadding);
3883
3895
  tickUpdate.select("line").attr("x2", tickMajorSize).attr("y2", 0);
3884
3896
  tickUpdate.select("text").attr("x", Math.max(tickMajorSize, 0) + tickPadding).attr("y", 0).attr("dy", ".32em").attr("text-anchor", "start");
3885
3897
  pathUpdate.attr("d", "M" + tickEndSize + "," + range[0] + "H0V" + range[1] + "H" + tickEndSize);
@@ -1203,7 +1203,7 @@ function d3_layout_packIntersects(a, b) {
1203
1203
  var dx = b.x - a.x,
1204
1204
  dy = b.y - a.y,
1205
1205
  dr = a.r + b.r;
1206
- return (dr * dr - dx * dx - dy * dy) > .001; // within epsilon
1206
+ return dr * dr - dx * dx - dy * dy > .001; // within epsilon
1207
1207
  }
1208
1208
 
1209
1209
  function d3_layout_packCircle(nodes) {
@@ -1262,28 +1262,20 @@ function d3_layout_packCircle(nodes) {
1262
1262
  if (isect == 1) {
1263
1263
  for (k = a._pack_prev; k !== j._pack_prev; k = k._pack_prev, s2++) {
1264
1264
  if (d3_layout_packIntersects(k, c)) {
1265
- if (s2 < s1) {
1266
- isect = -1;
1267
- j = k;
1268
- }
1269
1265
  break;
1270
1266
  }
1271
1267
  }
1272
1268
  }
1273
1269
 
1274
1270
  // Update node chain.
1275
- if (isect == 0) {
1271
+ if (isect) {
1272
+ if (s1 < s2 || (s1 == s2 && b.r < a.r)) d3_layout_packSplice(a, b = j);
1273
+ else d3_layout_packSplice(a = k, b);
1274
+ i--;
1275
+ } else {
1276
1276
  d3_layout_packInsert(a, c);
1277
1277
  b = c;
1278
1278
  bound(c);
1279
- } else if (isect > 0) {
1280
- d3_layout_packSplice(a, j);
1281
- b = j;
1282
- i--;
1283
- } else { // isect < 0
1284
- d3_layout_packSplice(j, b);
1285
- a = j;
1286
- i--;
1287
1279
  }
1288
1280
  }
1289
1281
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: d3_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-31 00:00:00.000000000Z
12
+ date: 2012-01-19 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
16
- requirement: &70246086718880 !ruby/object:Gem::Requirement
16
+ requirement: &70100456956300 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.1.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70246086718880
24
+ version_requirements: *70100456956300
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bundler
27
- requirement: &70246086718200 !ruby/object:Gem::Requirement
27
+ requirement: &70100456955480 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.0.0
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70246086718200
35
+ version_requirements: *70100456955480
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rails
38
- requirement: &70246086717400 !ruby/object:Gem::Requirement
38
+ requirement: &70100456954960 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '3.1'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70246086717400
46
+ version_requirements: *70100456954960
47
47
  description: Gem installation of javascript framework for data visualization, D3
48
48
  email:
49
49
  - han@logicallsat.com