mirage2d 1.1.2 → 1.1.4
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.
- package/dist/MirageHttp.es.js +5268 -0
- package/dist/MirageHttp.es.js.map +1 -0
- package/dist/MirageHttp.umd.js +2 -0
- package/dist/MirageHttp.umd.js.map +1 -0
- package/dist/assets/js/basedecoder-fa2b8e8d.js +107 -0
- package/dist/assets/js/decoder-f19e05cf.js +6 -0
- package/dist/assets/js/deflate-adb9a67b.js +8 -0
- package/dist/{js/dist/_html2canvas@1.4.1@html2canvas.e8006fee.js → assets/js/html2canvas.esm-3dd231c5.js} +0 -0
- package/dist/assets/js/index-3263db85.js +1 -0
- package/dist/assets/js/index-a9db46a5.js +212968 -0
- package/dist/{js/lib/_canvg@3.0.10@canvg.bd557ac8.js → assets/js/index.es-38f73a27.js} +2179 -351
- package/dist/assets/js/jpeg-3bf23728.js +835 -0
- package/dist/{js/_lerc@3.0.0@lerc/_lerc@3.0.0@lerc.dc2ff398.js → assets/js/lerc-4c39f39b.js} +26 -1
- package/dist/assets/js/lzw-d0cad8af.js +123 -0
- package/dist/assets/js/packbits-d75b4cce.js +25 -0
- package/dist/{js/_pako@2.0.4@pako/_pako@2.0.4@pako.52d6b320.js → assets/js/pako.esm-49deb4d7.js} +0 -0
- package/dist/{js/dist/_dompurify@2.4.0@dompurify.e7ba523e.js → assets/js/purify.es-1915dfae.js} +0 -0
- package/dist/assets/js/raw-9656f9cc.js +7 -0
- package/dist/assets/js/webimage-edb7156c.js +27 -0
- package/package.json +1 -1
- package/dist/js/_@babel_runtime@7.18.9@@babel/_@babel_runtime@7.18.9@@babel.e0126ca2.js +0 -51
- package/dist/js/_@petamoriken_float16@3.6.6@@petamoriken/_@petamoriken_float16@3.6.6@@petamoriken.c5188241.js +0 -217
- package/dist/js/_@turf_along@6.5.0@@turf/_@turf_along@6.5.0@@turf.18dbc1a3.js +0 -31
- package/dist/js/_@turf_angle@6.5.0@@turf/_@turf_angle@6.5.0@@turf.554ac9bf.js +0 -1
- package/dist/js/_@turf_area@6.5.0@@turf/_@turf_area@6.5.0@@turf.6cbf0cc1.js +0 -74
- package/dist/js/_@turf_bbox-clip@6.5.0@@turf/_@turf_bbox-clip@6.5.0@@turf.e491cb90.js +0 -1
- package/dist/js/_@turf_bbox-polygon@6.5.0@@turf/_@turf_bbox-polygon@6.5.0@@turf.523f1c20.js +0 -19
- package/dist/js/_@turf_bbox@6.5.0@@turf/_@turf_bbox@6.5.0@@turf.4c59feee.js +0 -48
- package/dist/js/_@turf_bearing@6.5.0@@turf/_@turf_bearing@6.5.0@@turf.f2555a09.js +0 -25
- package/dist/js/_@turf_bezier-spline@6.5.0@@turf/_@turf_bezier-spline@6.5.0@@turf.fa7991dd.js +0 -137
- package/dist/js/_@turf_boolean-clockwise@6.5.0@@turf/_@turf_boolean-clockwise@6.5.0@@turf.4031f280.js +0 -1
- package/dist/js/_@turf_boolean-contains@6.5.0@@turf/_@turf_boolean-contains@6.5.0@@turf.836d55d8.js +0 -191
- package/dist/js/_@turf_boolean-crosses@6.5.0@@turf/_@turf_boolean-crosses@6.5.0@@turf.c5f65a28.js +0 -125
- package/dist/js/_@turf_boolean-disjoint@6.5.0@@turf/_@turf_boolean-disjoint@6.5.0@@turf.bbd60872.js +0 -122
- package/dist/js/_@turf_boolean-equal@6.5.0@@turf/_@turf_boolean-equal@6.5.0@@turf.341ffa01.js +0 -1
- package/dist/js/_@turf_boolean-intersects@6.5.0@@turf/_@turf_boolean-intersects@6.5.0@@turf.05fc28b3.js +0 -15
- package/dist/js/_@turf_boolean-overlap@6.5.0@@turf/_@turf_boolean-overlap@6.5.0@@turf.a519db25.js +0 -53
- package/dist/js/_@turf_boolean-parallel@6.5.0@@turf/_@turf_boolean-parallel@6.5.0@@turf.dbf2bc2d.js +0 -1
- package/dist/js/_@turf_boolean-point-in-polygon@6.5.0@@turf/_@turf_boolean-point-in-polygon@6.5.0@@turf.62a2d48a.js +0 -65
- package/dist/js/_@turf_boolean-point-on-line@6.5.0@@turf/_@turf_boolean-point-on-line@6.5.0@@turf.3cf3aaa1.js +0 -69
- package/dist/js/_@turf_boolean-within@6.5.0@@turf/_@turf_boolean-within@6.5.0@@turf.d70d6bfc.js +0 -172
- package/dist/js/_@turf_buffer@6.5.0@@turf/_@turf_buffer@6.5.0@@turf.88330dfe.js +0 -99
- package/dist/js/_@turf_center-mean@6.5.0@@turf/_@turf_center-mean@6.5.0@@turf.b3d7c917.js +0 -1
- package/dist/js/_@turf_center-median@6.5.0@@turf/_@turf_center-median@6.5.0@@turf.44c4669e.js +0 -1
- package/dist/js/_@turf_center-of-mass@6.5.0@@turf/_@turf_center-of-mass@6.5.0@@turf.63ce279e.js +0 -1
- package/dist/js/_@turf_center@6.5.0@@turf/_@turf_center@6.5.0@@turf.a45495b5.js +0 -12
- package/dist/js/_@turf_centroid@6.5.0@@turf/_@turf_centroid@6.5.0@@turf.0a5be869.js +0 -17
- package/dist/js/_@turf_circle@6.5.0@@turf/_@turf_circle@6.5.0@@turf.0166b8c2.js +0 -16
- package/dist/js/_@turf_clean-coords@6.5.0@@turf/_@turf_clean-coords@6.5.0@@turf.8c76bd63.js +0 -111
- package/dist/js/_@turf_clone@6.5.0@@turf/_@turf_clone@6.5.0@@turf.cd05b1f8.js +0 -100
- package/dist/js/_@turf_clusters-dbscan@6.5.0@@turf/_@turf_clusters-dbscan@6.5.0@@turf.6bbee7e9.js +0 -1
- package/dist/js/_@turf_clusters-kmeans@6.5.0@@turf/_@turf_clusters-kmeans@6.5.0@@turf.505415df.js +0 -1
- package/dist/js/_@turf_clusters@6.5.0@@turf/_@turf_clusters@6.5.0@@turf.84cb9680.js +0 -1
- package/dist/js/_@turf_collect@6.5.0@@turf/_@turf_collect@6.5.0@@turf.93e41b5f.js +0 -1
- package/dist/js/_@turf_combine@6.5.0@@turf/_@turf_combine@6.5.0@@turf.33ee6336.js +0 -1
- package/dist/js/_@turf_concave@6.5.0@@turf/_@turf_concave@6.5.0@@turf.6fb6a8be.js +0 -179
- package/dist/js/_@turf_convex@6.5.0@@turf/_@turf_convex@6.5.0@@turf.24600ac2.js +0 -1
- package/dist/js/_@turf_destination@6.5.0@@turf/_@turf_destination@6.5.0@@turf.2621651e.js +0 -18
- package/dist/js/_@turf_difference@6.5.0@@turf/_@turf_difference@6.5.0@@turf.70df5e79.js +0 -18
- package/dist/js/_@turf_dissolve@6.5.0@@turf/_@turf_dissolve@6.5.0@@turf.edb28fc1.js +0 -1
- package/dist/js/_@turf_distance-weight@6.5.0@@turf/_@turf_distance-weight@6.5.0@@turf.e168af7f.js +0 -1
- package/dist/js/_@turf_distance@6.5.0@@turf/_@turf_distance@6.5.0@@turf.0c7b8aea.js +0 -22
- package/dist/js/_@turf_ellipse@6.5.0@@turf/_@turf_ellipse@6.5.0@@turf.37986056.js +0 -1
- package/dist/js/_@turf_envelope@6.5.0@@turf/_@turf_envelope@6.5.0@@turf.599c5772.js +0 -1
- package/dist/js/_@turf_explode@6.5.0@@turf/_@turf_explode@6.5.0@@turf.5c768db5.js +0 -24
- package/dist/js/_@turf_flatten@6.5.0@@turf/_@turf_flatten@6.5.0@@turf.57e9114c.js +0 -1
- package/dist/js/_@turf_flip@6.5.0@@turf/_@turf_flip@6.5.0@@turf.1f02101f.js +0 -1
- package/dist/js/_@turf_great-circle@6.5.0@@turf/_@turf_great-circle@6.5.0@@turf.2ca021a8.js +0 -1
- package/dist/js/_@turf_helpers@6.5.0@@turf/_@turf_helpers@6.5.0@@turf.f1480aa1.js +0 -364
- package/dist/js/_@turf_hex-grid@6.5.0@@turf/_@turf_hex-grid@6.5.0@@turf.a6a45778.js +0 -99
- package/dist/js/_@turf_interpolate@6.5.0@@turf/_@turf_interpolate@6.5.0@@turf.4d39bd8c.js +0 -1
- package/dist/js/_@turf_intersect@6.5.0@@turf/_@turf_intersect@6.5.0@@turf.34082cdf.js +0 -17
- package/dist/js/_@turf_invariant@6.5.0@@turf/_@turf_invariant@6.5.0@@turf.0ef69f8c.js +0 -71
- package/dist/js/_@turf_isobands@6.5.0@@turf/_@turf_isobands@6.5.0@@turf.def019df.js +0 -3109
- package/dist/js/_@turf_isolines@6.5.0@@turf/_@turf_isolines@6.5.0@@turf.da623b25.js +0 -1
- package/dist/js/_@turf_kinks@6.5.0@@turf/_@turf_kinks@6.5.0@@turf.ee61685b.js +0 -87
- package/dist/js/_@turf_length@6.5.0@@turf/_@turf_length@6.5.0@@turf.f73f6c98.js +0 -12
- package/dist/js/_@turf_line-arc@6.5.0@@turf/_@turf_line-arc@6.5.0@@turf.3dc57055.js +0 -37
- package/dist/js/_@turf_line-chunk@6.5.0@@turf/_@turf_line-chunk@6.5.0@@turf.1867af48.js +0 -43
- package/dist/js/_@turf_line-intersect@6.5.0@@turf/_@turf_line-intersect@6.5.0@@turf.c4d81948.js +0 -73
- package/dist/js/_@turf_line-offset@6.5.0@@turf/_@turf_line-offset@6.5.0@@turf.e6846793.js +0 -116
- package/dist/js/_@turf_line-overlap@6.5.0@@turf/_@turf_line-overlap@6.5.0@@turf.addba9a5.js +0 -76
- package/dist/js/_@turf_line-segment@6.5.0@@turf/_@turf_line-segment@6.5.0@@turf.18ce3010.js +0 -55
- package/dist/js/_@turf_line-slice-along@6.5.0@@turf/_@turf_line-slice-along@6.5.0@@turf.2b802464.js +0 -57
- package/dist/js/_@turf_line-slice@6.5.0@@turf/_@turf_line-slice@6.5.0@@turf.6423a053.js +0 -23
- package/dist/js/_@turf_line-split@6.5.0@@turf/_@turf_line-split@6.5.0@@turf.2022f104.js +0 -125
- package/dist/js/_@turf_line-to-polygon@6.5.0@@turf/_@turf_line-to-polygon@6.5.0@@turf.83f5e69f.js +0 -1
- package/dist/js/_@turf_mask@6.5.0@@turf/_@turf_mask@6.5.0@@turf.96cd5a94.js +0 -1
- package/dist/js/_@turf_meta@6.5.0@@turf/_@turf_meta@6.5.0@@turf.1b9d5da5.js +0 -611
- package/dist/js/_@turf_midpoint@6.5.0@@turf/_@turf_midpoint@6.5.0@@turf.67c14f94.js +0 -1
- package/dist/js/_@turf_moran-index@6.5.0@@turf/_@turf_moran-index@6.5.0@@turf.2ad5365a.js +0 -1
- package/dist/js/_@turf_nearest-point-on-line@6.5.0@@turf/_@turf_nearest-point-on-line@6.5.0@@turf.095c8c0d.js +0 -57
- package/dist/js/_@turf_nearest-point-to-line@6.5.0@@turf/_@turf_nearest-point-to-line@6.5.0@@turf.68484097.js +0 -1
- package/dist/js/_@turf_nearest-point@6.5.0@@turf/_@turf_nearest-point@6.5.0@@turf.e0d2f509.js +0 -24
- package/dist/js/_@turf_planepoint@6.5.0@@turf/_@turf_planepoint@6.5.0@@turf.56fc70b3.js +0 -1
- package/dist/js/_@turf_point-grid@6.5.0@@turf/_@turf_point-grid@6.5.0@@turf.2d278644.js +0 -42
- package/dist/js/_@turf_point-on-feature@6.5.0@@turf/_@turf_point-on-feature@6.5.0@@turf.0c740874.js +0 -1
- package/dist/js/_@turf_point-to-line-distance@6.5.0@@turf/_@turf_point-to-line-distance@6.5.0@@turf.33105d82.js +0 -1
- package/dist/js/_@turf_points-within-polygon@6.5.0@@turf/_@turf_points-within-polygon@6.5.0@@turf.659cd335.js +0 -35
- package/dist/js/_@turf_polygon-smooth@6.5.0@@turf/_@turf_polygon-smooth@6.5.0@@turf.43a7c33e.js +0 -1
- package/dist/js/_@turf_polygon-tangents@6.5.0@@turf/_@turf_polygon-tangents@6.5.0@@turf.a2c3a7b6.js +0 -1
- package/dist/js/_@turf_polygon-to-line@6.5.0@@turf/_@turf_polygon-to-line@6.5.0@@turf.3177cfb1.js +0 -48
- package/dist/js/_@turf_polygonize@6.5.0@@turf/_@turf_polygonize@6.5.0@@turf.f7cc4910.js +0 -1
- package/dist/js/_@turf_projection@6.5.0@@turf/_@turf_projection@6.5.0@@turf.ffdd3321.js +0 -1
- package/dist/js/_@turf_random@6.5.0@@turf/_@turf_random@6.5.0@@turf.f65251e4.js +0 -130
- package/dist/js/_@turf_rectangle-grid@6.5.0@@turf/_@turf_rectangle-grid@6.5.0@@turf.7e8b1a1f.js +0 -49
- package/dist/js/_@turf_rewind@6.5.0@@turf/_@turf_rewind@6.5.0@@turf.5d137ee9.js +0 -1
- package/dist/js/_@turf_rhumb-bearing@6.5.0@@turf/_@turf_rhumb-bearing@6.5.0@@turf.fb8f6ade.js +0 -30
- package/dist/js/_@turf_rhumb-destination@6.5.0@@turf/_@turf_rhumb-destination@6.5.0@@turf.dc0e4753.js +0 -36
- package/dist/js/_@turf_rhumb-distance@6.5.0@@turf/_@turf_rhumb-distance@6.5.0@@turf.94e475b8.js +0 -30
- package/dist/js/_@turf_sample@6.5.0@@turf/_@turf_sample@6.5.0@@turf.7181d7a7.js +0 -1
- package/dist/js/_@turf_sector@6.5.0@@turf/_@turf_sector@6.5.0@@turf.04ffddfe.js +0 -39
- package/dist/js/_@turf_shortest-path@6.5.0@@turf/_@turf_shortest-path@6.5.0@@turf.0c1b62a8.js +0 -367
- package/dist/js/_@turf_simplify@6.5.0@@turf/_@turf_simplify@6.5.0@@turf.46703d2e.js +0 -1
- package/dist/js/_@turf_square-grid@6.5.0@@turf/_@turf_square-grid@6.5.0@@turf.38bd2eaa.js +0 -8
- package/dist/js/_@turf_square@6.5.0@@turf/_@turf_square@6.5.0@@turf.2705289a.js +0 -27
- package/dist/js/_@turf_standard-deviational-ellipse@6.5.0@@turf/_@turf_standard-deviational-ellipse@6.5.0@@turf.7094e432.js +0 -1
- package/dist/js/_@turf_tag@6.5.0@@turf/_@turf_tag@6.5.0@@turf.cb60b0c1.js +0 -1
- package/dist/js/_@turf_tesselate@6.5.0@@turf/_@turf_tesselate@6.5.0@@turf.330e4aae.js +0 -1
- package/dist/js/_@turf_tin@6.5.0@@turf/_@turf_tin@6.5.0@@turf.077204c4.js +0 -173
- package/dist/js/_@turf_transform-rotate@6.5.0@@turf/_@turf_transform-rotate@6.5.0@@turf.6d350d36.js +0 -1
- package/dist/js/_@turf_transform-scale@6.5.0@@turf/_@turf_transform-scale@6.5.0@@turf.d6f65671.js +0 -90
- package/dist/js/_@turf_transform-translate@6.5.0@@turf/_@turf_transform-translate@6.5.0@@turf.9296b81a.js +0 -1
- package/dist/js/_@turf_triangle-grid@6.5.0@@turf/_@turf_triangle-grid@6.5.0@@turf.939f94ab.js +0 -107
- package/dist/js/_@turf_truncate@6.5.0@@turf/_@turf_truncate@6.5.0@@turf.ed70ebcb.js +0 -33
- package/dist/js/_@turf_turf@6.4.0@@turf/_@turf_turf@6.4.0@@turf.34fde8ec.js +0 -1
- package/dist/js/_@turf_union@6.5.0@@turf/_@turf_union@6.5.0@@turf.386ee2eb.js +0 -1
- package/dist/js/_@turf_unkink-polygon@6.5.0@@turf/_@turf_unkink-polygon@6.5.0@@turf.cb446e47.js +0 -1
- package/dist/js/_@turf_voronoi@6.5.0@@turf/_@turf_voronoi@6.5.0@@turf.c30d929e.js +0 -30
- package/dist/js/_call-bind@1.0.2@call-bind/_call-bind@1.0.2@call-bind.3811d387.js +0 -53
- package/dist/js/_concaveman@1.2.1@concaveman/_concaveman@1.2.1@concaveman.e747f731.js +0 -1
- package/dist/js/_core-js@3.25.0@core-js/_core-js@3.25.0@core-js.003355ed.js +0 -5029
- package/dist/js/_crypto-js@4.1.1@crypto-js/_crypto-js@4.1.1@crypto-js.e2f7f158.js +0 -1823
- package/dist/js/_d3-array@1.2.4@d3-array/_d3-array@1.2.4@d3-array.d606df6b.js +0 -58
- package/dist/js/_d3-geo@1.7.1@d3-geo/_d3-geo@1.7.1@d3-geo.7d357be1.js +0 -1094
- package/dist/js/_d3-voronoi@1.1.2@d3-voronoi/_d3-voronoi@1.1.2@d3-voronoi.072f12a6.js +0 -816
- package/dist/js/_deep-equal@1.1.1@deep-equal/_deep-equal@1.1.1@deep-equal.98576c17.js +0 -108
- package/dist/js/_define-properties@1.1.4@define-properties/_define-properties@1.1.4@define-properties.647c3367.js +0 -40
- package/dist/js/_density-clustering@1.3.0@density-clustering/_density-clustering@1.3.0@density-clustering.a07fc6ae.js +0 -1
- package/dist/js/_earcut@2.2.4@earcut/_earcut@2.2.4@earcut.972ebfd3.js +0 -1
- package/dist/js/_echarts-gl@1.1.2@echarts-gl/_echarts-gl@1.1.2@echarts-gl.1e3964b9.js +0 -36533
- package/dist/js/_echarts@4.9.0@echarts/_echarts@4.9.0@echarts.7d74ba77.js +0 -44219
- package/dist/js/_fflate@0.4.8@fflate/_fflate@0.4.8@fflate.d8111196.js +0 -571
- package/dist/js/_function-bind@1.1.1@function-bind/_function-bind@1.1.1@function-bind.de3cf11d.js +0 -46
- package/dist/js/_functions-have-names@1.2.3@functions-have-names/_functions-have-names@1.2.3@functions-have-names.7def2408.js +0 -27
- package/dist/js/_geojson-equality@0.1.6@geojson-equality/_geojson-equality@0.1.6@geojson-equality.09ffa121.js +0 -133
- package/dist/js/_geojson-path-finder@1.5.3@geojson-path-finder/_geojson-path-finder@1.5.3@geojson-path-finder.7a10eb99.js +0 -348
- package/dist/js/_geojson-rbush@3.2.0@geojson-rbush/_geojson-rbush@3.2.0@geojson-rbush.2adaeedb.js +0 -93
- package/dist/js/_geotiff@2.0.4@geotiff/_geotiff@2.0.4@geotiff.5b08f79e.js +0 -3663
- package/dist/js/_get-intrinsic@1.1.2@get-intrinsic/_get-intrinsic@1.1.2@get-intrinsic.a633bd68.js +0 -291
- package/dist/js/_has-property-descriptors@1.0.0@has-property-descriptors/_has-property-descriptors@1.0.0@has-property-descriptors.6bd2d302.js +0 -26
- package/dist/js/_has-symbols@1.0.3@has-symbols/_has-symbols@1.0.3@has-symbols.70406077.js +0 -63
- package/dist/js/_has-tostringtag@1.0.0@has-tostringtag/_has-tostringtag@1.0.0@has-tostringtag.2d502422.js +0 -6
- package/dist/js/_has@1.0.3@has/_has@1.0.3@has.ddd2eb68.js +0 -4
- package/dist/js/_ieee754@1.2.1@ieee754/_ieee754@1.2.1@ieee754.56426503.js +0 -80
- package/dist/js/_is-arguments@1.1.1@is-arguments/_is-arguments@1.1.1@is-arguments.7d77e24a.js +0 -23
- package/dist/js/_is-date-object@1.0.5@is-date-object/_is-date-object@1.0.5@is-date-object.08cc2543.js +0 -20
- package/dist/js/_is-regex@1.1.4@is-regex/_is-regex@1.1.4@is-regex.6417e007.js +0 -47
- package/dist/js/_jspdf@2.5.1@jspdf/_jspdf@2.5.1@jspdf.e927dbd8.js +0 -8494
- package/dist/js/_kml-geojson@1.2.0@kml-geojson/_kml-geojson@1.2.0@kml-geojson.f1ae86e4.js +0 -7858
- package/dist/js/_lru-cache@6.0.0@lru-cache/_lru-cache@6.0.0@lru-cache.dd72cc1b.js +0 -263
- package/dist/js/_mgrs@1.0.0@mgrs/_mgrs@1.0.0@mgrs.12d1da3e.js +0 -432
- package/dist/js/_object-assign@4.1.1@object-assign/_object-assign@4.1.1@object-assign.e4009c1c.js +0 -69
- package/dist/js/_object-is@1.1.5@object-is/_object-is@1.1.5@object-is.e47f5d65.js +0 -45
- package/dist/js/_object-keys@1.1.1@object-keys/_object-keys@1.1.1@object-keys.4b1d0a99.js +0 -151
- package/dist/js/_ol-echarts@2.0.6@ol-echarts/_ol-echarts@2.0.6@ol-echarts.658aaf82.js +0 -841
- package/dist/js/_ol-ext@3.2.30@ol-ext/_ol-ext@3.2.30@ol-ext.b94220dd.js +0 -4614
- package/dist/js/_ol-mapbox-style@8.2.1@ol-mapbox-style/_ol-mapbox-style@8.2.1@ol-mapbox-style.795310f3.js +0 -1
- package/dist/js/_ol@6.15.1@ol/_ol@6.15.1@ol.8fd0cbb5.js +0 -31823
- package/dist/js/_pbf@3.2.1@pbf/_pbf@3.2.1@pbf.330acf55.js +0 -647
- package/dist/js/_performance-now@2.1.0@performance-now/_performance-now@2.1.0@performance-now.a51379c2.js +0 -34
- package/dist/js/_point-in-polygon@1.1.0@point-in-polygon/_point-in-polygon@1.1.0@point-in-polygon.2cc4306e.js +0 -1
- package/dist/js/_polygon-clipping@0.15.3@polygon-clipping/_polygon-clipping@0.15.3@polygon-clipping.c0e9ec57.js +0 -1363
- package/dist/js/_proj4@2.8.0@proj4/_proj4@2.8.0@proj4.1600352c.js +0 -4885
- package/dist/js/_quickselect@1.1.1@quickselect/_quickselect@1.1.1@quickselect.8afce154.js +0 -1
- package/dist/js/_quickselect@2.0.0@quickselect/_quickselect@2.0.0@quickselect.9f5c1e48.js +0 -51
- package/dist/js/_raf@3.4.1@raf/_raf@3.4.1@raf.ac0d6c66.js +0 -60
- package/dist/js/_rbush@2.0.2@rbush/_rbush@2.0.2@rbush.7149e620.js +0 -1
- package/dist/js/_rbush@3.0.1@rbush/_rbush@3.0.1@rbush.57d33d95.js +0 -402
- package/dist/js/_regexp.prototype.flags@1.4.3@regexp.prototype.flags/_regexp.prototype.flags@1.4.3@regexp.prototype.flags.8b6921c6.js +0 -102
- package/dist/js/_rgbcolor@1.0.1@rgbcolor/_rgbcolor@1.0.1@rgbcolor.dd87e013.js +0 -272
- package/dist/js/_robust-predicates@2.0.4@robust-predicates/_robust-predicates@2.0.4@robust-predicates.564bf2f8.js +0 -1
- package/dist/js/_skmeans@0.9.7@skmeans/_skmeans@0.9.7@skmeans.933c6a76.js +0 -1
- package/dist/js/_splaytree@3.1.1@splaytree/_splaytree@3.1.1@splaytree.6cb55ed3.js +0 -671
- package/dist/js/_stackblur-canvas@2.5.0@stackblur-canvas/_stackblur-canvas@2.5.0@stackblur-canvas.dd883d14.js +0 -214
- package/dist/js/_svg-pathdata@6.0.3@svg-pathdata/_svg-pathdata@6.0.3@svg-pathdata.7e858a5f.js +0 -441
- package/dist/js/_tinyqueue@2.0.3@tinyqueue/_tinyqueue@2.0.3@tinyqueue.78918532.js +0 -73
- package/dist/js/_topojson-client@3.1.0@topojson-client/_topojson-client@3.1.0@topojson-client.aef4e2d5.js +0 -238
- package/dist/js/_topojson-server@3.0.1@topojson-server/_topojson-server@3.0.1@topojson-server.b521a412.js +0 -662
- package/dist/js/_turf-jsts@1.2.3@turf-jsts/_turf-jsts@1.2.3@turf-jsts.6ef42696.js +0 -18934
- package/dist/js/_web-worker@1.2.0@web-worker/_web-worker@1.2.0@web-worker.43288df7.js +0 -2
- package/dist/js/_wkt-parser@1.3.2@wkt-parser/_wkt-parser@1.3.2@wkt-parser.0e1cf374.js +0 -461
- package/dist/js/_xml-utils@1.2.0@xml-utils/_xml-utils@1.2.0@xml-utils.2a8ae655.js +0 -126
- package/dist/js/_yallist@4.0.0@yallist/_yallist@4.0.0@yallist.8350aafe.js +0 -363
- package/dist/js/_zrender@4.3.2@zrender/_zrender@4.3.2@zrender.1feea14d.js +0 -12455
- package/dist/mirage2d.es.js +0 -15894
|
@@ -1,1094 +0,0 @@
|
|
|
1
|
-
import { m as merge } from "../_d3-array@1.2.4@d3-array/_d3-array@1.2.4@d3-array.d606df6b.js";
|
|
2
|
-
function adder() {
|
|
3
|
-
return new Adder();
|
|
4
|
-
}
|
|
5
|
-
function Adder() {
|
|
6
|
-
this.reset();
|
|
7
|
-
}
|
|
8
|
-
Adder.prototype = {
|
|
9
|
-
constructor: Adder,
|
|
10
|
-
reset: function() {
|
|
11
|
-
this.s = this.t = 0;
|
|
12
|
-
},
|
|
13
|
-
add: function(y) {
|
|
14
|
-
add(temp, y, this.t);
|
|
15
|
-
add(this, temp.s, this.s);
|
|
16
|
-
if (this.s)
|
|
17
|
-
this.t += temp.t;
|
|
18
|
-
else
|
|
19
|
-
this.s = temp.t;
|
|
20
|
-
},
|
|
21
|
-
valueOf: function() {
|
|
22
|
-
return this.s;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
var temp = new Adder();
|
|
26
|
-
function add(adder2, a, b) {
|
|
27
|
-
var x = adder2.s = a + b, bv = x - a, av = x - bv;
|
|
28
|
-
adder2.t = a - av + (b - bv);
|
|
29
|
-
}
|
|
30
|
-
var epsilon = 1e-6;
|
|
31
|
-
var pi = Math.PI;
|
|
32
|
-
var halfPi = pi / 2;
|
|
33
|
-
var quarterPi = pi / 4;
|
|
34
|
-
var tau = pi * 2;
|
|
35
|
-
var degrees = 180 / pi;
|
|
36
|
-
var radians = pi / 180;
|
|
37
|
-
var abs = Math.abs;
|
|
38
|
-
var atan = Math.atan;
|
|
39
|
-
var atan2 = Math.atan2;
|
|
40
|
-
var cos = Math.cos;
|
|
41
|
-
var sin = Math.sin;
|
|
42
|
-
var sqrt = Math.sqrt;
|
|
43
|
-
function acos(x) {
|
|
44
|
-
return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);
|
|
45
|
-
}
|
|
46
|
-
function asin(x) {
|
|
47
|
-
return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x);
|
|
48
|
-
}
|
|
49
|
-
function noop() {
|
|
50
|
-
}
|
|
51
|
-
function streamGeometry(geometry, stream) {
|
|
52
|
-
if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {
|
|
53
|
-
streamGeometryType[geometry.type](geometry, stream);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
var streamObjectType = {
|
|
57
|
-
Feature: function(object, stream) {
|
|
58
|
-
streamGeometry(object.geometry, stream);
|
|
59
|
-
},
|
|
60
|
-
FeatureCollection: function(object, stream) {
|
|
61
|
-
var features = object.features, i = -1, n = features.length;
|
|
62
|
-
while (++i < n)
|
|
63
|
-
streamGeometry(features[i].geometry, stream);
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
var streamGeometryType = {
|
|
67
|
-
Sphere: function(object, stream) {
|
|
68
|
-
stream.sphere();
|
|
69
|
-
},
|
|
70
|
-
Point: function(object, stream) {
|
|
71
|
-
object = object.coordinates;
|
|
72
|
-
stream.point(object[0], object[1], object[2]);
|
|
73
|
-
},
|
|
74
|
-
MultiPoint: function(object, stream) {
|
|
75
|
-
var coordinates = object.coordinates, i = -1, n = coordinates.length;
|
|
76
|
-
while (++i < n)
|
|
77
|
-
object = coordinates[i], stream.point(object[0], object[1], object[2]);
|
|
78
|
-
},
|
|
79
|
-
LineString: function(object, stream) {
|
|
80
|
-
streamLine(object.coordinates, stream, 0);
|
|
81
|
-
},
|
|
82
|
-
MultiLineString: function(object, stream) {
|
|
83
|
-
var coordinates = object.coordinates, i = -1, n = coordinates.length;
|
|
84
|
-
while (++i < n)
|
|
85
|
-
streamLine(coordinates[i], stream, 0);
|
|
86
|
-
},
|
|
87
|
-
Polygon: function(object, stream) {
|
|
88
|
-
streamPolygon(object.coordinates, stream);
|
|
89
|
-
},
|
|
90
|
-
MultiPolygon: function(object, stream) {
|
|
91
|
-
var coordinates = object.coordinates, i = -1, n = coordinates.length;
|
|
92
|
-
while (++i < n)
|
|
93
|
-
streamPolygon(coordinates[i], stream);
|
|
94
|
-
},
|
|
95
|
-
GeometryCollection: function(object, stream) {
|
|
96
|
-
var geometries = object.geometries, i = -1, n = geometries.length;
|
|
97
|
-
while (++i < n)
|
|
98
|
-
streamGeometry(geometries[i], stream);
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
function streamLine(coordinates, stream, closed) {
|
|
102
|
-
var i = -1, n = coordinates.length - closed, coordinate;
|
|
103
|
-
stream.lineStart();
|
|
104
|
-
while (++i < n)
|
|
105
|
-
coordinate = coordinates[i], stream.point(coordinate[0], coordinate[1], coordinate[2]);
|
|
106
|
-
stream.lineEnd();
|
|
107
|
-
}
|
|
108
|
-
function streamPolygon(coordinates, stream) {
|
|
109
|
-
var i = -1, n = coordinates.length;
|
|
110
|
-
stream.polygonStart();
|
|
111
|
-
while (++i < n)
|
|
112
|
-
streamLine(coordinates[i], stream, 1);
|
|
113
|
-
stream.polygonEnd();
|
|
114
|
-
}
|
|
115
|
-
function geoStream(object, stream) {
|
|
116
|
-
if (object && streamObjectType.hasOwnProperty(object.type)) {
|
|
117
|
-
streamObjectType[object.type](object, stream);
|
|
118
|
-
} else {
|
|
119
|
-
streamGeometry(object, stream);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
adder();
|
|
123
|
-
adder();
|
|
124
|
-
function spherical(cartesian2) {
|
|
125
|
-
return [atan2(cartesian2[1], cartesian2[0]), asin(cartesian2[2])];
|
|
126
|
-
}
|
|
127
|
-
function cartesian(spherical2) {
|
|
128
|
-
var lambda = spherical2[0], phi = spherical2[1], cosPhi = cos(phi);
|
|
129
|
-
return [cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)];
|
|
130
|
-
}
|
|
131
|
-
function cartesianDot(a, b) {
|
|
132
|
-
return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
|
|
133
|
-
}
|
|
134
|
-
function cartesianCross(a, b) {
|
|
135
|
-
return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];
|
|
136
|
-
}
|
|
137
|
-
function cartesianAddInPlace(a, b) {
|
|
138
|
-
a[0] += b[0], a[1] += b[1], a[2] += b[2];
|
|
139
|
-
}
|
|
140
|
-
function cartesianScale(vector, k) {
|
|
141
|
-
return [vector[0] * k, vector[1] * k, vector[2] * k];
|
|
142
|
-
}
|
|
143
|
-
function cartesianNormalizeInPlace(d) {
|
|
144
|
-
var l = sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);
|
|
145
|
-
d[0] /= l, d[1] /= l, d[2] /= l;
|
|
146
|
-
}
|
|
147
|
-
adder();
|
|
148
|
-
function compose(a, b) {
|
|
149
|
-
function compose2(x, y) {
|
|
150
|
-
return x = a(x, y), b(x[0], x[1]);
|
|
151
|
-
}
|
|
152
|
-
if (a.invert && b.invert)
|
|
153
|
-
compose2.invert = function(x, y) {
|
|
154
|
-
return x = b.invert(x, y), x && a.invert(x[0], x[1]);
|
|
155
|
-
};
|
|
156
|
-
return compose2;
|
|
157
|
-
}
|
|
158
|
-
function rotationIdentity(lambda, phi) {
|
|
159
|
-
return [lambda > pi ? lambda - tau : lambda < -pi ? lambda + tau : lambda, phi];
|
|
160
|
-
}
|
|
161
|
-
rotationIdentity.invert = rotationIdentity;
|
|
162
|
-
function rotateRadians(deltaLambda, deltaPhi, deltaGamma) {
|
|
163
|
-
return (deltaLambda %= tau) ? deltaPhi || deltaGamma ? compose(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma)) : rotationLambda(deltaLambda) : deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma) : rotationIdentity;
|
|
164
|
-
}
|
|
165
|
-
function forwardRotationLambda(deltaLambda) {
|
|
166
|
-
return function(lambda, phi) {
|
|
167
|
-
return lambda += deltaLambda, [lambda > pi ? lambda - tau : lambda < -pi ? lambda + tau : lambda, phi];
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
function rotationLambda(deltaLambda) {
|
|
171
|
-
var rotation = forwardRotationLambda(deltaLambda);
|
|
172
|
-
rotation.invert = forwardRotationLambda(-deltaLambda);
|
|
173
|
-
return rotation;
|
|
174
|
-
}
|
|
175
|
-
function rotationPhiGamma(deltaPhi, deltaGamma) {
|
|
176
|
-
var cosDeltaPhi = cos(deltaPhi), sinDeltaPhi = sin(deltaPhi), cosDeltaGamma = cos(deltaGamma), sinDeltaGamma = sin(deltaGamma);
|
|
177
|
-
function rotation(lambda, phi) {
|
|
178
|
-
var cosPhi = cos(phi), x = cos(lambda) * cosPhi, y = sin(lambda) * cosPhi, z = sin(phi), k = z * cosDeltaPhi + x * sinDeltaPhi;
|
|
179
|
-
return [
|
|
180
|
-
atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi),
|
|
181
|
-
asin(k * cosDeltaGamma + y * sinDeltaGamma)
|
|
182
|
-
];
|
|
183
|
-
}
|
|
184
|
-
rotation.invert = function(lambda, phi) {
|
|
185
|
-
var cosPhi = cos(phi), x = cos(lambda) * cosPhi, y = sin(lambda) * cosPhi, z = sin(phi), k = z * cosDeltaGamma - y * sinDeltaGamma;
|
|
186
|
-
return [
|
|
187
|
-
atan2(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi),
|
|
188
|
-
asin(k * cosDeltaPhi - x * sinDeltaPhi)
|
|
189
|
-
];
|
|
190
|
-
};
|
|
191
|
-
return rotation;
|
|
192
|
-
}
|
|
193
|
-
function circleStream(stream, radius, delta, direction, t0, t1) {
|
|
194
|
-
if (!delta)
|
|
195
|
-
return;
|
|
196
|
-
var cosRadius = cos(radius), sinRadius = sin(radius), step = direction * delta;
|
|
197
|
-
if (t0 == null) {
|
|
198
|
-
t0 = radius + direction * tau;
|
|
199
|
-
t1 = radius - step / 2;
|
|
200
|
-
} else {
|
|
201
|
-
t0 = circleRadius(cosRadius, t0);
|
|
202
|
-
t1 = circleRadius(cosRadius, t1);
|
|
203
|
-
if (direction > 0 ? t0 < t1 : t0 > t1)
|
|
204
|
-
t0 += direction * tau;
|
|
205
|
-
}
|
|
206
|
-
for (var point, t = t0; direction > 0 ? t > t1 : t < t1; t -= step) {
|
|
207
|
-
point = spherical([cosRadius, -sinRadius * cos(t), -sinRadius * sin(t)]);
|
|
208
|
-
stream.point(point[0], point[1]);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
function circleRadius(cosRadius, point) {
|
|
212
|
-
point = cartesian(point), point[0] -= cosRadius;
|
|
213
|
-
cartesianNormalizeInPlace(point);
|
|
214
|
-
var radius = acos(-point[1]);
|
|
215
|
-
return ((-point[2] < 0 ? -radius : radius) + tau - epsilon) % tau;
|
|
216
|
-
}
|
|
217
|
-
function clipBuffer() {
|
|
218
|
-
var lines = [], line;
|
|
219
|
-
return {
|
|
220
|
-
point: function(x, y) {
|
|
221
|
-
line.push([x, y]);
|
|
222
|
-
},
|
|
223
|
-
lineStart: function() {
|
|
224
|
-
lines.push(line = []);
|
|
225
|
-
},
|
|
226
|
-
lineEnd: noop,
|
|
227
|
-
rejoin: function() {
|
|
228
|
-
if (lines.length > 1)
|
|
229
|
-
lines.push(lines.pop().concat(lines.shift()));
|
|
230
|
-
},
|
|
231
|
-
result: function() {
|
|
232
|
-
var result = lines;
|
|
233
|
-
lines = [];
|
|
234
|
-
line = null;
|
|
235
|
-
return result;
|
|
236
|
-
}
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
function clipLine(a, b, x02, y02, x12, y12) {
|
|
240
|
-
var ax = a[0], ay = a[1], bx = b[0], by = b[1], t0 = 0, t1 = 1, dx = bx - ax, dy = by - ay, r;
|
|
241
|
-
r = x02 - ax;
|
|
242
|
-
if (!dx && r > 0)
|
|
243
|
-
return;
|
|
244
|
-
r /= dx;
|
|
245
|
-
if (dx < 0) {
|
|
246
|
-
if (r < t0)
|
|
247
|
-
return;
|
|
248
|
-
if (r < t1)
|
|
249
|
-
t1 = r;
|
|
250
|
-
} else if (dx > 0) {
|
|
251
|
-
if (r > t1)
|
|
252
|
-
return;
|
|
253
|
-
if (r > t0)
|
|
254
|
-
t0 = r;
|
|
255
|
-
}
|
|
256
|
-
r = x12 - ax;
|
|
257
|
-
if (!dx && r < 0)
|
|
258
|
-
return;
|
|
259
|
-
r /= dx;
|
|
260
|
-
if (dx < 0) {
|
|
261
|
-
if (r > t1)
|
|
262
|
-
return;
|
|
263
|
-
if (r > t0)
|
|
264
|
-
t0 = r;
|
|
265
|
-
} else if (dx > 0) {
|
|
266
|
-
if (r < t0)
|
|
267
|
-
return;
|
|
268
|
-
if (r < t1)
|
|
269
|
-
t1 = r;
|
|
270
|
-
}
|
|
271
|
-
r = y02 - ay;
|
|
272
|
-
if (!dy && r > 0)
|
|
273
|
-
return;
|
|
274
|
-
r /= dy;
|
|
275
|
-
if (dy < 0) {
|
|
276
|
-
if (r < t0)
|
|
277
|
-
return;
|
|
278
|
-
if (r < t1)
|
|
279
|
-
t1 = r;
|
|
280
|
-
} else if (dy > 0) {
|
|
281
|
-
if (r > t1)
|
|
282
|
-
return;
|
|
283
|
-
if (r > t0)
|
|
284
|
-
t0 = r;
|
|
285
|
-
}
|
|
286
|
-
r = y12 - ay;
|
|
287
|
-
if (!dy && r < 0)
|
|
288
|
-
return;
|
|
289
|
-
r /= dy;
|
|
290
|
-
if (dy < 0) {
|
|
291
|
-
if (r > t1)
|
|
292
|
-
return;
|
|
293
|
-
if (r > t0)
|
|
294
|
-
t0 = r;
|
|
295
|
-
} else if (dy > 0) {
|
|
296
|
-
if (r < t0)
|
|
297
|
-
return;
|
|
298
|
-
if (r < t1)
|
|
299
|
-
t1 = r;
|
|
300
|
-
}
|
|
301
|
-
if (t0 > 0)
|
|
302
|
-
a[0] = ax + t0 * dx, a[1] = ay + t0 * dy;
|
|
303
|
-
if (t1 < 1)
|
|
304
|
-
b[0] = ax + t1 * dx, b[1] = ay + t1 * dy;
|
|
305
|
-
return true;
|
|
306
|
-
}
|
|
307
|
-
function pointEqual(a, b) {
|
|
308
|
-
return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon;
|
|
309
|
-
}
|
|
310
|
-
function Intersection(point, points, other, entry) {
|
|
311
|
-
this.x = point;
|
|
312
|
-
this.z = points;
|
|
313
|
-
this.o = other;
|
|
314
|
-
this.e = entry;
|
|
315
|
-
this.v = false;
|
|
316
|
-
this.n = this.p = null;
|
|
317
|
-
}
|
|
318
|
-
function clipPolygon(segments, compareIntersection2, startInside, interpolate, stream) {
|
|
319
|
-
var subject = [], clip2 = [], i, n;
|
|
320
|
-
segments.forEach(function(segment) {
|
|
321
|
-
if ((n2 = segment.length - 1) <= 0)
|
|
322
|
-
return;
|
|
323
|
-
var n2, p0 = segment[0], p1 = segment[n2], x;
|
|
324
|
-
if (pointEqual(p0, p1)) {
|
|
325
|
-
stream.lineStart();
|
|
326
|
-
for (i = 0; i < n2; ++i)
|
|
327
|
-
stream.point((p0 = segment[i])[0], p0[1]);
|
|
328
|
-
stream.lineEnd();
|
|
329
|
-
return;
|
|
330
|
-
}
|
|
331
|
-
subject.push(x = new Intersection(p0, segment, null, true));
|
|
332
|
-
clip2.push(x.o = new Intersection(p0, null, x, false));
|
|
333
|
-
subject.push(x = new Intersection(p1, segment, null, false));
|
|
334
|
-
clip2.push(x.o = new Intersection(p1, null, x, true));
|
|
335
|
-
});
|
|
336
|
-
if (!subject.length)
|
|
337
|
-
return;
|
|
338
|
-
clip2.sort(compareIntersection2);
|
|
339
|
-
link(subject);
|
|
340
|
-
link(clip2);
|
|
341
|
-
for (i = 0, n = clip2.length; i < n; ++i) {
|
|
342
|
-
clip2[i].e = startInside = !startInside;
|
|
343
|
-
}
|
|
344
|
-
var start = subject[0], points, point;
|
|
345
|
-
while (1) {
|
|
346
|
-
var current = start, isSubject = true;
|
|
347
|
-
while (current.v)
|
|
348
|
-
if ((current = current.n) === start)
|
|
349
|
-
return;
|
|
350
|
-
points = current.z;
|
|
351
|
-
stream.lineStart();
|
|
352
|
-
do {
|
|
353
|
-
current.v = current.o.v = true;
|
|
354
|
-
if (current.e) {
|
|
355
|
-
if (isSubject) {
|
|
356
|
-
for (i = 0, n = points.length; i < n; ++i)
|
|
357
|
-
stream.point((point = points[i])[0], point[1]);
|
|
358
|
-
} else {
|
|
359
|
-
interpolate(current.x, current.n.x, 1, stream);
|
|
360
|
-
}
|
|
361
|
-
current = current.n;
|
|
362
|
-
} else {
|
|
363
|
-
if (isSubject) {
|
|
364
|
-
points = current.p.z;
|
|
365
|
-
for (i = points.length - 1; i >= 0; --i)
|
|
366
|
-
stream.point((point = points[i])[0], point[1]);
|
|
367
|
-
} else {
|
|
368
|
-
interpolate(current.x, current.p.x, -1, stream);
|
|
369
|
-
}
|
|
370
|
-
current = current.p;
|
|
371
|
-
}
|
|
372
|
-
current = current.o;
|
|
373
|
-
points = current.z;
|
|
374
|
-
isSubject = !isSubject;
|
|
375
|
-
} while (!current.v);
|
|
376
|
-
stream.lineEnd();
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
function link(array) {
|
|
380
|
-
if (!(n = array.length))
|
|
381
|
-
return;
|
|
382
|
-
var n, i = 0, a = array[0], b;
|
|
383
|
-
while (++i < n) {
|
|
384
|
-
a.n = b = array[i];
|
|
385
|
-
b.p = a;
|
|
386
|
-
a = b;
|
|
387
|
-
}
|
|
388
|
-
a.n = b = array[0];
|
|
389
|
-
b.p = a;
|
|
390
|
-
}
|
|
391
|
-
var clipMax = 1e9, clipMin = -clipMax;
|
|
392
|
-
function clipExtent(x02, y02, x12, y12) {
|
|
393
|
-
function visible(x, y) {
|
|
394
|
-
return x02 <= x && x <= x12 && y02 <= y && y <= y12;
|
|
395
|
-
}
|
|
396
|
-
function interpolate(from, to, direction, stream) {
|
|
397
|
-
var a = 0, a1 = 0;
|
|
398
|
-
if (from == null || (a = corner(from, direction)) !== (a1 = corner(to, direction)) || comparePoint(from, to) < 0 ^ direction > 0) {
|
|
399
|
-
do
|
|
400
|
-
stream.point(a === 0 || a === 3 ? x02 : x12, a > 1 ? y12 : y02);
|
|
401
|
-
while ((a = (a + direction + 4) % 4) !== a1);
|
|
402
|
-
} else {
|
|
403
|
-
stream.point(to[0], to[1]);
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
function corner(p, direction) {
|
|
407
|
-
return abs(p[0] - x02) < epsilon ? direction > 0 ? 0 : 3 : abs(p[0] - x12) < epsilon ? direction > 0 ? 2 : 1 : abs(p[1] - y02) < epsilon ? direction > 0 ? 1 : 0 : direction > 0 ? 3 : 2;
|
|
408
|
-
}
|
|
409
|
-
function compareIntersection2(a, b) {
|
|
410
|
-
return comparePoint(a.x, b.x);
|
|
411
|
-
}
|
|
412
|
-
function comparePoint(a, b) {
|
|
413
|
-
var ca = corner(a, 1), cb = corner(b, 1);
|
|
414
|
-
return ca !== cb ? ca - cb : ca === 0 ? b[1] - a[1] : ca === 1 ? a[0] - b[0] : ca === 2 ? a[1] - b[1] : b[0] - a[0];
|
|
415
|
-
}
|
|
416
|
-
return function(stream) {
|
|
417
|
-
var activeStream = stream, bufferStream = clipBuffer(), segments, polygon, ring, x__, y__, v__, x_, y_, v_, first, clean;
|
|
418
|
-
var clipStream = {
|
|
419
|
-
point,
|
|
420
|
-
lineStart,
|
|
421
|
-
lineEnd,
|
|
422
|
-
polygonStart,
|
|
423
|
-
polygonEnd
|
|
424
|
-
};
|
|
425
|
-
function point(x, y) {
|
|
426
|
-
if (visible(x, y))
|
|
427
|
-
activeStream.point(x, y);
|
|
428
|
-
}
|
|
429
|
-
function polygonInside() {
|
|
430
|
-
var winding = 0;
|
|
431
|
-
for (var i = 0, n = polygon.length; i < n; ++i) {
|
|
432
|
-
for (var ring2 = polygon[i], j = 1, m = ring2.length, point2 = ring2[0], a0, a1, b0 = point2[0], b1 = point2[1]; j < m; ++j) {
|
|
433
|
-
a0 = b0, a1 = b1, point2 = ring2[j], b0 = point2[0], b1 = point2[1];
|
|
434
|
-
if (a1 <= y12) {
|
|
435
|
-
if (b1 > y12 && (b0 - a0) * (y12 - a1) > (b1 - a1) * (x02 - a0))
|
|
436
|
-
++winding;
|
|
437
|
-
} else {
|
|
438
|
-
if (b1 <= y12 && (b0 - a0) * (y12 - a1) < (b1 - a1) * (x02 - a0))
|
|
439
|
-
--winding;
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
return winding;
|
|
444
|
-
}
|
|
445
|
-
function polygonStart() {
|
|
446
|
-
activeStream = bufferStream, segments = [], polygon = [], clean = true;
|
|
447
|
-
}
|
|
448
|
-
function polygonEnd() {
|
|
449
|
-
var startInside = polygonInside(), cleanInside = clean && startInside, visible2 = (segments = merge(segments)).length;
|
|
450
|
-
if (cleanInside || visible2) {
|
|
451
|
-
stream.polygonStart();
|
|
452
|
-
if (cleanInside) {
|
|
453
|
-
stream.lineStart();
|
|
454
|
-
interpolate(null, null, 1, stream);
|
|
455
|
-
stream.lineEnd();
|
|
456
|
-
}
|
|
457
|
-
if (visible2) {
|
|
458
|
-
clipPolygon(segments, compareIntersection2, startInside, interpolate, stream);
|
|
459
|
-
}
|
|
460
|
-
stream.polygonEnd();
|
|
461
|
-
}
|
|
462
|
-
activeStream = stream, segments = polygon = ring = null;
|
|
463
|
-
}
|
|
464
|
-
function lineStart() {
|
|
465
|
-
clipStream.point = linePoint;
|
|
466
|
-
if (polygon)
|
|
467
|
-
polygon.push(ring = []);
|
|
468
|
-
first = true;
|
|
469
|
-
v_ = false;
|
|
470
|
-
x_ = y_ = NaN;
|
|
471
|
-
}
|
|
472
|
-
function lineEnd() {
|
|
473
|
-
if (segments) {
|
|
474
|
-
linePoint(x__, y__);
|
|
475
|
-
if (v__ && v_)
|
|
476
|
-
bufferStream.rejoin();
|
|
477
|
-
segments.push(bufferStream.result());
|
|
478
|
-
}
|
|
479
|
-
clipStream.point = point;
|
|
480
|
-
if (v_)
|
|
481
|
-
activeStream.lineEnd();
|
|
482
|
-
}
|
|
483
|
-
function linePoint(x, y) {
|
|
484
|
-
var v = visible(x, y);
|
|
485
|
-
if (polygon)
|
|
486
|
-
ring.push([x, y]);
|
|
487
|
-
if (first) {
|
|
488
|
-
x__ = x, y__ = y, v__ = v;
|
|
489
|
-
first = false;
|
|
490
|
-
if (v) {
|
|
491
|
-
activeStream.lineStart();
|
|
492
|
-
activeStream.point(x, y);
|
|
493
|
-
}
|
|
494
|
-
} else {
|
|
495
|
-
if (v && v_)
|
|
496
|
-
activeStream.point(x, y);
|
|
497
|
-
else {
|
|
498
|
-
var a = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))], b = [x = Math.max(clipMin, Math.min(clipMax, x)), y = Math.max(clipMin, Math.min(clipMax, y))];
|
|
499
|
-
if (clipLine(a, b, x02, y02, x12, y12)) {
|
|
500
|
-
if (!v_) {
|
|
501
|
-
activeStream.lineStart();
|
|
502
|
-
activeStream.point(a[0], a[1]);
|
|
503
|
-
}
|
|
504
|
-
activeStream.point(b[0], b[1]);
|
|
505
|
-
if (!v)
|
|
506
|
-
activeStream.lineEnd();
|
|
507
|
-
clean = false;
|
|
508
|
-
} else if (v) {
|
|
509
|
-
activeStream.lineStart();
|
|
510
|
-
activeStream.point(x, y);
|
|
511
|
-
clean = false;
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
x_ = x, y_ = y, v_ = v;
|
|
516
|
-
}
|
|
517
|
-
return clipStream;
|
|
518
|
-
};
|
|
519
|
-
}
|
|
520
|
-
var sum = adder();
|
|
521
|
-
function polygonContains(polygon, point) {
|
|
522
|
-
var lambda = point[0], phi = point[1], normal = [sin(lambda), -cos(lambda), 0], angle = 0, winding = 0;
|
|
523
|
-
sum.reset();
|
|
524
|
-
for (var i = 0, n = polygon.length; i < n; ++i) {
|
|
525
|
-
if (!(m = (ring = polygon[i]).length))
|
|
526
|
-
continue;
|
|
527
|
-
var ring, m, point0 = ring[m - 1], lambda0 = point0[0], phi0 = point0[1] / 2 + quarterPi, sinPhi0 = sin(phi0), cosPhi0 = cos(phi0);
|
|
528
|
-
for (var j = 0; j < m; ++j, lambda0 = lambda1, sinPhi0 = sinPhi1, cosPhi0 = cosPhi1, point0 = point1) {
|
|
529
|
-
var point1 = ring[j], lambda1 = point1[0], phi1 = point1[1] / 2 + quarterPi, sinPhi1 = sin(phi1), cosPhi1 = cos(phi1), delta = lambda1 - lambda0, sign = delta >= 0 ? 1 : -1, absDelta = sign * delta, antimeridian = absDelta > pi, k = sinPhi0 * sinPhi1;
|
|
530
|
-
sum.add(atan2(k * sign * sin(absDelta), cosPhi0 * cosPhi1 + k * cos(absDelta)));
|
|
531
|
-
angle += antimeridian ? delta + sign * tau : delta;
|
|
532
|
-
if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) {
|
|
533
|
-
var arc = cartesianCross(cartesian(point0), cartesian(point1));
|
|
534
|
-
cartesianNormalizeInPlace(arc);
|
|
535
|
-
var intersection = cartesianCross(normal, arc);
|
|
536
|
-
cartesianNormalizeInPlace(intersection);
|
|
537
|
-
var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection[2]);
|
|
538
|
-
if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) {
|
|
539
|
-
winding += antimeridian ^ delta >= 0 ? 1 : -1;
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
return (angle < -epsilon || angle < epsilon && sum < -epsilon) ^ winding & 1;
|
|
545
|
-
}
|
|
546
|
-
adder();
|
|
547
|
-
function identity(x) {
|
|
548
|
-
return x;
|
|
549
|
-
}
|
|
550
|
-
adder();
|
|
551
|
-
adder();
|
|
552
|
-
var x0 = Infinity, y0 = x0, x1 = -x0, y1 = x1;
|
|
553
|
-
var boundsStream = {
|
|
554
|
-
point: boundsPoint,
|
|
555
|
-
lineStart: noop,
|
|
556
|
-
lineEnd: noop,
|
|
557
|
-
polygonStart: noop,
|
|
558
|
-
polygonEnd: noop,
|
|
559
|
-
result: function() {
|
|
560
|
-
var bounds = [[x0, y0], [x1, y1]];
|
|
561
|
-
x1 = y1 = -(y0 = x0 = Infinity);
|
|
562
|
-
return bounds;
|
|
563
|
-
}
|
|
564
|
-
};
|
|
565
|
-
function boundsPoint(x, y) {
|
|
566
|
-
if (x < x0)
|
|
567
|
-
x0 = x;
|
|
568
|
-
if (x > x1)
|
|
569
|
-
x1 = x;
|
|
570
|
-
if (y < y0)
|
|
571
|
-
y0 = y;
|
|
572
|
-
if (y > y1)
|
|
573
|
-
y1 = y;
|
|
574
|
-
}
|
|
575
|
-
adder();
|
|
576
|
-
function clip(pointVisible, clipLine2, interpolate, start) {
|
|
577
|
-
return function(rotate, sink) {
|
|
578
|
-
var line = clipLine2(sink), rotatedStart = rotate.invert(start[0], start[1]), ringBuffer = clipBuffer(), ringSink = clipLine2(ringBuffer), polygonStarted = false, polygon, segments, ring;
|
|
579
|
-
var clip2 = {
|
|
580
|
-
point,
|
|
581
|
-
lineStart,
|
|
582
|
-
lineEnd,
|
|
583
|
-
polygonStart: function() {
|
|
584
|
-
clip2.point = pointRing;
|
|
585
|
-
clip2.lineStart = ringStart;
|
|
586
|
-
clip2.lineEnd = ringEnd;
|
|
587
|
-
segments = [];
|
|
588
|
-
polygon = [];
|
|
589
|
-
},
|
|
590
|
-
polygonEnd: function() {
|
|
591
|
-
clip2.point = point;
|
|
592
|
-
clip2.lineStart = lineStart;
|
|
593
|
-
clip2.lineEnd = lineEnd;
|
|
594
|
-
segments = merge(segments);
|
|
595
|
-
var startInside = polygonContains(polygon, rotatedStart);
|
|
596
|
-
if (segments.length) {
|
|
597
|
-
if (!polygonStarted)
|
|
598
|
-
sink.polygonStart(), polygonStarted = true;
|
|
599
|
-
clipPolygon(segments, compareIntersection, startInside, interpolate, sink);
|
|
600
|
-
} else if (startInside) {
|
|
601
|
-
if (!polygonStarted)
|
|
602
|
-
sink.polygonStart(), polygonStarted = true;
|
|
603
|
-
sink.lineStart();
|
|
604
|
-
interpolate(null, null, 1, sink);
|
|
605
|
-
sink.lineEnd();
|
|
606
|
-
}
|
|
607
|
-
if (polygonStarted)
|
|
608
|
-
sink.polygonEnd(), polygonStarted = false;
|
|
609
|
-
segments = polygon = null;
|
|
610
|
-
},
|
|
611
|
-
sphere: function() {
|
|
612
|
-
sink.polygonStart();
|
|
613
|
-
sink.lineStart();
|
|
614
|
-
interpolate(null, null, 1, sink);
|
|
615
|
-
sink.lineEnd();
|
|
616
|
-
sink.polygonEnd();
|
|
617
|
-
}
|
|
618
|
-
};
|
|
619
|
-
function point(lambda, phi) {
|
|
620
|
-
var point2 = rotate(lambda, phi);
|
|
621
|
-
if (pointVisible(lambda = point2[0], phi = point2[1]))
|
|
622
|
-
sink.point(lambda, phi);
|
|
623
|
-
}
|
|
624
|
-
function pointLine(lambda, phi) {
|
|
625
|
-
var point2 = rotate(lambda, phi);
|
|
626
|
-
line.point(point2[0], point2[1]);
|
|
627
|
-
}
|
|
628
|
-
function lineStart() {
|
|
629
|
-
clip2.point = pointLine;
|
|
630
|
-
line.lineStart();
|
|
631
|
-
}
|
|
632
|
-
function lineEnd() {
|
|
633
|
-
clip2.point = point;
|
|
634
|
-
line.lineEnd();
|
|
635
|
-
}
|
|
636
|
-
function pointRing(lambda, phi) {
|
|
637
|
-
ring.push([lambda, phi]);
|
|
638
|
-
var point2 = rotate(lambda, phi);
|
|
639
|
-
ringSink.point(point2[0], point2[1]);
|
|
640
|
-
}
|
|
641
|
-
function ringStart() {
|
|
642
|
-
ringSink.lineStart();
|
|
643
|
-
ring = [];
|
|
644
|
-
}
|
|
645
|
-
function ringEnd() {
|
|
646
|
-
pointRing(ring[0][0], ring[0][1]);
|
|
647
|
-
ringSink.lineEnd();
|
|
648
|
-
var clean = ringSink.clean(), ringSegments = ringBuffer.result(), i, n = ringSegments.length, m, segment, point2;
|
|
649
|
-
ring.pop();
|
|
650
|
-
polygon.push(ring);
|
|
651
|
-
ring = null;
|
|
652
|
-
if (!n)
|
|
653
|
-
return;
|
|
654
|
-
if (clean & 1) {
|
|
655
|
-
segment = ringSegments[0];
|
|
656
|
-
if ((m = segment.length - 1) > 0) {
|
|
657
|
-
if (!polygonStarted)
|
|
658
|
-
sink.polygonStart(), polygonStarted = true;
|
|
659
|
-
sink.lineStart();
|
|
660
|
-
for (i = 0; i < m; ++i)
|
|
661
|
-
sink.point((point2 = segment[i])[0], point2[1]);
|
|
662
|
-
sink.lineEnd();
|
|
663
|
-
}
|
|
664
|
-
return;
|
|
665
|
-
}
|
|
666
|
-
if (n > 1 && clean & 2)
|
|
667
|
-
ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));
|
|
668
|
-
segments.push(ringSegments.filter(validSegment));
|
|
669
|
-
}
|
|
670
|
-
return clip2;
|
|
671
|
-
};
|
|
672
|
-
}
|
|
673
|
-
function validSegment(segment) {
|
|
674
|
-
return segment.length > 1;
|
|
675
|
-
}
|
|
676
|
-
function compareIntersection(a, b) {
|
|
677
|
-
return ((a = a.x)[0] < 0 ? a[1] - halfPi - epsilon : halfPi - a[1]) - ((b = b.x)[0] < 0 ? b[1] - halfPi - epsilon : halfPi - b[1]);
|
|
678
|
-
}
|
|
679
|
-
var clipAntimeridian = clip(
|
|
680
|
-
function() {
|
|
681
|
-
return true;
|
|
682
|
-
},
|
|
683
|
-
clipAntimeridianLine,
|
|
684
|
-
clipAntimeridianInterpolate,
|
|
685
|
-
[-pi, -halfPi]
|
|
686
|
-
);
|
|
687
|
-
function clipAntimeridianLine(stream) {
|
|
688
|
-
var lambda0 = NaN, phi0 = NaN, sign0 = NaN, clean;
|
|
689
|
-
return {
|
|
690
|
-
lineStart: function() {
|
|
691
|
-
stream.lineStart();
|
|
692
|
-
clean = 1;
|
|
693
|
-
},
|
|
694
|
-
point: function(lambda1, phi1) {
|
|
695
|
-
var sign1 = lambda1 > 0 ? pi : -pi, delta = abs(lambda1 - lambda0);
|
|
696
|
-
if (abs(delta - pi) < epsilon) {
|
|
697
|
-
stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? halfPi : -halfPi);
|
|
698
|
-
stream.point(sign0, phi0);
|
|
699
|
-
stream.lineEnd();
|
|
700
|
-
stream.lineStart();
|
|
701
|
-
stream.point(sign1, phi0);
|
|
702
|
-
stream.point(lambda1, phi0);
|
|
703
|
-
clean = 0;
|
|
704
|
-
} else if (sign0 !== sign1 && delta >= pi) {
|
|
705
|
-
if (abs(lambda0 - sign0) < epsilon)
|
|
706
|
-
lambda0 -= sign0 * epsilon;
|
|
707
|
-
if (abs(lambda1 - sign1) < epsilon)
|
|
708
|
-
lambda1 -= sign1 * epsilon;
|
|
709
|
-
phi0 = clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1);
|
|
710
|
-
stream.point(sign0, phi0);
|
|
711
|
-
stream.lineEnd();
|
|
712
|
-
stream.lineStart();
|
|
713
|
-
stream.point(sign1, phi0);
|
|
714
|
-
clean = 0;
|
|
715
|
-
}
|
|
716
|
-
stream.point(lambda0 = lambda1, phi0 = phi1);
|
|
717
|
-
sign0 = sign1;
|
|
718
|
-
},
|
|
719
|
-
lineEnd: function() {
|
|
720
|
-
stream.lineEnd();
|
|
721
|
-
lambda0 = phi0 = NaN;
|
|
722
|
-
},
|
|
723
|
-
clean: function() {
|
|
724
|
-
return 2 - clean;
|
|
725
|
-
}
|
|
726
|
-
};
|
|
727
|
-
}
|
|
728
|
-
function clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1) {
|
|
729
|
-
var cosPhi0, cosPhi1, sinLambda0Lambda1 = sin(lambda0 - lambda1);
|
|
730
|
-
return abs(sinLambda0Lambda1) > epsilon ? atan((sin(phi0) * (cosPhi1 = cos(phi1)) * sin(lambda1) - sin(phi1) * (cosPhi0 = cos(phi0)) * sin(lambda0)) / (cosPhi0 * cosPhi1 * sinLambda0Lambda1)) : (phi0 + phi1) / 2;
|
|
731
|
-
}
|
|
732
|
-
function clipAntimeridianInterpolate(from, to, direction, stream) {
|
|
733
|
-
var phi;
|
|
734
|
-
if (from == null) {
|
|
735
|
-
phi = direction * halfPi;
|
|
736
|
-
stream.point(-pi, phi);
|
|
737
|
-
stream.point(0, phi);
|
|
738
|
-
stream.point(pi, phi);
|
|
739
|
-
stream.point(pi, 0);
|
|
740
|
-
stream.point(pi, -phi);
|
|
741
|
-
stream.point(0, -phi);
|
|
742
|
-
stream.point(-pi, -phi);
|
|
743
|
-
stream.point(-pi, 0);
|
|
744
|
-
stream.point(-pi, phi);
|
|
745
|
-
} else if (abs(from[0] - to[0]) > epsilon) {
|
|
746
|
-
var lambda = from[0] < to[0] ? pi : -pi;
|
|
747
|
-
phi = direction * lambda / 2;
|
|
748
|
-
stream.point(-lambda, phi);
|
|
749
|
-
stream.point(0, phi);
|
|
750
|
-
stream.point(lambda, phi);
|
|
751
|
-
} else {
|
|
752
|
-
stream.point(to[0], to[1]);
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
function clipCircle(radius, delta) {
|
|
756
|
-
var cr = cos(radius), smallRadius = cr > 0, notHemisphere = abs(cr) > epsilon;
|
|
757
|
-
function interpolate(from, to, direction, stream) {
|
|
758
|
-
circleStream(stream, radius, delta, direction, from, to);
|
|
759
|
-
}
|
|
760
|
-
function visible(lambda, phi) {
|
|
761
|
-
return cos(lambda) * cos(phi) > cr;
|
|
762
|
-
}
|
|
763
|
-
function clipLine2(stream) {
|
|
764
|
-
var point0, c0, v0, v00, clean;
|
|
765
|
-
return {
|
|
766
|
-
lineStart: function() {
|
|
767
|
-
v00 = v0 = false;
|
|
768
|
-
clean = 1;
|
|
769
|
-
},
|
|
770
|
-
point: function(lambda, phi) {
|
|
771
|
-
var point1 = [lambda, phi], point2, v = visible(lambda, phi), c = smallRadius ? v ? 0 : code(lambda, phi) : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;
|
|
772
|
-
if (!point0 && (v00 = v0 = v))
|
|
773
|
-
stream.lineStart();
|
|
774
|
-
if (v !== v0) {
|
|
775
|
-
point2 = intersect(point0, point1);
|
|
776
|
-
if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {
|
|
777
|
-
point1[0] += epsilon;
|
|
778
|
-
point1[1] += epsilon;
|
|
779
|
-
v = visible(point1[0], point1[1]);
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
if (v !== v0) {
|
|
783
|
-
clean = 0;
|
|
784
|
-
if (v) {
|
|
785
|
-
stream.lineStart();
|
|
786
|
-
point2 = intersect(point1, point0);
|
|
787
|
-
stream.point(point2[0], point2[1]);
|
|
788
|
-
} else {
|
|
789
|
-
point2 = intersect(point0, point1);
|
|
790
|
-
stream.point(point2[0], point2[1]);
|
|
791
|
-
stream.lineEnd();
|
|
792
|
-
}
|
|
793
|
-
point0 = point2;
|
|
794
|
-
} else if (notHemisphere && point0 && smallRadius ^ v) {
|
|
795
|
-
var t;
|
|
796
|
-
if (!(c & c0) && (t = intersect(point1, point0, true))) {
|
|
797
|
-
clean = 0;
|
|
798
|
-
if (smallRadius) {
|
|
799
|
-
stream.lineStart();
|
|
800
|
-
stream.point(t[0][0], t[0][1]);
|
|
801
|
-
stream.point(t[1][0], t[1][1]);
|
|
802
|
-
stream.lineEnd();
|
|
803
|
-
} else {
|
|
804
|
-
stream.point(t[1][0], t[1][1]);
|
|
805
|
-
stream.lineEnd();
|
|
806
|
-
stream.lineStart();
|
|
807
|
-
stream.point(t[0][0], t[0][1]);
|
|
808
|
-
}
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
if (v && (!point0 || !pointEqual(point0, point1))) {
|
|
812
|
-
stream.point(point1[0], point1[1]);
|
|
813
|
-
}
|
|
814
|
-
point0 = point1, v0 = v, c0 = c;
|
|
815
|
-
},
|
|
816
|
-
lineEnd: function() {
|
|
817
|
-
if (v0)
|
|
818
|
-
stream.lineEnd();
|
|
819
|
-
point0 = null;
|
|
820
|
-
},
|
|
821
|
-
clean: function() {
|
|
822
|
-
return clean | (v00 && v0) << 1;
|
|
823
|
-
}
|
|
824
|
-
};
|
|
825
|
-
}
|
|
826
|
-
function intersect(a, b, two) {
|
|
827
|
-
var pa = cartesian(a), pb = cartesian(b);
|
|
828
|
-
var n1 = [1, 0, 0], n2 = cartesianCross(pa, pb), n2n2 = cartesianDot(n2, n2), n1n2 = n2[0], determinant = n2n2 - n1n2 * n1n2;
|
|
829
|
-
if (!determinant)
|
|
830
|
-
return !two && a;
|
|
831
|
-
var c1 = cr * n2n2 / determinant, c2 = -cr * n1n2 / determinant, n1xn2 = cartesianCross(n1, n2), A = cartesianScale(n1, c1), B = cartesianScale(n2, c2);
|
|
832
|
-
cartesianAddInPlace(A, B);
|
|
833
|
-
var u = n1xn2, w = cartesianDot(A, u), uu = cartesianDot(u, u), t2 = w * w - uu * (cartesianDot(A, A) - 1);
|
|
834
|
-
if (t2 < 0)
|
|
835
|
-
return;
|
|
836
|
-
var t = sqrt(t2), q = cartesianScale(u, (-w - t) / uu);
|
|
837
|
-
cartesianAddInPlace(q, A);
|
|
838
|
-
q = spherical(q);
|
|
839
|
-
if (!two)
|
|
840
|
-
return q;
|
|
841
|
-
var lambda0 = a[0], lambda1 = b[0], phi0 = a[1], phi1 = b[1], z;
|
|
842
|
-
if (lambda1 < lambda0)
|
|
843
|
-
z = lambda0, lambda0 = lambda1, lambda1 = z;
|
|
844
|
-
var delta2 = lambda1 - lambda0, polar = abs(delta2 - pi) < epsilon, meridian = polar || delta2 < epsilon;
|
|
845
|
-
if (!polar && phi1 < phi0)
|
|
846
|
-
z = phi0, phi0 = phi1, phi1 = z;
|
|
847
|
-
if (meridian ? polar ? phi0 + phi1 > 0 ^ q[1] < (abs(q[0] - lambda0) < epsilon ? phi0 : phi1) : phi0 <= q[1] && q[1] <= phi1 : delta2 > pi ^ (lambda0 <= q[0] && q[0] <= lambda1)) {
|
|
848
|
-
var q1 = cartesianScale(u, (-w + t) / uu);
|
|
849
|
-
cartesianAddInPlace(q1, A);
|
|
850
|
-
return [q, spherical(q1)];
|
|
851
|
-
}
|
|
852
|
-
}
|
|
853
|
-
function code(lambda, phi) {
|
|
854
|
-
var r = smallRadius ? radius : pi - radius, code2 = 0;
|
|
855
|
-
if (lambda < -r)
|
|
856
|
-
code2 |= 1;
|
|
857
|
-
else if (lambda > r)
|
|
858
|
-
code2 |= 2;
|
|
859
|
-
if (phi < -r)
|
|
860
|
-
code2 |= 4;
|
|
861
|
-
else if (phi > r)
|
|
862
|
-
code2 |= 8;
|
|
863
|
-
return code2;
|
|
864
|
-
}
|
|
865
|
-
return clip(visible, clipLine2, interpolate, smallRadius ? [0, -radius] : [-pi, radius - pi]);
|
|
866
|
-
}
|
|
867
|
-
function transformer(methods) {
|
|
868
|
-
return function(stream) {
|
|
869
|
-
var s = new TransformStream();
|
|
870
|
-
for (var key in methods)
|
|
871
|
-
s[key] = methods[key];
|
|
872
|
-
s.stream = stream;
|
|
873
|
-
return s;
|
|
874
|
-
};
|
|
875
|
-
}
|
|
876
|
-
function TransformStream() {
|
|
877
|
-
}
|
|
878
|
-
TransformStream.prototype = {
|
|
879
|
-
constructor: TransformStream,
|
|
880
|
-
point: function(x, y) {
|
|
881
|
-
this.stream.point(x, y);
|
|
882
|
-
},
|
|
883
|
-
sphere: function() {
|
|
884
|
-
this.stream.sphere();
|
|
885
|
-
},
|
|
886
|
-
lineStart: function() {
|
|
887
|
-
this.stream.lineStart();
|
|
888
|
-
},
|
|
889
|
-
lineEnd: function() {
|
|
890
|
-
this.stream.lineEnd();
|
|
891
|
-
},
|
|
892
|
-
polygonStart: function() {
|
|
893
|
-
this.stream.polygonStart();
|
|
894
|
-
},
|
|
895
|
-
polygonEnd: function() {
|
|
896
|
-
this.stream.polygonEnd();
|
|
897
|
-
}
|
|
898
|
-
};
|
|
899
|
-
function fitExtent(projection2, extent, object) {
|
|
900
|
-
var w = extent[1][0] - extent[0][0], h = extent[1][1] - extent[0][1], clip2 = projection2.clipExtent && projection2.clipExtent();
|
|
901
|
-
projection2.scale(150).translate([0, 0]);
|
|
902
|
-
if (clip2 != null)
|
|
903
|
-
projection2.clipExtent(null);
|
|
904
|
-
geoStream(object, projection2.stream(boundsStream));
|
|
905
|
-
var b = boundsStream.result(), k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])), x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2, y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2;
|
|
906
|
-
if (clip2 != null)
|
|
907
|
-
projection2.clipExtent(clip2);
|
|
908
|
-
return projection2.scale(k * 150).translate([x, y]);
|
|
909
|
-
}
|
|
910
|
-
function fitSize(projection2, size, object) {
|
|
911
|
-
return fitExtent(projection2, [[0, 0], size], object);
|
|
912
|
-
}
|
|
913
|
-
var maxDepth = 16, cosMinDistance = cos(30 * radians);
|
|
914
|
-
function resample(project, delta2) {
|
|
915
|
-
return +delta2 ? resample$1(project, delta2) : resampleNone(project);
|
|
916
|
-
}
|
|
917
|
-
function resampleNone(project) {
|
|
918
|
-
return transformer({
|
|
919
|
-
point: function(x, y) {
|
|
920
|
-
x = project(x, y);
|
|
921
|
-
this.stream.point(x[0], x[1]);
|
|
922
|
-
}
|
|
923
|
-
});
|
|
924
|
-
}
|
|
925
|
-
function resample$1(project, delta2) {
|
|
926
|
-
function resampleLineTo(x02, y02, lambda0, a0, b0, c0, x12, y12, lambda1, a1, b1, c1, depth, stream) {
|
|
927
|
-
var dx = x12 - x02, dy = y12 - y02, d2 = dx * dx + dy * dy;
|
|
928
|
-
if (d2 > 4 * delta2 && depth--) {
|
|
929
|
-
var a = a0 + a1, b = b0 + b1, c = c0 + c1, m = sqrt(a * a + b * b + c * c), phi2 = asin(c /= m), lambda2 = abs(abs(c) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : atan2(b, a), p = project(lambda2, phi2), x2 = p[0], y2 = p[1], dx2 = x2 - x02, dy2 = y2 - y02, dz = dy * dx2 - dx * dy2;
|
|
930
|
-
if (dz * dz / d2 > delta2 || abs((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) {
|
|
931
|
-
resampleLineTo(x02, y02, lambda0, a0, b0, c0, x2, y2, lambda2, a /= m, b /= m, c, depth, stream);
|
|
932
|
-
stream.point(x2, y2);
|
|
933
|
-
resampleLineTo(x2, y2, lambda2, a, b, c, x12, y12, lambda1, a1, b1, c1, depth, stream);
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
return function(stream) {
|
|
938
|
-
var lambda00, x00, y00, a00, b00, c00, lambda0, x02, y02, a0, b0, c0;
|
|
939
|
-
var resampleStream = {
|
|
940
|
-
point,
|
|
941
|
-
lineStart,
|
|
942
|
-
lineEnd,
|
|
943
|
-
polygonStart: function() {
|
|
944
|
-
stream.polygonStart();
|
|
945
|
-
resampleStream.lineStart = ringStart;
|
|
946
|
-
},
|
|
947
|
-
polygonEnd: function() {
|
|
948
|
-
stream.polygonEnd();
|
|
949
|
-
resampleStream.lineStart = lineStart;
|
|
950
|
-
}
|
|
951
|
-
};
|
|
952
|
-
function point(x, y) {
|
|
953
|
-
x = project(x, y);
|
|
954
|
-
stream.point(x[0], x[1]);
|
|
955
|
-
}
|
|
956
|
-
function lineStart() {
|
|
957
|
-
x02 = NaN;
|
|
958
|
-
resampleStream.point = linePoint;
|
|
959
|
-
stream.lineStart();
|
|
960
|
-
}
|
|
961
|
-
function linePoint(lambda, phi) {
|
|
962
|
-
var c = cartesian([lambda, phi]), p = project(lambda, phi);
|
|
963
|
-
resampleLineTo(x02, y02, lambda0, a0, b0, c0, x02 = p[0], y02 = p[1], lambda0 = lambda, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);
|
|
964
|
-
stream.point(x02, y02);
|
|
965
|
-
}
|
|
966
|
-
function lineEnd() {
|
|
967
|
-
resampleStream.point = point;
|
|
968
|
-
stream.lineEnd();
|
|
969
|
-
}
|
|
970
|
-
function ringStart() {
|
|
971
|
-
lineStart();
|
|
972
|
-
resampleStream.point = ringPoint;
|
|
973
|
-
resampleStream.lineEnd = ringEnd;
|
|
974
|
-
}
|
|
975
|
-
function ringPoint(lambda, phi) {
|
|
976
|
-
linePoint(lambda00 = lambda, phi), x00 = x02, y00 = y02, a00 = a0, b00 = b0, c00 = c0;
|
|
977
|
-
resampleStream.point = linePoint;
|
|
978
|
-
}
|
|
979
|
-
function ringEnd() {
|
|
980
|
-
resampleLineTo(x02, y02, lambda0, a0, b0, c0, x00, y00, lambda00, a00, b00, c00, maxDepth, stream);
|
|
981
|
-
resampleStream.lineEnd = lineEnd;
|
|
982
|
-
lineEnd();
|
|
983
|
-
}
|
|
984
|
-
return resampleStream;
|
|
985
|
-
};
|
|
986
|
-
}
|
|
987
|
-
var transformRadians = transformer({
|
|
988
|
-
point: function(x, y) {
|
|
989
|
-
this.stream.point(x * radians, y * radians);
|
|
990
|
-
}
|
|
991
|
-
});
|
|
992
|
-
function projection(project) {
|
|
993
|
-
return projectionMutator(function() {
|
|
994
|
-
return project;
|
|
995
|
-
})();
|
|
996
|
-
}
|
|
997
|
-
function projectionMutator(projectAt) {
|
|
998
|
-
var project, k = 150, x = 480, y = 250, dx, dy, lambda = 0, phi = 0, deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, projectRotate, theta = null, preclip = clipAntimeridian, x02 = null, y02, x12, y12, postclip = identity, delta2 = 0.5, projectResample = resample(projectTransform, delta2), cache, cacheStream;
|
|
999
|
-
function projection2(point) {
|
|
1000
|
-
point = projectRotate(point[0] * radians, point[1] * radians);
|
|
1001
|
-
return [point[0] * k + dx, dy - point[1] * k];
|
|
1002
|
-
}
|
|
1003
|
-
function invert(point) {
|
|
1004
|
-
point = projectRotate.invert((point[0] - dx) / k, (dy - point[1]) / k);
|
|
1005
|
-
return point && [point[0] * degrees, point[1] * degrees];
|
|
1006
|
-
}
|
|
1007
|
-
function projectTransform(x2, y2) {
|
|
1008
|
-
return x2 = project(x2, y2), [x2[0] * k + dx, dy - x2[1] * k];
|
|
1009
|
-
}
|
|
1010
|
-
projection2.stream = function(stream) {
|
|
1011
|
-
return cache && cacheStream === stream ? cache : cache = transformRadians(preclip(rotate, projectResample(postclip(cacheStream = stream))));
|
|
1012
|
-
};
|
|
1013
|
-
projection2.clipAngle = function(_) {
|
|
1014
|
-
return arguments.length ? (preclip = +_ ? clipCircle(theta = _ * radians, 6 * radians) : (theta = null, clipAntimeridian), reset()) : theta * degrees;
|
|
1015
|
-
};
|
|
1016
|
-
projection2.clipExtent = function(_) {
|
|
1017
|
-
return arguments.length ? (postclip = _ == null ? (x02 = y02 = x12 = y12 = null, identity) : clipExtent(x02 = +_[0][0], y02 = +_[0][1], x12 = +_[1][0], y12 = +_[1][1]), reset()) : x02 == null ? null : [[x02, y02], [x12, y12]];
|
|
1018
|
-
};
|
|
1019
|
-
projection2.scale = function(_) {
|
|
1020
|
-
return arguments.length ? (k = +_, recenter()) : k;
|
|
1021
|
-
};
|
|
1022
|
-
projection2.translate = function(_) {
|
|
1023
|
-
return arguments.length ? (x = +_[0], y = +_[1], recenter()) : [x, y];
|
|
1024
|
-
};
|
|
1025
|
-
projection2.center = function(_) {
|
|
1026
|
-
return arguments.length ? (lambda = _[0] % 360 * radians, phi = _[1] % 360 * radians, recenter()) : [lambda * degrees, phi * degrees];
|
|
1027
|
-
};
|
|
1028
|
-
projection2.rotate = function(_) {
|
|
1029
|
-
return arguments.length ? (deltaLambda = _[0] % 360 * radians, deltaPhi = _[1] % 360 * radians, deltaGamma = _.length > 2 ? _[2] % 360 * radians : 0, recenter()) : [deltaLambda * degrees, deltaPhi * degrees, deltaGamma * degrees];
|
|
1030
|
-
};
|
|
1031
|
-
projection2.precision = function(_) {
|
|
1032
|
-
return arguments.length ? (projectResample = resample(projectTransform, delta2 = _ * _), reset()) : sqrt(delta2);
|
|
1033
|
-
};
|
|
1034
|
-
projection2.fitExtent = function(extent, object) {
|
|
1035
|
-
return fitExtent(projection2, extent, object);
|
|
1036
|
-
};
|
|
1037
|
-
projection2.fitSize = function(size, object) {
|
|
1038
|
-
return fitSize(projection2, size, object);
|
|
1039
|
-
};
|
|
1040
|
-
function recenter() {
|
|
1041
|
-
projectRotate = compose(rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma), project);
|
|
1042
|
-
var center = project(lambda, phi);
|
|
1043
|
-
dx = x - center[0] * k;
|
|
1044
|
-
dy = y + center[1] * k;
|
|
1045
|
-
return reset();
|
|
1046
|
-
}
|
|
1047
|
-
function reset() {
|
|
1048
|
-
cache = cacheStream = null;
|
|
1049
|
-
return projection2;
|
|
1050
|
-
}
|
|
1051
|
-
return function() {
|
|
1052
|
-
project = projectAt.apply(this, arguments);
|
|
1053
|
-
projection2.invert = project.invert && invert;
|
|
1054
|
-
return recenter();
|
|
1055
|
-
};
|
|
1056
|
-
}
|
|
1057
|
-
function azimuthalRaw(scale) {
|
|
1058
|
-
return function(x, y) {
|
|
1059
|
-
var cx = cos(x), cy = cos(y), k = scale(cx * cy);
|
|
1060
|
-
return [
|
|
1061
|
-
k * cy * sin(x),
|
|
1062
|
-
k * sin(y)
|
|
1063
|
-
];
|
|
1064
|
-
};
|
|
1065
|
-
}
|
|
1066
|
-
function azimuthalInvert(angle) {
|
|
1067
|
-
return function(x, y) {
|
|
1068
|
-
var z = sqrt(x * x + y * y), c = angle(z), sc = sin(c), cc = cos(c);
|
|
1069
|
-
return [
|
|
1070
|
-
atan2(x * sc, z * cc),
|
|
1071
|
-
asin(z && y * sc / z)
|
|
1072
|
-
];
|
|
1073
|
-
};
|
|
1074
|
-
}
|
|
1075
|
-
var azimuthalEqualAreaRaw = azimuthalRaw(function(cxcy) {
|
|
1076
|
-
return sqrt(2 / (1 + cxcy));
|
|
1077
|
-
});
|
|
1078
|
-
azimuthalEqualAreaRaw.invert = azimuthalInvert(function(z) {
|
|
1079
|
-
return 2 * asin(z / 2);
|
|
1080
|
-
});
|
|
1081
|
-
var azimuthalEquidistantRaw = azimuthalRaw(function(c) {
|
|
1082
|
-
return (c = acos(c)) && c / sin(c);
|
|
1083
|
-
});
|
|
1084
|
-
azimuthalEquidistantRaw.invert = azimuthalInvert(function(z) {
|
|
1085
|
-
return z;
|
|
1086
|
-
});
|
|
1087
|
-
function geoAzimuthalEquidistant() {
|
|
1088
|
-
return projection(azimuthalEquidistantRaw).scale(79.4188).clipAngle(180 - 1e-3);
|
|
1089
|
-
}
|
|
1090
|
-
function equirectangularRaw(lambda, phi) {
|
|
1091
|
-
return [lambda, phi];
|
|
1092
|
-
}
|
|
1093
|
-
equirectangularRaw.invert = equirectangularRaw;
|
|
1094
|
-
export { geoAzimuthalEquidistant as g };
|