d3-rails 0.0.3 → 0.0.4

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.
@@ -1,3 +1,7 @@
1
+ ## 0.0.4 (20 May 2012)
2
+
3
+ * Upgrade D3 to v2.9.2
4
+
1
5
  ## 0.0.3 (12 May 2012)
2
6
 
3
7
  * d3.js will also be available as d3.v2.js for compatibility reasons
data/README.md CHANGED
@@ -6,7 +6,7 @@ d3-rails provides D3 for Rails 3.1.
6
6
 
7
7
  ## Version
8
8
 
9
- d3-rails comes with version 2.9.1 of D3.js.
9
+ d3-rails comes with version 2.9.2 of D3.js.
10
10
 
11
11
 
12
12
  ## Installation
@@ -1,2 +1 @@
1
1
  require 'd3/rails'
2
-
@@ -1,3 +1,2 @@
1
1
  require 'd3/rails/engine'
2
2
  require 'd3/rails/version'
3
-
@@ -4,4 +4,3 @@ module D3
4
4
  end
5
5
  end
6
6
  end
7
-
@@ -1,6 +1,6 @@
1
1
  module D3
2
2
  module Rails
3
- VERSION = "0.0.3"
4
- D3_VERSION = "2.9.1"
3
+ VERSION = "0.0.4"
4
+ D3_VERSION = "2.9.2"
5
5
  end
6
6
  end
@@ -10,7 +10,7 @@ try {
10
10
  d3_style_setProperty.call(this, name, value + "", priority);
11
11
  };
12
12
  }
13
- d3 = {version: "2.9.1"}; // semver
13
+ d3 = {version: "2.9.2"}; // semver
14
14
  function d3_class(ctor, properties) {
15
15
  try {
16
16
  for (var key in properties) {
@@ -661,7 +661,7 @@ d3.format = function(specifier) {
661
661
  // Apply the scale, computing it from the value's exponent for si format.
662
662
  if (scale < 0) {
663
663
  var prefix = d3.formatPrefix(value, precision);
664
- value *= prefix.scale;
664
+ value = prefix.scale(value);
665
665
  suffix = prefix.symbol;
666
666
  } else {
667
667
  value *= scale;
@@ -730,12 +730,12 @@ d3.formatPrefix = function(value, precision) {
730
730
  };
731
731
 
732
732
  function d3_formatPrefix(d, i) {
733
+ var k = Math.pow(10, Math.abs(8 - i) * 3);
733
734
  return {
734
- scale: Math.pow(10, (8 - i) * 3),
735
+ scale: i > 8 ? function(d) { return d / k; } : function(d) { return d * k; },
735
736
  symbol: d
736
737
  };
737
738
  }
738
-
739
739
  /*
740
740
  * TERMS OF USE - EASING EQUATIONS
741
741
  *
@@ -5564,6 +5564,7 @@ d3.layout.pie = function() {
5564
5564
  // They are stored in the original data's order.
5565
5565
  var arcs = [];
5566
5566
  index.forEach(function(i) {
5567
+ var d;
5567
5568
  arcs[i] = {
5568
5569
  data: data[i],
5569
5570
  value: d = values[i],
@@ -5987,7 +5988,8 @@ d3.layout.hierarchy = function() {
5987
5988
  n,
5988
5989
  c = node.children = [],
5989
5990
  v = 0,
5990
- j = depth + 1;
5991
+ j = depth + 1,
5992
+ d;
5991
5993
  while (++i < n) {
5992
5994
  d = recurse(childs[i], j, nodes);
5993
5995
  d.parent = node;
@@ -10,7 +10,7 @@ try {
10
10
  d3_style_setProperty.call(this, name, value + "", priority);
11
11
  };
12
12
  }
13
- d3 = {version: "2.9.1"}; // semver
13
+ d3 = {version: "2.9.2"}; // semver
14
14
  function d3_class(ctor, properties) {
15
15
  try {
16
16
  for (var key in properties) {
@@ -661,7 +661,7 @@ d3.format = function(specifier) {
661
661
  // Apply the scale, computing it from the value's exponent for si format.
662
662
  if (scale < 0) {
663
663
  var prefix = d3.formatPrefix(value, precision);
664
- value *= prefix.scale;
664
+ value = prefix.scale(value);
665
665
  suffix = prefix.symbol;
666
666
  } else {
667
667
  value *= scale;
@@ -730,12 +730,12 @@ d3.formatPrefix = function(value, precision) {
730
730
  };
731
731
 
732
732
  function d3_formatPrefix(d, i) {
733
+ var k = Math.pow(10, Math.abs(8 - i) * 3);
733
734
  return {
734
- scale: Math.pow(10, (8 - i) * 3),
735
+ scale: i > 8 ? function(d) { return d / k; } : function(d) { return d * k; },
735
736
  symbol: d
736
737
  };
737
738
  }
738
-
739
739
  /*
740
740
  * TERMS OF USE - EASING EQUATIONS
741
741
  *
@@ -5564,6 +5564,7 @@ d3.layout.pie = function() {
5564
5564
  // They are stored in the original data's order.
5565
5565
  var arcs = [];
5566
5566
  index.forEach(function(i) {
5567
+ var d;
5567
5568
  arcs[i] = {
5568
5569
  data: data[i],
5569
5570
  value: d = values[i],
@@ -5987,7 +5988,8 @@ d3.layout.hierarchy = function() {
5987
5988
  n,
5988
5989
  c = node.children = [],
5989
5990
  v = 0,
5990
- j = depth + 1;
5991
+ j = depth + 1,
5992
+ d;
5991
5993
  while (++i < n) {
5992
5994
  d = recurse(childs[i], j, nodes);
5993
5995
  d.parent = node;
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.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-12 00:00:00.000000000 Z
12
+ date: 2012-05-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties