@mui/x-charts-vendor 9.0.0 → 9.4.0

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.
Files changed (65) hide show
  1. package/d3-geo.d.ts +4 -0
  2. package/d3-geo.js +5 -0
  3. package/d3-geo.mjs +5 -0
  4. package/lib-vendor/d3-geo/LICENSE +34 -0
  5. package/lib-vendor/d3-geo/dist/d3-geo.js +2873 -0
  6. package/lib-vendor/d3-geo/dist/d3-geo.min.js +1957 -0
  7. package/lib-vendor/d3-geo/src/area.js +77 -0
  8. package/lib-vendor/d3-geo/src/bounds.js +169 -0
  9. package/lib-vendor/d3-geo/src/cartesian.js +42 -0
  10. package/lib-vendor/d3-geo/src/centroid.js +134 -0
  11. package/lib-vendor/d3-geo/src/circle.js +77 -0
  12. package/lib-vendor/d3-geo/src/clip/antimeridian.js +89 -0
  13. package/lib-vendor/d3-geo/src/clip/buffer.js +30 -0
  14. package/lib-vendor/d3-geo/src/clip/circle.js +173 -0
  15. package/lib-vendor/d3-geo/src/clip/extent.js +25 -0
  16. package/lib-vendor/d3-geo/src/clip/index.js +124 -0
  17. package/lib-vendor/d3-geo/src/clip/line.js +60 -0
  18. package/lib-vendor/d3-geo/src/clip/rectangle.js +159 -0
  19. package/lib-vendor/d3-geo/src/clip/rejoin.js +103 -0
  20. package/lib-vendor/d3-geo/src/compose.js +15 -0
  21. package/lib-vendor/d3-geo/src/constant.js +11 -0
  22. package/lib-vendor/d3-geo/src/contains.js +95 -0
  23. package/lib-vendor/d3-geo/src/distance.js +18 -0
  24. package/lib-vendor/d3-geo/src/graticule.js +118 -0
  25. package/lib-vendor/d3-geo/src/identity.js +8 -0
  26. package/lib-vendor/d3-geo/src/index.js +335 -0
  27. package/lib-vendor/d3-geo/src/interpolate.js +35 -0
  28. package/lib-vendor/d3-geo/src/length.js +50 -0
  29. package/lib-vendor/d3-geo/src/math.js +44 -0
  30. package/lib-vendor/d3-geo/src/noop.js +7 -0
  31. package/lib-vendor/d3-geo/src/path/area.js +50 -0
  32. package/lib-vendor/d3-geo/src/path/bounds.js +31 -0
  33. package/lib-vendor/d3-geo/src/path/centroid.js +89 -0
  34. package/lib-vendor/d3-geo/src/path/context.js +53 -0
  35. package/lib-vendor/d3-geo/src/path/index.js +71 -0
  36. package/lib-vendor/d3-geo/src/path/measure.js +47 -0
  37. package/lib-vendor/d3-geo/src/path/string.js +93 -0
  38. package/lib-vendor/d3-geo/src/pointEqual.js +10 -0
  39. package/lib-vendor/d3-geo/src/polygonContains.js +72 -0
  40. package/lib-vendor/d3-geo/src/projection/albers.js +11 -0
  41. package/lib-vendor/d3-geo/src/projection/albersUsa.js +118 -0
  42. package/lib-vendor/d3-geo/src/projection/azimuthal.js +26 -0
  43. package/lib-vendor/d3-geo/src/projection/azimuthalEqualArea.js +20 -0
  44. package/lib-vendor/d3-geo/src/projection/azimuthalEquidistant.js +20 -0
  45. package/lib-vendor/d3-geo/src/projection/conic.js +18 -0
  46. package/lib-vendor/d3-geo/src/projection/conicConformal.js +39 -0
  47. package/lib-vendor/d3-geo/src/projection/conicEqualArea.js +33 -0
  48. package/lib-vendor/d3-geo/src/projection/conicEquidistant.js +31 -0
  49. package/lib-vendor/d3-geo/src/projection/cylindricalEqualArea.js +17 -0
  50. package/lib-vendor/d3-geo/src/projection/equalEarth.js +37 -0
  51. package/lib-vendor/d3-geo/src/projection/equirectangular.js +16 -0
  52. package/lib-vendor/d3-geo/src/projection/fit.js +52 -0
  53. package/lib-vendor/d3-geo/src/projection/gnomonic.js +20 -0
  54. package/lib-vendor/d3-geo/src/projection/identity.js +103 -0
  55. package/lib-vendor/d3-geo/src/projection/index.js +181 -0
  56. package/lib-vendor/d3-geo/src/projection/mercator.js +51 -0
  57. package/lib-vendor/d3-geo/src/projection/naturalEarth1.js +29 -0
  58. package/lib-vendor/d3-geo/src/projection/orthographic.js +18 -0
  59. package/lib-vendor/d3-geo/src/projection/resample.js +106 -0
  60. package/lib-vendor/d3-geo/src/projection/stereographic.js +22 -0
  61. package/lib-vendor/d3-geo/src/projection/transverseMercator.js +27 -0
  62. package/lib-vendor/d3-geo/src/rotation.js +65 -0
  63. package/lib-vendor/d3-geo/src/stream.js +83 -0
  64. package/lib-vendor/d3-geo/src/transform.js +42 -0
  65. package/package.json +18 -2
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.azimuthalEqualAreaRaw = void 0;
8
+ exports.default = _default;
9
+ var _math = require("../math.js");
10
+ var _azimuthal = require("./azimuthal.js");
11
+ var _index = _interopRequireDefault(require("./index.js"));
12
+ var azimuthalEqualAreaRaw = exports.azimuthalEqualAreaRaw = (0, _azimuthal.azimuthalRaw)(function (cxcy) {
13
+ return (0, _math.sqrt)(2 / (1 + cxcy));
14
+ });
15
+ azimuthalEqualAreaRaw.invert = (0, _azimuthal.azimuthalInvert)(function (z) {
16
+ return 2 * (0, _math.asin)(z / 2);
17
+ });
18
+ function _default() {
19
+ return (0, _index.default)(azimuthalEqualAreaRaw).scale(124.75).clipAngle(180 - 1e-3);
20
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.azimuthalEquidistantRaw = void 0;
8
+ exports.default = _default;
9
+ var _math = require("../math.js");
10
+ var _azimuthal = require("./azimuthal.js");
11
+ var _index = _interopRequireDefault(require("./index.js"));
12
+ var azimuthalEquidistantRaw = exports.azimuthalEquidistantRaw = (0, _azimuthal.azimuthalRaw)(function (c) {
13
+ return (c = (0, _math.acos)(c)) && c / (0, _math.sin)(c);
14
+ });
15
+ azimuthalEquidistantRaw.invert = (0, _azimuthal.azimuthalInvert)(function (z) {
16
+ return z;
17
+ });
18
+ function _default() {
19
+ return (0, _index.default)(azimuthalEquidistantRaw).scale(79.4188).clipAngle(180 - 1e-3);
20
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.conicProjection = conicProjection;
7
+ var _math = require("../math.js");
8
+ var _index = require("./index.js");
9
+ function conicProjection(projectAt) {
10
+ var phi0 = 0,
11
+ phi1 = _math.pi / 3,
12
+ m = (0, _index.projectionMutator)(projectAt),
13
+ p = m(phi0, phi1);
14
+ p.parallels = function (_) {
15
+ return arguments.length ? m(phi0 = _[0] * _math.radians, phi1 = _[1] * _math.radians) : [phi0 * _math.degrees, phi1 * _math.degrees];
16
+ };
17
+ return p;
18
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.conicConformalRaw = conicConformalRaw;
7
+ exports.default = _default;
8
+ var _math = require("../math.js");
9
+ var _conic = require("./conic.js");
10
+ var _mercator = require("./mercator.js");
11
+ function tany(y) {
12
+ return (0, _math.tan)((_math.halfPi + y) / 2);
13
+ }
14
+ function conicConformalRaw(y0, y1) {
15
+ var cy0 = (0, _math.cos)(y0),
16
+ n = y0 === y1 ? (0, _math.sin)(y0) : (0, _math.log)(cy0 / (0, _math.cos)(y1)) / (0, _math.log)(tany(y1) / tany(y0)),
17
+ f = cy0 * (0, _math.pow)(tany(y0), n) / n;
18
+ if (!n) return _mercator.mercatorRaw;
19
+ function project(x, y) {
20
+ if (f > 0) {
21
+ if (y < -_math.halfPi + _math.epsilon) y = -_math.halfPi + _math.epsilon;
22
+ } else {
23
+ if (y > _math.halfPi - _math.epsilon) y = _math.halfPi - _math.epsilon;
24
+ }
25
+ var r = f / (0, _math.pow)(tany(y), n);
26
+ return [r * (0, _math.sin)(n * x), f - r * (0, _math.cos)(n * x)];
27
+ }
28
+ project.invert = function (x, y) {
29
+ var fy = f - y,
30
+ r = (0, _math.sign)(n) * (0, _math.sqrt)(x * x + fy * fy),
31
+ l = (0, _math.atan2)(x, (0, _math.abs)(fy)) * (0, _math.sign)(fy);
32
+ if (fy * n < 0) l -= _math.pi * (0, _math.sign)(x) * (0, _math.sign)(fy);
33
+ return [l / n, 2 * (0, _math.atan)((0, _math.pow)(f / r, 1 / n)) - _math.halfPi];
34
+ };
35
+ return project;
36
+ }
37
+ function _default() {
38
+ return (0, _conic.conicProjection)(conicConformalRaw).scale(109.5).parallels([30, 30]);
39
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.conicEqualAreaRaw = conicEqualAreaRaw;
7
+ exports.default = _default;
8
+ var _math = require("../math.js");
9
+ var _conic = require("./conic.js");
10
+ var _cylindricalEqualArea = require("./cylindricalEqualArea.js");
11
+ function conicEqualAreaRaw(y0, y1) {
12
+ var sy0 = (0, _math.sin)(y0),
13
+ n = (sy0 + (0, _math.sin)(y1)) / 2;
14
+
15
+ // Are the parallels symmetrical around the Equator?
16
+ if ((0, _math.abs)(n) < _math.epsilon) return (0, _cylindricalEqualArea.cylindricalEqualAreaRaw)(y0);
17
+ var c = 1 + sy0 * (2 * n - sy0),
18
+ r0 = (0, _math.sqrt)(c) / n;
19
+ function project(x, y) {
20
+ var r = (0, _math.sqrt)(c - 2 * n * (0, _math.sin)(y)) / n;
21
+ return [r * (0, _math.sin)(x *= n), r0 - r * (0, _math.cos)(x)];
22
+ }
23
+ project.invert = function (x, y) {
24
+ var r0y = r0 - y,
25
+ l = (0, _math.atan2)(x, (0, _math.abs)(r0y)) * (0, _math.sign)(r0y);
26
+ if (r0y * n < 0) l -= _math.pi * (0, _math.sign)(x) * (0, _math.sign)(r0y);
27
+ return [l / n, (0, _math.asin)((c - (x * x + r0y * r0y) * n * n) / (2 * n))];
28
+ };
29
+ return project;
30
+ }
31
+ function _default() {
32
+ return (0, _conic.conicProjection)(conicEqualAreaRaw).scale(155.424).center([0, 33.6442]);
33
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.conicEquidistantRaw = conicEquidistantRaw;
7
+ exports.default = _default;
8
+ var _math = require("../math.js");
9
+ var _conic = require("./conic.js");
10
+ var _equirectangular = require("./equirectangular.js");
11
+ function conicEquidistantRaw(y0, y1) {
12
+ var cy0 = (0, _math.cos)(y0),
13
+ n = y0 === y1 ? (0, _math.sin)(y0) : (cy0 - (0, _math.cos)(y1)) / (y1 - y0),
14
+ g = cy0 / n + y0;
15
+ if ((0, _math.abs)(n) < _math.epsilon) return _equirectangular.equirectangularRaw;
16
+ function project(x, y) {
17
+ var gy = g - y,
18
+ nx = n * x;
19
+ return [gy * (0, _math.sin)(nx), g - gy * (0, _math.cos)(nx)];
20
+ }
21
+ project.invert = function (x, y) {
22
+ var gy = g - y,
23
+ l = (0, _math.atan2)(x, (0, _math.abs)(gy)) * (0, _math.sign)(gy);
24
+ if (gy * n < 0) l -= _math.pi * (0, _math.sign)(x) * (0, _math.sign)(gy);
25
+ return [l / n, g - (0, _math.sign)(n) * (0, _math.sqrt)(x * x + gy * gy)];
26
+ };
27
+ return project;
28
+ }
29
+ function _default() {
30
+ return (0, _conic.conicProjection)(conicEquidistantRaw).scale(131.154).center([0, 13.9389]);
31
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.cylindricalEqualAreaRaw = cylindricalEqualAreaRaw;
7
+ var _math = require("../math.js");
8
+ function cylindricalEqualAreaRaw(phi0) {
9
+ var cosPhi0 = (0, _math.cos)(phi0);
10
+ function forward(lambda, phi) {
11
+ return [lambda * cosPhi0, (0, _math.sin)(phi) / cosPhi0];
12
+ }
13
+ forward.invert = function (x, y) {
14
+ return [x / cosPhi0, (0, _math.asin)(y * cosPhi0)];
15
+ };
16
+ return forward;
17
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = _default;
8
+ exports.equalEarthRaw = equalEarthRaw;
9
+ var _index = _interopRequireDefault(require("./index.js"));
10
+ var _math = require("../math.js");
11
+ var A1 = 1.340264,
12
+ A2 = -0.081106,
13
+ A3 = 0.000893,
14
+ A4 = 0.003796,
15
+ M = (0, _math.sqrt)(3) / 2,
16
+ iterations = 12;
17
+ function equalEarthRaw(lambda, phi) {
18
+ var l = (0, _math.asin)(M * (0, _math.sin)(phi)),
19
+ l2 = l * l,
20
+ l6 = l2 * l2 * l2;
21
+ return [lambda * (0, _math.cos)(l) / (M * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2))), l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2))];
22
+ }
23
+ equalEarthRaw.invert = function (x, y) {
24
+ var l = y,
25
+ l2 = l * l,
26
+ l6 = l2 * l2 * l2;
27
+ for (var i = 0, delta, fy, fpy; i < iterations; ++i) {
28
+ fy = l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2)) - y;
29
+ fpy = A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2);
30
+ l -= delta = fy / fpy, l2 = l * l, l6 = l2 * l2 * l2;
31
+ if ((0, _math.abs)(delta) < _math.epsilon2) break;
32
+ }
33
+ return [M * x * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2)) / (0, _math.cos)(l), (0, _math.asin)((0, _math.sin)(l) / M)];
34
+ };
35
+ function _default() {
36
+ return (0, _index.default)(equalEarthRaw).scale(177.158);
37
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = _default;
8
+ exports.equirectangularRaw = equirectangularRaw;
9
+ var _index = _interopRequireDefault(require("./index.js"));
10
+ function equirectangularRaw(lambda, phi) {
11
+ return [lambda, phi];
12
+ }
13
+ equirectangularRaw.invert = equirectangularRaw;
14
+ function _default() {
15
+ return (0, _index.default)(equirectangularRaw).scale(152.63);
16
+ }
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.fitExtent = fitExtent;
8
+ exports.fitHeight = fitHeight;
9
+ exports.fitSize = fitSize;
10
+ exports.fitWidth = fitWidth;
11
+ var _stream = _interopRequireDefault(require("../stream.js"));
12
+ var _bounds = _interopRequireDefault(require("../path/bounds.js"));
13
+ function fit(projection, fitBounds, object) {
14
+ var clip = projection.clipExtent && projection.clipExtent();
15
+ projection.scale(150).translate([0, 0]);
16
+ if (clip != null) projection.clipExtent(null);
17
+ (0, _stream.default)(object, projection.stream(_bounds.default));
18
+ fitBounds(_bounds.default.result());
19
+ if (clip != null) projection.clipExtent(clip);
20
+ return projection;
21
+ }
22
+ function fitExtent(projection, extent, object) {
23
+ return fit(projection, function (b) {
24
+ var w = extent[1][0] - extent[0][0],
25
+ h = extent[1][1] - extent[0][1],
26
+ k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])),
27
+ x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2,
28
+ y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2;
29
+ projection.scale(150 * k).translate([x, y]);
30
+ }, object);
31
+ }
32
+ function fitSize(projection, size, object) {
33
+ return fitExtent(projection, [[0, 0], size], object);
34
+ }
35
+ function fitWidth(projection, width, object) {
36
+ return fit(projection, function (b) {
37
+ var w = +width,
38
+ k = w / (b[1][0] - b[0][0]),
39
+ x = (w - k * (b[1][0] + b[0][0])) / 2,
40
+ y = -k * b[0][1];
41
+ projection.scale(150 * k).translate([x, y]);
42
+ }, object);
43
+ }
44
+ function fitHeight(projection, height, object) {
45
+ return fit(projection, function (b) {
46
+ var h = +height,
47
+ k = h / (b[1][1] - b[0][1]),
48
+ x = -k * b[0][0],
49
+ y = (h - k * (b[1][1] + b[0][1])) / 2;
50
+ projection.scale(150 * k).translate([x, y]);
51
+ }, object);
52
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = _default;
8
+ exports.gnomonicRaw = gnomonicRaw;
9
+ var _math = require("../math.js");
10
+ var _azimuthal = require("./azimuthal.js");
11
+ var _index = _interopRequireDefault(require("./index.js"));
12
+ function gnomonicRaw(x, y) {
13
+ var cy = (0, _math.cos)(y),
14
+ k = (0, _math.cos)(x) * cy;
15
+ return [cy * (0, _math.sin)(x) / k, (0, _math.sin)(y) / k];
16
+ }
17
+ gnomonicRaw.invert = (0, _azimuthal.azimuthalInvert)(_math.atan);
18
+ function _default() {
19
+ return (0, _index.default)(gnomonicRaw).scale(144.049).clipAngle(60);
20
+ }
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = _default;
8
+ var _rectangle = _interopRequireDefault(require("../clip/rectangle.js"));
9
+ var _identity = _interopRequireDefault(require("../identity.js"));
10
+ var _transform = require("../transform.js");
11
+ var _fit = require("./fit.js");
12
+ var _math = require("../math.js");
13
+ function _default() {
14
+ var k = 1,
15
+ tx = 0,
16
+ ty = 0,
17
+ sx = 1,
18
+ sy = 1,
19
+ // scale, translate and reflect
20
+ alpha = 0,
21
+ ca,
22
+ sa,
23
+ // angle
24
+ x0 = null,
25
+ y0,
26
+ x1,
27
+ y1,
28
+ // clip extent
29
+ kx = 1,
30
+ ky = 1,
31
+ transform = (0, _transform.transformer)({
32
+ point: function (x, y) {
33
+ var p = projection([x, y]);
34
+ this.stream.point(p[0], p[1]);
35
+ }
36
+ }),
37
+ postclip = _identity.default,
38
+ cache,
39
+ cacheStream;
40
+ function reset() {
41
+ kx = k * sx;
42
+ ky = k * sy;
43
+ cache = cacheStream = null;
44
+ return projection;
45
+ }
46
+ function projection(p) {
47
+ var x = p[0] * kx,
48
+ y = p[1] * ky;
49
+ if (alpha) {
50
+ var t = y * ca - x * sa;
51
+ x = x * ca + y * sa;
52
+ y = t;
53
+ }
54
+ return [x + tx, y + ty];
55
+ }
56
+ projection.invert = function (p) {
57
+ var x = p[0] - tx,
58
+ y = p[1] - ty;
59
+ if (alpha) {
60
+ var t = y * ca + x * sa;
61
+ x = x * ca - y * sa;
62
+ y = t;
63
+ }
64
+ return [x / kx, y / ky];
65
+ };
66
+ projection.stream = function (stream) {
67
+ return cache && cacheStream === stream ? cache : cache = transform(postclip(cacheStream = stream));
68
+ };
69
+ projection.postclip = function (_) {
70
+ return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip;
71
+ };
72
+ projection.clipExtent = function (_) {
73
+ return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, _identity.default) : (0, _rectangle.default)(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];
74
+ };
75
+ projection.scale = function (_) {
76
+ return arguments.length ? (k = +_, reset()) : k;
77
+ };
78
+ projection.translate = function (_) {
79
+ return arguments.length ? (tx = +_[0], ty = +_[1], reset()) : [tx, ty];
80
+ };
81
+ projection.angle = function (_) {
82
+ return arguments.length ? (alpha = _ % 360 * _math.radians, sa = (0, _math.sin)(alpha), ca = (0, _math.cos)(alpha), reset()) : alpha * _math.degrees;
83
+ };
84
+ projection.reflectX = function (_) {
85
+ return arguments.length ? (sx = _ ? -1 : 1, reset()) : sx < 0;
86
+ };
87
+ projection.reflectY = function (_) {
88
+ return arguments.length ? (sy = _ ? -1 : 1, reset()) : sy < 0;
89
+ };
90
+ projection.fitExtent = function (extent, object) {
91
+ return (0, _fit.fitExtent)(projection, extent, object);
92
+ };
93
+ projection.fitSize = function (size, object) {
94
+ return (0, _fit.fitSize)(projection, size, object);
95
+ };
96
+ projection.fitWidth = function (width, object) {
97
+ return (0, _fit.fitWidth)(projection, width, object);
98
+ };
99
+ projection.fitHeight = function (height, object) {
100
+ return (0, _fit.fitHeight)(projection, height, object);
101
+ };
102
+ return projection;
103
+ }
@@ -0,0 +1,181 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = projection;
8
+ exports.projectionMutator = projectionMutator;
9
+ var _antimeridian = _interopRequireDefault(require("../clip/antimeridian.js"));
10
+ var _circle = _interopRequireDefault(require("../clip/circle.js"));
11
+ var _rectangle = _interopRequireDefault(require("../clip/rectangle.js"));
12
+ var _compose = _interopRequireDefault(require("../compose.js"));
13
+ var _identity = _interopRequireDefault(require("../identity.js"));
14
+ var _math = require("../math.js");
15
+ var _rotation = require("../rotation.js");
16
+ var _transform = require("../transform.js");
17
+ var _fit = require("./fit.js");
18
+ var _resample = _interopRequireDefault(require("./resample.js"));
19
+ var transformRadians = (0, _transform.transformer)({
20
+ point: function (x, y) {
21
+ this.stream.point(x * _math.radians, y * _math.radians);
22
+ }
23
+ });
24
+ function transformRotate(rotate) {
25
+ return (0, _transform.transformer)({
26
+ point: function (x, y) {
27
+ var r = rotate(x, y);
28
+ return this.stream.point(r[0], r[1]);
29
+ }
30
+ });
31
+ }
32
+ function scaleTranslate(k, dx, dy, sx, sy) {
33
+ function transform(x, y) {
34
+ x *= sx;
35
+ y *= sy;
36
+ return [dx + k * x, dy - k * y];
37
+ }
38
+ transform.invert = function (x, y) {
39
+ return [(x - dx) / k * sx, (dy - y) / k * sy];
40
+ };
41
+ return transform;
42
+ }
43
+ function scaleTranslateRotate(k, dx, dy, sx, sy, alpha) {
44
+ if (!alpha) return scaleTranslate(k, dx, dy, sx, sy);
45
+ var cosAlpha = (0, _math.cos)(alpha),
46
+ sinAlpha = (0, _math.sin)(alpha),
47
+ a = cosAlpha * k,
48
+ b = sinAlpha * k,
49
+ ai = cosAlpha / k,
50
+ bi = sinAlpha / k,
51
+ ci = (sinAlpha * dy - cosAlpha * dx) / k,
52
+ fi = (sinAlpha * dx + cosAlpha * dy) / k;
53
+ function transform(x, y) {
54
+ x *= sx;
55
+ y *= sy;
56
+ return [a * x - b * y + dx, dy - b * x - a * y];
57
+ }
58
+ transform.invert = function (x, y) {
59
+ return [sx * (ai * x - bi * y + ci), sy * (fi - bi * x - ai * y)];
60
+ };
61
+ return transform;
62
+ }
63
+ function projection(project) {
64
+ return projectionMutator(function () {
65
+ return project;
66
+ })();
67
+ }
68
+ function projectionMutator(projectAt) {
69
+ var project,
70
+ k = 150,
71
+ // scale
72
+ x = 480,
73
+ y = 250,
74
+ // translate
75
+ lambda = 0,
76
+ phi = 0,
77
+ // center
78
+ deltaLambda = 0,
79
+ deltaPhi = 0,
80
+ deltaGamma = 0,
81
+ rotate,
82
+ // pre-rotate
83
+ alpha = 0,
84
+ // post-rotate angle
85
+ sx = 1,
86
+ // reflectX
87
+ sy = 1,
88
+ // reflectX
89
+ theta = null,
90
+ preclip = _antimeridian.default,
91
+ // pre-clip angle
92
+ x0 = null,
93
+ y0,
94
+ x1,
95
+ y1,
96
+ postclip = _identity.default,
97
+ // post-clip extent
98
+ delta2 = 0.5,
99
+ // precision
100
+ projectResample,
101
+ projectTransform,
102
+ projectRotateTransform,
103
+ cache,
104
+ cacheStream;
105
+ function projection(point) {
106
+ return projectRotateTransform(point[0] * _math.radians, point[1] * _math.radians);
107
+ }
108
+ function invert(point) {
109
+ point = projectRotateTransform.invert(point[0], point[1]);
110
+ return point && [point[0] * _math.degrees, point[1] * _math.degrees];
111
+ }
112
+ projection.stream = function (stream) {
113
+ return cache && cacheStream === stream ? cache : cache = transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream = stream)))));
114
+ };
115
+ projection.preclip = function (_) {
116
+ return arguments.length ? (preclip = _, theta = undefined, reset()) : preclip;
117
+ };
118
+ projection.postclip = function (_) {
119
+ return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip;
120
+ };
121
+ projection.clipAngle = function (_) {
122
+ return arguments.length ? (preclip = +_ ? (0, _circle.default)(theta = _ * _math.radians) : (theta = null, _antimeridian.default), reset()) : theta * _math.degrees;
123
+ };
124
+ projection.clipExtent = function (_) {
125
+ return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, _identity.default) : (0, _rectangle.default)(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];
126
+ };
127
+ projection.scale = function (_) {
128
+ return arguments.length ? (k = +_, recenter()) : k;
129
+ };
130
+ projection.translate = function (_) {
131
+ return arguments.length ? (x = +_[0], y = +_[1], recenter()) : [x, y];
132
+ };
133
+ projection.center = function (_) {
134
+ return arguments.length ? (lambda = _[0] % 360 * _math.radians, phi = _[1] % 360 * _math.radians, recenter()) : [lambda * _math.degrees, phi * _math.degrees];
135
+ };
136
+ projection.rotate = function (_) {
137
+ return arguments.length ? (deltaLambda = _[0] % 360 * _math.radians, deltaPhi = _[1] % 360 * _math.radians, deltaGamma = _.length > 2 ? _[2] % 360 * _math.radians : 0, recenter()) : [deltaLambda * _math.degrees, deltaPhi * _math.degrees, deltaGamma * _math.degrees];
138
+ };
139
+ projection.angle = function (_) {
140
+ return arguments.length ? (alpha = _ % 360 * _math.radians, recenter()) : alpha * _math.degrees;
141
+ };
142
+ projection.reflectX = function (_) {
143
+ return arguments.length ? (sx = _ ? -1 : 1, recenter()) : sx < 0;
144
+ };
145
+ projection.reflectY = function (_) {
146
+ return arguments.length ? (sy = _ ? -1 : 1, recenter()) : sy < 0;
147
+ };
148
+ projection.precision = function (_) {
149
+ return arguments.length ? (projectResample = (0, _resample.default)(projectTransform, delta2 = _ * _), reset()) : (0, _math.sqrt)(delta2);
150
+ };
151
+ projection.fitExtent = function (extent, object) {
152
+ return (0, _fit.fitExtent)(projection, extent, object);
153
+ };
154
+ projection.fitSize = function (size, object) {
155
+ return (0, _fit.fitSize)(projection, size, object);
156
+ };
157
+ projection.fitWidth = function (width, object) {
158
+ return (0, _fit.fitWidth)(projection, width, object);
159
+ };
160
+ projection.fitHeight = function (height, object) {
161
+ return (0, _fit.fitHeight)(projection, height, object);
162
+ };
163
+ function recenter() {
164
+ var center = scaleTranslateRotate(k, 0, 0, sx, sy, alpha).apply(null, project(lambda, phi)),
165
+ transform = scaleTranslateRotate(k, x - center[0], y - center[1], sx, sy, alpha);
166
+ rotate = (0, _rotation.rotateRadians)(deltaLambda, deltaPhi, deltaGamma);
167
+ projectTransform = (0, _compose.default)(project, transform);
168
+ projectRotateTransform = (0, _compose.default)(rotate, projectTransform);
169
+ projectResample = (0, _resample.default)(projectTransform, delta2);
170
+ return reset();
171
+ }
172
+ function reset() {
173
+ cache = cacheStream = null;
174
+ return projection;
175
+ }
176
+ return function () {
177
+ project = projectAt.apply(this, arguments);
178
+ projection.invert = project.invert && invert;
179
+ return recenter();
180
+ };
181
+ }
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = _default;
8
+ exports.mercatorProjection = mercatorProjection;
9
+ exports.mercatorRaw = mercatorRaw;
10
+ var _math = require("../math.js");
11
+ var _rotation = _interopRequireDefault(require("../rotation.js"));
12
+ var _index = _interopRequireDefault(require("./index.js"));
13
+ function mercatorRaw(lambda, phi) {
14
+ return [lambda, (0, _math.log)((0, _math.tan)((_math.halfPi + phi) / 2))];
15
+ }
16
+ mercatorRaw.invert = function (x, y) {
17
+ return [x, 2 * (0, _math.atan)((0, _math.exp)(y)) - _math.halfPi];
18
+ };
19
+ function _default() {
20
+ return mercatorProjection(mercatorRaw).scale(961 / _math.tau);
21
+ }
22
+ function mercatorProjection(project) {
23
+ var m = (0, _index.default)(project),
24
+ center = m.center,
25
+ scale = m.scale,
26
+ translate = m.translate,
27
+ clipExtent = m.clipExtent,
28
+ x0 = null,
29
+ y0,
30
+ x1,
31
+ y1; // clip extent
32
+
33
+ m.scale = function (_) {
34
+ return arguments.length ? (scale(_), reclip()) : scale();
35
+ };
36
+ m.translate = function (_) {
37
+ return arguments.length ? (translate(_), reclip()) : translate();
38
+ };
39
+ m.center = function (_) {
40
+ return arguments.length ? (center(_), reclip()) : center();
41
+ };
42
+ m.clipExtent = function (_) {
43
+ return arguments.length ? (_ == null ? x0 = y0 = x1 = y1 = null : (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reclip()) : x0 == null ? null : [[x0, y0], [x1, y1]];
44
+ };
45
+ function reclip() {
46
+ var k = _math.pi * scale(),
47
+ t = m((0, _rotation.default)(m.rotate()).invert([0, 0]));
48
+ return clipExtent(x0 == null ? [[t[0] - k, t[1] - k], [t[0] + k, t[1] + k]] : project === mercatorRaw ? [[Math.max(t[0] - k, x0), y0], [Math.min(t[0] + k, x1), y1]] : [[x0, Math.max(t[1] - k, y0)], [x1, Math.min(t[1] + k, y1)]]);
49
+ }
50
+ return reclip();
51
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = _default;
8
+ exports.naturalEarth1Raw = naturalEarth1Raw;
9
+ var _index = _interopRequireDefault(require("./index.js"));
10
+ var _math = require("../math.js");
11
+ function naturalEarth1Raw(lambda, phi) {
12
+ var phi2 = phi * phi,
13
+ phi4 = phi2 * phi2;
14
+ return [lambda * (0.8707 - 0.131979 * phi2 + phi4 * (-0.013791 + phi4 * (0.003971 * phi2 - 0.001529 * phi4))), phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4)))];
15
+ }
16
+ naturalEarth1Raw.invert = function (x, y) {
17
+ var phi = y,
18
+ i = 25,
19
+ delta;
20
+ do {
21
+ var phi2 = phi * phi,
22
+ phi4 = phi2 * phi2;
23
+ phi -= delta = (phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4))) - y) / (1.007226 + phi2 * (0.015085 * 3 + phi4 * (-0.044475 * 7 + 0.028874 * 9 * phi2 - 0.005916 * 11 * phi4)));
24
+ } while ((0, _math.abs)(delta) > _math.epsilon && --i > 0);
25
+ return [x / (0.8707 + (phi2 = phi * phi) * (-0.131979 + phi2 * (-0.013791 + phi2 * phi2 * phi2 * (0.003971 - 0.001529 * phi2)))), phi];
26
+ };
27
+ function _default() {
28
+ return (0, _index.default)(naturalEarth1Raw).scale(175.295);
29
+ }