Skip to content

Commit 056c488

Browse files
committed
Merge remote-tracking branch 'origin/fix-imports' into 3.4.12
2 parents 98e7d4b + 03e74cb commit 056c488

File tree

11 files changed

+49
-58
lines changed

11 files changed

+49
-58
lines changed

d3.js

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,13 +1116,13 @@
11161116
var rect = container.getBoundingClientRect();
11171117
return [ e.clientX - rect.left - container.clientLeft, e.clientY - rect.top - container.clientTop ];
11181118
}
1119-
d3.touches = function(container, touches) {
1120-
if (arguments.length < 2) touches = d3_eventSource().touches;
1121-
return touches ? d3_array(touches).map(function(touch) {
1122-
var point = d3_mousePoint(container, touch);
1123-
point.identifier = touch.identifier;
1124-
return point;
1125-
}) : [];
1119+
d3.touch = function(container, touches, identifier) {
1120+
if (arguments.length < 3) identifier = touches, touches = d3_eventSource().changedTouches;
1121+
if (touches) for (var i = 0, n = touches.length, touch; i < n; ++i) {
1122+
if ((touch = touches[i]).identifier === identifier) {
1123+
return d3_mousePoint(container, touch);
1124+
}
1125+
}
11261126
};
11271127
d3.behavior.drag = function() {
11281128
var event = d3_eventDispatch(drag, "drag", "dragstart", "dragend"), origin = null, mousedown = dragstart(d3_noop, d3.mouse, d3_behavior_dragMouseSubject, "mousemove", "mouseup"), touchstart = dragstart(d3_behavior_dragTouchId, d3.touch, d3_behavior_dragTouchSubject, "touchmove", "touchend");
@@ -1182,6 +1182,14 @@
11821182
function d3_behavior_dragMouseSubject() {
11831183
return d3_window;
11841184
}
1185+
d3.touches = function(container, touches) {
1186+
if (arguments.length < 2) touches = d3_eventSource().touches;
1187+
return touches ? d3_array(touches).map(function(touch) {
1188+
var point = d3_mousePoint(container, touch);
1189+
point.identifier = touch.identifier;
1190+
return point;
1191+
}) : [];
1192+
};
11851193
var π = Math.PI, τ = 2 * π, halfπ = π / 2, ε = 1e-6, ε2 = ε * ε, d3_radians = π / 180, d3_degrees = 180 / π;
11861194
function d3_sgn(x) {
11871195
return x > 0 ? 1 : x < 0 ? -1 : 0;
@@ -2022,14 +2030,6 @@
20222030
};
20232031
d3.csv = d3.dsv(",", "text/csv");
20242032
d3.tsv = d3.dsv(" ", "text/tab-separated-values");
2025-
d3.touch = function(container, touches, identifier) {
2026-
if (arguments.length < 3) identifier = touches, touches = d3_eventSource().changedTouches;
2027-
if (touches) for (var i = 0, n = touches.length, touch; i < n; ++i) {
2028-
if ((touch = touches[i]).identifier === identifier) {
2029-
return d3_mousePoint(container, touch);
2030-
}
2031-
}
2032-
};
20332033
var d3_timer_queueHead, d3_timer_queueTail, d3_timer_interval, d3_timer_timeout, d3_timer_active, d3_timer_frame = d3_window[d3_vendorSymbol(d3_window, "requestAnimationFrame")] || function(callback) {
20342034
setTimeout(callback, 17);
20352035
};
@@ -3320,35 +3320,6 @@
33203320
function d3_geo_clipSort(a, b) {
33213321
return ((a = a.x)[0] < 0 ? a[1] - halfπ - ε : halfπ - a[1]) - ((b = b.x)[0] < 0 ? b[1] - halfπ - ε : halfπ - b[1]);
33223322
}
3323-
function d3_geo_pointInPolygon(point, polygon) {
3324-
var meridian = point[0], parallel = point[1], meridianNormal = [ Math.sin(meridian), -Math.cos(meridian), 0 ], polarAngle = 0, winding = 0;
3325-
d3_geo_areaRingSum.reset();
3326-
for (var i = 0, n = polygon.length; i < n; ++i) {
3327-
var ring = polygon[i], m = ring.length;
3328-
if (!m) continue;
3329-
var point0 = ring[0], λ0 = point0[0], φ0 = point0[1] / 2 + π / 4, sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), j = 1;
3330-
while (true) {
3331-
if (j === m) j = 0;
3332-
point = ring[j];
3333-
var λ = point[0], φ = point[1] / 2 + π / 4, sinφ = Math.sin(φ), cosφ = Math.cos(φ), = λ - λ0, sdλ = >= 0 ? 1 : -1, adλ = sdλ * , antimeridian = adλ > π, k = sinφ0 * sinφ;
3334-
d3_geo_areaRingSum.add(Math.atan2(k * sdλ * Math.sin(adλ), cosφ0 * cosφ + k * Math.cos(adλ)));
3335-
polarAngle += antimeridian ? + sdλ * τ : ;
3336-
if (antimeridian ^ λ0 >= meridian ^ λ >= meridian) {
3337-
var arc = d3_geo_cartesianCross(d3_geo_cartesian(point0), d3_geo_cartesian(point));
3338-
d3_geo_cartesianNormalize(arc);
3339-
var intersection = d3_geo_cartesianCross(meridianNormal, arc);
3340-
d3_geo_cartesianNormalize(intersection);
3341-
var φarc = (antimeridian ^ >= 0 ? -1 : 1) * d3_asin(intersection[2]);
3342-
if (parallel > φarc || parallel === φarc && (arc[0] || arc[1])) {
3343-
winding += antimeridian ^ >= 0 ? 1 : -1;
3344-
}
3345-
}
3346-
if (!j++) break;
3347-
λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ, point0 = point;
3348-
}
3349-
}
3350-
return (polarAngle < -ε || polarAngle < ε && d3_geo_areaRingSum < 0) ^ winding & 1;
3351-
}
33523323
var d3_geo_clipAntimeridian = d3_geo_clip(d3_true, d3_geo_clipAntimeridianLine, d3_geo_clipAntimeridianInterpolate, [ -π, -π / 2 ]);
33533324
function d3_geo_clipAntimeridianLine(listener) {
33543325
var λ0 = NaN, φ0 = NaN, sλ0 = NaN, clean;
@@ -3416,6 +3387,35 @@
34163387
listener.point(to[0], to[1]);
34173388
}
34183389
}
3390+
function d3_geo_pointInPolygon(point, polygon) {
3391+
var meridian = point[0], parallel = point[1], meridianNormal = [ Math.sin(meridian), -Math.cos(meridian), 0 ], polarAngle = 0, winding = 0;
3392+
d3_geo_areaRingSum.reset();
3393+
for (var i = 0, n = polygon.length; i < n; ++i) {
3394+
var ring = polygon[i], m = ring.length;
3395+
if (!m) continue;
3396+
var point0 = ring[0], λ0 = point0[0], φ0 = point0[1] / 2 + π / 4, sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), j = 1;
3397+
while (true) {
3398+
if (j === m) j = 0;
3399+
point = ring[j];
3400+
var λ = point[0], φ = point[1] / 2 + π / 4, sinφ = Math.sin(φ), cosφ = Math.cos(φ), = λ - λ0, sdλ = >= 0 ? 1 : -1, adλ = sdλ * , antimeridian = adλ > π, k = sinφ0 * sinφ;
3401+
d3_geo_areaRingSum.add(Math.atan2(k * sdλ * Math.sin(adλ), cosφ0 * cosφ + k * Math.cos(adλ)));
3402+
polarAngle += antimeridian ? + sdλ * τ : ;
3403+
if (antimeridian ^ λ0 >= meridian ^ λ >= meridian) {
3404+
var arc = d3_geo_cartesianCross(d3_geo_cartesian(point0), d3_geo_cartesian(point));
3405+
d3_geo_cartesianNormalize(arc);
3406+
var intersection = d3_geo_cartesianCross(meridianNormal, arc);
3407+
d3_geo_cartesianNormalize(intersection);
3408+
var φarc = (antimeridian ^ >= 0 ? -1 : 1) * d3_asin(intersection[2]);
3409+
if (parallel > φarc || parallel === φarc && (arc[0] || arc[1])) {
3410+
winding += antimeridian ^ >= 0 ? 1 : -1;
3411+
}
3412+
}
3413+
if (!j++) break;
3414+
λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ, point0 = point;
3415+
}
3416+
}
3417+
return (polarAngle < -ε || polarAngle < ε && d3_geo_areaRingSum < 0) ^ winding & 1;
3418+
}
34193419
function d3_geo_clipCircle(radius) {
34203420
var cr = Math.cos(radius), smallRadius = cr > 0, notHemisphere = abs(cr) > ε, interpolate = d3_geo_circleInterpolate(radius, 6 * d3_radians);
34213421
return d3_geo_clip(visible, clipLine, interpolate, smallRadius ? [ 0, -radius ] : [ -π, radius - π ]);

d3.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/behavior/drag.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import "../core/rebind";
33
import "../event/drag";
44
import "../event/event";
55
import "../event/mouse";
6-
import "../event/touches";
6+
import "../event/touch";
77
import "behavior";
88

99
d3.behavior.drag = function() {

src/core/vendor.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import "document";
2-
31
function d3_vendorSymbol(object, name) {
42
if (name in object) return name;
53
name = name.charAt(0).toUpperCase() + name.slice(1);

src/geo/clip-antimeridian.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import "../core/true";
22
import "../math/abs";
33
import "../math/trigonometry";
44
import "clip";
5-
import "point-in-polygon";
65

76
var d3_geo_clipAntimeridian = d3_geo_clip(
87
d3_true,

src/scale/pow.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import "linear";
2-
import "nice";
32
import "scale";
43

54
d3.scale.pow = function() {

src/svg/brush.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import "../core/identity";
22
import "../core/document";
33
import "../core/rebind";
4-
import "../event/dispatch";
54
import "../event/drag";
65
import "../event/event";
76
import "../event/mouse";
8-
import "../event/touches";
97
import "../scale/scale";
108
import "../selection/selection";
119
import "svg";

src/time/format-iso.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import "format";
22
import "format-utc";
3-
import "time";
43

54
var d3_time_formatIso = d3_time_formatUtc("%Y-%m-%dT%H:%M:%S.%LZ");
65

src/time/scale.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import "../arrays/bisect";
22
import "../arrays/range";
33
import "../core/identity";
4-
import "../core/rebind";
54
import "../core/true";
65
import "../scale/linear";
76
import "../scale/nice";

src/transition/selectAll.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import "../selection/select";
1+
import "../selection/selectAll";
22
import "transition";
33

44
d3_transitionPrototype.selectAll = function(selector) {

0 commit comments

Comments
 (0)