Merge branch 'force_layout_divide_by_zero' of https://github.com/Rhizi/d3 into fix-force-weight-zero

updated upstream into a topic branch.
This commit is contained in:
Mike Bostock 2015-10-25 20:46:20 -07:00
Родитель 80aa000a4c bcf6362581
Коммит 9edc7f2f5a
3 изменённых файлов: 3 добавлений и 3 удалений

2
d3.js поставляемый
Просмотреть файл

@ -6268,7 +6268,7 @@
l = alpha * strengths[i] * ((l = Math.sqrt(l)) - distances[i]) / l; l = alpha * strengths[i] * ((l = Math.sqrt(l)) - distances[i]) / l;
x *= l; x *= l;
y *= l; y *= l;
t.x -= x * (k = s.weight / (t.weight + s.weight)); t.x -= x * (k = s.weight + t.weight ? s.weight / (s.weight + t.weight) : .5);
t.y -= y * k; t.y -= y * k;
s.x += x * (k = 1 - k); s.x += x * (k = 1 - k);
s.y += y * k; s.y += y * k;

2
d3.min.js поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -87,7 +87,7 @@ d3.layout.force = function() {
l = alpha * strengths[i] * ((l = Math.sqrt(l)) - distances[i]) / l; l = alpha * strengths[i] * ((l = Math.sqrt(l)) - distances[i]) / l;
x *= l; x *= l;
y *= l; y *= l;
t.x -= x * (k = s.weight / (t.weight + s.weight)); t.x -= x * (k = (s.weight + t.weight ? s.weight / (s.weight + t.weight) : .5));
t.y -= y * k; t.y -= y * k;
s.x += x * (k = 1 - k); s.x += x * (k = 1 - k);
s.y += y * k; s.y += y * k;