d3-rails 3.3.5 → 3.3.6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/app/assets/javascripts/d3.js +78 -75
- data/app/assets/javascripts/d3.min.js +5 -5
- data/app/assets/javascripts/d3.v3.js +78 -75
- data/app/assets/javascripts/d3.v3.min.js +5 -5
- data/lib/d3/rails/version.rb +1 -1
- metadata +2 -2
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
d3 = function() {
|
2
2
|
var d3 = {
|
3
|
-
version: "3.3.
|
3
|
+
version: "3.3.6"
|
4
4
|
};
|
5
5
|
if (!Date.now) Date.now = function() {
|
6
6
|
return +new Date();
|
@@ -273,7 +273,7 @@ d3 = function() {
|
|
273
273
|
}
|
274
274
|
}
|
275
275
|
});
|
276
|
-
var d3_map_prefix = "\
|
276
|
+
var d3_map_prefix = "\x00", d3_map_prefixCode = d3_map_prefix.charCodeAt(0);
|
277
277
|
d3.nest = function() {
|
278
278
|
var nest = {}, keys = [], sortKeys = [], sortValues, rollup;
|
279
279
|
function map(mapType, array, depth) {
|
@@ -1158,7 +1158,7 @@ d3 = function() {
|
|
1158
1158
|
};
|
1159
1159
|
return d3.rebind(drag, event, "on");
|
1160
1160
|
};
|
1161
|
-
var π = Math.PI, ε = 1e-6, ε2 = ε * ε, d3_radians = π / 180, d3_degrees = 180 / π;
|
1161
|
+
var π = Math.PI, τ = 2 * π, halfπ = π / 2, ε = 1e-6, ε2 = ε * ε, d3_radians = π / 180, d3_degrees = 180 / π;
|
1162
1162
|
function d3_sgn(x) {
|
1163
1163
|
return x > 0 ? 1 : x < 0 ? -1 : 0;
|
1164
1164
|
}
|
@@ -1166,16 +1166,16 @@ d3 = function() {
|
|
1166
1166
|
return x > 1 ? 0 : x < -1 ? π : Math.acos(x);
|
1167
1167
|
}
|
1168
1168
|
function d3_asin(x) {
|
1169
|
-
return x > 1 ? π
|
1169
|
+
return x > 1 ? halfπ : x < -1 ? -halfπ : Math.asin(x);
|
1170
1170
|
}
|
1171
1171
|
function d3_sinh(x) {
|
1172
|
-
return (
|
1172
|
+
return ((x = Math.exp(x)) - 1 / x) / 2;
|
1173
1173
|
}
|
1174
1174
|
function d3_cosh(x) {
|
1175
|
-
return (
|
1175
|
+
return ((x = Math.exp(x)) + 1 / x) / 2;
|
1176
1176
|
}
|
1177
1177
|
function d3_tanh(x) {
|
1178
|
-
return
|
1178
|
+
return ((x = Math.exp(2 * x)) - 1) / (x + 1);
|
1179
1179
|
}
|
1180
1180
|
function d3_haversin(x) {
|
1181
1181
|
return (x = Math.sin(x / 2)) * x;
|
@@ -2611,7 +2611,7 @@ d3 = function() {
|
|
2611
2611
|
function d3_true() {
|
2612
2612
|
return true;
|
2613
2613
|
}
|
2614
|
-
function d3_geo_clipPolygon(segments, compare,
|
2614
|
+
function d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener) {
|
2615
2615
|
var subject = [], clip = [];
|
2616
2616
|
segments.forEach(function(segment) {
|
2617
2617
|
if ((n = segment.length - 1) <= 0) return;
|
@@ -2664,8 +2664,8 @@ d3 = function() {
|
|
2664
2664
|
d3_geo_clipPolygonLinkCircular(subject);
|
2665
2665
|
d3_geo_clipPolygonLinkCircular(clip);
|
2666
2666
|
if (!subject.length) return;
|
2667
|
-
|
2668
|
-
clip[i].entry =
|
2667
|
+
for (var i = 0, entry = clipStartInside, n = clip.length; i < n; ++i) {
|
2668
|
+
clip[i].entry = entry = !entry;
|
2669
2669
|
}
|
2670
2670
|
var start = subject[0], current, points, point;
|
2671
2671
|
while (1) {
|
@@ -2708,9 +2708,9 @@ d3 = function() {
|
|
2708
2708
|
a.next = b = array[0];
|
2709
2709
|
b.prev = a;
|
2710
2710
|
}
|
2711
|
-
function d3_geo_clip(pointVisible, clipLine, interpolate,
|
2712
|
-
return function(listener) {
|
2713
|
-
var line = clipLine(listener);
|
2711
|
+
function d3_geo_clip(pointVisible, clipLine, interpolate, clipStart) {
|
2712
|
+
return function(rotate, listener) {
|
2713
|
+
var line = clipLine(listener), rotatedClipStart = rotate.invert(clipStart[0], clipStart[1]);
|
2714
2714
|
var clip = {
|
2715
2715
|
point: point,
|
2716
2716
|
lineStart: lineStart,
|
@@ -2728,9 +2728,10 @@ d3 = function() {
|
|
2728
2728
|
clip.lineStart = lineStart;
|
2729
2729
|
clip.lineEnd = lineEnd;
|
2730
2730
|
segments = d3.merge(segments);
|
2731
|
+
var clipStartInside = d3_geo_pointInPolygon(rotatedClipStart, polygon);
|
2731
2732
|
if (segments.length) {
|
2732
|
-
d3_geo_clipPolygon(segments, d3_geo_clipSort,
|
2733
|
-
} else if (
|
2733
|
+
d3_geo_clipPolygon(segments, d3_geo_clipSort, clipStartInside, interpolate, listener);
|
2734
|
+
} else if (clipStartInside) {
|
2734
2735
|
listener.lineStart();
|
2735
2736
|
interpolate(null, null, 1, listener);
|
2736
2737
|
listener.lineEnd();
|
@@ -2747,10 +2748,12 @@ d3 = function() {
|
|
2747
2748
|
}
|
2748
2749
|
};
|
2749
2750
|
function point(λ, φ) {
|
2750
|
-
|
2751
|
+
var point = rotate(λ, φ);
|
2752
|
+
if (pointVisible(λ = point[0], φ = point[1])) listener.point(λ, φ);
|
2751
2753
|
}
|
2752
2754
|
function pointLine(λ, φ) {
|
2753
|
-
|
2755
|
+
var point = rotate(λ, φ);
|
2756
|
+
line.point(point[0], point[1]);
|
2754
2757
|
}
|
2755
2758
|
function lineStart() {
|
2756
2759
|
clip.point = pointLine;
|
@@ -2763,8 +2766,9 @@ d3 = function() {
|
|
2763
2766
|
var segments;
|
2764
2767
|
var buffer = d3_geo_clipBufferListener(), ringListener = clipLine(buffer), polygon, ring;
|
2765
2768
|
function pointRing(λ, φ) {
|
2766
|
-
ringListener.point(λ, φ);
|
2767
2769
|
ring.push([ λ, φ ]);
|
2770
|
+
var point = rotate(λ, φ);
|
2771
|
+
ringListener.point(point[0], point[1]);
|
2768
2772
|
}
|
2769
2773
|
function ringStart() {
|
2770
2774
|
ringListener.lineStart();
|
@@ -2817,7 +2821,7 @@ d3 = function() {
|
|
2817
2821
|
};
|
2818
2822
|
}
|
2819
2823
|
function d3_geo_clipSort(a, b) {
|
2820
|
-
return ((a = a.point)[0] < 0 ? a[1] - π
|
2824
|
+
return ((a = a.point)[0] < 0 ? a[1] - halfπ - ε : halfπ - a[1]) - ((b = b.point)[0] < 0 ? b[1] - halfπ - ε : halfπ - b[1]);
|
2821
2825
|
}
|
2822
2826
|
function d3_geo_pointInPolygon(point, polygon) {
|
2823
2827
|
var meridian = point[0], parallel = point[1], meridianNormal = [ Math.sin(meridian), -Math.cos(meridian), 0 ], polarAngle = 0, winding = 0;
|
@@ -2838,7 +2842,7 @@ d3 = function() {
|
|
2838
2842
|
var intersection = d3_geo_cartesianCross(meridianNormal, arc);
|
2839
2843
|
d3_geo_cartesianNormalize(intersection);
|
2840
2844
|
var φarc = (antimeridian ^ dλ >= 0 ? -1 : 1) * d3_asin(intersection[2]);
|
2841
|
-
if (parallel > φarc) {
|
2845
|
+
if (parallel > φarc || parallel === φarc && (arc[0] || arc[1])) {
|
2842
2846
|
winding += antimeridian ^ dλ >= 0 ? 1 : -1;
|
2843
2847
|
}
|
2844
2848
|
}
|
@@ -2848,7 +2852,7 @@ d3 = function() {
|
|
2848
2852
|
}
|
2849
2853
|
return (polarAngle < -ε || polarAngle < ε && d3_geo_areaRingSum < 0) ^ winding & 1;
|
2850
2854
|
}
|
2851
|
-
var d3_geo_clipAntimeridian = d3_geo_clip(d3_true, d3_geo_clipAntimeridianLine, d3_geo_clipAntimeridianInterpolate,
|
2855
|
+
var d3_geo_clipAntimeridian = d3_geo_clip(d3_true, d3_geo_clipAntimeridianLine, d3_geo_clipAntimeridianInterpolate, [ -π, -π / 2 ]);
|
2852
2856
|
function d3_geo_clipAntimeridianLine(listener) {
|
2853
2857
|
var λ0 = NaN, φ0 = NaN, sλ0 = NaN, clean;
|
2854
2858
|
return {
|
@@ -2859,7 +2863,7 @@ d3 = function() {
|
|
2859
2863
|
point: function(λ1, φ1) {
|
2860
2864
|
var sλ1 = λ1 > 0 ? π : -π, dλ = Math.abs(λ1 - λ0);
|
2861
2865
|
if (Math.abs(dλ - π) < ε) {
|
2862
|
-
listener.point(λ0, φ0 = (φ0 + φ1) / 2 > 0 ? π
|
2866
|
+
listener.point(λ0, φ0 = (φ0 + φ1) / 2 > 0 ? halfπ : -halfπ);
|
2863
2867
|
listener.point(sλ0, φ0);
|
2864
2868
|
listener.lineEnd();
|
2865
2869
|
listener.lineStart();
|
@@ -2895,7 +2899,7 @@ d3 = function() {
|
|
2895
2899
|
function d3_geo_clipAntimeridianInterpolate(from, to, direction, listener) {
|
2896
2900
|
var φ;
|
2897
2901
|
if (from == null) {
|
2898
|
-
φ = direction *
|
2902
|
+
φ = direction * halfπ;
|
2899
2903
|
listener.point(-π, φ);
|
2900
2904
|
listener.point(0, φ);
|
2901
2905
|
listener.point(π, φ);
|
@@ -2915,13 +2919,9 @@ d3 = function() {
|
|
2915
2919
|
listener.point(to[0], to[1]);
|
2916
2920
|
}
|
2917
2921
|
}
|
2918
|
-
var d3_geo_clipAntimeridianPoint = [ -π, 0 ];
|
2919
|
-
function d3_geo_clipAntimeridianPolygonContains(polygon) {
|
2920
|
-
return d3_geo_pointInPolygon(d3_geo_clipAntimeridianPoint, polygon);
|
2921
|
-
}
|
2922
2922
|
function d3_geo_clipCircle(radius) {
|
2923
|
-
var cr = Math.cos(radius), smallRadius = cr > 0,
|
2924
|
-
return d3_geo_clip(visible, clipLine, interpolate,
|
2923
|
+
var cr = Math.cos(radius), smallRadius = cr > 0, notHemisphere = Math.abs(cr) > ε, interpolate = d3_geo_circleInterpolate(radius, 6 * d3_radians);
|
2924
|
+
return d3_geo_clip(visible, clipLine, interpolate, smallRadius ? [ 0, -radius ] : [ -π, radius - π ]);
|
2925
2925
|
function visible(λ, φ) {
|
2926
2926
|
return Math.cos(λ) * Math.cos(φ) > cr;
|
2927
2927
|
}
|
@@ -3014,9 +3014,6 @@ d3 = function() {
|
|
3014
3014
|
if (φ < -r) code |= 4; else if (φ > r) code |= 8;
|
3015
3015
|
return code;
|
3016
3016
|
}
|
3017
|
-
function polygonContains(polygon) {
|
3018
|
-
return d3_geo_pointInPolygon(point, polygon);
|
3019
|
-
}
|
3020
3017
|
}
|
3021
3018
|
var d3_geo_clipExtentMAX = 1e9;
|
3022
3019
|
d3.geo.clipExtent = function() {
|
@@ -3047,25 +3044,27 @@ d3 = function() {
|
|
3047
3044
|
listener = bufferListener;
|
3048
3045
|
segments = [];
|
3049
3046
|
polygon = [];
|
3047
|
+
clean = true;
|
3050
3048
|
},
|
3051
3049
|
polygonEnd: function() {
|
3052
3050
|
listener = listener_;
|
3053
|
-
|
3051
|
+
segments = d3.merge(segments);
|
3052
|
+
var clipStartInside = insidePolygon([ x0, y1 ]), inside = clean && clipStartInside, visible = segments.length;
|
3053
|
+
if (inside || visible) {
|
3054
3054
|
listener.polygonStart();
|
3055
|
-
|
3055
|
+
if (inside) {
|
3056
|
+
listener.lineStart();
|
3057
|
+
interpolate(null, null, 1, listener);
|
3058
|
+
listener.lineEnd();
|
3059
|
+
}
|
3060
|
+
if (visible) {
|
3061
|
+
d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener);
|
3062
|
+
}
|
3056
3063
|
listener.polygonEnd();
|
3057
|
-
} else if (insidePolygon([ x0, y0 ])) {
|
3058
|
-
listener.polygonStart(), listener.lineStart();
|
3059
|
-
interpolate(null, null, 1, listener);
|
3060
|
-
listener.lineEnd(), listener.polygonEnd();
|
3061
3064
|
}
|
3062
3065
|
segments = polygon = ring = null;
|
3063
3066
|
}
|
3064
3067
|
};
|
3065
|
-
function inside(point) {
|
3066
|
-
var a = corner(point, -1), i = insidePolygon([ a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0 ]);
|
3067
|
-
return i;
|
3068
|
-
}
|
3069
3068
|
function insidePolygon(p) {
|
3070
3069
|
var wn = 0, n = polygon.length, y = p[1];
|
3071
3070
|
for (var i = 0; i < n; ++i) {
|
@@ -3094,13 +3093,13 @@ d3 = function() {
|
|
3094
3093
|
listener.point(to[0], to[1]);
|
3095
3094
|
}
|
3096
3095
|
}
|
3097
|
-
function
|
3096
|
+
function pointVisible(x, y) {
|
3098
3097
|
return x0 <= x && x <= x1 && y0 <= y && y <= y1;
|
3099
3098
|
}
|
3100
3099
|
function point(x, y) {
|
3101
|
-
if (
|
3100
|
+
if (pointVisible(x, y)) listener.point(x, y);
|
3102
3101
|
}
|
3103
|
-
var x__, y__, v__, x_, y_, v_, first;
|
3102
|
+
var x__, y__, v__, x_, y_, v_, first, clean;
|
3104
3103
|
function lineStart() {
|
3105
3104
|
clip.point = linePoint;
|
3106
3105
|
if (polygon) polygon.push(ring = []);
|
@@ -3120,7 +3119,7 @@ d3 = function() {
|
|
3120
3119
|
function linePoint(x, y) {
|
3121
3120
|
x = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, x));
|
3122
3121
|
y = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, y));
|
3123
|
-
var v =
|
3122
|
+
var v = pointVisible(x, y);
|
3124
3123
|
if (polygon) ring.push([ x, y ]);
|
3125
3124
|
if (first) {
|
3126
3125
|
x__ = x, y__ = y, v__ = v;
|
@@ -3139,9 +3138,11 @@ d3 = function() {
|
|
3139
3138
|
}
|
3140
3139
|
listener.point(b[0], b[1]);
|
3141
3140
|
if (!v) listener.lineEnd();
|
3141
|
+
clean = false;
|
3142
3142
|
} else if (v) {
|
3143
3143
|
listener.lineStart();
|
3144
3144
|
listener.point(x, y);
|
3145
|
+
clean = false;
|
3145
3146
|
}
|
3146
3147
|
}
|
3147
3148
|
}
|
@@ -3469,7 +3470,7 @@ d3 = function() {
|
|
3469
3470
|
};
|
3470
3471
|
function point(x, y) {
|
3471
3472
|
context.moveTo(x, y);
|
3472
|
-
context.arc(x, y, pointRadius, 0,
|
3473
|
+
context.arc(x, y, pointRadius, 0, τ);
|
3473
3474
|
}
|
3474
3475
|
function pointLineStart(x, y) {
|
3475
3476
|
context.moveTo(x, y);
|
@@ -3668,7 +3669,7 @@ d3 = function() {
|
|
3668
3669
|
}
|
3669
3670
|
projection.stream = function(output) {
|
3670
3671
|
if (stream) stream.valid = false;
|
3671
|
-
stream =
|
3672
|
+
stream = d3_geo_projectionRadians(preclip(rotate, projectResample(postclip(output))));
|
3672
3673
|
stream.valid = true;
|
3673
3674
|
return stream;
|
3674
3675
|
};
|
@@ -3725,11 +3726,10 @@ d3 = function() {
|
|
3725
3726
|
return reset();
|
3726
3727
|
};
|
3727
3728
|
}
|
3728
|
-
function
|
3729
|
+
function d3_geo_projectionRadians(stream) {
|
3729
3730
|
var transform = new d3_geo_transform(stream);
|
3730
|
-
transform.point = function(
|
3731
|
-
|
3732
|
-
stream.point(x > π ? x - 2 * π : x < -π ? x + 2 * π : x, y[1]);
|
3731
|
+
transform.point = function(λ, φ) {
|
3732
|
+
stream.point(λ * d3_radians, φ * d3_radians);
|
3733
3733
|
};
|
3734
3734
|
return transform;
|
3735
3735
|
}
|
@@ -3751,12 +3751,16 @@ d3 = function() {
|
|
3751
3751
|
};
|
3752
3752
|
return forward;
|
3753
3753
|
};
|
3754
|
+
function d3_geo_identityRotation(λ, φ) {
|
3755
|
+
return [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ];
|
3756
|
+
}
|
3757
|
+
d3_geo_identityRotation.invert = d3_geo_equirectangular;
|
3754
3758
|
function d3_geo_rotation(δλ, δφ, δγ) {
|
3755
|
-
return δλ ? δφ || δγ ? d3_geo_compose(d3_geo_rotationλ(δλ), d3_geo_rotationφγ(δφ, δγ)) : d3_geo_rotationλ(δλ) : δφ || δγ ? d3_geo_rotationφγ(δφ, δγ) :
|
3759
|
+
return δλ ? δφ || δγ ? d3_geo_compose(d3_geo_rotationλ(δλ), d3_geo_rotationφγ(δφ, δγ)) : d3_geo_rotationλ(δλ) : δφ || δγ ? d3_geo_rotationφγ(δφ, δγ) : d3_geo_identityRotation;
|
3756
3760
|
}
|
3757
3761
|
function d3_geo_forwardRotationλ(δλ) {
|
3758
3762
|
return function(λ, φ) {
|
3759
|
-
return λ += δλ, [ λ > π ? λ -
|
3763
|
+
return λ += δλ, [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ];
|
3760
3764
|
};
|
3761
3765
|
}
|
3762
3766
|
function d3_geo_rotationλ(δλ) {
|
@@ -3815,9 +3819,9 @@ d3 = function() {
|
|
3815
3819
|
if (from != null) {
|
3816
3820
|
from = d3_geo_circleAngle(cr, from);
|
3817
3821
|
to = d3_geo_circleAngle(cr, to);
|
3818
|
-
if (direction > 0 ? from < to : from > to) from += direction *
|
3822
|
+
if (direction > 0 ? from < to : from > to) from += direction * τ;
|
3819
3823
|
} else {
|
3820
|
-
from = radius + direction *
|
3824
|
+
from = radius + direction * τ;
|
3821
3825
|
to = radius - .5 * step;
|
3822
3826
|
}
|
3823
3827
|
for (var point, t = from; direction > 0 ? t > to : t < to; t -= step) {
|
@@ -4033,12 +4037,12 @@ d3 = function() {
|
|
4033
4037
|
}, n = φ0 === φ1 ? Math.sin(φ0) : Math.log(cosφ0 / Math.cos(φ1)) / Math.log(t(φ1) / t(φ0)), F = cosφ0 * Math.pow(t(φ0), n) / n;
|
4034
4038
|
if (!n) return d3_geo_mercator;
|
4035
4039
|
function forward(λ, φ) {
|
4036
|
-
var ρ = Math.abs(Math.abs(φ) - π
|
4040
|
+
var ρ = Math.abs(Math.abs(φ) - halfπ) < ε ? 0 : F / Math.pow(t(φ), n);
|
4037
4041
|
return [ ρ * Math.sin(n * λ), F - ρ * Math.cos(n * λ) ];
|
4038
4042
|
}
|
4039
4043
|
forward.invert = function(x, y) {
|
4040
4044
|
var ρ0_y = F - y, ρ = d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y);
|
4041
|
-
return [ Math.atan2(x, ρ0_y) / n, 2 * Math.atan(Math.pow(F / ρ, 1 / n)) - π
|
4045
|
+
return [ Math.atan2(x, ρ0_y) / n, 2 * Math.atan(Math.pow(F / ρ, 1 / n)) - halfπ ];
|
4042
4046
|
};
|
4043
4047
|
return forward;
|
4044
4048
|
}
|
@@ -4071,7 +4075,7 @@ d3 = function() {
|
|
4071
4075
|
return [ λ, Math.log(Math.tan(π / 4 + φ / 2)) ];
|
4072
4076
|
}
|
4073
4077
|
d3_geo_mercator.invert = function(x, y) {
|
4074
|
-
return [ x, 2 * Math.atan(Math.exp(y)) - π
|
4078
|
+
return [ x, 2 * Math.atan(Math.exp(y)) - halfπ ];
|
4075
4079
|
};
|
4076
4080
|
function d3_geo_mercatorProjection(project) {
|
4077
4081
|
var m = d3_geo_projection(project), scale = m.scale, translate = m.translate, clipExtent = m.clipExtent, clipAuto;
|
@@ -4358,7 +4362,7 @@ d3 = function() {
|
|
4358
4362
|
var tangents = [], d, a, b, s, m = d3_svg_lineFiniteDifferences(points), i = -1, j = points.length - 1;
|
4359
4363
|
while (++i < j) {
|
4360
4364
|
d = d3_svg_lineSlope(points[i], points[i + 1]);
|
4361
|
-
if (Math.abs(d) <
|
4365
|
+
if (Math.abs(d) < ε) {
|
4362
4366
|
m[i] = m[i + 1] = 0;
|
4363
4367
|
} else {
|
4364
4368
|
a = m[i] / d;
|
@@ -5273,7 +5277,7 @@ d3 = function() {
|
|
5273
5277
|
};
|
5274
5278
|
}
|
5275
5279
|
function d3_ease_sin(t) {
|
5276
|
-
return 1 - Math.cos(t * π
|
5280
|
+
return 1 - Math.cos(t * halfπ);
|
5277
5281
|
}
|
5278
5282
|
function d3_ease_exp(t) {
|
5279
5283
|
return Math.pow(2, 10 * (t - 1));
|
@@ -5284,9 +5288,9 @@ d3 = function() {
|
|
5284
5288
|
function d3_ease_elastic(a, p) {
|
5285
5289
|
var s;
|
5286
5290
|
if (arguments.length < 2) p = .45;
|
5287
|
-
if (arguments.length) s = p /
|
5291
|
+
if (arguments.length) s = p / τ * Math.asin(1 / a); else a = 1, s = p / 4;
|
5288
5292
|
return function(t) {
|
5289
|
-
return 1 + a * Math.pow(2, 10 *
|
5293
|
+
return 1 + a * Math.pow(2, -10 * t) * Math.sin((t - s) * τ / p);
|
5290
5294
|
};
|
5291
5295
|
}
|
5292
5296
|
function d3_ease_back(s) {
|
@@ -5520,7 +5524,7 @@ d3 = function() {
|
|
5520
5524
|
});
|
5521
5525
|
});
|
5522
5526
|
}
|
5523
|
-
k = (
|
5527
|
+
k = (τ - padding * n) / k;
|
5524
5528
|
x = 0, i = -1;
|
5525
5529
|
while (++i < n) {
|
5526
5530
|
x0 = x, j = -1;
|
@@ -5972,7 +5976,7 @@ d3 = function() {
|
|
5972
5976
|
return d3_layout_hierarchyRebind(partition, hierarchy);
|
5973
5977
|
};
|
5974
5978
|
d3.layout.pie = function() {
|
5975
|
-
var value = Number, sort = d3_layout_pieSortByValue, startAngle = 0, endAngle =
|
5979
|
+
var value = Number, sort = d3_layout_pieSortByValue, startAngle = 0, endAngle = τ;
|
5976
5980
|
function pie(data) {
|
5977
5981
|
var values = data.map(function(d, i) {
|
5978
5982
|
return +value.call(pie, d, i);
|
@@ -7326,7 +7330,7 @@ d3 = function() {
|
|
7326
7330
|
};
|
7327
7331
|
return arc;
|
7328
7332
|
};
|
7329
|
-
var d3_svg_arcOffset =
|
7333
|
+
var d3_svg_arcOffset = -halfπ, d3_svg_arcMax = τ - ε;
|
7330
7334
|
function d3_svg_arcInnerRadius(d) {
|
7331
7335
|
return d.innerRadius;
|
7332
7336
|
}
|
@@ -7845,7 +7849,7 @@ d3 = function() {
|
|
7845
7849
|
++lock.count;
|
7846
7850
|
d3.timer(function(elapsed) {
|
7847
7851
|
var d = node.__data__, ease = transition.ease, delay = transition.delay, duration = transition.duration, tweened = [];
|
7848
|
-
if (delay <= elapsed) return start(elapsed);
|
7852
|
+
if (delay <= elapsed) return start(elapsed - delay);
|
7849
7853
|
d3_timer_replace(start, delay, time);
|
7850
7854
|
function start(elapsed) {
|
7851
7855
|
if (lock.active > id) return stop();
|
@@ -7856,12 +7860,12 @@ d3 = function() {
|
|
7856
7860
|
tweened.push(value);
|
7857
7861
|
}
|
7858
7862
|
});
|
7859
|
-
if (tick(elapsed)) return 1;
|
7860
|
-
d3_timer_replace(tick,
|
7863
|
+
if (tick(elapsed || 1)) return 1;
|
7864
|
+
d3_timer_replace(tick, delay, time);
|
7861
7865
|
}
|
7862
7866
|
function tick(elapsed) {
|
7863
7867
|
if (lock.active !== id) return stop();
|
7864
|
-
var t =
|
7868
|
+
var t = elapsed / duration, e = ease(t), n = tweened.length;
|
7865
7869
|
while (n > 0) {
|
7866
7870
|
tweened[--n].call(node, e);
|
7867
7871
|
}
|
@@ -7882,11 +7886,10 @@ d3 = function() {
|
|
7882
7886
|
function axis(g) {
|
7883
7887
|
g.each(function() {
|
7884
7888
|
var g = d3.select(this);
|
7885
|
-
var
|
7886
|
-
var
|
7889
|
+
var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = scale.copy();
|
7890
|
+
var ticks = tickValues == null ? scale1.ticks ? scale1.ticks.apply(scale1, tickArguments_) : scale1.domain() : tickValues, tickFormat = tickFormat_ == null ? scale1.tickFormat ? scale1.tickFormat.apply(scale1, tickArguments_) : d3_identity : tickFormat_, tick = g.selectAll(".tick").data(ticks, scale1), tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick").style("opacity", ε), tickExit = d3.transition(tick.exit()).style("opacity", ε).remove(), tickUpdate = d3.transition(tick).style("opacity", 1), tickTransform;
|
7891
|
+
var range = d3_scaleRange(scale1), path = g.selectAll(".domain").data([ 0 ]), pathUpdate = (path.enter().append("path").attr("class", "domain"),
|
7887
7892
|
d3.transition(path));
|
7888
|
-
var scale1 = scale.copy(), scale0 = this.__chart__ || scale1;
|
7889
|
-
this.__chart__ = scale1;
|
7890
7893
|
tickEnter.append("line");
|
7891
7894
|
tickEnter.append("text");
|
7892
7895
|
var lineEnter = tickEnter.select("line"), lineUpdate = tickUpdate.select("line"), text = tick.select("text").text(tickFormat), textEnter = tickEnter.select("text"), textUpdate = tickUpdate.select("text");
|
@@ -7939,7 +7942,7 @@ d3 = function() {
|
|
7939
7942
|
break;
|
7940
7943
|
}
|
7941
7944
|
}
|
7942
|
-
if (
|
7945
|
+
if (scale1.rangeBand) {
|
7943
7946
|
var dx = scale1.rangeBand() / 2, x = function(d) {
|
7944
7947
|
return scale1(d) + dx;
|
7945
7948
|
};
|