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:
Коммит
9edc7f2f5a
|
@ -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;
|
||||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -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;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче