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AIC,EAAI,EAAI,I,iEC5E7B,MAAM0sB,E","sources":["webpack://@amcharts/amcharts5/./src/.internal/charts/map/MapSeries.ts","webpack://@amcharts/amcharts5/./node_modules/d3-array/src/fsum.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/math.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/noop.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/stream.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/length.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/distance.js","webpack://@amcharts/amcharts5/./src/.internal/charts/map/MapLine.ts","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/interpolate.js","webpack://@amcharts/amcharts5/./src/.internal/charts/map/MapLineSeries.ts","webpack://@amcharts/amcharts5/./node_modules/d3-array/src/range.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/graticule.js","webpack://@amcharts/amcharts5/./src/.internal/charts/map/GraticuleSeries.ts","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/compose.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/rotation.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/clip/buffer.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/pointEqual.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/clip/rejoin.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/cartesian.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/polygonContains.js","webpack://@amcharts/amcharts5/./node_modules/d3-array/src/merge.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/clip/index.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/clip/antimeridian.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/constant.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/circle.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/clip/circle.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/clip/rectangle.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/clip/line.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/identity.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/transform.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/path/bounds.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/fit.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/resample.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/index.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/mercator.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/path/area.js","webpack://@amcharts/amcharts5/./src/.internal/charts/map/MapChartDefaultTheme.ts","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/path/centroid.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/path/context.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/path/measure.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/path/string.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/centroid.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/area.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/bounds.js","webpack://@amcharts/amcharts5/./src/.internal/charts/map/MapUtils.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/map/MapChart.ts","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/path/index.js","webpack://@amcharts/amcharts5/./src/.internal/charts/map/MapPointSeries.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/map/MapPolygon.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/map/MapPolygonSeries.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/map/ZoomControl.ts","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/orthographic.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/equirectangular.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/conicEqualArea.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/cylindricalEqualArea.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/conic.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/albersUsa.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/albers.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/azimuthal.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/equalEarth.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/naturalEarth1.js","webpack://@amcharts/amcharts5/./node_modules/polylabel/polylabel.js","webpack://@amcharts/amcharts5/./node_modules/tinyqueue/index.js","webpack://@amcharts/amcharts5/./tmp/webpack/map.js"],"sourcesContent":["import type { MapChart } from \"./MapChart\";\nimport type { GeoProjection, GeoPath } from \"d3-geo\";\n\nimport { Series, ISeriesSettings, ISeriesDataItem, ISeriesPrivate, ISeriesEvents } from \"../../core/render/Series\";\n\nimport * as $array from \"../../core/util/Array\";\nimport * as $object from \"../../core/util/Object\";\n\nexport interface IMapSeriesDataItem extends ISeriesDataItem {\n\tgeometry?: GeoJSON.Geometry;\n\tgeometryType?: GeoJSON.GeoJsonGeometryTypes;\n\tvalue?: number;\n}\n\nexport interface IMapSeriesSettings extends ISeriesSettings {\n\n\t/**\n\t * Map data in GeoJSON format.\n\t */\n\tgeoJSON?: GeoJSON.GeoJSON;\n\n\t/**\n\t * An array of map object ids from geodata to include in the map.\n\t *\n\t * If set, only those objects listed in `include` will be shown.\n\t */\n\tinclude?: Array;\n\n\t/**\n\t * An array of map object ids from geodata to omit when showing the map.\n\t */\n\texclude?: Array;\n\n\t/**\n\t * A field in series `data` that will hold map object's numeric value.\n\t *\n\t * It can be used in a number of places, e.g. tooltips, heat rules, etc.\n\t */\n\tvalueField?: string;\n\n\t/**\n\t * @ignore\n\t */\n\tgeometryField?: string;\n\n\t/**\n\t * @ignore\n\t */\n\tgeometryTypeField?: string;\n\n\t/**\n\t * Names of geodata items, such as countries, to replace by from loaded\n\t * geodata.\n\t *\n\t * Can be used to override built-in English names for countries.\n\t *\n\t * ```TypeScript\n\t * import am5geodata_lang_ES from '@amcharts5-geodata/lang/es';\n\t * // ...\n\t * map.geodataNames = am5geodata_lang_ES;\n\t * ```\n\t * ```JavaScript\n\t * map.geodataNames = am5geodata_lang_ES;\n\t * ```\n\t *\n\t * @since 5.1.13\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-translations/} for more info\n\t */\n\tgeodataNames?: { [index: string]: string };\n\n}\n\nexport interface IMapSeriesPrivate extends ISeriesPrivate {\n}\n\nexport interface IMapSeriesEvents extends ISeriesEvents {\n\n\t/**\n\t * Invoked when geodata is finished loading and processed.\n\t */\n\tgeodataprocessed: {};\n\n}\n\n/**\n * Base class for map series.\n */\nexport abstract class MapSeries extends Series {\n\tpublic static className: string = \"MapSeries\";\n\tpublic static classNames: Array = Series.classNames.concat([MapSeries.className]);\n\n\tdeclare public chart: MapChart | undefined;\n\tdeclare public _settings: IMapSeriesSettings;\n\tdeclare public _privateSettings: IMapSeriesPrivate;\n\tdeclare public _dataItemSettings: IMapSeriesDataItem;\n\tdeclare public _events: IMapSeriesEvents;\n\n\tprotected _types: Array = [];\n\n\tpublic _geometries: Array = [];\n\tprotected _geoJSONparsed: boolean = false;\n\n\tprotected _afterNew() {\n\t\tthis.fields.push(\"geometry\", \"geometryType\");\n\t\tthis._setRawDefault(\"geometryField\", \"geometry\");\n\t\tthis._setRawDefault(\"geometryTypeField\", \"geometryType\");\n\t\tthis._setRawDefault(\"idField\", \"id\");\n\n\t\tthis.on(\"geoJSON\", (geoJSON) => {\n\t\t\tlet previous = this._prevSettings.geoJSON;\n\t\t\tif (previous && previous != geoJSON) {\n\t\t\t\tthis.data.clear();\n\t\t\t}\n\t\t})\n\n\t\tsuper._afterNew();\n\t}\n\n\tpublic _prepareChildren() {\n\t\tsuper._prepareChildren();\n\n\t\tif (this._valuesDirty || this.isDirty(\"geoJSON\") || this.isDirty(\"include\") || this.isDirty(\"exclude\")) {\n\t\t\tconst geoJSON = this.get(\"geoJSON\");\n\t\t\tlet previous = this._prevSettings.geoJSON;\n\n\t\t\tif (previous && previous != geoJSON) {\n\t\t\t\tthis._prevSettings.geoJSON = undefined;\n\t\t\t\tthis._geoJSONparsed = false;\n\t\t\t}\n\n\t\t\tif (!this._geoJSONparsed) {\n\t\t\t\tthis._parseGeoJSON();\n\t\t\t\tthis._geoJSONparsed = true;\n\t\t\t}\n\n\t\t\tconst chart = this.chart;\n\t\t\tconst exclude = this.get(\"exclude\");\n\n\t\t\tif (exclude) {\n\t\t\t\tif (chart) {\n\t\t\t\t\tchart._centerLocation = null;\n\t\t\t\t}\n\t\t\t\t$array.each(exclude, (id) => {\n\t\t\t\t\tconst dataItem = this.getDataItemById(id);\n\t\t\t\t\tif (dataItem) {\n\t\t\t\t\t\tthis.disposeDataItem(dataItem);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tconst include = this.get(\"include\");\n\t\t\tif (include) {\n\t\t\t\tif (chart) {\n\t\t\t\t\tchart._centerLocation = null;\n\t\t\t\t}\n\t\t\t\t$array.each(this.dataItems, (dataItem) => {\n\t\t\t\t\tconst id = dataItem.get(\"id\");\n\t\t\t\t\tif (id && include.indexOf(id) == -1) {\n\t\t\t\t\t\tthis.disposeDataItem(dataItem);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected checkInclude(id: string, includes: string[] | undefined, excludes?: string[] | undefined): boolean {\n\t\tif (includes) {\n\t\t\tif (includes.length == 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (includes.indexOf(id) == -1) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (excludes && excludes.length > 0) {\n\t\t\tif (excludes.indexOf(id) != -1) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tprotected _parseGeoJSON() {\n\n\t\tconst geoJSON = this.get(\"geoJSON\");\n\t\tif (geoJSON) {\n\n\t\t\tlet features!: any[];\n\n\t\t\tif (geoJSON.type == \"FeatureCollection\") {\n\t\t\t\tfeatures = geoJSON.features;\n\t\t\t}\n\t\t\telse if (geoJSON.type == \"Feature\") {\n\t\t\t\tfeatures = [geoJSON];\n\t\t\t}\n\t\t\telse if ([\"Point\", \"LineString\", \"Polygon\", \"MultiPoint\", \"MultiLineString\", \"MultiPolygon\"].indexOf(geoJSON.type) != -1) {\n\t\t\t\tfeatures = [{ geometry: geoJSON }];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.log(\"nothing found in geoJSON\");\n\t\t\t}\n\n\t\t\tconst geodataNames = this.get(\"geodataNames\");\n\t\t\tif (features) {\n\n\t\t\t\tfor (let i = 0, len = features.length; i < len; i++) {\n\t\t\t\t\tlet feature: any = features[i];\n\t\t\t\t\tlet geometry: any = feature.geometry;\n\n\t\t\t\t\tif (geometry) {\n\t\t\t\t\t\tlet type = geometry.type;\n\t\t\t\t\t\tlet id: string = feature.id;\n\n\t\t\t\t\t\tif (geodataNames && geodataNames[id]) {\n\t\t\t\t\t\t\tfeature.properties.name = geodataNames[id];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (this._types.indexOf(type) != -1) {\n\t\t\t\t\t\t\tif (!this.checkInclude(id, this.get(\"include\"), this.get(\"exclude\"))) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tlet dataItem: any;\n\n\t\t\t\t\t\t\tif (id != null) {\n\t\t\t\t\t\t\t\t// find data object in user-provided data\n\t\t\t\t\t\t\t\tdataItem = $array.find(this.dataItems, (value: any) => {\n\t\t\t\t\t\t\t\t\treturn value.get(\"id\") == id;\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tlet dataObject: any;\n\n\t\t\t\t\t\t\tif (dataItem) {\n\t\t\t\t\t\t\t\tdataObject = dataItem.dataContext;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// create one if not found\n\t\t\t\t\t\t\tif (!dataItem) {\n\t\t\t\t\t\t\t\tdataObject = { geometry: geometry, geometryType: type, id: id, madeFromGeoData: true };\n\t\t\t\t\t\t\t\tthis.data.push(dataObject);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// in case found\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// if user-provided object doesn't have points data provided in any way:\n\t\t\t\t\t\t\t\tif (!dataObject.geometry) {\n\t\t\t\t\t\t\t\t\tdataObject.geometry = geometry;\n\t\t\t\t\t\t\t\t\tdataObject.geometryType = type;\n\t\t\t\t\t\t\t\t\tdataItem.set(\"geometry\", geometry);\n\t\t\t\t\t\t\t\t\tdataItem.set(\"geometryType\", type);\n\t\t\t\t\t\t\t\t\tthis.processDataItem(dataItem);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// copy properties data to datacontext\n\t\t\t\t\t\t\t$object.softCopyProperties(feature.properties, dataObject);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst type = \"geodataprocessed\";\n\t\t\tif (this.events.isEnabled(type)) {\n\t\t\t\tthis.events.dispatch(type, { type: type, target: this });\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic abstract markDirtyProjection(): void\n\n\tpublic _placeBulletsContainer(_chart: MapChart) {\n\t\tthis.children.moveValue(this.bulletsContainer);\n\t}\n\n\tpublic _removeBulletsContainer() {\n\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic projection(): GeoProjection | undefined {\n\t\tconst chart = this.chart;\n\t\tif (chart) {\n\t\t\treturn chart.get(\"projection\");\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic geoPath(): GeoPath | undefined {\n\t\tconst chart = this.chart;\n\t\tif (chart) {\n\t\t\treturn chart.getPrivate(\"geoPath\");\n\t\t}\n\t}\n\n\tprotected _addGeometry(geometry: any) {\n\t\tif (geometry) {\n\t\t\tthis._geometries.push(geometry);\n\n\t\t\tconst chart = this.chart;\n\t\t\tif (chart) {\n\t\t\t\tchart.markDirtyGeometries();\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _removeGeometry(geometry: any) {\n\t\tif (geometry) {\n\t\t\t$array.remove(this._geometries, geometry);\n\n\t\t\tconst chart = this.chart;\n\t\t\tif (chart) {\n\t\t\t\tchart.markDirtyGeometries();\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _dispose() {\n\t\tsuper._dispose();\n\n\t\tconst chart = this.chart;\n\t\tif (chart) {\n\t\t\tchart.series.removeValue(this);\n\t\t}\n\t}\n\n\tprotected _onDataClear() {\n\t\tsuper._onDataClear();\n\t\tthis._geoJSONparsed = false;\n\t}\n}\n","// https://github.com/python/cpython/blob/a74eea238f5baba15797e2e8b570d153bc8690a7/Modules/mathmodule.c#L1423\nexport class Adder {\n constructor() {\n this._partials = new Float64Array(32);\n this._n = 0;\n }\n add(x) {\n const p = this._partials;\n let i = 0;\n for (let j = 0; j < this._n && j < 32; j++) {\n const y = p[j],\n hi = x + y,\n lo = Math.abs(x) < Math.abs(y) ? x - (hi - y) : y - (hi - x);\n if (lo) p[i++] = lo;\n x = hi;\n }\n p[i] = x;\n this._n = i + 1;\n return this;\n }\n valueOf() {\n const p = this._partials;\n let n = this._n, x, y, lo, hi = 0;\n if (n > 0) {\n hi = p[--n];\n while (n > 0) {\n x = hi;\n y = p[--n];\n hi = x + y;\n lo = y - (hi - x);\n if (lo) break;\n }\n if (n > 0 && ((lo < 0 && p[n - 1] < 0) || (lo > 0 && p[n - 1] > 0))) {\n y = lo * 2;\n x = hi + y;\n if (y == x - hi) hi = x;\n }\n }\n return hi;\n }\n}\n\nexport function fsum(values, valueof) {\n const adder = new Adder();\n if (valueof === undefined) {\n for (let value of values) {\n if (value = +value) {\n adder.add(value);\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if (value = +valueof(value, ++index, values)) {\n adder.add(value);\n }\n }\n }\n return +adder;\n}\n\nexport function fcumsum(values, valueof) {\n const adder = new Adder();\n let index = -1;\n return Float64Array.from(values, valueof === undefined\n ? v => adder.add(+v || 0)\n : v => adder.add(+valueof(v, ++index, values) || 0)\n );\n}\n","export var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var quarterPi = pi / 4;\nexport var tau = pi * 2;\n\nexport var degrees = 180 / pi;\nexport var radians = pi / 180;\n\nexport var abs = Math.abs;\nexport var atan = Math.atan;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var ceil = Math.ceil;\nexport var exp = Math.exp;\nexport var floor = Math.floor;\nexport var hypot = Math.hypot;\nexport var log = Math.log;\nexport var pow = Math.pow;\nexport var sin = Math.sin;\nexport var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };\nexport var sqrt = Math.sqrt;\nexport var tan = Math.tan;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x);\n}\n\nexport function haversin(x) {\n return (x = sin(x / 2)) * x;\n}\n","export default function noop() {}\n","function streamGeometry(geometry, stream) {\n if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {\n streamGeometryType[geometry.type](geometry, stream);\n }\n}\n\nvar streamObjectType = {\n Feature: function(object, stream) {\n streamGeometry(object.geometry, stream);\n },\n FeatureCollection: function(object, stream) {\n var features = object.features, i = -1, n = features.length;\n while (++i < n) streamGeometry(features[i].geometry, stream);\n }\n};\n\nvar streamGeometryType = {\n Sphere: function(object, stream) {\n stream.sphere();\n },\n Point: function(object, stream) {\n object = object.coordinates;\n stream.point(object[0], object[1], object[2]);\n },\n MultiPoint: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) object = coordinates[i], stream.point(object[0], object[1], object[2]);\n },\n LineString: function(object, stream) {\n streamLine(object.coordinates, stream, 0);\n },\n MultiLineString: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamLine(coordinates[i], stream, 0);\n },\n Polygon: function(object, stream) {\n streamPolygon(object.coordinates, stream);\n },\n MultiPolygon: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamPolygon(coordinates[i], stream);\n },\n GeometryCollection: function(object, stream) {\n var geometries = object.geometries, i = -1, n = geometries.length;\n while (++i < n) streamGeometry(geometries[i], stream);\n }\n};\n\nfunction streamLine(coordinates, stream, closed) {\n var i = -1, n = coordinates.length - closed, coordinate;\n stream.lineStart();\n while (++i < n) coordinate = coordinates[i], stream.point(coordinate[0], coordinate[1], coordinate[2]);\n stream.lineEnd();\n}\n\nfunction streamPolygon(coordinates, stream) {\n var i = -1, n = coordinates.length;\n stream.polygonStart();\n while (++i < n) streamLine(coordinates[i], stream, 1);\n stream.polygonEnd();\n}\n\nexport default function(object, stream) {\n if (object && streamObjectType.hasOwnProperty(object.type)) {\n streamObjectType[object.type](object, stream);\n } else {\n streamGeometry(object, stream);\n }\n}\n","import {Adder} from \"d3-array\";\nimport {abs, atan2, cos, radians, sin, sqrt} from \"./math.js\";\nimport noop from \"./noop.js\";\nimport stream from \"./stream.js\";\n\nvar lengthSum,\n lambda0,\n sinPhi0,\n cosPhi0;\n\nvar lengthStream = {\n sphere: noop,\n point: noop,\n lineStart: lengthLineStart,\n lineEnd: noop,\n polygonStart: noop,\n polygonEnd: noop\n};\n\nfunction lengthLineStart() {\n lengthStream.point = lengthPointFirst;\n lengthStream.lineEnd = lengthLineEnd;\n}\n\nfunction lengthLineEnd() {\n lengthStream.point = lengthStream.lineEnd = noop;\n}\n\nfunction lengthPointFirst(lambda, phi) {\n lambda *= radians, phi *= radians;\n lambda0 = lambda, sinPhi0 = sin(phi), cosPhi0 = cos(phi);\n lengthStream.point = lengthPoint;\n}\n\nfunction lengthPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var sinPhi = sin(phi),\n cosPhi = cos(phi),\n delta = abs(lambda - lambda0),\n cosDelta = cos(delta),\n sinDelta = sin(delta),\n x = cosPhi * sinDelta,\n y = cosPhi0 * sinPhi - sinPhi0 * cosPhi * cosDelta,\n z = sinPhi0 * sinPhi + cosPhi0 * cosPhi * cosDelta;\n lengthSum.add(atan2(sqrt(x * x + y * y), z));\n lambda0 = lambda, sinPhi0 = sinPhi, cosPhi0 = cosPhi;\n}\n\nexport default function(object) {\n lengthSum = new Adder();\n stream(object, lengthStream);\n return +lengthSum;\n}\n","import length from \"./length.js\";\n\nvar coordinates = [null, null],\n object = {type: \"LineString\", coordinates: coordinates};\n\nexport default function(a, b) {\n coordinates[0] = a;\n coordinates[1] = b;\n return length(object);\n}\n","import type { MapLineSeries, IMapLineSeriesDataItem } from \"./MapLineSeries\";\nimport type { IGeoPoint } from \"../../core/util/IGeoPoint\";\nimport type { DataItem } from \"../../core/render/Component\";\n\n\nimport { Graphics, IGraphicsSettings, IGraphicsPrivate } from \"../../core/render/Graphics\";\nimport { geoLength, geoInterpolate, geoDistance } from \"d3-geo\";\n\nexport interface IMapLineSettings extends IGraphicsSettings {\n\n\t/**\n\t * A GeoJSON representation of the polygons geometry.\n\t */\n\tgeometry?: GeoJSON.LineString | GeoJSON.MultiLineString;\n\n\t/**\n\t * @todo needs description\n\t * @default 0.5\n\t */\n\tprecision?: number;\n}\n\nexport interface IMapLinePrivate extends IGraphicsPrivate {\n\n\t/**\n\t * @ignore\n\t */\n\tseries: MapLineSeries;\n\n}\n\n/**\n * A line object in a [[MapLineSeries]].\n */\nexport class MapLine extends Graphics {\n\n\tdeclare public _settings: IMapLineSettings;\n\tdeclare public _privateSettings: IMapLinePrivate;\n\n\tpublic static className: string = \"MapLine\";\n\tpublic static classNames: Array = Graphics.classNames.concat([MapLine.className]);\n\tprotected _projectionDirty: boolean = false;\n\n\tpublic _beforeChanged() {\n\t\tsuper._beforeChanged();\n\n\t\tif (this._projectionDirty || this.isDirty(\"geometry\") || this.isDirty(\"precision\")) {\n\t\t\tconst geometry = this.get(\"geometry\")!;\n\t\t\tif (geometry) {\n\t\t\t\tconst series = this.getPrivate(\"series\");\n\t\t\t\tif (series) {\n\t\t\t\t\tconst chart = series.chart;\n\t\t\t\t\tif (chart) {\n\t\t\t\t\t\tconst projection = chart.get(\"projection\");\n\t\t\t\t\t\tlet clipAngle: number | null = null;\n\n\t\t\t\t\t\tif (projection) {\n\t\t\t\t\t\t\tclipAngle = projection.clipAngle();\n\t\t\t\t\t\t\tprojection.precision(this.get(\"precision\", 0.5));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst dataItem = this.dataItem as DataItem;\n\t\t\t\t\t\tconst geoPath = chart.getPrivate(\"geoPath\");\n\t\t\t\t\t\tif (geoPath && dataItem) {\n\t\t\t\t\t\t\tthis._clear = true;\n\t\t\t\t\t\t\tif (dataItem.get(\"lineType\", series.get(\"lineType\")) == \"straight\") {\n\n\t\t\t\t\t\t\t\tconst geometry = this.get(\"geometry\")!;\n\n\t\t\t\t\t\t\t\tif (geometry) {\n\t\t\t\t\t\t\t\t\tlet coordinates = geometry.coordinates;\n\t\t\t\t\t\t\t\t\tif (coordinates) {\n\n\t\t\t\t\t\t\t\t\t\tlet segments!: number[][][];\n\n\t\t\t\t\t\t\t\t\t\tif (geometry.type == \"LineString\") {\n\t\t\t\t\t\t\t\t\t\t\tsegments = [coordinates] as number[][][];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if (geometry.type == \"MultiLineString\") {\n\t\t\t\t\t\t\t\t\t\t\tsegments = coordinates as number[][][];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tthis.set(\"draw\", (display) => {\n\t\t\t\t\t\t\t\t\t\t\tfor (let s = 0; s < segments.length; s++) {\n\t\t\t\t\t\t\t\t\t\t\t\tlet segment = segments[s];\n\t\t\t\t\t\t\t\t\t\t\t\tif (segment.length > 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst gp0 = segment[0];\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst p0 = chart.convert({ longitude: gp0[0], latitude: gp0[1] })\n\t\t\t\t\t\t\t\t\t\t\t\t\tdisplay.lineTo(p0.x, p0.y);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor (let p = 0; p < segment.length; p++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst gp = segment[p];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst pn = chart.convert({ longitude: gp[0], latitude: gp[1] })\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisplay.lineTo(pn.x, pn.y);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tthis.set(\"draw\", (_display) => {\n\t\t\t\t\t\t\t\t\tif (projection && series.get(\"clipBack\") === false) {\n\t\t\t\t\t\t\t\t\t\tprojection.clipAngle(180);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tgeoPath.context(this._display as any);\n\t\t\t\t\t\t\t\t\tgeoPath(geometry);\n\t\t\t\t\t\t\t\t\tgeoPath.context(null);\n\n\t\t\t\t\t\t\t\t\tif (projection) {\n\t\t\t\t\t\t\t\t\t\tprojection.clipAngle(clipAngle as any);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic markDirtyProjection() {\n\t\tthis.markDirty();\n\t\tthis._projectionDirty = true;\n\t}\n\n\tpublic _clearDirty() {\n\t\tsuper._clearDirty();\n\t\tthis._projectionDirty = false;\n\t}\n\n\t/**\n\t * Converts relative position along the line (0-1) into pixel coordinates.\n\t *\n\t * @param position Position (0-1)\n\t * @return Coordinates\n\t */\n\tpublic positionToGeoPoint(position: number): IGeoPoint {\n\n\t\tconst geometry = this.get(\"geometry\")!;\n\t\tconst series = this.getPrivate(\"series\");\n\t\tconst chart = series.chart;\n\t\tconst dataItem = this.dataItem as DataItem;\n\n\t\tif (geometry && series && chart && dataItem) {\n\t\t\tconst lineType = dataItem.get(\"lineType\", series.get(\"lineType\"));\n\t\t\tlet totalDistance: number = geoLength(geometry);\n\t\t\tlet currentDistance: number = 0;\n\n\t\t\tlet distanceAB: number;\n\t\t\tlet positionA: number = 0;\n\t\t\tlet positionB: number = 0;\n\t\t\tlet pointA!: [number, number];\n\t\t\tlet pointB!: [number, number];\n\n\t\t\tlet coordinates = geometry.coordinates;\n\t\t\tif (coordinates) {\n\t\t\t\tlet segments!: number[][][];\n\n\t\t\t\tif (geometry.type == \"LineString\") {\n\t\t\t\t\tsegments = [coordinates] as number[][][];\n\t\t\t\t}\n\t\t\t\telse if (geometry.type == \"MultiLineString\") {\n\t\t\t\t\tsegments = coordinates as number[][][];\n\t\t\t\t}\n\n\t\t\t\tfor (let s = 0; s < segments.length; s++) {\n\t\t\t\t\tlet segment = segments[s];\n\t\t\t\t\tif (segment.length > 1) {\n\t\t\t\t\t\tfor (let p = 1; p < segment.length; p++) {\n\t\t\t\t\t\t\tpointA = segment[p - 1] as [number, number];\n\t\t\t\t\t\t\tpointB = segment[p] as [number, number];\n\n\t\t\t\t\t\t\tpositionA = currentDistance / totalDistance;\n\t\t\t\t\t\t\tdistanceAB = geoDistance(pointA, pointB);\n\t\t\t\t\t\t\tcurrentDistance += distanceAB;\n\t\t\t\t\t\t\tpositionB = currentDistance / totalDistance;\n\n\t\t\t\t\t\t\tif (positionA <= position && positionB > position) {\n\t\t\t\t\t\t\t\ts = segments.length;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (segment.length == 1) {\n\t\t\t\t\t\tpointA = segment[0] as [number, number];\n\t\t\t\t\t\tpointB = segment[0] as [number, number];\n\t\t\t\t\t\tpositionA = 0;\n\t\t\t\t\t\tpositionB = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (pointA && pointB) {\n\t\t\t\t\tlet positionAB: number = (position - positionA) / (positionB - positionA);\n\t\t\t\t\tlet location: number[];\n\n\t\t\t\t\tif (lineType == \"straight\") {\n\t\t\t\t\t\tlet p0 = chart.convert({ longitude: pointA[0], latitude: pointA[1] });\n\t\t\t\t\t\tlet p1 = chart.convert({ longitude: pointB[0], latitude: pointB[1] });\n\n\t\t\t\t\t\tlet x = p0.x + (p1.x - p0.x) * positionAB;\n\t\t\t\t\t\tlet y = p0.y + (p1.y - p0.y) * positionAB;\n\n\t\t\t\t\t\treturn chart.invert({ x: x, y: y });\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tlocation = geoInterpolate(pointA, pointB)(positionAB);\n\t\t\t\t\t\treturn { longitude: location[0], latitude: location[1] }\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { longitude: 0, latitude: 0 };\n\t}\n}\n","import {asin, atan2, cos, degrees, haversin, radians, sin, sqrt} from \"./math.js\";\n\nexport default function(a, b) {\n var x0 = a[0] * radians,\n y0 = a[1] * radians,\n x1 = b[0] * radians,\n y1 = b[1] * radians,\n cy0 = cos(y0),\n sy0 = sin(y0),\n cy1 = cos(y1),\n sy1 = sin(y1),\n kx0 = cy0 * cos(x0),\n ky0 = cy0 * sin(x0),\n kx1 = cy1 * cos(x1),\n ky1 = cy1 * sin(x1),\n d = 2 * asin(sqrt(haversin(y1 - y0) + cy0 * cy1 * haversin(x1 - x0))),\n k = sin(d);\n\n var interpolate = d ? function(t) {\n var B = sin(t *= d) / k,\n A = sin(d - t) / k,\n x = A * kx0 + B * kx1,\n y = A * ky0 + B * ky1,\n z = A * sy0 + B * sy1;\n return [\n atan2(y, x) * degrees,\n atan2(z, sqrt(x * x + y * y)) * degrees\n ];\n } : function() {\n return [x0 * degrees, y0 * degrees];\n };\n\n interpolate.distance = d;\n\n return interpolate;\n}\n","import type { IMapPointSeriesDataItem } from \"./MapPointSeries\";\nimport type { DataItem } from \"../../core/render/Component\";\n\nimport { MapSeries, IMapSeriesSettings, IMapSeriesDataItem, IMapSeriesPrivate } from \"./MapSeries\";\nimport { MapLine } from \"./MapLine\";\nimport { ListTemplate } from \"../../core/util/List\";\nimport { Template } from \"../../core/util/Template\";\n\nimport * as $array from \"../../core/util/Array\";\n\n/**\n * @ignore\n */\nexport interface IMapLineSeriesPrivate extends IMapSeriesPrivate {\t\n}\n\nexport interface IMapLineSeriesDataItem extends IMapSeriesDataItem {\n\n\t/**\n\t * Related [[MapLine]] object.\n\t */\n\tmapLine?: MapLine;\n\n\t/**\n\t * GeoJSON geometry of the line.\n\t */\n\tgeometry?: GeoJSON.LineString | GeoJSON.MultiLineString;\n\n\t/**\n\t * An array of data items from [[MapPointSeries]] to use as line end-points.\n\t */\n\tpointsToConnect?: Array>;\n\n\t/**\n\t * A line type.\n\t *\n\t * * `\"curved\"` (default) - connects points using shortest distance, which will result in curved lines based on map projection.\n\t * * `\"straight\"` - connects points using visually straight lines, and will not cross the -180/180 longitude.\n\t * \n\t * @default \"curved\"\n\t * @since 5.2.32\n\t */\n\tlineType?: \"curved\" | \"straight\"\t\n\n}\n\nexport interface IMapLineSeriesSettings extends IMapSeriesSettings {\n\n\t/**\n\t * If set to `true` will hide line segments that are in the invisible range\n\t * of the map.\n\t *\n\t * For example on the side of the globe facing away from the viewer when\n\t * used with Orthographic projection.\n\t *\n\t * NOTE: not all projections have invisible side.\n\t */\n\tclipBack?: boolean;\n\n\t/**\n\t * A line type.\n\t *\n\t * * `\"curved\"` (default) - connects points using shortest distance, which will result in curved lines based on map projection.\n\t * * `\"straight\"` - connects points using visually straight lines, and will not cross the -180/180 longitude.\n\t * \n\t * @default \"curved\"\n\t * @since 5.2.24\n\t */\n\tlineType?: \"curved\" | \"straight\"\n\n\n\t/**\n\t * @ignore\n\t */\n\tlineTypeField?: string;\n}\n\n/**\n * Creates a map series for displaying lines on the map.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-line-series/} for more info\n * @important\n */\nexport class MapLineSeries extends MapSeries {\n\n\tprotected _afterNew() {\n\t\tthis.fields.push(\"lineType\");\n\t\tthis._setRawDefault(\"lineTypeField\", \"lineType\");\n\t\tsuper._afterNew();\n\t}\t\n\n\t/**\n\t * @ignore\n\t */\n\tpublic makeMapLine(dataItem: DataItem): MapLine {\n\t\tconst mapLine = this.children.push(this.mapLines.make());\n\t\tmapLine._setDataItem(dataItem);\n\t\tthis.mapLines.push(mapLine);\n\t\treturn mapLine;\n\t}\n\n\t/**\n\t * A [[ListTemplate]] of all lines in series.\n\t *\n\t * `mapLines.template` can also be used to configure lines.\n\t *\n\t * @default new ListTemplate\n\t */\n\tpublic readonly mapLines: ListTemplate = new ListTemplate(\n\t\tTemplate.new({}),\n\t\t() => MapLine._new(this._root, {}, [this.mapLines.template])\n\t);\n\n\tpublic static className: string = \"MapLineSeries\";\n\tpublic static classNames: Array = MapSeries.classNames.concat([MapLineSeries.className]);\n\n\tdeclare public _settings: IMapLineSeriesSettings;\n\tdeclare public _privateSettings: IMapLineSeriesPrivate;\n\tdeclare public _dataItemSettings: IMapLineSeriesDataItem;\n\n\tprotected _types: Array = [\"LineString\", \"MultiLineString\"];\n\n\t/**\n\t * @ignore\n\t */\n\tpublic markDirtyProjection() {\n\t\t$array.each(this.dataItems, (dataItem) => {\n\t\t\tlet mapLine = dataItem.get(\"mapLine\");\n\t\t\tif (mapLine) {\n\t\t\t\tmapLine.markDirtyProjection();\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic _prepareChildren() {\n\t\tsuper._prepareChildren();\n\n\t\tif (this.isDirty(\"stroke\")) {\n\t\t\tthis.mapLines.template.set(\"stroke\", this.get(\"stroke\"));\n\t\t}\n\t}\n\n\tprotected processDataItem(dataItem: DataItem) {\n\t\tsuper.processDataItem(dataItem);\n\n\t\tlet mapLine = dataItem.get(\"mapLine\");\n\t\tif (!mapLine) {\n\t\t\tmapLine = this.makeMapLine(dataItem);\n\t\t}\n\n\t\tthis._handlePointsToConnect(dataItem);\n\t\tdataItem.on(\"pointsToConnect\", () => {\n\t\t\tthis._handlePointsToConnect(dataItem);\n\t\t})\n\n\t\tdataItem.set(\"mapLine\", mapLine);\n\n\n\t\tmapLine.setPrivate(\"series\", this);\n\t}\n\n\tprotected _handlePointsToConnect(dataItem: DataItem) {\n\n\t\tconst pointsToConnect = dataItem.get(\"pointsToConnect\");\n\t\tif (pointsToConnect) {\n\t\t\t$array.each(pointsToConnect, (point) => {\n\n\t\t\t\tpoint.on(\"geometry\", () => {\n\t\t\t\t\tthis.markDirtyValues(dataItem);\n\t\t\t\t})\n\n\t\t\t\tpoint.on(\"longitude\", () => {\n\t\t\t\t\tthis.markDirtyValues(dataItem);\n\t\t\t\t})\n\n\t\t\t\tpoint.on(\"latitude\", () => {\n\t\t\t\t\tthis.markDirtyValues(dataItem);\n\t\t\t\t})\n\t\t\t})\n\n\t\t\tthis.markDirtyValues(dataItem);\n\t\t}\n\t}\n\n\t/**\n\t * Forces a repaint of the element which relies on data.\n\t *\n\t * @since 5.0.21\n\t */\n\tpublic markDirtyValues(dataItem: DataItem) {\n\t\tsuper.markDirtyValues();\n\t\tif (dataItem) {\n\t\t\tconst mapLine = dataItem.get(\"mapLine\");\n\t\t\tif (mapLine) {\n\t\t\t\tconst pointsToConnect = dataItem.get(\"pointsToConnect\");\n\t\t\t\tif (pointsToConnect) {\n\t\t\t\t\tlet coordinates: Array> = [];\n\t\t\t\t\t$array.each(pointsToConnect, (point) => {\n\t\t\t\t\t\tconst longitude = point.get(\"longitude\");\n\t\t\t\t\t\tconst latitude = point.get(\"latitude\");\n\t\t\t\t\t\tif (longitude != null && latitude != null) {\n\t\t\t\t\t\t\tcoordinates.push([longitude, latitude]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tconst geometry = point.get(\"geometry\");\n\t\t\t\t\t\t\tif (geometry) {\n\t\t\t\t\t\t\t\tconst coords = geometry.coordinates;\n\t\t\t\t\t\t\t\tif (coords) {\n\t\t\t\t\t\t\t\t\tcoordinates.push([coords[0] as any, coords[1] as any]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\n\t\t\t\t\tlet geometry: any = { type: \"LineString\", coordinates: coordinates };\n\n\t\t\t\t\tdataItem.setRaw(\"geometry\", geometry);\n\t\t\t\t\tmapLine.set(\"geometry\", geometry);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmapLine.set(\"geometry\", dataItem.get(\"geometry\"));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic disposeDataItem(dataItem: DataItem) {\n\t\tsuper.disposeDataItem(dataItem);\n\t\tconst mapLine = dataItem.get(\"mapLine\");\n\t\tif (mapLine) {\n\t\t\tthis.mapLines.removeValue(mapLine);\n\t\t\tmapLine.dispose();\n\t\t}\n\t}\n}\n","export default function range(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n","import {range} from \"d3-array\";\nimport {abs, ceil, epsilon} from \"./math.js\";\n\nfunction graticuleX(y0, y1, dy) {\n var y = range(y0, y1 - epsilon, dy).concat(y1);\n return function(x) { return y.map(function(y) { return [x, y]; }); };\n}\n\nfunction graticuleY(x0, x1, dx) {\n var x = range(x0, x1 - epsilon, dx).concat(x1);\n return function(y) { return x.map(function(x) { return [x, y]; }); };\n}\n\nexport default function graticule() {\n var x1, x0, X1, X0,\n y1, y0, Y1, Y0,\n dx = 10, dy = dx, DX = 90, DY = 360,\n x, y, X, Y,\n precision = 2.5;\n\n function graticule() {\n return {type: \"MultiLineString\", coordinates: lines()};\n }\n\n function lines() {\n return range(ceil(X0 / DX) * DX, X1, DX).map(X)\n .concat(range(ceil(Y0 / DY) * DY, Y1, DY).map(Y))\n .concat(range(ceil(x0 / dx) * dx, x1, dx).filter(function(x) { return abs(x % DX) > epsilon; }).map(x))\n .concat(range(ceil(y0 / dy) * dy, y1, dy).filter(function(y) { return abs(y % DY) > epsilon; }).map(y));\n }\n\n graticule.lines = function() {\n return lines().map(function(coordinates) { return {type: \"LineString\", coordinates: coordinates}; });\n };\n\n graticule.outline = function() {\n return {\n type: \"Polygon\",\n coordinates: [\n X(X0).concat(\n Y(Y1).slice(1),\n X(X1).reverse().slice(1),\n Y(Y0).reverse().slice(1))\n ]\n };\n };\n\n graticule.extent = function(_) {\n if (!arguments.length) return graticule.extentMinor();\n return graticule.extentMajor(_).extentMinor(_);\n };\n\n graticule.extentMajor = function(_) {\n if (!arguments.length) return [[X0, Y0], [X1, Y1]];\n X0 = +_[0][0], X1 = +_[1][0];\n Y0 = +_[0][1], Y1 = +_[1][1];\n if (X0 > X1) _ = X0, X0 = X1, X1 = _;\n if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _;\n return graticule.precision(precision);\n };\n\n graticule.extentMinor = function(_) {\n if (!arguments.length) return [[x0, y0], [x1, y1]];\n x0 = +_[0][0], x1 = +_[1][0];\n y0 = +_[0][1], y1 = +_[1][1];\n if (x0 > x1) _ = x0, x0 = x1, x1 = _;\n if (y0 > y1) _ = y0, y0 = y1, y1 = _;\n return graticule.precision(precision);\n };\n\n graticule.step = function(_) {\n if (!arguments.length) return graticule.stepMinor();\n return graticule.stepMajor(_).stepMinor(_);\n };\n\n graticule.stepMajor = function(_) {\n if (!arguments.length) return [DX, DY];\n DX = +_[0], DY = +_[1];\n return graticule;\n };\n\n graticule.stepMinor = function(_) {\n if (!arguments.length) return [dx, dy];\n dx = +_[0], dy = +_[1];\n return graticule;\n };\n\n graticule.precision = function(_) {\n if (!arguments.length) return precision;\n precision = +_;\n x = graticuleX(y0, y1, 90);\n y = graticuleY(x0, x1, precision);\n X = graticuleX(Y0, Y1, 90);\n Y = graticuleY(X0, X1, precision);\n return graticule;\n };\n\n return graticule\n .extentMajor([[-180, -90 + epsilon], [180, 90 - epsilon]])\n .extentMinor([[-180, -80 - epsilon], [180, 80 + epsilon]]);\n}\n\nexport function graticule10() {\n return graticule()();\n}\n","import { MapLineSeries, IMapLineSeriesSettings, IMapLineSeriesPrivate, IMapLineSeriesDataItem } from \"./MapLineSeries\";\nimport type { DataItem } from \"../../core/render/Component\";\nimport { geoGraticule } from \"d3-geo\";\n\n\nexport interface IGraticuleSeriesDataItem extends IMapLineSeriesDataItem {\n}\n\nexport interface IGraticuleSeriesPrivate extends IMapLineSeriesPrivate {\n}\n\nexport interface IGraticuleSeriesSettings extends IMapLineSeriesSettings {\n\n\t/**\n\t * Place a grid line every Xth latitude/longitude.\n\t *\n\t * @default 10\n\t */\n\tstep?: number;\n}\n\n/**\n * A [[MapChart]] series to draw a map grid.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/graticule-series/} for more info\n * @important\n */\nexport class GraticuleSeries extends MapLineSeries {\n\n\tpublic static className: string = \"GraticuleSeries\";\n\tpublic static classNames: Array = MapLineSeries.classNames.concat([GraticuleSeries.className]);\n\n\tdeclare public _settings: IGraticuleSeriesSettings;\n\tdeclare public _privateSettings: IGraticuleSeriesPrivate;\n\n\tprotected _dataItem: DataItem = this.makeDataItem({});\n\n\tprotected _afterNew() {\n\t\tsuper._afterNew();\n\t\tthis.dataItems.push(this._dataItem);\n\t\tthis._generate();\n\t}\n\n\tpublic _updateChildren() {\n\t\tsuper._updateChildren();\n\n\t\tif (this.isDirty(\"step\")) {\n\t\t\tthis._generate();\n\t\t}\n\t}\n\n\tprotected _generate() {\n\t\tlet graticule = geoGraticule();\n\n\t\tif (graticule) {\n\t\t\tconst step = this.get(\"step\", 10);\n\n\t\t\tgraticule.stepMinor([360, 360]);\n\t\t\tgraticule.stepMajor([step, step]);\n\t\t\tthis._dataItem.set(\"geometry\", graticule());\n\t\t}\n\t}\n}\n","export default function(a, b) {\n\n function compose(x, y) {\n return x = a(x, y), b(x[0], x[1]);\n }\n\n if (a.invert && b.invert) compose.invert = function(x, y) {\n return x = b.invert(x, y), x && a.invert(x[0], x[1]);\n };\n\n return compose;\n}\n","import compose from \"./compose.js\";\nimport {abs, asin, atan2, cos, degrees, pi, radians, sin, tau} from \"./math.js\";\n\nfunction rotationIdentity(lambda, phi) {\n return [abs(lambda) > pi ? lambda + Math.round(-lambda / tau) * tau : lambda, phi];\n}\n\nrotationIdentity.invert = rotationIdentity;\n\nexport function rotateRadians(deltaLambda, deltaPhi, deltaGamma) {\n return (deltaLambda %= tau) ? (deltaPhi || deltaGamma ? compose(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma))\n : rotationLambda(deltaLambda))\n : (deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma)\n : rotationIdentity);\n}\n\nfunction forwardRotationLambda(deltaLambda) {\n return function(lambda, phi) {\n return lambda += deltaLambda, [lambda > pi ? lambda - tau : lambda < -pi ? lambda + tau : lambda, phi];\n };\n}\n\nfunction rotationLambda(deltaLambda) {\n var rotation = forwardRotationLambda(deltaLambda);\n rotation.invert = forwardRotationLambda(-deltaLambda);\n return rotation;\n}\n\nfunction rotationPhiGamma(deltaPhi, deltaGamma) {\n var cosDeltaPhi = cos(deltaPhi),\n sinDeltaPhi = sin(deltaPhi),\n cosDeltaGamma = cos(deltaGamma),\n sinDeltaGamma = sin(deltaGamma);\n\n function rotation(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaPhi + x * sinDeltaPhi;\n return [\n atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi),\n asin(k * cosDeltaGamma + y * sinDeltaGamma)\n ];\n }\n\n rotation.invert = function(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaGamma - y * sinDeltaGamma;\n return [\n atan2(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi),\n asin(k * cosDeltaPhi - x * sinDeltaPhi)\n ];\n };\n\n return rotation;\n}\n\nexport default function(rotate) {\n rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0);\n\n function forward(coordinates) {\n coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n }\n\n forward.invert = function(coordinates) {\n coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n };\n\n return forward;\n}\n","import noop from \"../noop.js\";\n\nexport default function() {\n var lines = [],\n line;\n return {\n point: function(x, y, m) {\n line.push([x, y, m]);\n },\n lineStart: function() {\n lines.push(line = []);\n },\n lineEnd: noop,\n rejoin: function() {\n if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));\n },\n result: function() {\n var result = lines;\n lines = [];\n line = null;\n return result;\n }\n };\n}\n","import {abs, epsilon} from \"./math.js\";\n\nexport default function(a, b) {\n return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon;\n}\n","import pointEqual from \"../pointEqual.js\";\nimport {epsilon} from \"../math.js\";\n\nfunction Intersection(point, points, other, entry) {\n this.x = point;\n this.z = points;\n this.o = other; // another intersection\n this.e = entry; // is an entry?\n this.v = false; // visited\n this.n = this.p = null; // next & previous\n}\n\n// A generalized polygon clipping algorithm: given a polygon that has been cut\n// into its visible line segments, and rejoins the segments by interpolating\n// along the clip edge.\nexport default function(segments, compareIntersection, startInside, interpolate, stream) {\n var subject = [],\n clip = [],\n i,\n n;\n\n segments.forEach(function(segment) {\n if ((n = segment.length - 1) <= 0) return;\n var n, p0 = segment[0], p1 = segment[n], x;\n\n if (pointEqual(p0, p1)) {\n if (!p0[2] && !p1[2]) {\n stream.lineStart();\n for (i = 0; i < n; ++i) stream.point((p0 = segment[i])[0], p0[1]);\n stream.lineEnd();\n return;\n }\n // handle degenerate cases by moving the point\n p1[0] += 2 * epsilon;\n }\n\n subject.push(x = new Intersection(p0, segment, null, true));\n clip.push(x.o = new Intersection(p0, null, x, false));\n subject.push(x = new Intersection(p1, segment, null, false));\n clip.push(x.o = new Intersection(p1, null, x, true));\n });\n\n if (!subject.length) return;\n\n clip.sort(compareIntersection);\n link(subject);\n link(clip);\n\n for (i = 0, n = clip.length; i < n; ++i) {\n clip[i].e = startInside = !startInside;\n }\n\n var start = subject[0],\n points,\n point;\n\n while (1) {\n // Find first unvisited intersection.\n var current = start,\n isSubject = true;\n while (current.v) if ((current = current.n) === start) return;\n points = current.z;\n stream.lineStart();\n do {\n current.v = current.o.v = true;\n if (current.e) {\n if (isSubject) {\n for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.n.x, 1, stream);\n }\n current = current.n;\n } else {\n if (isSubject) {\n points = current.p.z;\n for (i = points.length - 1; i >= 0; --i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.p.x, -1, stream);\n }\n current = current.p;\n }\n current = current.o;\n points = current.z;\n isSubject = !isSubject;\n } while (!current.v);\n stream.lineEnd();\n }\n}\n\nfunction link(array) {\n if (!(n = array.length)) return;\n var n,\n i = 0,\n a = array[0],\n b;\n while (++i < n) {\n a.n = b = array[i];\n b.p = a;\n a = b;\n }\n a.n = b = array[0];\n b.p = a;\n}\n","import {asin, atan2, cos, sin, sqrt} from \"./math.js\";\n\nexport function spherical(cartesian) {\n return [atan2(cartesian[1], cartesian[0]), asin(cartesian[2])];\n}\n\nexport function cartesian(spherical) {\n var lambda = spherical[0], phi = spherical[1], cosPhi = cos(phi);\n return [cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)];\n}\n\nexport function cartesianDot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n\nexport function cartesianCross(a, b) {\n 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]];\n}\n\n// TODO return a\nexport function cartesianAddInPlace(a, b) {\n a[0] += b[0], a[1] += b[1], a[2] += b[2];\n}\n\nexport function cartesianScale(vector, k) {\n return [vector[0] * k, vector[1] * k, vector[2] * k];\n}\n\n// TODO return d\nexport function cartesianNormalizeInPlace(d) {\n var l = sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);\n d[0] /= l, d[1] /= l, d[2] /= l;\n}\n","import {Adder} from \"d3-array\";\nimport {cartesian, cartesianCross, cartesianNormalizeInPlace} from \"./cartesian.js\";\nimport {abs, asin, atan2, cos, epsilon, epsilon2, halfPi, pi, quarterPi, sign, sin, tau} from \"./math.js\";\n\nfunction longitude(point) {\n return abs(point[0]) <= pi ? point[0] : sign(point[0]) * ((abs(point[0]) + pi) % tau - pi);\n}\n\nexport default function(polygon, point) {\n var lambda = longitude(point),\n phi = point[1],\n sinPhi = sin(phi),\n normal = [sin(lambda), -cos(lambda), 0],\n angle = 0,\n winding = 0;\n\n var sum = new Adder();\n\n if (sinPhi === 1) phi = halfPi + epsilon;\n else if (sinPhi === -1) phi = -halfPi - epsilon;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n if (!(m = (ring = polygon[i]).length)) continue;\n var ring,\n m,\n point0 = ring[m - 1],\n lambda0 = longitude(point0),\n phi0 = point0[1] / 2 + quarterPi,\n sinPhi0 = sin(phi0),\n cosPhi0 = cos(phi0);\n\n for (var j = 0; j < m; ++j, lambda0 = lambda1, sinPhi0 = sinPhi1, cosPhi0 = cosPhi1, point0 = point1) {\n var point1 = ring[j],\n lambda1 = longitude(point1),\n phi1 = point1[1] / 2 + quarterPi,\n sinPhi1 = sin(phi1),\n cosPhi1 = cos(phi1),\n delta = lambda1 - lambda0,\n sign = delta >= 0 ? 1 : -1,\n absDelta = sign * delta,\n antimeridian = absDelta > pi,\n k = sinPhi0 * sinPhi1;\n\n sum.add(atan2(k * sign * sin(absDelta), cosPhi0 * cosPhi1 + k * cos(absDelta)));\n angle += antimeridian ? delta + sign * tau : delta;\n\n // Are the longitudes either side of the point’s meridian (lambda),\n // and are the latitudes smaller than the parallel (phi)?\n if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) {\n var arc = cartesianCross(cartesian(point0), cartesian(point1));\n cartesianNormalizeInPlace(arc);\n var intersection = cartesianCross(normal, arc);\n cartesianNormalizeInPlace(intersection);\n var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection[2]);\n if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) {\n winding += antimeridian ^ delta >= 0 ? 1 : -1;\n }\n }\n }\n }\n\n // First, determine whether the South pole is inside or outside:\n //\n // It is inside if:\n // * the polygon winds around it in a clockwise direction.\n // * the polygon does not (cumulatively) wind around it, but has a negative\n // (counter-clockwise) area.\n //\n // Second, count the (signed) number of times a segment crosses a lambda\n // from the point to the South pole. If it is zero, then the point is the\n // same side as the South pole.\n\n return (angle < -epsilon || angle < epsilon && sum < -epsilon2) ^ (winding & 1);\n}\n","function* flatten(arrays) {\n for (const array of arrays) {\n yield* array;\n }\n}\n\nexport default function merge(arrays) {\n return Array.from(flatten(arrays));\n}\n","import clipBuffer from \"./buffer.js\";\nimport clipRejoin from \"./rejoin.js\";\nimport {epsilon, halfPi} from \"../math.js\";\nimport polygonContains from \"../polygonContains.js\";\nimport {merge} from \"d3-array\";\n\nexport default function(pointVisible, clipLine, interpolate, start) {\n return function(sink) {\n var line = clipLine(sink),\n ringBuffer = clipBuffer(),\n ringSink = clipLine(ringBuffer),\n polygonStarted = false,\n polygon,\n segments,\n ring;\n\n var clip = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() {\n clip.point = pointRing;\n clip.lineStart = ringStart;\n clip.lineEnd = ringEnd;\n segments = [];\n polygon = [];\n },\n polygonEnd: function() {\n clip.point = point;\n clip.lineStart = lineStart;\n clip.lineEnd = lineEnd;\n segments = merge(segments);\n var startInside = polygonContains(polygon, start);\n if (segments.length) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n clipRejoin(segments, compareIntersection, startInside, interpolate, sink);\n } else if (startInside) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n }\n if (polygonStarted) sink.polygonEnd(), polygonStarted = false;\n segments = polygon = null;\n },\n sphere: function() {\n sink.polygonStart();\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n sink.polygonEnd();\n }\n };\n\n function point(lambda, phi) {\n if (pointVisible(lambda, phi)) sink.point(lambda, phi);\n }\n\n function pointLine(lambda, phi) {\n line.point(lambda, phi);\n }\n\n function lineStart() {\n clip.point = pointLine;\n line.lineStart();\n }\n\n function lineEnd() {\n clip.point = point;\n line.lineEnd();\n }\n\n function pointRing(lambda, phi) {\n ring.push([lambda, phi]);\n ringSink.point(lambda, phi);\n }\n\n function ringStart() {\n ringSink.lineStart();\n ring = [];\n }\n\n function ringEnd() {\n pointRing(ring[0][0], ring[0][1]);\n ringSink.lineEnd();\n\n var clean = ringSink.clean(),\n ringSegments = ringBuffer.result(),\n i, n = ringSegments.length, m,\n segment,\n point;\n\n ring.pop();\n polygon.push(ring);\n ring = null;\n\n if (!n) return;\n\n // No intersections.\n if (clean & 1) {\n segment = ringSegments[0];\n if ((m = segment.length - 1) > 0) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n for (i = 0; i < m; ++i) sink.point((point = segment[i])[0], point[1]);\n sink.lineEnd();\n }\n return;\n }\n\n // Rejoin connected segments.\n // TODO reuse ringBuffer.rejoin()?\n if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));\n\n segments.push(ringSegments.filter(validSegment));\n }\n\n return clip;\n };\n}\n\nfunction validSegment(segment) {\n return segment.length > 1;\n}\n\n// Intersections are sorted along the clip edge. For both antimeridian cutting\n// and circle clipping, the same comparison is used.\nfunction compareIntersection(a, b) {\n return ((a = a.x)[0] < 0 ? a[1] - halfPi - epsilon : halfPi - a[1])\n - ((b = b.x)[0] < 0 ? b[1] - halfPi - epsilon : halfPi - b[1]);\n}\n","import clip from \"./index.js\";\nimport {abs, atan, cos, epsilon, halfPi, pi, sin} from \"../math.js\";\n\nexport default clip(\n function() { return true; },\n clipAntimeridianLine,\n clipAntimeridianInterpolate,\n [-pi, -halfPi]\n);\n\n// Takes a line and cuts into visible segments. Return values: 0 - there were\n// intersections or the line was empty; 1 - no intersections; 2 - there were\n// intersections, and the first and last segments should be rejoined.\nfunction clipAntimeridianLine(stream) {\n var lambda0 = NaN,\n phi0 = NaN,\n sign0 = NaN,\n clean; // no intersections\n\n return {\n lineStart: function() {\n stream.lineStart();\n clean = 1;\n },\n point: function(lambda1, phi1) {\n var sign1 = lambda1 > 0 ? pi : -pi,\n delta = abs(lambda1 - lambda0);\n if (abs(delta - pi) < epsilon) { // line crosses a pole\n stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? halfPi : -halfPi);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n stream.point(lambda1, phi0);\n clean = 0;\n } else if (sign0 !== sign1 && delta >= pi) { // line crosses antimeridian\n if (abs(lambda0 - sign0) < epsilon) lambda0 -= sign0 * epsilon; // handle degeneracies\n if (abs(lambda1 - sign1) < epsilon) lambda1 -= sign1 * epsilon;\n phi0 = clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n clean = 0;\n }\n stream.point(lambda0 = lambda1, phi0 = phi1);\n sign0 = sign1;\n },\n lineEnd: function() {\n stream.lineEnd();\n lambda0 = phi0 = NaN;\n },\n clean: function() {\n return 2 - clean; // if intersections, rejoin first and last segments\n }\n };\n}\n\nfunction clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1) {\n var cosPhi0,\n cosPhi1,\n sinLambda0Lambda1 = sin(lambda0 - lambda1);\n return abs(sinLambda0Lambda1) > epsilon\n ? atan((sin(phi0) * (cosPhi1 = cos(phi1)) * sin(lambda1)\n - sin(phi1) * (cosPhi0 = cos(phi0)) * sin(lambda0))\n / (cosPhi0 * cosPhi1 * sinLambda0Lambda1))\n : (phi0 + phi1) / 2;\n}\n\nfunction clipAntimeridianInterpolate(from, to, direction, stream) {\n var phi;\n if (from == null) {\n phi = direction * halfPi;\n stream.point(-pi, phi);\n stream.point(0, phi);\n stream.point(pi, phi);\n stream.point(pi, 0);\n stream.point(pi, -phi);\n stream.point(0, -phi);\n stream.point(-pi, -phi);\n stream.point(-pi, 0);\n stream.point(-pi, phi);\n } else if (abs(from[0] - to[0]) > epsilon) {\n var lambda = from[0] < to[0] ? pi : -pi;\n phi = direction * lambda / 2;\n stream.point(-lambda, phi);\n stream.point(0, phi);\n stream.point(lambda, phi);\n } else {\n stream.point(to[0], to[1]);\n }\n}\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","import {cartesian, cartesianNormalizeInPlace, spherical} from \"./cartesian.js\";\nimport constant from \"./constant.js\";\nimport {acos, cos, degrees, epsilon, radians, sin, tau} from \"./math.js\";\nimport {rotateRadians} from \"./rotation.js\";\n\n// Generates a circle centered at [0°, 0°], with a given radius and precision.\nexport function circleStream(stream, radius, delta, direction, t0, t1) {\n if (!delta) return;\n var cosRadius = cos(radius),\n sinRadius = sin(radius),\n step = direction * delta;\n if (t0 == null) {\n t0 = radius + direction * tau;\n t1 = radius - step / 2;\n } else {\n t0 = circleRadius(cosRadius, t0);\n t1 = circleRadius(cosRadius, t1);\n if (direction > 0 ? t0 < t1 : t0 > t1) t0 += direction * tau;\n }\n for (var point, t = t0; direction > 0 ? t > t1 : t < t1; t -= step) {\n point = spherical([cosRadius, -sinRadius * cos(t), -sinRadius * sin(t)]);\n stream.point(point[0], point[1]);\n }\n}\n\n// Returns the signed angle of a cartesian point relative to [cosRadius, 0, 0].\nfunction circleRadius(cosRadius, point) {\n point = cartesian(point), point[0] -= cosRadius;\n cartesianNormalizeInPlace(point);\n var radius = acos(-point[1]);\n return ((-point[2] < 0 ? -radius : radius) + tau - epsilon) % tau;\n}\n\nexport default function() {\n var center = constant([0, 0]),\n radius = constant(90),\n precision = constant(6),\n ring,\n rotate,\n stream = {point: point};\n\n function point(x, y) {\n ring.push(x = rotate(x, y));\n x[0] *= degrees, x[1] *= degrees;\n }\n\n function circle() {\n var c = center.apply(this, arguments),\n r = radius.apply(this, arguments) * radians,\n p = precision.apply(this, arguments) * radians;\n ring = [];\n rotate = rotateRadians(-c[0] * radians, -c[1] * radians, 0).invert;\n circleStream(stream, r, p, 1);\n c = {type: \"Polygon\", coordinates: [ring]};\n ring = rotate = null;\n return c;\n }\n\n circle.center = function(_) {\n return arguments.length ? (center = typeof _ === \"function\" ? _ : constant([+_[0], +_[1]]), circle) : center;\n };\n\n circle.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : constant(+_), circle) : radius;\n };\n\n circle.precision = function(_) {\n return arguments.length ? (precision = typeof _ === \"function\" ? _ : constant(+_), circle) : precision;\n };\n\n return circle;\n}\n","import {cartesian, cartesianAddInPlace, cartesianCross, cartesianDot, cartesianScale, spherical} from \"../cartesian.js\";\nimport {circleStream} from \"../circle.js\";\nimport {abs, cos, epsilon, pi, radians, sqrt} from \"../math.js\";\nimport pointEqual from \"../pointEqual.js\";\nimport clip from \"./index.js\";\n\nexport default function(radius) {\n var cr = cos(radius),\n delta = 6 * radians,\n smallRadius = cr > 0,\n notHemisphere = abs(cr) > epsilon; // TODO optimise for this common case\n\n function interpolate(from, to, direction, stream) {\n circleStream(stream, radius, delta, direction, from, to);\n }\n\n function visible(lambda, phi) {\n return cos(lambda) * cos(phi) > cr;\n }\n\n // Takes a line and cuts into visible segments. Return values used for polygon\n // clipping: 0 - there were intersections or the line was empty; 1 - no\n // intersections 2 - there were intersections, and the first and last segments\n // should be rejoined.\n function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }\n\n // Intersects the great circle between a and b with the clip circle.\n function intersect(a, b, two) {\n var pa = cartesian(a),\n pb = cartesian(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = cartesianCross(pa, pb),\n n2n2 = cartesianDot(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = cartesianCross(n1, n2),\n A = cartesianScale(n1, c1),\n B = cartesianScale(n2, c2);\n cartesianAddInPlace(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = cartesianDot(A, u),\n uu = cartesianDot(u, u),\n t2 = w * w - uu * (cartesianDot(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = sqrt(t2),\n q = cartesianScale(u, (-w - t) / uu);\n cartesianAddInPlace(q, A);\n q = spherical(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = abs(delta - pi) < epsilon,\n meridian = polar || delta < epsilon;\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (abs(q[0] - lambda0) < epsilon ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > pi ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = cartesianScale(u, (-w + t) / uu);\n cartesianAddInPlace(q1, A);\n return [q, spherical(q1)];\n }\n }\n\n // Generates a 4-bit vector representing the location of a point relative to\n // the small circle's bounding box.\n function code(lambda, phi) {\n var r = smallRadius ? radius : pi - radius,\n code = 0;\n if (lambda < -r) code |= 1; // left\n else if (lambda > r) code |= 2; // right\n if (phi < -r) code |= 4; // below\n else if (phi > r) code |= 8; // above\n return code;\n }\n\n return clip(visible, clipLine, interpolate, smallRadius ? [0, -radius] : [-pi, radius - pi]);\n}\n","import {abs, epsilon} from \"../math.js\";\nimport clipBuffer from \"./buffer.js\";\nimport clipLine from \"./line.js\";\nimport clipRejoin from \"./rejoin.js\";\nimport {merge} from \"d3-array\";\n\nvar clipMax = 1e9, clipMin = -clipMax;\n\n// TODO Use d3-polygon’s polygonContains here for the ring check?\n// TODO Eliminate duplicate buffering in clipBuffer and polygon.push?\n\nexport default function clipRectangle(x0, y0, x1, y1) {\n\n function visible(x, y) {\n return x0 <= x && x <= x1 && y0 <= y && y <= y1;\n }\n\n function interpolate(from, to, direction, stream) {\n var a = 0, a1 = 0;\n if (from == null\n || (a = corner(from, direction)) !== (a1 = corner(to, direction))\n || comparePoint(from, to) < 0 ^ direction > 0) {\n do stream.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0);\n while ((a = (a + direction + 4) % 4) !== a1);\n } else {\n stream.point(to[0], to[1]);\n }\n }\n\n function corner(p, direction) {\n return abs(p[0] - x0) < epsilon ? direction > 0 ? 0 : 3\n : abs(p[0] - x1) < epsilon ? direction > 0 ? 2 : 1\n : abs(p[1] - y0) < epsilon ? direction > 0 ? 1 : 0\n : direction > 0 ? 3 : 2; // abs(p[1] - y1) < epsilon\n }\n\n function compareIntersection(a, b) {\n return comparePoint(a.x, b.x);\n }\n\n function comparePoint(a, b) {\n var ca = corner(a, 1),\n cb = corner(b, 1);\n return ca !== cb ? ca - cb\n : ca === 0 ? b[1] - a[1]\n : ca === 1 ? a[0] - b[0]\n : ca === 2 ? a[1] - b[1]\n : b[0] - a[0];\n }\n\n return function(stream) {\n var activeStream = stream,\n bufferStream = clipBuffer(),\n segments,\n polygon,\n ring,\n x__, y__, v__, // first point\n x_, y_, v_, // previous point\n first,\n clean;\n\n var clipStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: polygonStart,\n polygonEnd: polygonEnd\n };\n\n function point(x, y) {\n if (visible(x, y)) activeStream.point(x, y);\n }\n\n function polygonInside() {\n var winding = 0;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n for (var ring = polygon[i], j = 1, m = ring.length, point = ring[0], a0, a1, b0 = point[0], b1 = point[1]; j < m; ++j) {\n a0 = b0, a1 = b1, point = ring[j], b0 = point[0], b1 = point[1];\n if (a1 <= y1) { if (b1 > y1 && (b0 - a0) * (y1 - a1) > (b1 - a1) * (x0 - a0)) ++winding; }\n else { if (b1 <= y1 && (b0 - a0) * (y1 - a1) < (b1 - a1) * (x0 - a0)) --winding; }\n }\n }\n\n return winding;\n }\n\n // Buffer geometry within a polygon and then clip it en masse.\n function polygonStart() {\n activeStream = bufferStream, segments = [], polygon = [], clean = true;\n }\n\n function polygonEnd() {\n var startInside = polygonInside(),\n cleanInside = clean && startInside,\n visible = (segments = merge(segments)).length;\n if (cleanInside || visible) {\n stream.polygonStart();\n if (cleanInside) {\n stream.lineStart();\n interpolate(null, null, 1, stream);\n stream.lineEnd();\n }\n if (visible) {\n clipRejoin(segments, compareIntersection, startInside, interpolate, stream);\n }\n stream.polygonEnd();\n }\n activeStream = stream, segments = polygon = ring = null;\n }\n\n function lineStart() {\n clipStream.point = linePoint;\n if (polygon) polygon.push(ring = []);\n first = true;\n v_ = false;\n x_ = y_ = NaN;\n }\n\n // TODO rather than special-case polygons, simply handle them separately.\n // Ideally, coincident intersection points should be jittered to avoid\n // clipping issues.\n function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }\n\n function linePoint(x, y) {\n var v = visible(x, y);\n if (polygon) ring.push([x, y]);\n if (first) {\n x__ = x, y__ = y, v__ = v;\n first = false;\n if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n }\n } else {\n if (v && v_) activeStream.point(x, y);\n else {\n var a = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))],\n b = [x = Math.max(clipMin, Math.min(clipMax, x)), y = Math.max(clipMin, Math.min(clipMax, y))];\n if (clipLine(a, b, x0, y0, x1, y1)) {\n if (!v_) {\n activeStream.lineStart();\n activeStream.point(a[0], a[1]);\n }\n activeStream.point(b[0], b[1]);\n if (!v) activeStream.lineEnd();\n clean = false;\n } else if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n clean = false;\n }\n }\n }\n x_ = x, y_ = y, v_ = v;\n }\n\n return clipStream;\n };\n}\n","export default function(a, b, x0, y0, x1, y1) {\n var ax = a[0],\n ay = a[1],\n bx = b[0],\n by = b[1],\n t0 = 0,\n t1 = 1,\n dx = bx - ax,\n dy = by - ay,\n r;\n\n r = x0 - ax;\n if (!dx && r > 0) return;\n r /= dx;\n if (dx < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dx > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = x1 - ax;\n if (!dx && r < 0) return;\n r /= dx;\n if (dx < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dx > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n r = y0 - ay;\n if (!dy && r > 0) return;\n r /= dy;\n if (dy < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dy > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = y1 - ay;\n if (!dy && r < 0) return;\n r /= dy;\n if (dy < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dy > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n if (t0 > 0) a[0] = ax + t0 * dx, a[1] = ay + t0 * dy;\n if (t1 < 1) b[0] = ax + t1 * dx, b[1] = ay + t1 * dy;\n return true;\n}\n","export default x => x;\n","export default function(methods) {\n return {\n stream: transformer(methods)\n };\n}\n\nexport function transformer(methods) {\n return function(stream) {\n var s = new TransformStream;\n for (var key in methods) s[key] = methods[key];\n s.stream = stream;\n return s;\n };\n}\n\nfunction TransformStream() {}\n\nTransformStream.prototype = {\n constructor: TransformStream,\n point: function(x, y) { this.stream.point(x, y); },\n sphere: function() { this.stream.sphere(); },\n lineStart: function() { this.stream.lineStart(); },\n lineEnd: function() { this.stream.lineEnd(); },\n polygonStart: function() { this.stream.polygonStart(); },\n polygonEnd: function() { this.stream.polygonEnd(); }\n};\n","import noop from \"../noop.js\";\n\nvar x0 = Infinity,\n y0 = x0,\n x1 = -x0,\n y1 = x1;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: noop,\n polygonEnd: noop,\n result: function() {\n var bounds = [[x0, y0], [x1, y1]];\n x1 = y1 = -(y0 = x0 = Infinity);\n return bounds;\n }\n};\n\nfunction boundsPoint(x, y) {\n if (x < x0) x0 = x;\n if (x > x1) x1 = x;\n if (y < y0) y0 = y;\n if (y > y1) y1 = y;\n}\n\nexport default boundsStream;\n","import {default as geoStream} from \"../stream.js\";\nimport boundsStream from \"../path/bounds.js\";\n\nfunction fit(projection, fitBounds, object) {\n var clip = projection.clipExtent && projection.clipExtent();\n projection.scale(150).translate([0, 0]);\n if (clip != null) projection.clipExtent(null);\n geoStream(object, projection.stream(boundsStream));\n fitBounds(boundsStream.result());\n if (clip != null) projection.clipExtent(clip);\n return projection;\n}\n\nexport function fitExtent(projection, extent, object) {\n return fit(projection, function(b) {\n var w = extent[1][0] - extent[0][0],\n h = extent[1][1] - extent[0][1],\n k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])),\n x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2,\n y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nexport function fitSize(projection, size, object) {\n return fitExtent(projection, [[0, 0], size], object);\n}\n\nexport function fitWidth(projection, width, object) {\n return fit(projection, function(b) {\n var w = +width,\n k = w / (b[1][0] - b[0][0]),\n x = (w - k * (b[1][0] + b[0][0])) / 2,\n y = -k * b[0][1];\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nexport function fitHeight(projection, height, object) {\n return fit(projection, function(b) {\n var h = +height,\n k = h / (b[1][1] - b[0][1]),\n x = -k * b[0][0],\n y = (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n","import {cartesian} from \"../cartesian.js\";\nimport {abs, asin, atan2, cos, epsilon, radians, sqrt} from \"../math.js\";\nimport {transformer} from \"../transform.js\";\n\nvar maxDepth = 16, // maximum depth of subdivision\n cosMinDistance = cos(30 * radians); // cos(minimum angular distance)\n\nexport default function(project, delta2) {\n return +delta2 ? resample(project, delta2) : resampleNone(project);\n}\n\nfunction resampleNone(project) {\n return transformer({\n point: function(x, y) {\n x = project(x, y);\n this.stream.point(x[0], x[1]);\n }\n });\n}\n\nfunction resample(project, delta2) {\n\n function resampleLineTo(x0, y0, lambda0, a0, b0, c0, x1, y1, lambda1, a1, b1, c1, depth, stream) {\n var dx = x1 - x0,\n dy = y1 - y0,\n d2 = dx * dx + dy * dy;\n if (d2 > 4 * delta2 && depth--) {\n var a = a0 + a1,\n b = b0 + b1,\n c = c0 + c1,\n m = sqrt(a * a + b * b + c * c),\n phi2 = asin(c /= m),\n lambda2 = abs(abs(c) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : atan2(b, a),\n p = project(lambda2, phi2),\n x2 = p[0],\n y2 = p[1],\n dx2 = x2 - x0,\n dy2 = y2 - y0,\n dz = dy * dx2 - dx * dy2;\n if (dz * dz / d2 > delta2 // perpendicular projected distance\n || abs((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 // midpoint close to an end\n || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { // angular distance\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x2, y2, lambda2, a /= m, b /= m, c, depth, stream);\n stream.point(x2, y2);\n resampleLineTo(x2, y2, lambda2, a, b, c, x1, y1, lambda1, a1, b1, c1, depth, stream);\n }\n }\n }\n return function(stream) {\n var lambda00, x00, y00, a00, b00, c00, // first point\n lambda0, x0, y0, a0, b0, c0; // previous point\n\n var resampleStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() { stream.polygonStart(); resampleStream.lineStart = ringStart; },\n polygonEnd: function() { stream.polygonEnd(); resampleStream.lineStart = lineStart; }\n };\n\n function point(x, y) {\n x = project(x, y);\n stream.point(x[0], x[1]);\n }\n\n function lineStart() {\n x0 = NaN;\n resampleStream.point = linePoint;\n stream.lineStart();\n }\n\n function linePoint(lambda, phi) {\n var c = cartesian([lambda, phi]), p = project(lambda, phi);\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x0 = p[0], y0 = p[1], lambda0 = lambda, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);\n stream.point(x0, y0);\n }\n\n function lineEnd() {\n resampleStream.point = point;\n stream.lineEnd();\n }\n\n function ringStart() {\n lineStart();\n resampleStream.point = ringPoint;\n resampleStream.lineEnd = ringEnd;\n }\n\n function ringPoint(lambda, phi) {\n linePoint(lambda00 = lambda, phi), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0;\n resampleStream.point = linePoint;\n }\n\n function ringEnd() {\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x00, y00, lambda00, a00, b00, c00, maxDepth, stream);\n resampleStream.lineEnd = lineEnd;\n lineEnd();\n }\n\n return resampleStream;\n };\n}\n","import clipAntimeridian from \"../clip/antimeridian.js\";\nimport clipCircle from \"../clip/circle.js\";\nimport clipRectangle from \"../clip/rectangle.js\";\nimport compose from \"../compose.js\";\nimport identity from \"../identity.js\";\nimport {cos, degrees, radians, sin, sqrt} from \"../math.js\";\nimport {rotateRadians} from \"../rotation.js\";\nimport {transformer} from \"../transform.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\nimport resample from \"./resample.js\";\n\nvar transformRadians = transformer({\n point: function(x, y) {\n this.stream.point(x * radians, y * radians);\n }\n});\n\nfunction transformRotate(rotate) {\n return transformer({\n point: function(x, y) {\n var r = rotate(x, y);\n return this.stream.point(r[0], r[1]);\n }\n });\n}\n\nfunction scaleTranslate(k, dx, dy, sx, sy) {\n function transform(x, y) {\n x *= sx; y *= sy;\n return [dx + k * x, dy - k * y];\n }\n transform.invert = function(x, y) {\n return [(x - dx) / k * sx, (dy - y) / k * sy];\n };\n return transform;\n}\n\nfunction scaleTranslateRotate(k, dx, dy, sx, sy, alpha) {\n if (!alpha) return scaleTranslate(k, dx, dy, sx, sy);\n var cosAlpha = cos(alpha),\n sinAlpha = sin(alpha),\n a = cosAlpha * k,\n b = sinAlpha * k,\n ai = cosAlpha / k,\n bi = sinAlpha / k,\n ci = (sinAlpha * dy - cosAlpha * dx) / k,\n fi = (sinAlpha * dx + cosAlpha * dy) / k;\n function transform(x, y) {\n x *= sx; y *= sy;\n return [a * x - b * y + dx, dy - b * x - a * y];\n }\n transform.invert = function(x, y) {\n return [sx * (ai * x - bi * y + ci), sy * (fi - bi * x - ai * y)];\n };\n return transform;\n}\n\nexport default function projection(project) {\n return projectionMutator(function() { return project; })();\n}\n\nexport function projectionMutator(projectAt) {\n var project,\n k = 150, // scale\n x = 480, y = 250, // translate\n lambda = 0, phi = 0, // center\n deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, // pre-rotate\n alpha = 0, // post-rotate angle\n sx = 1, // reflectX\n sy = 1, // reflectX\n theta = null, preclip = clipAntimeridian, // pre-clip angle\n x0 = null, y0, x1, y1, postclip = identity, // post-clip extent\n delta2 = 0.5, // precision\n projectResample,\n projectTransform,\n projectRotateTransform,\n cache,\n cacheStream;\n\n function projection(point) {\n return projectRotateTransform(point[0] * radians, point[1] * radians);\n }\n\n function invert(point) {\n point = projectRotateTransform.invert(point[0], point[1]);\n return point && [point[0] * degrees, point[1] * degrees];\n }\n\n projection.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream = stream)))));\n };\n\n projection.preclip = function(_) {\n return arguments.length ? (preclip = _, theta = undefined, reset()) : preclip;\n };\n\n projection.postclip = function(_) {\n return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip;\n };\n\n projection.clipAngle = function(_) {\n return arguments.length ? (preclip = +_ ? clipCircle(theta = _ * radians) : (theta = null, clipAntimeridian), reset()) : theta * degrees;\n };\n\n projection.clipExtent = function(_) {\n return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n projection.scale = function(_) {\n return arguments.length ? (k = +_, recenter()) : k;\n };\n\n projection.translate = function(_) {\n return arguments.length ? (x = +_[0], y = +_[1], recenter()) : [x, y];\n };\n\n projection.center = function(_) {\n return arguments.length ? (lambda = _[0] % 360 * radians, phi = _[1] % 360 * radians, recenter()) : [lambda * degrees, phi * degrees];\n };\n\n projection.rotate = function(_) {\n 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];\n };\n\n projection.angle = function(_) {\n return arguments.length ? (alpha = _ % 360 * radians, recenter()) : alpha * degrees;\n };\n\n projection.reflectX = function(_) {\n return arguments.length ? (sx = _ ? -1 : 1, recenter()) : sx < 0;\n };\n\n projection.reflectY = function(_) {\n return arguments.length ? (sy = _ ? -1 : 1, recenter()) : sy < 0;\n };\n\n projection.precision = function(_) {\n return arguments.length ? (projectResample = resample(projectTransform, delta2 = _ * _), reset()) : sqrt(delta2);\n };\n\n projection.fitExtent = function(extent, object) {\n return fitExtent(projection, extent, object);\n };\n\n projection.fitSize = function(size, object) {\n return fitSize(projection, size, object);\n };\n\n projection.fitWidth = function(width, object) {\n return fitWidth(projection, width, object);\n };\n\n projection.fitHeight = function(height, object) {\n return fitHeight(projection, height, object);\n };\n\n function recenter() {\n var center = scaleTranslateRotate(k, 0, 0, sx, sy, alpha).apply(null, project(lambda, phi)),\n transform = scaleTranslateRotate(k, x - center[0], y - center[1], sx, sy, alpha);\n rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma);\n projectTransform = compose(project, transform);\n projectRotateTransform = compose(rotate, projectTransform);\n projectResample = resample(projectTransform, delta2);\n return reset();\n }\n\n function reset() {\n cache = cacheStream = null;\n return projection;\n }\n\n return function() {\n project = projectAt.apply(this, arguments);\n projection.invert = project.invert && invert;\n return recenter();\n };\n}\n","import {atan, exp, halfPi, log, pi, tan, tau} from \"../math.js\";\nimport rotation from \"../rotation.js\";\nimport projection from \"./index.js\";\n\nexport function mercatorRaw(lambda, phi) {\n return [lambda, log(tan((halfPi + phi) / 2))];\n}\n\nmercatorRaw.invert = function(x, y) {\n return [x, 2 * atan(exp(y)) - halfPi];\n};\n\nexport default function() {\n return mercatorProjection(mercatorRaw)\n .scale(961 / tau);\n}\n\nexport function mercatorProjection(project) {\n var m = projection(project),\n center = m.center,\n scale = m.scale,\n translate = m.translate,\n clipExtent = m.clipExtent,\n x0 = null, y0, x1, y1; // clip extent\n\n m.scale = function(_) {\n return arguments.length ? (scale(_), reclip()) : scale();\n };\n\n m.translate = function(_) {\n return arguments.length ? (translate(_), reclip()) : translate();\n };\n\n m.center = function(_) {\n return arguments.length ? (center(_), reclip()) : center();\n };\n\n m.clipExtent = function(_) {\n 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]];\n };\n\n function reclip() {\n var k = pi * scale(),\n t = m(rotation(m.rotate()).invert([0, 0]));\n return clipExtent(x0 == null\n ? [[t[0] - k, t[1] - k], [t[0] + k, t[1] + k]] : project === mercatorRaw\n ? [[Math.max(t[0] - k, x0), y0], [Math.min(t[0] + k, x1), y1]]\n : [[x0, Math.max(t[1] - k, y0)], [x1, Math.min(t[1] + k, y1)]]);\n }\n\n return reclip();\n}\n","import {Adder} from \"d3-array\";\nimport {abs} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar areaSum = new Adder(),\n areaRingSum = new Adder(),\n x00,\n y00,\n x0,\n y0;\n\nvar areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n areaStream.lineStart = areaStream.lineEnd = areaStream.point = noop;\n areaSum.add(abs(areaRingSum));\n areaRingSum = new Adder();\n },\n result: function() {\n var area = areaSum / 2;\n areaSum = new Adder();\n return area;\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaPointFirst(x, y) {\n areaStream.point = areaPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction areaPoint(x, y) {\n areaRingSum.add(y0 * x - x0 * y);\n x0 = x, y0 = y;\n}\n\nfunction areaRingEnd() {\n areaPoint(x00, y00);\n}\n\nexport default areaStream;\n","import { Theme } from \"../../core/Theme\";\r\nimport { p50 } from \"../../core/util/Percent\";\r\nimport { setColor } from \"../../themes/DefaultTheme\";\r\n\r\nimport { geoMercator } from \"d3-geo\";\r\n\r\nimport * as $ease from \"../../core/util/Ease\";\r\n\r\n\r\n/**\r\n * @ignore\r\n */\r\nexport class MapChartDefaultTheme extends Theme {\r\n\tprotected setupDefaultRules() {\r\n\t\tsuper.setupDefaultRules();\r\n\r\n\t\tconst ic = this._root.interfaceColors;\r\n\t\tconst r = this.rule.bind(this);\r\n\r\n\t\t/**\r\n\t\t * ========================================================================\r\n\t\t * charts/map\r\n\t\t * ========================================================================\r\n\t\t */\r\n\r\n\t\tr(\"MapChart\").setAll({\r\n\t\t\tprojection: geoMercator(),\r\n\t\t\tpanX: \"translateX\",\r\n\t\t\tpanY: \"translateY\",\r\n\t\t\tpinchZoom: true,\r\n\t\t\tzoomStep: 2,\r\n\t\t\tzoomLevel: 1,\r\n\t\t\trotationX: 0,\r\n\t\t\trotationY: 0,\r\n\t\t\trotationZ: 0,\r\n\t\t\tmaxZoomLevel: 32,\r\n\t\t\tminZoomLevel: 1,\r\n\t\t\twheelY: \"zoom\",\r\n\t\t\twheelX: \"none\",\r\n\t\t\tanimationEasing: $ease.out($ease.cubic),\r\n\t\t\twheelEasing: $ease.out($ease.cubic),\r\n\t\t\twheelDuration: 0,\r\n\t\t\twheelSensitivity: 1,\r\n\t\t\tmaxPanOut: 0.4,\r\n\t\t\tcenterMapOnZoomOut: true\r\n\t\t});\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"MapLine\");\r\n\r\n\t\t\trule.setAll({\r\n\t\t\t\tprecision: 0.5,\r\n\t\t\t\trole: \"figure\",\r\n\t\t\t});\r\n\r\n\t\t\tsetColor(rule, \"stroke\", ic, \"grid\");\r\n\t\t}\r\n\r\n\t\tr(\"MapPointSeries\").setAll({\r\n\t\t\tclipFront: false,\r\n\t\t\tclipBack: true,\r\n\t\t\tautoScale: false\r\n\t\t})\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"MapPolygon\");\r\n\r\n\t\t\trule.setAll({\r\n\t\t\t\tprecision: 0.5,\r\n\t\t\t\tisMeasured: false,\r\n\t\t\t\trole: \"figure\",\r\n\t\t\t\tfillOpacity: 1,\r\n\t\t\t\tposition: \"absolute\",\r\n\t\t\t\tstrokeWidth: 0.2,\r\n\t\t\t\tstrokeOpacity: 1,\r\n\t\t\t});\r\n\r\n\t\t\tsetColor(rule, \"fill\", ic, \"primaryButton\");\r\n\t\t\tsetColor(rule, \"stroke\", ic, \"background\");\r\n\t\t}\r\n\r\n\t\tr(\"Graphics\", [\"map\", \"button\", \"plus\", \"icon\"]).setAll({\r\n\t\t\tx: p50,\r\n\t\t\ty: p50,\r\n\t\t\tdraw: (display) => {\r\n\t\t\t\tdisplay.moveTo(-4, 0);\r\n\t\t\t\tdisplay.lineTo(4, 0);\r\n\t\t\t\tdisplay.moveTo(0, -4);\r\n\t\t\t\tdisplay.lineTo(0, 4);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tr(\"Graphics\", [\"map\", \"button\", \"minus\", \"icon\"]).setAll({\r\n\t\t\tx: p50,\r\n\t\t\ty: p50,\r\n\t\t\tdraw: (display) => {\r\n\t\t\t\tdisplay.moveTo(-4, 0);\r\n\t\t\t\tdisplay.lineTo(4, 0);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\t/**\r\n\t\t * ------------------------------------------------------------------------\r\n\t\t * charts/map: Series\r\n\t\t * ------------------------------------------------------------------------\r\n\t\t */\r\n\r\n\t\tr(\"GraticuleSeries\").setAll({\r\n\t\t\tstep: 10\r\n\t\t});\r\n\r\n\r\n\t}\r\n}\r\n","import {sqrt} from \"../math.js\";\n\n// TODO Enforce positive area for exterior, negative area for interior?\n\nvar X0 = 0,\n Y0 = 0,\n Z0 = 0,\n X1 = 0,\n Y1 = 0,\n Z1 = 0,\n X2 = 0,\n Y2 = 0,\n Z2 = 0,\n x00,\n y00,\n x0,\n y0;\n\nvar centroidStream = {\n point: centroidPoint,\n lineStart: centroidLineStart,\n lineEnd: centroidLineEnd,\n polygonStart: function() {\n centroidStream.lineStart = centroidRingStart;\n centroidStream.lineEnd = centroidRingEnd;\n },\n polygonEnd: function() {\n centroidStream.point = centroidPoint;\n centroidStream.lineStart = centroidLineStart;\n centroidStream.lineEnd = centroidLineEnd;\n },\n result: function() {\n var centroid = Z2 ? [X2 / Z2, Y2 / Z2]\n : Z1 ? [X1 / Z1, Y1 / Z1]\n : Z0 ? [X0 / Z0, Y0 / Z0]\n : [NaN, NaN];\n X0 = Y0 = Z0 =\n X1 = Y1 = Z1 =\n X2 = Y2 = Z2 = 0;\n return centroid;\n }\n};\n\nfunction centroidPoint(x, y) {\n X0 += x;\n Y0 += y;\n ++Z0;\n}\n\nfunction centroidLineStart() {\n centroidStream.point = centroidPointFirstLine;\n}\n\nfunction centroidPointFirstLine(x, y) {\n centroidStream.point = centroidPointLine;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidPointLine(x, y) {\n var dx = x - x0, dy = y - y0, z = sqrt(dx * dx + dy * dy);\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidLineEnd() {\n centroidStream.point = centroidPoint;\n}\n\nfunction centroidRingStart() {\n centroidStream.point = centroidPointFirstRing;\n}\n\nfunction centroidRingEnd() {\n centroidPointRing(x00, y00);\n}\n\nfunction centroidPointFirstRing(x, y) {\n centroidStream.point = centroidPointRing;\n centroidPoint(x00 = x0 = x, y00 = y0 = y);\n}\n\nfunction centroidPointRing(x, y) {\n var dx = x - x0,\n dy = y - y0,\n z = sqrt(dx * dx + dy * dy);\n\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n\n z = y0 * x - x0 * y;\n X2 += z * (x0 + x);\n Y2 += z * (y0 + y);\n Z2 += z * 3;\n centroidPoint(x0 = x, y0 = y);\n}\n\nexport default centroidStream;\n","import {tau} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nexport default function PathContext(context) {\n this._context = context;\n}\n\nPathContext.prototype = {\n _radius: 4.5,\n pointRadius: function(_) {\n return this._radius = _, this;\n },\n polygonStart: function() {\n this._line = 0;\n },\n polygonEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line === 0) this._context.closePath();\n this._point = NaN;\n },\n point: function(x, y) {\n switch (this._point) {\n case 0: {\n this._context.moveTo(x, y);\n this._point = 1;\n break;\n }\n case 1: {\n this._context.lineTo(x, y);\n break;\n }\n default: {\n this._context.moveTo(x + this._radius, y);\n this._context.arc(x, y, this._radius, 0, tau);\n break;\n }\n }\n },\n result: noop\n};\n","import {Adder} from \"d3-array\";\nimport {sqrt} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar lengthSum = new Adder(),\n lengthRing,\n x00,\n y00,\n x0,\n y0;\n\nvar lengthStream = {\n point: noop,\n lineStart: function() {\n lengthStream.point = lengthPointFirst;\n },\n lineEnd: function() {\n if (lengthRing) lengthPoint(x00, y00);\n lengthStream.point = noop;\n },\n polygonStart: function() {\n lengthRing = true;\n },\n polygonEnd: function() {\n lengthRing = null;\n },\n result: function() {\n var length = +lengthSum;\n lengthSum = new Adder();\n return length;\n }\n};\n\nfunction lengthPointFirst(x, y) {\n lengthStream.point = lengthPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction lengthPoint(x, y) {\n x0 -= x, y0 -= y;\n lengthSum.add(sqrt(x0 * x0 + y0 * y0));\n x0 = x, y0 = y;\n}\n\nexport default lengthStream;\n","export default function PathString() {\n this._string = [];\n}\n\nPathString.prototype = {\n _radius: 4.5,\n _circle: circle(4.5),\n pointRadius: function(_) {\n if ((_ = +_) !== this._radius) this._radius = _, this._circle = null;\n return this;\n },\n polygonStart: function() {\n this._line = 0;\n },\n polygonEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line === 0) this._string.push(\"Z\");\n this._point = NaN;\n },\n point: function(x, y) {\n switch (this._point) {\n case 0: {\n this._string.push(\"M\", x, \",\", y);\n this._point = 1;\n break;\n }\n case 1: {\n this._string.push(\"L\", x, \",\", y);\n break;\n }\n default: {\n if (this._circle == null) this._circle = circle(this._radius);\n this._string.push(\"M\", x, \",\", y, this._circle);\n break;\n }\n }\n },\n result: function() {\n if (this._string.length) {\n var result = this._string.join(\"\");\n this._string = [];\n return result;\n } else {\n return null;\n }\n }\n};\n\nfunction circle(radius) {\n return \"m0,\" + radius\n + \"a\" + radius + \",\" + radius + \" 0 1,1 0,\" + -2 * radius\n + \"a\" + radius + \",\" + radius + \" 0 1,1 0,\" + 2 * radius\n + \"z\";\n}\n","import {Adder} from \"d3-array\";\nimport {asin, atan2, cos, degrees, epsilon, epsilon2, hypot, radians, sin, sqrt} from \"./math.js\";\nimport noop from \"./noop.js\";\nimport stream from \"./stream.js\";\n\nvar W0, W1,\n X0, Y0, Z0,\n X1, Y1, Z1,\n X2, Y2, Z2,\n lambda00, phi00, // first point\n x0, y0, z0; // previous point\n\nvar centroidStream = {\n sphere: noop,\n point: centroidPoint,\n lineStart: centroidLineStart,\n lineEnd: centroidLineEnd,\n polygonStart: function() {\n centroidStream.lineStart = centroidRingStart;\n centroidStream.lineEnd = centroidRingEnd;\n },\n polygonEnd: function() {\n centroidStream.lineStart = centroidLineStart;\n centroidStream.lineEnd = centroidLineEnd;\n }\n};\n\n// Arithmetic mean of Cartesian vectors.\nfunction centroidPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi);\n centroidPointCartesian(cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi));\n}\n\nfunction centroidPointCartesian(x, y, z) {\n ++W0;\n X0 += (x - X0) / W0;\n Y0 += (y - Y0) / W0;\n Z0 += (z - Z0) / W0;\n}\n\nfunction centroidLineStart() {\n centroidStream.point = centroidLinePointFirst;\n}\n\nfunction centroidLinePointFirst(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi);\n x0 = cosPhi * cos(lambda);\n y0 = cosPhi * sin(lambda);\n z0 = sin(phi);\n centroidStream.point = centroidLinePoint;\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidLinePoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi),\n x = cosPhi * cos(lambda),\n y = cosPhi * sin(lambda),\n z = sin(phi),\n w = atan2(sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z);\n W1 += w;\n X1 += w * (x0 + (x0 = x));\n Y1 += w * (y0 + (y0 = y));\n Z1 += w * (z0 + (z0 = z));\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidLineEnd() {\n centroidStream.point = centroidPoint;\n}\n\n// See J. E. Brock, The Inertia Tensor for a Spherical Triangle,\n// J. Applied Mechanics 42, 239 (1975).\nfunction centroidRingStart() {\n centroidStream.point = centroidRingPointFirst;\n}\n\nfunction centroidRingEnd() {\n centroidRingPoint(lambda00, phi00);\n centroidStream.point = centroidPoint;\n}\n\nfunction centroidRingPointFirst(lambda, phi) {\n lambda00 = lambda, phi00 = phi;\n lambda *= radians, phi *= radians;\n centroidStream.point = centroidRingPoint;\n var cosPhi = cos(phi);\n x0 = cosPhi * cos(lambda);\n y0 = cosPhi * sin(lambda);\n z0 = sin(phi);\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidRingPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi),\n x = cosPhi * cos(lambda),\n y = cosPhi * sin(lambda),\n z = sin(phi),\n cx = y0 * z - z0 * y,\n cy = z0 * x - x0 * z,\n cz = x0 * y - y0 * x,\n m = hypot(cx, cy, cz),\n w = asin(m), // line weight = angle\n v = m && -w / m; // area weight multiplier\n X2.add(v * cx);\n Y2.add(v * cy);\n Z2.add(v * cz);\n W1 += w;\n X1 += w * (x0 + (x0 = x));\n Y1 += w * (y0 + (y0 = y));\n Z1 += w * (z0 + (z0 = z));\n centroidPointCartesian(x0, y0, z0);\n}\n\nexport default function(object) {\n W0 = W1 =\n X0 = Y0 = Z0 =\n X1 = Y1 = Z1 = 0;\n X2 = new Adder();\n Y2 = new Adder();\n Z2 = new Adder();\n stream(object, centroidStream);\n\n var x = +X2,\n y = +Y2,\n z = +Z2,\n m = hypot(x, y, z);\n\n // If the area-weighted ccentroid is undefined, fall back to length-weighted ccentroid.\n if (m < epsilon2) {\n x = X1, y = Y1, z = Z1;\n // If the feature has zero length, fall back to arithmetic mean of point vectors.\n if (W1 < epsilon) x = X0, y = Y0, z = Z0;\n m = hypot(x, y, z);\n // If the feature still has an undefined ccentroid, then return.\n if (m < epsilon2) return [NaN, NaN];\n }\n\n return [atan2(y, x) * degrees, asin(z / m) * degrees];\n}\n","import {Adder} from \"d3-array\";\nimport {atan2, cos, quarterPi, radians, sin, tau} from \"./math.js\";\nimport noop from \"./noop.js\";\nimport stream from \"./stream.js\";\n\nexport var areaRingSum = new Adder();\n\n// hello?\n\nvar areaSum = new Adder(),\n lambda00,\n phi00,\n lambda0,\n cosPhi0,\n sinPhi0;\n\nexport var areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaRingSum = new Adder();\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n var areaRing = +areaRingSum;\n areaSum.add(areaRing < 0 ? tau + areaRing : areaRing);\n this.lineStart = this.lineEnd = this.point = noop;\n },\n sphere: function() {\n areaSum.add(tau);\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaRingEnd() {\n areaPoint(lambda00, phi00);\n}\n\nfunction areaPointFirst(lambda, phi) {\n areaStream.point = areaPoint;\n lambda00 = lambda, phi00 = phi;\n lambda *= radians, phi *= radians;\n lambda0 = lambda, cosPhi0 = cos(phi = phi / 2 + quarterPi), sinPhi0 = sin(phi);\n}\n\nfunction areaPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n phi = phi / 2 + quarterPi; // half the angular distance from south pole\n\n // Spherical excess E for a spherical triangle with vertices: south pole,\n // previous point, current point. Uses a formula derived from Cagnoli’s\n // theorem. See Todhunter, Spherical Trig. (1871), Sec. 103, Eq. (2).\n var dLambda = lambda - lambda0,\n sdLambda = dLambda >= 0 ? 1 : -1,\n adLambda = sdLambda * dLambda,\n cosPhi = cos(phi),\n sinPhi = sin(phi),\n k = sinPhi0 * sinPhi,\n u = cosPhi0 * cosPhi + k * cos(adLambda),\n v = k * sdLambda * sin(adLambda);\n areaRingSum.add(atan2(v, u));\n\n // Advance the previous points.\n lambda0 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi;\n}\n\nexport default function(object) {\n areaSum = new Adder();\n stream(object, areaStream);\n return areaSum * 2;\n}\n","import {Adder} from \"d3-array\";\nimport {areaStream, areaRingSum} from \"./area.js\";\nimport {cartesian, cartesianCross, cartesianNormalizeInPlace, spherical} from \"./cartesian.js\";\nimport {abs, degrees, epsilon, radians} from \"./math.js\";\nimport stream from \"./stream.js\";\n\nvar lambda0, phi0, lambda1, phi1, // bounds\n lambda2, // previous lambda-coordinate\n lambda00, phi00, // first point\n p0, // previous 3D point\n deltaSum,\n ranges,\n range;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: boundsLineStart,\n lineEnd: boundsLineEnd,\n polygonStart: function() {\n boundsStream.point = boundsRingPoint;\n boundsStream.lineStart = boundsRingStart;\n boundsStream.lineEnd = boundsRingEnd;\n deltaSum = new Adder();\n areaStream.polygonStart();\n },\n polygonEnd: function() {\n areaStream.polygonEnd();\n boundsStream.point = boundsPoint;\n boundsStream.lineStart = boundsLineStart;\n boundsStream.lineEnd = boundsLineEnd;\n if (areaRingSum < 0) lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);\n else if (deltaSum > epsilon) phi1 = 90;\n else if (deltaSum < -epsilon) phi0 = -90;\n range[0] = lambda0, range[1] = lambda1;\n },\n sphere: function() {\n lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);\n }\n};\n\nfunction boundsPoint(lambda, phi) {\n ranges.push(range = [lambda0 = lambda, lambda1 = lambda]);\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n}\n\nfunction linePoint(lambda, phi) {\n var p = cartesian([lambda * radians, phi * radians]);\n if (p0) {\n var normal = cartesianCross(p0, p),\n equatorial = [normal[1], -normal[0], 0],\n inflection = cartesianCross(equatorial, normal);\n cartesianNormalizeInPlace(inflection);\n inflection = spherical(inflection);\n var delta = lambda - lambda2,\n sign = delta > 0 ? 1 : -1,\n lambdai = inflection[0] * degrees * sign,\n phii,\n antimeridian = abs(delta) > 180;\n if (antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = inflection[1] * degrees;\n if (phii > phi1) phi1 = phii;\n } else if (lambdai = (lambdai + 360) % 360 - 180, antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = -inflection[1] * degrees;\n if (phii < phi0) phi0 = phii;\n } else {\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n }\n if (antimeridian) {\n if (lambda < lambda2) {\n if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda;\n }\n } else {\n if (lambda1 >= lambda0) {\n if (lambda < lambda0) lambda0 = lambda;\n if (lambda > lambda1) lambda1 = lambda;\n } else {\n if (lambda > lambda2) {\n if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda;\n }\n }\n }\n } else {\n ranges.push(range = [lambda0 = lambda, lambda1 = lambda]);\n }\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n p0 = p, lambda2 = lambda;\n}\n\nfunction boundsLineStart() {\n boundsStream.point = linePoint;\n}\n\nfunction boundsLineEnd() {\n range[0] = lambda0, range[1] = lambda1;\n boundsStream.point = boundsPoint;\n p0 = null;\n}\n\nfunction boundsRingPoint(lambda, phi) {\n if (p0) {\n var delta = lambda - lambda2;\n deltaSum.add(abs(delta) > 180 ? delta + (delta > 0 ? 360 : -360) : delta);\n } else {\n lambda00 = lambda, phi00 = phi;\n }\n areaStream.point(lambda, phi);\n linePoint(lambda, phi);\n}\n\nfunction boundsRingStart() {\n areaStream.lineStart();\n}\n\nfunction boundsRingEnd() {\n boundsRingPoint(lambda00, phi00);\n areaStream.lineEnd();\n if (abs(deltaSum) > epsilon) lambda0 = -(lambda1 = 180);\n range[0] = lambda0, range[1] = lambda1;\n p0 = null;\n}\n\n// Finds the left-right distance between two longitudes.\n// This is almost the same as (lambda1 - lambda0 + 360°) % 360°, except that we want\n// the distance between ±180° to be 360°.\nfunction angle(lambda0, lambda1) {\n return (lambda1 -= lambda0) < 0 ? lambda1 + 360 : lambda1;\n}\n\nfunction rangeCompare(a, b) {\n return a[0] - b[0];\n}\n\nfunction rangeContains(range, x) {\n return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;\n}\n\nexport default function(feature) {\n var i, n, a, b, merged, deltaMax, delta;\n\n phi1 = lambda1 = -(lambda0 = phi0 = Infinity);\n ranges = [];\n stream(feature, boundsStream);\n\n // First, sort ranges by their minimum longitudes.\n if (n = ranges.length) {\n ranges.sort(rangeCompare);\n\n // Then, merge any ranges that overlap.\n for (i = 1, a = ranges[0], merged = [a]; i < n; ++i) {\n b = ranges[i];\n if (rangeContains(a, b[0]) || rangeContains(a, b[1])) {\n if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1];\n if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0];\n } else {\n merged.push(a = b);\n }\n }\n\n // Finally, find the largest gap between the merged ranges.\n // The final bounding box will be the inverse of this gap.\n for (deltaMax = -Infinity, n = merged.length - 1, i = 0, a = merged[n]; i <= n; a = b, ++i) {\n b = merged[i];\n if ((delta = angle(a[1], b[0])) > deltaMax) deltaMax = delta, lambda0 = b[0], lambda1 = a[1];\n }\n }\n\n ranges = range = null;\n\n return lambda0 === Infinity || phi0 === Infinity\n ? [[NaN, NaN], [NaN, NaN]]\n : [[lambda0, phi0], [lambda1, phi1]];\n}\n","import type { IGeoPoint } from \"../../core/util/IGeoPoint\";\nimport * as $math from \"../../core/util/Math\";\nimport { geoCircle, geoCentroid, geoBounds } from \"d3-geo\";\n\n/**\n * Returns a GeoJSON representation of a circle, suitable for use as `geometry` value\n * in a [[MapPolygon]] in a [[MapPolygonSeries]].\n * \n * @param geoPoint Coordinates\n * @param radius Circle radius in degrees\n * @return Polygon geometry\n */\nexport function getGeoCircle(geoPoint: IGeoPoint, radius: number): GeoJSON.Polygon {\n\treturn geoCircle().center([geoPoint.longitude, geoPoint.latitude]).radius(radius)();\n}\n\n/**\n * @ignore\n */\nexport function getGeoCentroid(geometry: GeoJSON.GeometryObject): IGeoPoint {\n\tconst centroid = geoCentroid(geometry);\n\treturn { longitude: centroid[0], latitude: centroid[1] };\n}\n\n/**\n * @ignore\n */\nexport function getGeoBounds(geometry: GeoJSON.GeometryObject): { left: number, right: number, top: number, bottom: number } {\n\tconst bounds = geoBounds(geometry);\n\n\tif (bounds) {\n\t\tconst geoBounds = { left: bounds[0][0], right: bounds[1][0], top: bounds[1][1], bottom: bounds[0][1] };\n\t\tif(geoBounds.right < geoBounds.left){\n\t\t\tgeoBounds.right = 180;\n\t\t\tgeoBounds.left = -180;\n\t\t}\n\t\treturn geoBounds;\n\t}\n\treturn { left: 0, right: 0, top: 0, bottom: 0 };\n}\n\n/**\n * Returns a GeoJSON representation of a rectangle, suitable for use\n * as `geometry` value in a [[MapPolygon]] in a [[MapPolygonSeries]].\n * \n * @param north North latitude\n * @param east East longitude\n * @param south South latitude\n * @param west West longitude\n * @return polygon geometry\n */\nexport function getGeoRectangle(north: number, east: number, south: number, west: number): GeoJSON.MultiPolygon {\n\n\tlet multiPolygon: Array>> = [];\n\n\tif (west <= -180) {\n\t\twest = -179.9999;\n\t}\n\tif (south <= -90) {\n\t\tsouth = -89.9999;\n\t}\n\tif (north >= 90) {\n\t\tnorth = 89.9999;\n\t}\n\tif (east >= 180) {\n\t\teast = 179.9999;\n\t}\n\n\n\tlet stepLong = Math.min(90, (east - west) / Math.ceil((east - west) / 90));\n\tlet stepLat = (north - south) / Math.ceil((north - south) / 90);\n\n\tfor (let ln = west; ln < east; ln = ln + stepLong) {\n\t\tlet surface: Array<[number, number]> = [];\n\t\tmultiPolygon.push([surface]);\n\n\t\tif (ln + stepLong > east) {\n\t\t\tstepLong = east - ln;\n\t\t}\n\n\t\tfor (let ll = ln; ll <= ln + stepLong; ll = ll + 5) {\n\t\t\tsurface.push([ll, north]);\n\t\t}\n\n\t\tfor (let lt = north; lt >= south; lt = lt - stepLat) {\n\t\t\tsurface.push([ln + stepLong, lt]);\n\t\t}\n\n\t\tfor (let ll = ln + stepLong; ll >= ln; ll = ll - 5) {\n\t\t\tsurface.push([ll, south]);\n\t\t}\n\n\t\tfor (let lt = south; lt <= north; lt = lt + stepLat) {\n\t\t\tsurface.push([ln, lt]);\n\t\t}\n\t}\n\n\treturn { type: \"MultiPolygon\", coordinates: multiPolygon };\n}\n\n/**\n * Update longitudes and latitudes that wrap around -180/180 and -90/90 values.\n * \n * @param geoPoint Input coordinates\n * @return Updated coordinates\n */\nexport function normalizeGeoPoint(geoPoint: IGeoPoint): IGeoPoint {\n\tlet longitude = wrapAngleTo180(geoPoint.longitude);\n\tlet latitude = Math.asin(Math.sin((geoPoint.latitude * $math.RADIANS))) * $math.DEGREES;\n\n\tlet latitude180 = wrapAngleTo180(geoPoint.latitude);\n\n\tif (Math.abs(latitude180) > 90) {\n\t\tlongitude = wrapAngleTo180(longitude + 180);\n\t}\n\n\tgeoPoint.longitude = longitude;\n\tgeoPoint.latitude = latitude;\n\n\treturn geoPoint;\n}\n\n/**\n * @ignore\n */\nexport function wrapAngleTo180(angle: number): number {\n\tangle = angle % 360;\n\n\tif (angle > 180) {\n\t\tangle -= 360;\n\t}\n\tif (angle < -180) {\n\t\tangle += 360;\n\t}\n\n\treturn angle;\n}","import type { MapSeries } from \"./MapSeries\";\nimport type { MapPointSeries } from \"./MapPointSeries\";\nimport type { GeoProjection, GeoPath } from \"d3-geo\";\nimport type { IPoint } from \"../../core/util/IPoint\";\nimport type { IGeoPoint } from \"../../core/util/IGeoPoint\";\nimport type { Time } from \"../../core/util/Animation\";\nimport type { ZoomControl } from \"./ZoomControl\";\nimport type { Animation } from \"../../core/util/Entity\";\nimport type { DataItem } from \"../../core/render/Component\";\nimport type { IMapPolygonSeriesDataItem } from \"./MapPolygonSeries\";\n\nimport { MapChartDefaultTheme } from \"./MapChartDefaultTheme\";\nimport { SerialChart, ISerialChartPrivate, ISerialChartSettings, ISerialChartEvents } from \"../../core/render/SerialChart\";\nimport { Rectangle } from \"../../core/render/Rectangle\";\nimport { geoPath } from \"d3-geo\";\nimport { Color } from \"../../core/util/Color\";\nimport { registry } from \"../../core/Registry\";\n\nimport * as $math from \"../../core/util/Math\";\nimport * as $array from \"../../core/util/Array\";\nimport * as $type from \"../../core/util/Type\";\nimport * as $mapUtils from \"./MapUtils\";\nimport * as $object from \"../../core/util/Object\";\nimport * as $utils from \"../../core/util/Utils\";\n\nimport type { IDisposer } from \"../../core/util/Disposer\";\nimport type { ISpritePointerEvent } from \"../../core/render/Sprite\";\n\nexport interface IMapChartSettings extends ISerialChartSettings {\n\n\t/**\n\t * A projection to use when plotting the map.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/#Projections} for more info\n\t */\n\tprojection?: GeoProjection;\n\n\t/**\n\t * Current zoom level.\n\t */\n\tzoomLevel?: number;\n\n\t/**\n\t * @ignore\n\t */\n\ttranslateX?: number;\n\n\t/**\n\t * @ignore\n\t */\n\ttranslateY?: number;\n\n\t/**\n\t * Vertical centering of the map.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/#Centering_the_map} for more info\n\t */\n\trotationY?: number;\n\n\t/**\n\t * Horizontal centering of the map.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/#Centering_the_map} for more info\n\t */\n\trotationX?: number;\n\n\t/**\n\t * Depth centering of the map.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/#Centering_the_map} for more info\n\t */\n\trotationZ?: number;\n\n\t/**\n\t * Highest zoom level map is allowed to zoom in to.\n\t *\n\t * @deault 32\n\t */\n\tmaxZoomLevel?: number;\n\n\t/**\n\t * Lowest zoom level map is allowed to zoom in to.\n\t *\n\t * @deault 1\n\t */\n\tminZoomLevel?: number;\n\n\t/**\n\t * Increment zoom level by `zoomStep` when user zooms in via [[ZoomControl]] or\n\t * API.\n\t *\n\t * @default 2\n\t */\n\tzoomStep?: number;\n\n\t/**\n\t * Defines what happens when map is being dragged horizontally.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Panning} for more info\n\t * @default \"translateX\"\n\t */\n\tpanX?: \"none\" | \"rotateX\" | \"translateX\";\n\n\t/**\n\t * Defines what happens when map is being dragged vertically.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Panning} for more info\n\t * @default \"translateY\"\n\t */\n\tpanY?: \"none\" | \"rotateY\" | \"translateY\";\n\n\t/**\n\t * Enables pinch-zooming of the map on multi-touch devices.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Pinch_zoom} for more info\n\t * @default true\n\t */\n\tpinchZoom?: boolean;\n\n\t/**\n\t * Defines what happens when mouse wheel is turned horizontally.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Mouse_wheel_behavior} for more info\n\t * @default \"none\"\n\t */\n\twheelX?: \"none\" | \"zoom\" | \"rotateX\" | \"rotateY\";\n\n\t/**\n\t * Defines what happens when mouse wheel is turned vertically.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Mouse_wheel_behavior} for more info\n\t * @default \"zoom\"\n\t */\n\twheelY?: \"none\" | \"zoom\" | \"rotateX\" | \"rotateY\";\n\n\t/**\n\t * Sensitivity of a mouse wheel.\n\t *\n\t * @default 1\n\t */\n\twheelSensitivity?: number;\n\n\t/**\n\t * Duration of mouse-wheel action animation, in milliseconds.\n\t */\n\twheelDuration?: number;\n\n\t/**\n\t * An easing function to use for mouse wheel action animations.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/animations/#Easing_functions} for more info\n\t * @default am5.ease.out($ease.cubic)\n\t */\n\twheelEasing?: (t: Time) => Time;\n\n\t/**\n\t * Duration of zoom/pan animations, in milliseconds.\n\t */\n\tanimationDuration?: number;\n\n\t/**\n\t * An easing function to use for zoom/pan animations.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/animations/#Easing_functions} for more info\n\t * @default am5.ease.out($ease.cubic)\n\t */\n\tanimationEasing?: (t: Time) => Time;\n\n\n\t/**\n\t * A [[ZoomControl]] instance.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/#Zoom_control} for more info\n\t */\n\tzoomControl?: ZoomControl;\n\n\t/**\n\t * Initial/home zoom level.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Initial_position_and_zoom} for more info\n\t */\n\thomeZoomLevel?: number;\n\n\t/**\n\t * Initial coordinates to center map on load or `goHome()` call.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Initial_position_and_zoom} for more info\n\t */\n\thomeGeoPoint?: IGeoPoint;\n\n\t/**\n\t * How much of a map can go outside the viewport.\n\t *\n\t * @default 0.4\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Panning_outside_viewport} for more info\n\t */\n\tmaxPanOut?: number;\n\n\t/**\n\t * Setting `true` means that the map will automatically center itself (or go\n\t * to `homeGeoPoint` if set) when fully zoomed out.\n\t *\n\t * `false` would mean that zoom out will be centered around the mouse\n\t * cursor (when zooming using wheel), or current map position.\n\t * \n\t * @default true\n\t * @since 5.2.1\n\t */\n\tcenterMapOnZoomOut?: boolean;\n\n}\n\nexport interface IMapChartPrivate extends ISerialChartPrivate {\n\n\t/**\n\t * @ignore\n\t */\n\tgeoPath: GeoPath;\n\n\t/**\n\t * @ignore\n\t */\n\tmapScale: number;\n\n}\n\n\nexport interface IMapChartEvents extends ISerialChartEvents {\n\n\t/**\n\t * Invoked when geo bounds of the map change, usually after map is\n\t * initialized.\n\t */\n\tgeoboundschanged: {};\n\n}\n\n\nexport class MapChart extends SerialChart {\n\tpublic static className: string = \"MapChart\";\n\tpublic static classNames: Array = SerialChart.classNames.concat([MapChart.className]);\n\n\tdeclare public _settings: IMapChartSettings;\n\tdeclare public _privateSettings: IMapChartPrivate;\n\tdeclare public _seriesType: MapSeries;\n\tdeclare public _events: IMapChartEvents;\n\n\tprotected _downTranslateX: number | undefined;\n\tprotected _downTranslateY: number | undefined;\n\tprotected _downRotationX: number | undefined;\n\tprotected _downRotationY: number | undefined;\n\tprotected _downRotationZ: number | undefined;\n\tprotected _pLat: number = 0;\n\tprotected _pLon: number = 0;\n\n\tprotected _movePoints: { [index: number]: IPoint } = {};\n\tprotected _downZoomLevel: number = 1;\n\tprotected _doubleDownDistance: number = 0;\n\n\tprotected _dirtyGeometries: boolean = false;\n\tprotected _geometryColection: GeoJSON.GeometryCollection = { type: \"GeometryCollection\", geometries: [] };\n\n\tpublic _centerLocation: [number, number] | null = null;\n\n\tprotected _za?: Animation;\n\tprotected _rxa?: Animation;\n\tprotected _rya?: Animation;\n\tprotected _txa?: Animation;\n\tprotected _tya?: Animation;\n\n\tprotected _mapBounds = [[0, 0], [0, 0]];\n\n\tprotected _geoCentroid: IGeoPoint = { longitude: 0, latitude: 0 };\n\tprotected _geoBounds: { left: number, right: number, top: number, bottom: number } = { left: 0, right: 0, top: 0, bottom: 0 };\n\tprotected _prevGeoBounds: { left: number, right: number, top: number, bottom: number } = { left: 0, right: 0, top: 0, bottom: 0 };\n\n\tprotected _dispatchBounds: boolean = false;\n\n\tprotected _wheelDp: IDisposer | undefined;\n\n\tprotected _pw?: number;\n\tprotected _ph?: number;\n\n\tprotected _mapFitted: boolean = false;\n\n\tprotected _centerX: number = 0;\n\tprotected _centerY: number = 0;\n\n\tprotected _makeGeoPath() {\n\t\tconst projection = this.get(\"projection\")!;\n\t\tconst path = geoPath();\n\t\tpath.projection(projection);\n\t\tthis.setPrivateRaw(\"geoPath\", path);\n\t}\n\n\t/**\n\t * Returns a geoPoint of the current zoom position.\n\t * \n\t * You can later use it to restore zoom position, e.g.: `chart.zoomToGeoPoint(geoPoint, zoomLevel, true)`.\n\t *\n\t * @since 5.2.19\n\t */\n\tpublic geoPoint() {\n\t\treturn this.invert({ x: this.width() / 2, y: this.height() / 2 });\n\t}\n\n\t/**\n\t * Returns coordinates to geographical center of the map.\n\t */\n\tpublic geoCentroid() {\n\t\treturn this._geoCentroid;\n\t}\n\n\t/**\n\t * Returns geographical bounds of the map.\n\t */\n\tpublic geoBounds() {\n\t\treturn this._geoBounds;\n\t}\n\n\tprotected _handleSetWheel() {\n\n\t\tconst wheelX = this.get(\"wheelX\");\n\t\tconst wheelY = this.get(\"wheelY\");\n\t\tconst chartContainer = this.chartContainer;\n\n\t\tif (wheelX != \"none\" || wheelY != \"none\") {\n\t\t\tif (this._wheelDp) {\n\t\t\t\tthis._wheelDp.dispose();\n\t\t\t}\n\t\t\t\n\t\t\tthis._wheelDp = chartContainer.events.on(\"wheel\", (event) => {\n\t\t\t\tconst wheelEasing = this.get(\"wheelEasing\")!;\n\t\t\t\tconst wheelSensitivity = this.get(\"wheelSensitivity\", 1);\n\t\t\t\tconst wheelDuration = this.get(\"wheelDuration\", 0);\n\n\t\t\t\tconst wheelEvent = event.originalEvent;\n\n\t\t\t\t// Ignore wheel event if it is happening on a non-chart element, e.g. if\n\t\t\t\t// some page element is over the chart.\n\t\t\t\tif ($utils.isLocalEvent(wheelEvent, this)) {\n\t\t\t\t\twheelEvent.preventDefault();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst chartContainer = this.chartContainer;\n\t\t\t\tconst point = chartContainer._display.toLocal(event.point);\n\n\t\t\t\tif ((wheelY == \"zoom\")) {\n\t\t\t\t\tthis._handleWheelZoom(wheelEvent.deltaY, point);\n\t\t\t\t}\n\t\t\t\telse if (wheelY == \"rotateY\") {\n\t\t\t\t\tthis._handleWheelRotateY(wheelEvent.deltaY / 5 * wheelSensitivity, wheelDuration, wheelEasing);\n\t\t\t\t}\n\t\t\t\telse if (wheelY == \"rotateX\") {\n\t\t\t\t\tthis._handleWheelRotateX(wheelEvent.deltaY / 5 * wheelSensitivity, wheelDuration, wheelEasing);\n\t\t\t\t}\n\n\t\t\t\tif ((wheelX == \"zoom\")) {\n\t\t\t\t\tthis._handleWheelZoom(wheelEvent.deltaX, point);\n\t\t\t\t}\n\t\t\t\telse if (wheelX == \"rotateY\") {\n\t\t\t\t\tthis._handleWheelRotateY(wheelEvent.deltaX / 5 * wheelSensitivity, wheelDuration, wheelEasing);\n\t\t\t\t}\n\t\t\t\telse if (wheelX == \"rotateX\") {\n\t\t\t\t\tthis._handleWheelRotateX(wheelEvent.deltaX / 5 * wheelSensitivity, wheelDuration, wheelEasing);\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t\tthis._disposers.push(this._wheelDp);\n\t\t}\n\t\telse {\n\t\t\tif (this._wheelDp) {\n\t\t\t\tthis._wheelDp.dispose();\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic _prepareChildren() {\n\t\tsuper._prepareChildren();\n\n\t\tconst projection = this.get(\"projection\")!;\n\t\tconst w = this.innerWidth();\n\t\tconst h = this.innerHeight();\n\n\t\tif (this.isDirty(\"projection\")) {\n\t\t\tthis._makeGeoPath();\n\t\t\tthis.markDirtyProjection();\n\t\t\tthis._fitMap();\n\n\t\t\tprojection.scale(this.getPrivate(\"mapScale\") * this.get(\"zoomLevel\", 1));\n\t\t\tif (projection.rotate) {\n\t\t\t\tprojection.rotate([this.get(\"rotationX\", 0), this.get(\"rotationY\", 0), this.get(\"rotationZ\", 0)])\n\t\t\t}\n\n\t\t\tlet prev = this._prevSettings.projection;\n\t\t\tif (prev && prev != projection) {\n\t\t\t\tlet hw = w / 2;\n\t\t\t\tlet hh = h / 2;\n\t\t\t\tif (prev.invert) {\n\t\t\t\t\tlet centerLocation = prev.invert([hw, hh]);\n\n\t\t\t\t\tif (centerLocation) {\n\n\t\t\t\t\t\tlet xy = projection(centerLocation);\n\t\t\t\t\t\tif (xy) {\n\t\t\t\t\t\t\tlet translate = projection.translate();\n\n\t\t\t\t\t\t\tlet xx = hw - ((xy[0] - translate[0]));\n\t\t\t\t\t\t\tlet yy = hh - ((xy[1] - translate[1]));\n\n\t\t\t\t\t\t\tprojection.translate([xx, yy])\n\n\t\t\t\t\t\t\tthis.setRaw(\"translateX\", xx);\n\t\t\t\t\t\t\tthis.setRaw(\"translateY\", yy);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.isDirty(\"wheelX\") || this.isDirty(\"wheelY\")) {\n\t\t\tthis._handleSetWheel();\n\t\t}\n\t\tvar previousGeometries = this._geometryColection.geometries;\n\t\tif (this._dirtyGeometries) {\n\t\t\tthis._geometryColection.geometries = [];\n\n\t\t\tthis.series.each((series) => {\n\t\t\t\t$array.pushAll(this._geometryColection.geometries, series._geometries);\n\t\t\t})\n\t\t\n\n\t\t\tthis._fitMap();\n\t\t}\n\n\t\tif (previousGeometries.length != 0 && (w != this._pw || h != this._ph || this._dirtyGeometries)) {\n\t\t\tif (w > 0 && h > 0) {\n\t\t\t\tlet hw = w / 2;\n\t\t\t\tlet hh = h / 2;\n\n\t\t\t\tprojection.fitSize([w, h], this._geometryColection);\n\t\t\t\tconst newScale = projection.scale();\n\n\t\t\t\tthis.setPrivateRaw(\"mapScale\", newScale);\n\t\t\t\tprojection.scale(newScale * this.get(\"zoomLevel\", 1));\n\n\t\t\t\tif (this._centerLocation) {\n\t\t\t\t\tlet xy = projection(this._centerLocation);\n\t\t\t\t\tif (xy) {\n\t\t\t\t\t\tlet translate = projection.translate();\n\n\t\t\t\t\t\tlet xx = hw - ((xy[0] - translate[0]));\n\t\t\t\t\t\tlet yy = hh - ((xy[1] - translate[1]));\n\n\t\t\t\t\t\tprojection.translate([xx, yy])\n\n\t\t\t\t\t\tthis.setRaw(\"translateX\", xx);\n\t\t\t\t\t\tthis.setRaw(\"translateY\", yy);\n\n\t\t\t\t\t\tthis._centerX = translate[0];\n\t\t\t\t\t\tthis._centerY = translate[1];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.markDirtyProjection();\n\n\t\t\t\tconst geoPath = this.getPrivate(\"geoPath\");\n\t\t\t\tthis._mapBounds = geoPath.bounds(this._geometryColection);\n\t\t\t}\n\t\t}\n\n\t\tthis._pw = w;\n\t\tthis._ph = h;\n\n\t\tif (this.isDirty(\"zoomControl\")) {\n\t\t\tconst previous = this._prevSettings.zoomControl;\n\t\t\tconst zoomControl = this.get(\"zoomControl\")!;\n\t\t\tif (zoomControl !== previous) {\n\t\t\t\tthis._disposeProperty(\"zoomControl\");\n\t\t\t\tif (previous) {\n\t\t\t\t\tprevious.dispose();\n\t\t\t\t}\n\t\t\t\tif (zoomControl) {\n\t\t\t\t\tzoomControl.setPrivate(\"chart\", this);\n\t\t\t\t\tthis.children.push(zoomControl);\n\t\t\t\t}\n\n\t\t\t\tthis.setRaw(\"zoomControl\", zoomControl);\n\t\t\t}\n\t\t}\n\n\t\tif (this.isDirty(\"zoomLevel\")) {\n\t\t\tprojection.scale(this.getPrivate(\"mapScale\") * this.get(\"zoomLevel\", 1));\n\t\t\tthis.markDirtyProjection();\n\n\t\t\tthis.series.each((series) => {\n\t\t\t\tif (series.isType(\"MapPointSeries\")) {\n\t\t\t\t\tif (series.get(\"autoScale\")) {\n\t\t\t\t\t\t$array.each(series.dataItems, (dataItem) => {\n\t\t\t\t\t\t\tconst bullets = dataItem.bullets;\n\t\t\t\t\t\t\tif (bullets) {\n\t\t\t\t\t\t\t\t$array.each(bullets, (bullet) => {\n\t\t\t\t\t\t\t\t\tconst sprite = bullet.get(\"sprite\");\n\t\t\t\t\t\t\t\t\tif (sprite) {\n\t\t\t\t\t\t\t\t\t\tsprite.set(\"scale\", this.get(\"zoomLevel\"));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tif (this.isDirty(\"translateX\") || this.isDirty(\"translateY\")) {\n\t\t\tprojection.translate([this.get(\"translateX\", this.width() / 2), this.get(\"translateY\", this.height() / 2)])\n\t\t\tthis.markDirtyProjection();\n\t\t}\n\n\t\tif (projection.rotate) {\n\t\t\tif (this.isDirty(\"rotationX\") || this.isDirty(\"rotationY\") || this.isDirty(\"rotationZ\")) {\n\t\t\t\tprojection.rotate([this.get(\"rotationX\", 0), this.get(\"rotationY\", 0), this.get(\"rotationZ\", 0)])\n\t\t\t\tthis.markDirtyProjection();\n\t\t\t}\n\t\t}\n\n\t\tif (this.isDirty(\"pinchZoom\") || this.get(\"panX\") || this.get(\"panY\")) {\n\t\t\tthis._setUpTouch();\n\t\t}\n\t}\n\n\n\tprotected _fitMap() {\n\t\tconst projection = this.get(\"projection\")!;\n\n\t\tlet w = this.innerWidth();\n\t\tlet h = this.innerHeight();\n\n\t\tif (w > 0 && h > 0) {\n\t\t\tprojection.fitSize([w, h], this._geometryColection);\n\t\t\tthis.setPrivateRaw(\"mapScale\", projection.scale());\n\n\t\t\tconst translate = projection.translate();\n\n\t\t\tthis.setRaw(\"translateX\", translate[0]);\n\t\t\tthis.setRaw(\"translateY\", translate[1]);\n\n\t\t\tthis._centerX = translate[0];\n\t\t\tthis._centerY = translate[1];\n\n\t\t\tconst geoPath = this.getPrivate(\"geoPath\");\n\t\t\tthis._mapBounds = geoPath.bounds(this._geometryColection);\n\n\t\t\tthis._geoCentroid = $mapUtils.getGeoCentroid(this._geometryColection);\n\n\t\t\tconst bounds = $mapUtils.getGeoBounds(this._geometryColection);\n\t\t\tthis._geoBounds = bounds;\n\n\t\t\tif (this._geometryColection.geometries.length > 0) {\n\n\t\t\t\tbounds.left = $math.round(this._geoBounds.left, 3);\n\t\t\t\tbounds.right = $math.round(this._geoBounds.right, 3);\n\t\t\t\tbounds.top = $math.round(this._geoBounds.top, 3);\n\t\t\t\tbounds.bottom = $math.round(this._geoBounds.bottom, 3);\n\n\t\t\t\tconst prevGeoBounds = this._prevGeoBounds;\n\n\t\t\t\tif (prevGeoBounds && !$utils.sameBounds(bounds, prevGeoBounds)) {\n\t\t\t\t\tthis._dispatchBounds = true;\n\t\t\t\t\tthis._prevGeoBounds = bounds;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._mapFitted = true;\n\t\t}\n\t}\n\n\t/**\n\t * Returns geographical coordinates for calculated or manual center of the\n\t * map.\n\t */\n\tpublic homeGeoPoint(): IGeoPoint {\n\t\tlet homeGeoPoint = this.get(\"homeGeoPoint\");\n\t\tif (!homeGeoPoint) {\n\t\t\tconst geoPath = this.getPrivate(\"geoPath\");\n\t\t\tconst bounds = geoPath.bounds(this._geometryColection);\n\n\t\t\tconst left = bounds[0][0];\n\t\t\tconst top = bounds[0][1];\n\n\t\t\tconst right = bounds[1][0];\n\t\t\tconst bottom = bounds[1][1];\n\n\t\t\thomeGeoPoint = this.invert({ x: left + (right - left) / 2, y: top + (bottom - top) / 2 });\n\t\t}\n\t\treturn homeGeoPoint;\n\t}\n\n\t/**\n\t * Repositions the map to the \"home\" zoom level and center coordinates.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Resetting_position_level} for more info\n\t * @param duration Animation duration in milliseconds\n\t */\n\tpublic goHome(duration?: number) {\n\t\tthis.zoomToGeoPoint(this.homeGeoPoint(), this.get(\"homeZoomLevel\", 1), true, duration);\n\t}\n\n\tpublic _updateChildren() {\n\t\tconst projection = this.get(\"projection\")!;\n\t\tif (projection.invert) {\n\t\t\tlet w = this.innerWidth();\n\t\t\tlet h = this.innerHeight();\n\t\t\tif (w > 0 && h > 0) {\n\t\t\t\tthis._centerLocation = projection.invert([this.innerWidth() / 2, this.innerHeight() / 2]);\n\t\t\t}\n\t\t}\n\t\tsuper._updateChildren();\n\t}\n\n\tpublic _afterChanged() {\n\t\tsuper._afterChanged();\n\t\tif (this._dispatchBounds) {\n\t\t\tthis._dispatchBounds = false;\n\t\t\tconst type = \"geoboundschanged\";\n\t\t\tif (this.events.isEnabled(type)) {\n\t\t\t\tthis.events.dispatch(type, { type: type, target: this });\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _setUpTouch(): void {\n\t\tif (!this.chartContainer._display.cancelTouch) {\n\t\t\tthis.chartContainer._display.cancelTouch = (this.get(\"pinchZoom\") || this.get(\"panX\") || this.get(\"panY\")) ? true : false;\n\t\t}\n\t}\n\n\n\t/**\n\t * @ignore\n\t */\n\tpublic markDirtyGeometries() {\n\t\tthis._dirtyGeometries = true;\n\t\tthis.markDirty();\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic markDirtyProjection() {\n\t\tthis.series.each((series) => {\n\t\t\tseries.markDirtyProjection();\n\t\t})\n\t}\n\n\tprotected _afterNew() {\n\t\tthis._defaultThemes.push(MapChartDefaultTheme.new(this._root));\n\t\tthis._settings.themeTags = $utils.mergeTags(this._settings.themeTags, [\"map\"]);\n\n\t\tsuper._afterNew();\n\n\t\tthis._makeGeoPath();\n\n\t\tthis.chartContainer.children.push(this.seriesContainer);\n\n\t\tif (this.get(\"translateX\") == null) {\n\t\t\tthis.set(\"translateX\", this.width() / 2);\n\t\t}\n\t\tif (this.get(\"translateY\") == null) {\n\t\t\tthis.set(\"translateY\", this.height() / 2);\n\t\t}\n\n\t\t// Setting trasnparent background so that full body of the plot container\n\t\t// is interactive\n\t\tthis.chartContainer.set(\"interactive\", true);\n\t\tthis.chartContainer.set(\"interactiveChildren\", false);\n\t\tthis.chartContainer.set(\"background\", Rectangle.new(this._root, {\n\t\t\tthemeTags: [\"map\", \"background\"],\n\t\t\tfill: Color.fromHex(0x000000),\n\t\t\tfillOpacity: 0\n\t\t}));\n\n\t\tthis._disposers.push(this.chartContainer.events.on(\"pointerdown\", (event) => {\n\t\t\tthis._handleChartDown(event);\n\t\t}));\n\n\t\tthis._disposers.push(this.chartContainer.events.on(\"globalpointerup\", (event) => {\n\t\t\tthis._handleChartUp(event);\n\t\t}));\n\n\t\tthis._disposers.push(this.chartContainer.events.on(\"globalpointermove\", (event) => {\n\t\t\tthis._handleChartMove(event);\n\t\t}));\n\n\t\tlet license = false;\n\t\tfor (let i = 0; i < registry.licenses.length; i++) {\n\t\t\tif (registry.licenses[i].match(/^AM5M.{5,}/i)) {\n\t\t\t\tlicense = true;\n\t\t\t}\n\t\t}\n\t\tif (!license) {\n\t\t\tthis._root._showBranding();\n\t\t}\n\n\t\tthis._setUpTouch();\n\n\t}\n\n\tprotected _handleChartDown(event: ISpritePointerEvent) {\n\n\t\tthis._downZoomLevel = this.get(\"zoomLevel\", 1);\n\n\n\t\tlet count = $object.keys(this.chartContainer._downPoints).length;\n\t\tif (count > 0) {\n\t\t\tthis._downTranslateX = this.get(\"translateX\");\n\t\t\tthis._downTranslateY = this.get(\"translateY\");\n\t\t\tthis._downRotationX = this.get(\"rotationX\");\n\t\t\tthis._downRotationY = this.get(\"rotationY\");\n\t\t\tthis._downRotationZ = this.get(\"rotationZ\");\n\n\t\t\tconst downId = this.chartContainer._getDownPointId();\n\t\t\tif (downId) {\n\t\t\t\tlet movePoint = this._movePoints[downId];\n\t\t\t\tif (movePoint) {\n\t\t\t\t\tthis.chartContainer._downPoints[downId] = movePoint;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if (count == 0) {\n\n\t\t\tlet bg = this.chartContainer.get(\"background\");\n\t\t\tif (bg) {\n\t\t\t\tbg.events.enableType(\"click\");\n\t\t\t}\n\n\t\t\tif (this.get(\"panX\") || this.get(\"panY\")) {\n\n\t\t\t\tif (this._za) {\n\t\t\t\t\tthis._za.stop();\n\t\t\t\t}\n\t\t\t\tif (this._txa) {\n\t\t\t\t\tthis._txa.stop();\n\t\t\t\t}\n\t\t\t\tif (this._tya) {\n\t\t\t\t\tthis._tya.stop();\n\t\t\t\t}\n\t\t\t\tif (this._rxa) {\n\t\t\t\t\tthis._rxa.stop();\n\t\t\t\t}\n\t\t\t\tif (this._rya) {\n\t\t\t\t\tthis._rya.stop();\n\t\t\t\t}\n\n\t\t\t\tconst downPoint = this.chartContainer._display.toLocal(event.point);\n\t\t\t\tthis._downTranslateX = this.get(\"translateX\");\n\t\t\t\tthis._downTranslateY = this.get(\"translateY\");\n\t\t\t\tthis._downRotationX = this.get(\"rotationX\");\n\t\t\t\tthis._downRotationY = this.get(\"rotationY\");\n\t\t\t\tthis._downRotationZ = this.get(\"rotationZ\");\n\n\t\t\t\tlet projection = this.get(\"projection\")!;\n\n\t\t\t\tif (projection.invert) {\n\t\t\t\t\tlet l0 = projection.invert([downPoint.x, downPoint.y]);\n\t\t\t\t\tlet l1 = projection.invert([downPoint.x + 1, downPoint.y + 1]);\n\t\t\t\t\tif (l0 && l1) {\n\t\t\t\t\t\tthis._pLon = Math.abs(l1[0] - l0[0]);\n\t\t\t\t\t\tthis._pLat = Math.abs(l1[1] - l0[1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Converts screen coordinates (X and Y) within chart to latitude and\n\t * longitude.\n\t * \n\t * @param point Screen coordinates\n\t * @return Geographical coordinates\n\t */\n\tpublic invert(point: IPoint): IGeoPoint {\n\t\tlet projection = this.get(\"projection\")!;\n\n\t\tif (projection.invert) {\n\t\t\tconst ll = projection.invert([point.x, point.y]);\n\t\t\tif (ll) {\n\t\t\t\treturn { longitude: ll[0], latitude: ll[1] };\n\t\t\t}\n\t\t}\n\n\t\treturn { longitude: 0, latitude: 0 };\n\t}\n\n\t/**\n\t * Converts latitude/longitude to screen coordinates (X and Y).\n\t * \n\t * @param point Geographical coordinates\n\t * @return Screen coordinates\n\t */\n\tpublic convert(point: IGeoPoint): IPoint {\n\t\tlet projection = this.get(\"projection\")!;\n\n\t\tconst xy = projection([point.longitude, point.latitude]);\n\n\t\tif (xy) {\n\t\t\treturn { x: xy[0], y: xy[1] };\n\t\t}\n\n\t\treturn { x: 0, y: 0 };\n\t}\n\n\tprotected _handleChartUp(_event: ISpritePointerEvent) {\n\t\tthis.chartContainer._downPoints = {}\n\t}\n\n\tprotected _handlePinch() {\n\t\tconst chartContainer = this.chartContainer;\n\t\tlet i = 0;\n\t\tlet downPoints: Array = [];\n\t\tlet movePoints: Array = [];\n\n\t\t$object.each(chartContainer._downPoints, (k, point) => {\n\t\t\tdownPoints[i] = point;\n\t\t\tlet movePoint = this._movePoints[k];\n\t\t\tif (movePoint) {\n\t\t\t\tmovePoints[i] = movePoint;\n\t\t\t}\n\t\t\ti++;\n\t\t});\n\n\t\tif (downPoints.length > 1 && movePoints.length > 1) {\n\t\t\tconst display = chartContainer._display;\n\n\t\t\tlet downPoint0 = downPoints[0];\n\t\t\tlet downPoint1 = downPoints[1];\n\n\t\t\tlet movePoint0 = movePoints[0];\n\t\t\tlet movePoint1 = movePoints[1];\n\n\t\t\tif (downPoint0 && downPoint1 && movePoint0 && movePoint1) {\n\n\t\t\t\tdownPoint0 = display.toLocal(downPoint0);\n\t\t\t\tdownPoint1 = display.toLocal(downPoint1);\n\n\t\t\t\tmovePoint0 = display.toLocal(movePoint0);\n\t\t\t\tmovePoint1 = display.toLocal(movePoint1);\n\n\t\t\t\tlet initialDistance = Math.hypot(downPoint1.x - downPoint0.x, downPoint1.y - downPoint0.y);\n\t\t\t\tlet currentDistance = Math.hypot(movePoint1.x - movePoint0.x, movePoint1.y - movePoint0.y);\n\n\t\t\t\tlet level = currentDistance / initialDistance * this._downZoomLevel;\n\t\t\t\tlevel = $math.fitToRange(level, this.get(\"minZoomLevel\", 1), this.get(\"maxZoomLevel\", 32));\n\n\t\t\t\tlet moveCenter = { x: movePoint0.x + (movePoint1.x - movePoint0.x) / 2, y: movePoint0.y + (movePoint1.y - movePoint0.y) / 2 };\n\t\t\t\tlet downCenter = { x: downPoint0.x + (downPoint1.x - downPoint0.x) / 2, y: downPoint0.y + (downPoint1.y - downPoint0.y) / 2 };\n\n\t\t\t\tlet tx = this._downTranslateX || 0;\n\t\t\t\tlet ty = this._downTranslateY || 0;\n\n\t\t\t\tlet zoomLevel = this._downZoomLevel;\n\n\t\t\t\tlet xx = moveCenter.x - (- tx + downCenter.x) / zoomLevel * level;\n\t\t\t\tlet yy = moveCenter.y - (- ty + downCenter.y) / zoomLevel * level;\n\n\t\t\t\tthis.set(\"zoomLevel\", level);\n\t\t\t\tthis.set(\"translateX\", xx);\n\t\t\t\tthis.set(\"translateY\", yy);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _handleChartMove(event: ISpritePointerEvent) {\n\t\tconst chartContainer = this.chartContainer;\n\t\tlet downPoint = chartContainer._getDownPoint();\n\t\tconst downPointId = chartContainer._getDownPointId();\n\t\tconst originalEvent = event.originalEvent as any;\n\n\t\tconst pointerId = originalEvent.pointerId;\n\n\t\tif (this.get(\"pinchZoom\")) {\n\t\t\tif (pointerId) {\n\t\t\t\tthis._movePoints[pointerId] = event.point;\n\n\t\t\t\tif ($object.keys(chartContainer._downPoints).length > 1) {\n\t\t\t\t\tthis._handlePinch();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (downPointId && pointerId && pointerId != downPointId) {\n\t\t\treturn;\n\t\t}\n\t\telse {\n\t\t\tif (downPoint) {\n\t\t\t\tconst panX = this.get(\"panX\");\n\t\t\t\tconst panY = this.get(\"panY\");\n\t\t\t\tif (panX != \"none\" || panY != \"none\") {\n\t\t\t\t\tconst display = chartContainer._display;\n\t\t\t\t\tlet local = display.toLocal(event.point);\n\t\t\t\t\tdownPoint = display.toLocal(downPoint);\n\n\t\t\t\t\tlet x = this._downTranslateX;\n\t\t\t\t\tlet y = this._downTranslateY;\n\n\t\t\t\t\tif (Math.hypot(downPoint.x - local.x, downPoint.y - local.y) > 5) {\n\t\t\t\t\t\tlet bg = chartContainer.get(\"background\");\n\t\t\t\t\t\tif (bg) {\n\t\t\t\t\t\t\tbg.events.disableType(\"click\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($type.isNumber(x) && $type.isNumber(y)) {\n\t\t\t\t\t\t\tlet projection = this.get(\"projection\")!;\n\t\t\t\t\t\t\tconst zoomLevel = this.get(\"zoomLevel\", 1);\n\n\t\t\t\t\t\t\tconst maxPanOut = this.get(\"maxPanOut\", 0.4);\n\t\t\t\t\t\t\tconst bounds = this._mapBounds;\n\n\t\t\t\t\t\t\tconst w = this.width();\n\t\t\t\t\t\t\tconst h = this.height();\n\n\t\t\t\t\t\t\tconst ww = bounds[1][0] - bounds[0][0];\n\t\t\t\t\t\t\tconst hh = bounds[1][1] - bounds[0][1];\n\n\t\t\t\t\t\t\tif (panX == \"translateX\") {\n\t\t\t\t\t\t\t\tx += local.x - downPoint.x;\n\n\t\t\t\t\t\t\t\tconst cx = w / 2 - (w / 2 - this._centerX) * zoomLevel;\n\t\t\t\t\t\t\t\tx = Math.min(x, cx + ww * maxPanOut * zoomLevel);\n\t\t\t\t\t\t\t\tx = Math.max(x, cx - ww * maxPanOut * zoomLevel);\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (panY == \"translateY\") {\n\t\t\t\t\t\t\t\ty += local.y - downPoint.y;\n\t\t\t\t\t\t\t\tconst cy = h / 2 - (h / 2 - this._centerY) * zoomLevel;\n\t\t\t\t\t\t\t\ty = Math.min(y, cy + hh * maxPanOut * zoomLevel);\n\t\t\t\t\t\t\t\ty = Math.max(y, cy - hh * maxPanOut * zoomLevel);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthis.set(\"translateX\", x);\n\t\t\t\t\t\t\tthis.set(\"translateY\", y);\n\n\t\t\t\t\t\t\tif (projection.invert) {\n\t\t\t\t\t\t\t\tlet downLocation = projection.invert([downPoint.x, downPoint.y]);\n\t\t\t\t\t\t\t\tif (location && downLocation) {\n\t\t\t\t\t\t\t\t\tif (panX == \"rotateX\") {\n\t\t\t\t\t\t\t\t\t\tthis.set(\"rotationX\", this._downRotationX! - (downPoint.x - local.x) * this._pLon);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (panY == \"rotateY\") {\n\t\t\t\t\t\t\t\t\t\tthis.set(\"rotationY\", this._downRotationY! + (downPoint.y - local.y) * this._pLat);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _handleWheelRotateY(delta: number, duration: number, easing: (t: Time) => Time) {\n\t\tthis._rya = this.animate({ key: \"rotationY\", to: this.get(\"rotationY\", 0) - delta, duration: duration, easing: easing });\n\t}\n\n\tprotected _handleWheelRotateX(delta: number, duration: number, easing: (t: Time) => Time) {\n\t\tthis._rxa = this.animate({ key: \"rotationX\", to: this.get(\"rotationX\", 0) - delta, duration: duration, easing: easing });\n\t}\n\n\tprotected _handleWheelZoom(delta: number, point: IPoint) {\n\t\tlet step = this.get(\"zoomStep\", 2);\n\t\tlet zoomLevel = this.get(\"zoomLevel\", 1);\n\t\tlet newZoomLevel = zoomLevel;\n\t\tif (delta > 0) {\n\t\t\tnewZoomLevel = zoomLevel / step;\n\t\t}\n\t\telse if (delta < 0) {\n\t\t\tnewZoomLevel = zoomLevel * step;\n\t\t}\n\n\t\tif (newZoomLevel != zoomLevel) {\n\t\t\tthis.zoomToPoint(point, newZoomLevel)\n\t\t}\n\t}\n\n\t/**\n\t * Zoom the map to geographical bounds.\n\t *\n\t * @param geoBounds Bounds\n\t * @param duration Animation duration in milliseconds\n\t */\n\tpublic zoomToGeoBounds(geoBounds: { left: number, right: number, top: number, bottom: number }, duration?: number): Animation | undefined {\n\t\tif (geoBounds.right < geoBounds.left) {\n\t\t\tgeoBounds.right = 180;\n\t\t\tgeoBounds.left = -180;\n\t\t}\n\n\t\tconst geoPath = this.getPrivate(\"geoPath\");\n\t\tconst mapBounds = geoPath.bounds(this._geometryColection);\n\n\t\tlet p0 = this.convert({ longitude: geoBounds.left, latitude: geoBounds.top });\n\t\tlet p1 = this.convert({ longitude: geoBounds.right, latitude: geoBounds.bottom });\n\n\t\tif (p0.y < mapBounds[0][1]) {\n\t\t\tp0.y = mapBounds[0][1];\n\t\t}\n\n\t\tif (p1.y > mapBounds[1][1]) {\n\t\t\tp1.y = mapBounds[1][1];\n\t\t}\n\n\t\tlet zl = this.get(\"zoomLevel\", 1);\n\n\t\tlet bounds = { left: p0.x, right: p1.x, top: p0.y, bottom: p1.y };\n\n\t\tlet seriesContainer = this.seriesContainer;\n\n\t\tlet zoomLevel = .9 * Math.min(seriesContainer.innerWidth() / (bounds.right - bounds.left) * zl, seriesContainer.innerHeight() / (bounds.bottom - bounds.top) * zl);\n\t\tlet x = bounds.left + (bounds.right - bounds.left) / 2;\n\t\tlet y = bounds.top + (bounds.bottom - bounds.top) / 2;\n\n\t\tlet geoPoint = this.invert({ x, y });\n\n\t\treturn this.zoomToGeoPoint(geoPoint, zoomLevel, true, duration);\n\t}\n\n\t/**\n\t * Zooms the map to specific screen point.\n\t *\n\t * @param point Point\n\t * @param level Zoom level\n\t * @param center Center the map\n\t * @param duration Duration of the animation in milliseconds\n\t */\n\tpublic zoomToPoint(point: IPoint, level: number, center?: boolean, duration?: number): Animation | undefined {\n\t\tif (level) {\n\t\t\tlevel = $math.fitToRange(level, this.get(\"minZoomLevel\", 1), this.get(\"maxZoomLevel\", 32));\n\t\t}\n\n\t\tif (!$type.isNumber(duration)) {\n\t\t\tduration = this.get(\"animationDuration\", 0);\n\t\t}\n\t\tconst easing = this.get(\"animationEasing\");\n\t\tconst zoomLevel = this.get(\"zoomLevel\", 1);\n\n\t\tif (this.get(\"centerMapOnZoomOut\") && level == this.get(\"homeZoomLevel\", 1)) {\n\t\t\tpoint = this.convert(this.homeGeoPoint());\n\t\t\tcenter = true;\n\t\t}\n\n\t\tlet x = point.x;\n\t\tlet y = point.y;\n\n\t\tlet tx = this.get(\"translateX\", 0);\n\t\tlet ty = this.get(\"translateY\", 0);\n\n\t\tlet cx = x;\n\t\tlet cy = y;\n\n\t\tif (center) {\n\t\t\tcx = this.width() / 2;\n\t\t\tcy = this.height() / 2;\n\t\t}\n\n\t\tlet xx = cx - ((x - tx) / zoomLevel * level);\n\t\tlet yy = cy - ((y - ty) / zoomLevel * level);\n\n\n\t\tthis._txa = this.animate({ key: \"translateX\", to: xx, duration: duration, easing: easing });\n\t\tthis._tya = this.animate({ key: \"translateY\", to: yy, duration: duration, easing: easing });\n\t\tthis._za = this.animate({ key: \"zoomLevel\", to: level, duration: duration, easing: easing });\n\n\t\tif (zoomLevel != level) {\n\t\t\tthis._root.readerAlert(this._t(\"Zoom level changed to %1\", this._root.locale, $type.numberToString(level)));\n\t\t}\n\n\t\treturn this._za;\n\t}\n\n\t/**\n\t * Zooms the map to specific geographical point.\n\t *\n\t * @param geoPoint Point\n\t * @param level Zoom level\n\t * @param center Center the map\n\t * @param duration Duration of the animation in milliseconds\n\t */\n\tpublic zoomToGeoPoint(geoPoint: IGeoPoint, level: number, center?: boolean, duration?: number): Animation | undefined {\n\t\tlet xy = this.convert(geoPoint);\n\n\t\tif (xy) {\n\t\t\treturn this.zoomToPoint(xy, level, center, duration);\n\t\t}\n\t}\n\n\t/**\n\t * Zooms the map in.\n\t */\n\tpublic zoomIn(): Animation | undefined {\n\t\treturn this.zoomToPoint({ x: this.width() / 2, y: this.height() / 2 }, this.get(\"zoomLevel\", 1) * this.get(\"zoomStep\", 2));\n\t}\n\n\t/**\n\t * Zooms the map out.\n\t */\n\tpublic zoomOut(): Animation | undefined {\n\t\treturn this.zoomToPoint({ x: this.width() / 2, y: this.height() / 2 }, this.get(\"zoomLevel\", 1) / this.get(\"zoomStep\", 2));\n\t}\n\n\tpublic _clearDirty() {\n\t\tsuper._clearDirty();\n\t\tthis._dirtyGeometries = false;\n\t\tthis._mapFitted = false;\n\t}\n\n\t/**\n\t * Returns area of a mapPolygon in square pixels.\n\t */\n\tpublic getArea(dataItem: DataItem): number {\n\t\tconst geoPath = this.getPrivate(\"geoPath\");\n\t\tconst geometry = dataItem.get(\"geometry\");\n\t\tif (geometry) {\n\t\t\treturn geoPath.area(geometry);\n\t\t}\n\t\treturn 0;\n\t}\n}\n","import identity from \"../identity.js\";\nimport stream from \"../stream.js\";\nimport pathArea from \"./area.js\";\nimport pathBounds from \"./bounds.js\";\nimport pathCentroid from \"./centroid.js\";\nimport PathContext from \"./context.js\";\nimport pathMeasure from \"./measure.js\";\nimport PathString from \"./string.js\";\n\nexport default function(projection, context) {\n var pointRadius = 4.5,\n projectionStream,\n contextStream;\n\n function path(object) {\n if (object) {\n if (typeof pointRadius === \"function\") contextStream.pointRadius(+pointRadius.apply(this, arguments));\n stream(object, projectionStream(contextStream));\n }\n return contextStream.result();\n }\n\n path.area = function(object) {\n stream(object, projectionStream(pathArea));\n return pathArea.result();\n };\n\n path.measure = function(object) {\n stream(object, projectionStream(pathMeasure));\n return pathMeasure.result();\n };\n\n path.bounds = function(object) {\n stream(object, projectionStream(pathBounds));\n return pathBounds.result();\n };\n\n path.centroid = function(object) {\n stream(object, projectionStream(pathCentroid));\n return pathCentroid.result();\n };\n\n path.projection = function(_) {\n return arguments.length ? (projectionStream = _ == null ? (projection = null, identity) : (projection = _).stream, path) : projection;\n };\n\n path.context = function(_) {\n if (!arguments.length) return context;\n contextStream = _ == null ? (context = null, new PathString) : new PathContext(context = _);\n if (typeof pointRadius !== \"function\") contextStream.pointRadius(pointRadius);\n return path;\n };\n\n path.pointRadius = function(_) {\n if (!arguments.length) return pointRadius;\n pointRadius = typeof _ === \"function\" ? _ : (contextStream.pointRadius(+_), +_);\n return path;\n };\n\n return path.projection(projection).context(context);\n}\n","import type { IMapLineSeriesDataItem, MapLineSeries } from \"./MapLineSeries\";\nimport type { IMapPolygonSeriesDataItem, MapPolygonSeries } from \"./MapPolygonSeries\";\nimport type { Bullet } from \"../../core/render/Bullet\";\nimport type { DataItem } from \"../../core/render/Component\";\nimport type { MapLine } from \"./MapLine\";\nimport type { MapPolygon } from \"./MapPolygon\";\n\nimport { MapSeries, IMapSeriesSettings, IMapSeriesDataItem, IMapSeriesPrivate } from \"./MapSeries\";\n\nimport * as $array from \"../../core/util/Array\";\nimport * as $type from \"../../core/util/Type\";\nimport * as $math from \"../../core/util/Math\";\nimport type { Animation } from \"../../core/util/Entity\";\n\nexport interface IMapPointSeriesPrivate extends IMapSeriesPrivate {\n}\n\nexport interface IMapPointSeriesDataItem extends IMapSeriesDataItem {\n\n\t/**\n\t * GeoJSON geometry of the point.\n\t */\n\tgeometry?: GeoJSON.Point | GeoJSON.MultiPoint;\n\n\t/**\n\t * Longitude.\n\t */\n\tlongitude?: number;\n\n\t/**\n\t * Latitude.\n\t */\n\tlatitude?: number;\n\n\t/**\n\t * Relative position (0-1) on the [[MapLine]] to place point on.\n\t */\n\tpositionOnLine?: number;\n\n\t/**\n\t * Automatically rotate the point bullet to face the direction of the line\n\t * it is attached to.\n\t */\n\tautoRotate?: boolean;\n\n\t/**\n\t * The angle will be added to the automatically-calculated angle.\n\t *\n\t * Can be used to reverse the direction.\n\t */\n\tautoRotateAngle?: number;\n\n\t/**\n\t * A data item from a [[MapLineSeries]] the point is attached to.\n\t */\n\tlineDataItem?: DataItem;\n\n\t/**\n\t * An ID of a [[MapLine]] the point is attached to.\n\t */\n\tlineId?: string;\n\n\t/**\n\t * A data item from a [[MapPolygonSeries]] to use for positioning of the\n\t * point.\n\t */\n\tpolygonDataItem?: DataItem;\n\n\t/**\n\t * An ID of the [[MapPolygon]] to use for centering the point.\n\t */\n\tpolygonId?: string;\n}\n\nexport interface IMapPointSeriesSettings extends IMapSeriesSettings {\n\n\t/**\n\t * A field in data that holds an ID of the related polygon.\n\t *\n\t * If set, the point will be positioned in the visual center of the target\n\t * polygon.\n\t */\n\tpolygonIdField?: string;\n\n\t/**\n\t * If set to `true` will hide all points that are in the visible range of\n\t * the map.\n\t */\n\tclipFront?: boolean;\n\n\t/**\n\t * If set to `true` will hide all points that are in the invisible range of\n\t * the map.\n\t *\n\t * For example on the side of the globe facing away from the viewer when\n\t * used with Orthographic projection.\n\t *\n\t * NOTE: not all projections have invisible side.\n\t *\n\t * @default true\n\t */\n\tclipBack?: boolean;\n\n\t/**\n\t * A field in data that holds point's longitude.\n\t */\n\tlatitudeField?: string;\n\n\t/**\n\t * A field in data that holds point's longitude.\n\t */\n\tlongitudeField?: string;\n\n\t/**\n\t * If set to `true`, bullets will resize when zooming the [[MapChart]].\n\t * \n\t * @since 5.2.8\n\t * @default false\n\t */\n\tautoScale?: boolean\n\n};\n\n/**\n * Creates a map series for displaying markers on the map.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-point-series/} for more info\n * @important\n */\nexport class MapPointSeries extends MapSeries {\n\n\tpublic static className: string = \"MapPointSeries\";\n\tpublic static classNames: Array = MapSeries.classNames.concat([MapPointSeries.className]);\n\n\tdeclare public _settings: IMapPointSeriesSettings;\n\tdeclare public _privateSettings: IMapPointSeriesPrivate;\n\tdeclare public _dataItemSettings: IMapPointSeriesDataItem;\n\n\tprotected _types: Array = [\"Point\", \"MultiPoint\"];\n\n\tprotected _afterNew() {\n\t\tthis.fields.push(\"polygonId\", \"lineId\", \"longitude\", \"latitude\");\n\t\tsuper._afterNew();\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic markDirtyProjection() {\n\t\tthis.markDirty();\n\t}\n\n\t/**\n\t * Forces a repaint of the element which relies on data.\n\t *\n\t * @since 5.0.21\n\t */\n\tpublic markDirtyValues(dataItem: DataItem) {\n\t\tsuper.markDirtyValues();\n\n\t\tif (dataItem) {\n\t\t\tthis._positionBullets(dataItem);\n\t\t}\n\t}\n\n\tprotected processDataItem(dataItem: DataItem) {\n\t\tsuper.processDataItem(dataItem);\n\t\tconst geometry = dataItem.get(\"geometry\");\n\t\tif (!geometry) {\n\t\t\tdataItem.set(\"geometry\", { type: \"Point\", coordinates: [dataItem.get(\"longitude\", 0), dataItem.get(\"latitude\", 0)] });\n\t\t}\n\t\telse {\n\t\t\tif (geometry.type == \"Point\") {\n\t\t\t\tconst coordinates = geometry.coordinates;\n\t\t\t\tif (coordinates) {\n\t\t\t\t\tdataItem.set(\"longitude\", coordinates[0]);\n\t\t\t\t\tdataItem.set(\"latitude\", coordinates[1]);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (geometry.type == \"MultiPoint\") {\n\t\t\t\tconst coordinates = geometry.coordinates;\n\t\t\t\tif (coordinates && coordinates[0]) {\n\t\t\t\t\tdataItem.set(\"longitude\", coordinates[0][0]);\n\t\t\t\t\tdataItem.set(\"latitude\", coordinates[0][1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _makeBullets(dataItem: DataItem) {\n\t\tdataItem.bullets = [];\n\n\t\tthis.bullets.each((bulletFunction) => {\n\t\t\tconst geometry = dataItem.get(\"geometry\");\n\n\t\t\tif (geometry) {\n\t\t\t\tif (geometry.type == \"Point\") {\n\t\t\t\t\tthis._makeBullet(dataItem, bulletFunction);\n\t\t\t\t}\n\t\t\t\telse if (geometry.type = \"MultiPoint\") {\n\t\t\t\t\tlet i = 0;\n\t\t\t\t\t$array.each(geometry.coordinates, () => {\n\t\t\t\t\t\tthis._makeBullet(dataItem, bulletFunction, i);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic _positionBullet(bullet: Bullet) {\n\t\tconst sprite = bullet.get(\"sprite\");\n\t\tif (sprite) {\n\t\t\tconst dataItem = sprite.dataItem as DataItem;\n\n\t\t\tconst latitude = dataItem.get(\"latitude\");\n\t\t\tconst longitude = dataItem.get(\"longitude\");\n\t\t\tconst lineDataItem = dataItem.get(\"lineDataItem\");\n\t\t\tconst chart = this.chart;\n\t\t\tlet line: MapLine | undefined;\n\t\t\tif (lineDataItem) {\n\t\t\t\tline = lineDataItem.get(\"mapLine\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst lineId = dataItem.get(\"lineId\");\n\n\t\t\t\tif (lineId && chart) {\n\t\t\t\t\tchart.series.each((series) => {\n\t\t\t\t\t\tif (series.isType(\"MapLineSeries\")) {\n\t\t\t\t\t\t\tlet lineDI = series.getDataItemById(lineId);\n\t\t\t\t\t\t\tif (lineDI) {\n\t\t\t\t\t\t\t\tdataItem.set(\"lineDataItem\", lineDI);\n\t\t\t\t\t\t\t\tline = lineDI.get(\"mapLine\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tconst polygonDataItem = dataItem.get(\"polygonDataItem\");\n\t\t\tlet polygon: MapPolygon | undefined;\n\t\t\tif (polygonDataItem) {\n\t\t\t\tpolygon = polygonDataItem.get(\"mapPolygon\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst polygonId = dataItem.get(\"polygonId\");\n\n\t\t\t\tif (polygonId && chart) {\n\t\t\t\t\tchart.series.each((series) => {\n\t\t\t\t\t\tif (series.isType(\"MapPolygonSeries\")) {\n\t\t\t\t\t\t\tlet polygonDI = series.getDataItemById(polygonId);\n\t\t\t\t\t\t\tif (polygonDI) {\n\t\t\t\t\t\t\t\tdataItem.set(\"polygonDataItem\", polygonDI);\n\t\t\t\t\t\t\t\tpolygon = polygonDI.get(\"mapPolygon\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst positionOnLine = dataItem.get(\"positionOnLine\");\n\t\t\tlet coordinates: [number, number] | undefined;\n\n\t\t\tlet angle: number | undefined;\n\n\t\t\tif (polygon) {\n\t\t\t\tlet geoPoint = polygon.visualCentroid();\n\t\t\t\tcoordinates = [geoPoint.longitude, geoPoint.latitude];\n\t\t\t\tdataItem.setRaw(\"longitude\", geoPoint.longitude);\n\t\t\t\tdataItem.setRaw(\"latitude\", geoPoint.latitude);\n\t\t\t}\n\t\t\telse if (line && $type.isNumber(positionOnLine)) {\n\t\t\t\tlet geoPoint = line.positionToGeoPoint(positionOnLine);\n\t\t\t\tcoordinates = [geoPoint.longitude, geoPoint.latitude];\n\n\t\t\t\tif (dataItem.get(\"autoRotate\", bullet.get(\"autoRotate\")) && chart) {\n\t\t\t\t\tconst geoPoint0 = line.positionToGeoPoint(positionOnLine - 0.002);\n\t\t\t\t\tconst geoPoint1 = line.positionToGeoPoint(positionOnLine + 0.002);\n\n\t\t\t\t\tconst point0 = chart.convert(geoPoint0);\n\t\t\t\t\tconst point1 = chart.convert(geoPoint1);\n\n\t\t\t\t\t//dataItem.set(\"autoRotateAngle\", $math.getAngle(point0, point1));\n\t\t\t\t\tangle = $math.getAngle(point0, point1);\n\t\t\t\t}\n\n\t\t\t\tdataItem.setRaw(\"longitude\", geoPoint.longitude);\n\t\t\t\tdataItem.setRaw(\"latitude\", geoPoint.latitude);\n\t\t\t}\n\t\t\telse if ($type.isNumber(longitude) && $type.isNumber(latitude)) {\n\t\t\t\tcoordinates = [longitude, latitude];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst geometry = dataItem.get(\"geometry\")!;\n\t\t\t\tif (geometry) {\n\t\t\t\t\tif (geometry.type == \"Point\") {\n\t\t\t\t\t\tthis._positionBulletReal(bullet, geometry, geometry.coordinates as [number, number], angle);\n\t\t\t\t\t}\n\t\t\t\t\telse if (geometry.type == \"MultiPoint\") {\n\t\t\t\t\t\tlet index = bullet._index || 0;\n\t\t\t\t\t\tcoordinates = geometry.coordinates[index] as [number, number];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (coordinates) {\n\t\t\t\tthis._positionBulletReal(bullet, { type: \"Point\", coordinates: coordinates }, coordinates, angle);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _positionBulletReal(bullet: Bullet, geometry: GeoJSON.Geometry, coordinates: [number, number], angle?: number) {\n\t\tconst sprite = bullet.get(\"sprite\");\n\t\tconst chart = this.chart;\n\t\tif (chart) {\n\t\t\tconst projection = chart.get(\"projection\")!;\n\t\t\tconst geoPath = chart.getPrivate(\"geoPath\");\n\t\t\tconst dataItem: DataItem = sprite.dataItem as DataItem;\n\n\t\t\tconst xy = projection(coordinates as any);\n\n\t\t\tif (xy) {\n\t\t\t\tsprite.setAll({ x: xy[0], y: xy[1] });\n\t\t\t}\n\n\t\t\tlet visible = true;\n\t\t\tif (geoPath(geometry)) {\n\t\t\t\tif (this.get(\"clipFront\")) {\n\t\t\t\t\tvisible = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (this.get(\"clipBack\")) {\n\t\t\t\t\tvisible = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsprite.setPrivate(\"visible\", visible);\n\n\t\t\tif (dataItem && angle != null && dataItem.get(\"autoRotate\", bullet.get(\"autoRotate\"))) {\n\t\t\t\tsprite.set(\"rotation\", angle + dataItem.get(\"autoRotateAngle\", bullet.get(\"autoRotateAngle\", 0)));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Centers the map to specific series' data item and zooms to the level\n\t * specified in the parameters.\n\t *\n\t * @param dataItem Map point\n\t * @param zoomLevel Zoom level\n\t */\n\tpublic zoomToDataItem(dataItem: DataItem, zoomLevel: number): Animation | undefined {\n\t\tconst chart = this.chart;\n\t\tif (chart) {\n\t\t\treturn chart.zoomToGeoPoint({ longitude: dataItem.get(\"longitude\", 0), latitude: dataItem.get(\"latitude\", 0) }, zoomLevel, true);\n\t\t}\n\t}\n\n\n\t/**\n\t * @ignore\n\t */\n\tpublic disposeDataItem(dataItem: DataItem) {\n\t\tconst chart = this.chart;\n\t\tif (chart) {\n\t\t\tchart.series.each((series) => {\n\t\t\t\tif (series.isType(\"MapLineSeries\")) {\n\t\t\t\t\t$array.each(series.dataItems, (di) => {\n\t\t\t\t\t\tconst pointsToConnect = di.get(\"pointsToConnect\");\n\t\t\t\t\t\tif (pointsToConnect) {\n\t\t\t\t\t\t\t$array.each(pointsToConnect, (point) => {\n\t\t\t\t\t\t\t\tif (point == dataItem) {\n\t\t\t\t\t\t\t\t\t$array.remove(pointsToConnect, point);\n\t\t\t\t\t\t\t\t\tseries.markDirtyValues(di);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tsuper.disposeDataItem(dataItem);\n\t}\n\n}\n","import { Graphics, IGraphicsSettings, IGraphicsPrivate } from \"../../core/render/Graphics\";\nimport type { MapPolygonSeries } from \"./MapPolygonSeries\";\nimport type { IGeoPoint } from \"../../core/util/IGeoPoint\";\nimport type { IPoint } from \"../../core/util/IPoint\";\nimport * as $mapUtils from \"./MapUtils\";\nimport $polylabel from \"polylabel\";\nimport { geoArea } from \"d3-geo\";\n\nexport interface IMapPolygonSettings extends IGraphicsSettings {\n\n\t/**\n\t * A GeoJSON representation of the polygons geometry.\n\t */\n\tgeometry?: GeoJSON.MultiPolygon | GeoJSON.Polygon;\n\n\t/**\n\t * @todo needs description\n\t * @default 0.5\n\t */\n\tprecision?: number;\n\n}\n\nexport interface IMapPolygonPrivate extends IGraphicsPrivate {\n}\n\n/**\n * A polygon in a [[MapPolygonSeries]].\n */\nexport class MapPolygon extends Graphics {\n\n\tdeclare public _settings: IMapPolygonSettings;\n\tdeclare public _privateSettings: IMapPolygonPrivate;\n\n\tpublic static className: string = \"MapPolygon\";\n\tpublic static classNames: Array = Graphics.classNames.concat([MapPolygon.className]);\n\tprotected _projectionDirty: boolean = false;\n\n\t/**\n\t * A [[MapPolygonSeries]] polygon belongs to.\n\t */\n\tpublic series: MapPolygonSeries | undefined;\n\n\tpublic _beforeChanged() {\n\t\tsuper._beforeChanged();\n\n\t\tif (this._projectionDirty || this.isDirty(\"geometry\") || this.isDirty(\"precision\")) {\n\t\t\tconst geometry = this.get(\"geometry\")!;\n\n\t\t\tif (geometry) {\n\t\t\t\tconst series = this.series;\n\t\t\t\tif (series) {\n\t\t\t\t\tconst projection = series.projection();\n\t\t\t\t\tif (projection) {\n\t\t\t\t\t\tprojection.precision(this.get(\"precision\", 0.5));\n\t\t\t\t\t}\n\n\t\t\t\t\tconst geoPath = series.geoPath();\n\n\t\t\t\t\tif (geoPath) {\n\t\t\t\t\t\tthis._clear = true;\n\n\t\t\t\t\t\tthis.set(\"draw\", (_display) => {\n\t\t\t\t\t\t\tgeoPath.context(this._display as any);\n\t\t\t\t\t\t\tgeoPath(geometry);\n\t\t\t\t\t\t\tgeoPath.context(null);\n\t\t\t\t\t\t})\n\n\t\t\t\t\t\tif (this.isHover()) {\n\t\t\t\t\t\t\tthis.showTooltip();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic markDirtyProjection() {\n\t\tthis.markDirty();\n\t\tthis._projectionDirty = true;\n\t}\n\n\tpublic _clearDirty() {\n\t\tsuper._clearDirty();\n\t\tthis._projectionDirty = false;\n\t}\n\n\t/**\n\t * Returns latitude/longitude of the geometrical center of the polygon.\n\t *\n\t * @return Center\n\t */\n\tpublic geoCentroid(): IGeoPoint {\n\t\tconst geometry = this.get(\"geometry\")!;\n\t\tif (geometry) {\n\t\t\treturn $mapUtils.getGeoCentroid(geometry);\n\t\t}\n\t\telse {\n\t\t\treturn { latitude: 0, longitude: 0 };\n\t\t}\n\t}\n\n\t/**\n\t * Returns latitude/longitude of the visual center of the polygon.\n\t *\n\t * @return Center\n\t */\n\tpublic visualCentroid(): IGeoPoint {\n\n\t\tlet biggestArea = 0;\n\t\tlet coordinates: number[][][] = [];\n\t\tconst geometry = this.get(\"geometry\")!;\n\n\t\tif (geometry) {\n\t\t\tif (geometry.type == \"Polygon\") {\n\t\t\t\tcoordinates = geometry.coordinates as number[][][];\n\t\t\t}\n\t\t\telse if (geometry.type == \"MultiPolygon\") {\n\t\t\t\tfor (let i = 0; i < geometry.coordinates.length; i++) {\n\t\t\t\t\tlet coords = geometry.coordinates[i] as number[][][];\n\t\t\t\t\tlet area = geoArea({ type: \"Polygon\", coordinates: coords });\n\t\t\t\t\tif (area > biggestArea) {\n\t\t\t\t\t\tcoordinates = coords;\n\t\t\t\t\t\tbiggestArea = area;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet center = $polylabel(coordinates as number[][][]);\n\t\t\treturn { longitude: center[0], latitude: center[1] };\n\n\t\t}\n\t\treturn { longitude: 0, latitude: 0 };\n\t}\n\n\n\tpublic _getTooltipPoint(): IPoint {\n\t\tconst series = this.series;\n\n\t\tif (series) {\n\t\t\tconst projection = series.projection();\n\t\t\tif (projection) {\n\t\t\t\tconst geoPoint = this.visualCentroid();\n\t\t\t\tconst xy = projection([geoPoint.longitude, geoPoint.latitude]);\n\n\t\t\t\tif (xy) {\n\t\t\t\t\treturn { x: xy[0], y: xy[1] }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { x: 0, y: 0 };\n\t}\n}\n","import type { DataItem } from \"../../core/render/Component\";\n\nimport { MapSeries, IMapSeriesSettings, IMapSeriesDataItem, IMapSeriesPrivate } from \"./MapSeries\";\nimport { MapPolygon } from \"./MapPolygon\";\nimport { Template } from \"../../core/util/Template\";\nimport { ListTemplate } from \"../../core/util/List\";\n\nimport * as $array from \"../../core/util/Array\";\nimport * as $mapUtils from \"./MapUtils\";\nimport type { Animation } from \"../../core/util/Entity\";\n\nexport interface IMapPolygonSeriesPrivate extends IMapSeriesPrivate {\n}\n\nexport interface IMapPolygonSeriesDataItem extends IMapSeriesDataItem {\n\n\t/**\n\t * Related [[MapPolygon]] object.\n\t */\n\tmapPolygon: MapPolygon;\n\n\t/**\n\t * GeoJSON geometry of the polygon.\n\t */\n\tgeometry?: GeoJSON.Polygon | GeoJSON.MultiPolygon;\n\n}\n\nexport interface IMapPolygonSeriesSettings extends IMapSeriesSettings {\n\n}\n\n/**\n * Creates a map series for displaying polygons.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-polygon-series/} for more info\n * @important\n */\nexport class MapPolygonSeries extends MapSeries {\n\n\t/**\n\t * @ignore\n\t */\n\tpublic makeMapPolygon(dataItem: DataItem): MapPolygon {\n\t\tconst mapPolygon = this.children.push(this.mapPolygons.make());\n\t\tmapPolygon._setDataItem(dataItem);\n\t\tthis.mapPolygons.push(mapPolygon);\n\t\treturn mapPolygon;\n\t}\n\n\t/**\n\t * A [[ListTemplate]] of all polygons in series.\n\t *\n\t * `mapPolygons.template` can also be used to configure polygons.\n\t *\n\t * @default new ListTemplate\n\t */\n\tpublic readonly mapPolygons: ListTemplate = new ListTemplate(\n\t\tTemplate.new({}),\n\t\t() => MapPolygon._new(this._root, {}, [this.mapPolygons.template])\n\t);\n\n\tpublic static className: string = \"MapPolygonSeries\";\n\tpublic static classNames: Array = MapSeries.classNames.concat([MapPolygonSeries.className]);\n\n\tdeclare public _settings: IMapPolygonSeriesSettings;\n\tdeclare public _privateSettings: IMapPolygonSeriesPrivate;\n\tdeclare public _dataItemSettings: IMapPolygonSeriesDataItem;\n\n\tprotected _types: Array = [\"Polygon\", \"MultiPolygon\"];\n\n\t/**\n\t * @ignore\n\t */\n\tpublic markDirtyProjection() {\n\t\t$array.each(this.dataItems, (dataItem) => {\n\t\t\tlet mapPolygon = dataItem.get(\"mapPolygon\");\n\t\t\tif (mapPolygon) {\n\t\t\t\tmapPolygon.markDirtyProjection();\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic _prepareChildren() {\n\t\tsuper._prepareChildren();\n\n\t\tif (this.isDirty(\"fill\")) {\n\t\t\tthis.mapPolygons.template.set(\"fill\", this.get(\"fill\"));\n\t\t}\n\t\tif (this.isDirty(\"stroke\")) {\n\t\t\tthis.mapPolygons.template.set(\"stroke\", this.get(\"stroke\"));\n\t\t}\n\t}\n\n\tprotected processDataItem(dataItem: DataItem) {\n\t\tsuper.processDataItem(dataItem);\n\n\t\tlet mapPolygon = dataItem.get(\"mapPolygon\");\n\t\tif (!mapPolygon) {\n\t\t\tmapPolygon = this.makeMapPolygon(dataItem);\n\t\t}\n\n\t\tdataItem.set(\"mapPolygon\", mapPolygon);\n\t\tconst geometry = dataItem.get(\"geometry\")!;\n\n\t\tif (geometry) {\n\t\t\tmapPolygon.set(\"geometry\", geometry);\n\t\t}\n\n\t\tmapPolygon.series = this;\n\n\t\tthis._addGeometry(dataItem.get(\"geometry\"));\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic disposeDataItem(dataItem: DataItem) {\n\t\tsuper.disposeDataItem(dataItem);\n\t\tconst mapPolygon = dataItem.get(\"mapPolygon\");\n\t\tif (mapPolygon) {\n\t\t\tthis.mapPolygons.removeValue(mapPolygon);\n\t\t\tmapPolygon.dispose();\n\t\t}\n\t\tthis._removeGeometry(dataItem.get(\"geometry\"));\n\t}\n\n\n\t/**\n\t * Forces a repaint of the element which relies on data.\n\t *\n\t * @since 5.0.21\n\t */\n\tpublic markDirtyValues(dataItem: DataItem) {\n\t\tsuper.markDirtyValues();\n\t\tif (dataItem) {\n\t\t\tconst mapPolygon = dataItem.get(\"mapPolygon\");\n\t\t\tif (mapPolygon) {\n\t\t\t\tmapPolygon.set(\"geometry\", dataItem.get(\"geometry\"));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Centers and zooms in on the specific polygon.\n\t *\n\t * @param dataItem Target data item\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Zooming_to_clicked_object} for more info\n\t */\n\tpublic zoomToDataItem(dataItem: DataItem):Animation | undefined {\n\t\tconst polygon = dataItem.get(\"mapPolygon\");\n\t\tif (polygon) {\n\t\t\tconst geometry = polygon.get(\"geometry\");\n\t\t\tconst chart = this.chart;\n\t\t\tif (geometry && chart) {\n\t\t\t\treturn chart.zoomToGeoBounds($mapUtils.getGeoBounds(geometry));\n\t\t\t}\n\t\t}\n\t}\n}\n","import type { MapChart } from \"./MapChart\";\n\nimport { Container, IContainerPrivate, IContainerSettings } from \"../../core/render/Container\";\nimport { Button } from \"../../core/render/Button\";\nimport { Graphics } from \"../../core/render/Graphics\";\nimport { p100 } from \"../../core/util/Percent\";\nimport { MultiDisposer } from \"../../core/util/Disposer\";\n\nexport interface IZoomControlSettings extends IContainerSettings {\n\n}\n\nexport interface IZoomControlPrivate extends IContainerPrivate {\n\n\t/**\n\t * @ignore\n\t */\n\tchart?: MapChart;\n\n}\n\n/**\n * A control that displays button for zooming [[MapChart]] in and out.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Zoom_control} for more information\n * @important\n */\nexport class ZoomControl extends Container {\n\n\t/**\n\t * A [[Button]] for zoom in.\n\t *\n\t * @default Button.new()\n\t */\n\tpublic readonly plusButton: Button = this.children.push(Button.new(this._root, { width: 36, height: 36, themeTags: [\"plus\"] }));\n\n\t/**\n\t * A [[Button]] for zoom out.\n\t *\n\t * @default Button.new()\n\t */\n\tpublic readonly minusButton: Button = this.children.push(Button.new(this._root, { width: 36, height: 36, themeTags: [\"minus\"] }));\n\n\tdeclare public _settings: IZoomControlSettings;\n\tdeclare public _privateSettings: IZoomControlPrivate;\n\n\tpublic static className: string = \"ZoomControl\";\n\tpublic static classNames: Array = Container.classNames.concat([ZoomControl.className]);\n\n\tprotected _disposer: MultiDisposer | undefined;\n\n\tprotected _afterNew() {\n\t\tsuper._afterNew();\n\n\t\tthis.set(\"position\", \"absolute\");\n\n\t\tthis.set(\"layout\", this._root.verticalLayout);\n\t\tthis.set(\"x\", p100);\n\t\tthis.set(\"centerX\", p100);\n\n\t\tthis.set(\"y\", p100);\n\t\tthis.set(\"centerY\", p100);\n\n\t\tthis.set(\"paddingRight\", 10);\n\t\tthis.set(\"paddingBottom\", 10);\n\n\t\tthis.plusButton.setAll({\n\t\t\ticon: Graphics.new(this._root, { themeTags: [\"icon\"] }),\n\t\t\tlayout: undefined\n\t\t});\n\n\t\tthis.minusButton.setAll({\n\t\t\ticon: Graphics.new(this._root, { themeTags: [\"icon\"] }),\n\t\t\tlayout: undefined\n\t\t});\n\n\t}\n\n\tpublic _prepareChildren() {\n\t\tsuper._prepareChildren();\n\n\t\tif (this.isPrivateDirty(\"chart\")) {\n\t\t\tconst chart = this.getPrivate(\"chart\");\n\t\t\tconst previous = this._prevPrivateSettings.chart;\n\t\t\tif (chart) {\n\t\t\t\tthis._disposer = new MultiDisposer([\n\t\t\t\t\tthis.plusButton.events.on(\"click\", () => {\n\t\t\t\t\t\tchart.zoomIn()\n\t\t\t\t\t}),\n\t\t\t\t\tthis.minusButton.events.on(\"click\", () => {\n\t\t\t\t\t\tchart.zoomOut()\n\t\t\t\t\t})])\n\t\t\t}\n\n\t\t\tif (previous && this._disposer) {\n\t\t\t\tthis._disposer.dispose();\n\t\t\t}\n\t\t}\n\t}\n}\n","import {asin, cos, epsilon, sin} from \"../math.js\";\nimport {azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport function orthographicRaw(x, y) {\n return [cos(y) * sin(x), sin(y)];\n}\n\northographicRaw.invert = azimuthalInvert(asin);\n\nexport default function() {\n return projection(orthographicRaw)\n .scale(249.5)\n .clipAngle(90 + epsilon);\n}\n","import projection from \"./index.js\";\n\nexport function equirectangularRaw(lambda, phi) {\n return [lambda, phi];\n}\n\nequirectangularRaw.invert = equirectangularRaw;\n\nexport default function() {\n return projection(equirectangularRaw)\n .scale(152.63);\n}\n","import {abs, asin, atan2, cos, epsilon, pi, sign, sin, sqrt} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {cylindricalEqualAreaRaw} from \"./cylindricalEqualArea.js\";\n\nexport function conicEqualAreaRaw(y0, y1) {\n var sy0 = sin(y0), n = (sy0 + sin(y1)) / 2;\n\n // Are the parallels symmetrical around the Equator?\n if (abs(n) < epsilon) return cylindricalEqualAreaRaw(y0);\n\n var c = 1 + sy0 * (2 * n - sy0), r0 = sqrt(c) / n;\n\n function project(x, y) {\n var r = sqrt(c - 2 * n * sin(y)) / n;\n return [r * sin(x *= n), r0 - r * cos(x)];\n }\n\n project.invert = function(x, y) {\n var r0y = r0 - y,\n l = atan2(x, abs(r0y)) * sign(r0y);\n if (r0y * n < 0)\n l -= pi * sign(x) * sign(r0y);\n return [l / n, asin((c - (x * x + r0y * r0y) * n * n) / (2 * n))];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicEqualAreaRaw)\n .scale(155.424)\n .center([0, 33.6442]);\n}\n","import {asin, cos, sin} from \"../math.js\";\n\nexport function cylindricalEqualAreaRaw(phi0) {\n var cosPhi0 = cos(phi0);\n\n function forward(lambda, phi) {\n return [lambda * cosPhi0, sin(phi) / cosPhi0];\n }\n\n forward.invert = function(x, y) {\n return [x / cosPhi0, asin(y * cosPhi0)];\n };\n\n return forward;\n}\n","import {degrees, pi, radians} from \"../math.js\";\nimport {projectionMutator} from \"./index.js\";\n\nexport function conicProjection(projectAt) {\n var phi0 = 0,\n phi1 = pi / 3,\n m = projectionMutator(projectAt),\n p = m(phi0, phi1);\n\n p.parallels = function(_) {\n return arguments.length ? m(phi0 = _[0] * radians, phi1 = _[1] * radians) : [phi0 * degrees, phi1 * degrees];\n };\n\n return p;\n}\n","import {epsilon} from \"../math.js\";\nimport albers from \"./albers.js\";\nimport conicEqualArea from \"./conicEqualArea.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\n\n// The projections must have mutually exclusive clip regions on the sphere,\n// as this will avoid emitting interleaving lines and polygons.\nfunction multiplex(streams) {\n var n = streams.length;\n return {\n point: function(x, y) { var i = -1; while (++i < n) streams[i].point(x, y); },\n sphere: function() { var i = -1; while (++i < n) streams[i].sphere(); },\n lineStart: function() { var i = -1; while (++i < n) streams[i].lineStart(); },\n lineEnd: function() { var i = -1; while (++i < n) streams[i].lineEnd(); },\n polygonStart: function() { var i = -1; while (++i < n) streams[i].polygonStart(); },\n polygonEnd: function() { var i = -1; while (++i < n) streams[i].polygonEnd(); }\n };\n}\n\n// A composite projection for the United States, configured by default for\n// 960×500. The projection also works quite well at 960×600 if you change the\n// scale to 1285 and adjust the translate accordingly. The set of standard\n// parallels for each region comes from USGS, which is published here:\n// http://egsc.usgs.gov/isb/pubs/MapProjections/projections.html#albers\nexport default function() {\n var cache,\n cacheStream,\n lower48 = albers(), lower48Point,\n alaska = conicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), alaskaPoint, // EPSG:3338\n hawaii = conicEqualArea().rotate([157, 0]).center([-3, 19.9]).parallels([8, 18]), hawaiiPoint, // ESRI:102007\n point, pointStream = {point: function(x, y) { point = [x, y]; }};\n\n function albersUsa(coordinates) {\n var x = coordinates[0], y = coordinates[1];\n return point = null,\n (lower48Point.point(x, y), point)\n || (alaskaPoint.point(x, y), point)\n || (hawaiiPoint.point(x, y), point);\n }\n\n albersUsa.invert = function(coordinates) {\n var k = lower48.scale(),\n t = lower48.translate(),\n x = (coordinates[0] - t[0]) / k,\n y = (coordinates[1] - t[1]) / k;\n return (y >= 0.120 && y < 0.234 && x >= -0.425 && x < -0.214 ? alaska\n : y >= 0.166 && y < 0.234 && x >= -0.214 && x < -0.115 ? hawaii\n : lower48).invert(coordinates);\n };\n\n albersUsa.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = multiplex([lower48.stream(cacheStream = stream), alaska.stream(stream), hawaii.stream(stream)]);\n };\n\n albersUsa.precision = function(_) {\n if (!arguments.length) return lower48.precision();\n lower48.precision(_), alaska.precision(_), hawaii.precision(_);\n return reset();\n };\n\n albersUsa.scale = function(_) {\n if (!arguments.length) return lower48.scale();\n lower48.scale(_), alaska.scale(_ * 0.35), hawaii.scale(_);\n return albersUsa.translate(lower48.translate());\n };\n\n albersUsa.translate = function(_) {\n if (!arguments.length) return lower48.translate();\n var k = lower48.scale(), x = +_[0], y = +_[1];\n\n lower48Point = lower48\n .translate(_)\n .clipExtent([[x - 0.455 * k, y - 0.238 * k], [x + 0.455 * k, y + 0.238 * k]])\n .stream(pointStream);\n\n alaskaPoint = alaska\n .translate([x - 0.307 * k, y + 0.201 * k])\n .clipExtent([[x - 0.425 * k + epsilon, y + 0.120 * k + epsilon], [x - 0.214 * k - epsilon, y + 0.234 * k - epsilon]])\n .stream(pointStream);\n\n hawaiiPoint = hawaii\n .translate([x - 0.205 * k, y + 0.212 * k])\n .clipExtent([[x - 0.214 * k + epsilon, y + 0.166 * k + epsilon], [x - 0.115 * k - epsilon, y + 0.234 * k - epsilon]])\n .stream(pointStream);\n\n return reset();\n };\n\n albersUsa.fitExtent = function(extent, object) {\n return fitExtent(albersUsa, extent, object);\n };\n\n albersUsa.fitSize = function(size, object) {\n return fitSize(albersUsa, size, object);\n };\n\n albersUsa.fitWidth = function(width, object) {\n return fitWidth(albersUsa, width, object);\n };\n\n albersUsa.fitHeight = function(height, object) {\n return fitHeight(albersUsa, height, object);\n };\n\n function reset() {\n cache = cacheStream = null;\n return albersUsa;\n }\n\n return albersUsa.scale(1070);\n}\n","import conicEqualArea from \"./conicEqualArea.js\";\n\nexport default function() {\n return conicEqualArea()\n .parallels([29.5, 45.5])\n .scale(1070)\n .translate([480, 250])\n .rotate([96, 0])\n .center([-0.6, 38.7]);\n}\n","import {asin, atan2, cos, sin, sqrt} from \"../math.js\";\n\nexport function azimuthalRaw(scale) {\n return function(x, y) {\n var cx = cos(x),\n cy = cos(y),\n k = scale(cx * cy);\n if (k === Infinity) return [2, 0];\n return [\n k * cy * sin(x),\n k * sin(y)\n ];\n }\n}\n\nexport function azimuthalInvert(angle) {\n return function(x, y) {\n var z = sqrt(x * x + y * y),\n c = angle(z),\n sc = sin(c),\n cc = cos(c);\n return [\n atan2(x * sc, z * cc),\n asin(z && y * sc / z)\n ];\n }\n}\n","import projection from \"./index.js\";\nimport {abs, asin, cos, epsilon2, sin, sqrt} from \"../math.js\";\n\nvar A1 = 1.340264,\n A2 = -0.081106,\n A3 = 0.000893,\n A4 = 0.003796,\n M = sqrt(3) / 2,\n iterations = 12;\n\nexport function equalEarthRaw(lambda, phi) {\n var l = asin(M * sin(phi)), l2 = l * l, l6 = l2 * l2 * l2;\n return [\n lambda * cos(l) / (M * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2))),\n l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2))\n ];\n}\n\nequalEarthRaw.invert = function(x, y) {\n var l = y, l2 = l * l, l6 = l2 * l2 * l2;\n for (var i = 0, delta, fy, fpy; i < iterations; ++i) {\n fy = l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2)) - y;\n fpy = A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2);\n l -= delta = fy / fpy, l2 = l * l, l6 = l2 * l2 * l2;\n if (abs(delta) < epsilon2) break;\n }\n return [\n M * x * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2)) / cos(l),\n asin(sin(l) / M)\n ];\n};\n\nexport default function() {\n return projection(equalEarthRaw)\n .scale(177.158);\n}\n","import projection from \"./index.js\";\nimport {abs, epsilon} from \"../math.js\";\n\nexport function naturalEarth1Raw(lambda, phi) {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n return [\n lambda * (0.8707 - 0.131979 * phi2 + phi4 * (-0.013791 + phi4 * (0.003971 * phi2 - 0.001529 * phi4))),\n phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4)))\n ];\n}\n\nnaturalEarth1Raw.invert = function(x, y) {\n var phi = y, i = 25, delta;\n do {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n phi -= delta = (phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4))) - y) /\n (1.007226 + phi2 * (0.015085 * 3 + phi4 * (-0.044475 * 7 + 0.028874 * 9 * phi2 - 0.005916 * 11 * phi4)));\n } while (abs(delta) > epsilon && --i > 0);\n return [\n x / (0.8707 + (phi2 = phi * phi) * (-0.131979 + phi2 * (-0.013791 + phi2 * phi2 * phi2 * (0.003971 - 0.001529 * phi2)))),\n phi\n ];\n};\n\nexport default function() {\n return projection(naturalEarth1Raw)\n .scale(175.295);\n}\n","'use strict';\n\nvar Queue = require('tinyqueue');\n\nif (Queue.default) Queue = Queue.default; // temporary webpack fix\n\nmodule.exports = polylabel;\nmodule.exports.default = polylabel;\n\nfunction polylabel(polygon, precision, debug) {\n precision = precision || 1.0;\n\n // find the bounding box of the outer ring\n var minX, minY, maxX, maxY;\n for (var i = 0; i < polygon[0].length; i++) {\n var p = polygon[0][i];\n if (!i || p[0] < minX) minX = p[0];\n if (!i || p[1] < minY) minY = p[1];\n if (!i || p[0] > maxX) maxX = p[0];\n if (!i || p[1] > maxY) maxY = p[1];\n }\n\n var width = maxX - minX;\n var height = maxY - minY;\n var cellSize = Math.min(width, height);\n var h = cellSize / 2;\n\n if (cellSize === 0) {\n var degeneratePoleOfInaccessibility = [minX, minY];\n degeneratePoleOfInaccessibility.distance = 0;\n return degeneratePoleOfInaccessibility;\n }\n\n // a priority queue of cells in order of their \"potential\" (max distance to polygon)\n var cellQueue = new Queue(undefined, compareMax);\n\n // cover polygon with initial cells\n for (var x = minX; x < maxX; x += cellSize) {\n for (var y = minY; y < maxY; y += cellSize) {\n cellQueue.push(new Cell(x + h, y + h, h, polygon));\n }\n }\n\n // take centroid as the first best guess\n var bestCell = getCentroidCell(polygon);\n\n // special case for rectangular polygons\n var bboxCell = new Cell(minX + width / 2, minY + height / 2, 0, polygon);\n if (bboxCell.d > bestCell.d) bestCell = bboxCell;\n\n var numProbes = cellQueue.length;\n\n while (cellQueue.length) {\n // pick the most promising cell from the queue\n var cell = cellQueue.pop();\n\n // update the best cell if we found a better one\n if (cell.d > bestCell.d) {\n bestCell = cell;\n if (debug) console.log('found best %d after %d probes', Math.round(1e4 * cell.d) / 1e4, numProbes);\n }\n\n // do not drill down further if there's no chance of a better solution\n if (cell.max - bestCell.d <= precision) continue;\n\n // split the cell into four cells\n h = cell.h / 2;\n cellQueue.push(new Cell(cell.x - h, cell.y - h, h, polygon));\n cellQueue.push(new Cell(cell.x + h, cell.y - h, h, polygon));\n cellQueue.push(new Cell(cell.x - h, cell.y + h, h, polygon));\n cellQueue.push(new Cell(cell.x + h, cell.y + h, h, polygon));\n numProbes += 4;\n }\n\n if (debug) {\n console.log('num probes: ' + numProbes);\n console.log('best distance: ' + bestCell.d);\n }\n\n var poleOfInaccessibility = [bestCell.x, bestCell.y];\n poleOfInaccessibility.distance = bestCell.d;\n return poleOfInaccessibility;\n}\n\nfunction compareMax(a, b) {\n return b.max - a.max;\n}\n\nfunction Cell(x, y, h, polygon) {\n this.x = x; // cell center x\n this.y = y; // cell center y\n this.h = h; // half the cell size\n this.d = pointToPolygonDist(x, y, polygon); // distance from cell center to polygon\n this.max = this.d + this.h * Math.SQRT2; // max distance to polygon within a cell\n}\n\n// signed distance from point to polygon outline (negative if point is outside)\nfunction pointToPolygonDist(x, y, polygon) {\n var inside = false;\n var minDistSq = Infinity;\n\n for (var k = 0; k < polygon.length; k++) {\n var ring = polygon[k];\n\n for (var i = 0, len = ring.length, j = len - 1; i < len; j = i++) {\n var a = ring[i];\n var b = ring[j];\n\n if ((a[1] > y !== b[1] > y) &&\n (x < (b[0] - a[0]) * (y - a[1]) / (b[1] - a[1]) + a[0])) inside = !inside;\n\n minDistSq = Math.min(minDistSq, getSegDistSq(x, y, a, b));\n }\n }\n\n return minDistSq === 0 ? 0 : (inside ? 1 : -1) * Math.sqrt(minDistSq);\n}\n\n// get polygon centroid\nfunction getCentroidCell(polygon) {\n var area = 0;\n var x = 0;\n var y = 0;\n var points = polygon[0];\n\n for (var i = 0, len = points.length, j = len - 1; i < len; j = i++) {\n var a = points[i];\n var b = points[j];\n var f = a[0] * b[1] - b[0] * a[1];\n x += (a[0] + b[0]) * f;\n y += (a[1] + b[1]) * f;\n area += f * 3;\n }\n if (area === 0) return new Cell(points[0][0], points[0][1], 0, polygon);\n return new Cell(x / area, y / area, 0, polygon);\n}\n\n// get squared distance from a point to a segment\nfunction getSegDistSq(px, py, a, b) {\n\n var x = a[0];\n var y = a[1];\n var dx = b[0] - x;\n var dy = b[1] - y;\n\n if (dx !== 0 || dy !== 0) {\n\n var t = ((px - x) * dx + (py - y) * dy) / (dx * dx + dy * dy);\n\n if (t > 1) {\n x = b[0];\n y = b[1];\n\n } else if (t > 0) {\n x += dx * t;\n y += dy * t;\n }\n }\n\n dx = px - x;\n dy = py - y;\n\n return dx * dx + dy * dy;\n}\n","\nexport default class TinyQueue {\n constructor(data = [], compare = defaultCompare) {\n this.data = data;\n this.length = this.data.length;\n this.compare = compare;\n\n if (this.length > 0) {\n for (let i = (this.length >> 1) - 1; i >= 0; i--) this._down(i);\n }\n }\n\n push(item) {\n this.data.push(item);\n this.length++;\n this._up(this.length - 1);\n }\n\n pop() {\n if (this.length === 0) return undefined;\n\n const top = this.data[0];\n const bottom = this.data.pop();\n this.length--;\n\n if (this.length > 0) {\n this.data[0] = bottom;\n this._down(0);\n }\n\n return top;\n }\n\n peek() {\n return this.data[0];\n }\n\n _up(pos) {\n const {data, compare} = this;\n const item = data[pos];\n\n while (pos > 0) {\n const parent = (pos - 1) >> 1;\n const current = data[parent];\n if (compare(item, current) >= 0) break;\n data[pos] = current;\n pos = parent;\n }\n\n data[pos] = item;\n }\n\n _down(pos) {\n const {data, compare} = this;\n const halfLength = this.length >> 1;\n const item = data[pos];\n\n while (pos < halfLength) {\n let left = (pos << 1) + 1;\n let best = data[left];\n const right = left + 1;\n\n if (right < this.length && compare(data[right], best) < 0) {\n left = right;\n best = data[right];\n }\n if (compare(best, item) >= 0) break;\n\n data[pos] = best;\n pos = left;\n }\n\n data[pos] = item;\n }\n}\n\nfunction defaultCompare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n","import * as m from \"./../../dist/es2015/map.js\";\nexport const am5map = m;"],"names":["this","fields","push","_setRawDefault","on","geoJSON","previous","_prevSettings","data","clear","_afterNew","_prepareChildren","_valuesDirty","isDirty","get","undefined","_geoJSONparsed","_parseGeoJSON","chart","exclude","_centerLocation","id","dataItem","getDataItemById","disposeDataItem","dataItems","indexOf","includes","excludes","length","features","type","geometry","console","log","geodataNames","i","len","feature","properties","name","_types","checkInclude","value","dataObject","dataContext","geometryType","set","processDataItem","madeFromGeoData","events","isEnabled","dispatch","target","_chart","children","moveValue","bulletsContainer","getPrivate","_geometries","markDirtyGeometries","_dispose","series","removeValue","_onDataClear","Series","MapSeries","className","Adder","constructor","_partials","Float64Array","_n","add","x","p","j","y","hi","lo","Math","abs","valueOf","n","epsilon","epsilon2","pi","PI","halfPi","quarterPi","tau","degrees","radians","atan","atan2","cos","ceil","exp","hypot","floor","pow","sin","sign","sqrt","tan","asin","haversin","noop","streamGeometry","stream","streamGeometryType","hasOwnProperty","lengthSum","lambda0","sinPhi0","cosPhi0","streamObjectType","Feature","object","FeatureCollection","Sphere","sphere","Point","coordinates","point","MultiPoint","LineString","streamLine","MultiLineString","Polygon","streamPolygon","MultiPolygon","GeometryCollection","geometries","closed","coordinate","lineStart","lineEnd","polygonStart","polygonEnd","lengthStream","lengthPointFirst","lengthLineEnd","lambda","phi","lengthPoint","sinPhi","cosPhi","delta","cosDelta","z","a","b","_beforeChanged","_projectionDirty","clipAngle","precision","_clear","display","s","segment","gp0","p0","convert","longitude","latitude","lineTo","gp","pn","_display","context","markDirty","_clearDirty","position","lineType","totalDistance","currentDistance","positionA","positionB","pointA","pointB","segments","positionAB","p1","invert","x0","y0","x1","y1","cy0","sy0","cy1","sy1","kx0","ky0","kx1","ky1","d","k","interpolate","t","B","A","distance","Graphics","MapLine","List","Template","_root","mapLines","template","mapLine","make","_setDataItem","markDirtyProjection","makeMapLine","_handlePointsToConnect","setPrivate","pointsToConnect","markDirtyValues","coords","setRaw","dispose","classNames","concat","MapLineSeries","range","start","stop","step","arguments","max","Array","graticuleX","dy","map","graticuleY","dx","makeDataItem","_dataItem","_generate","_updateChildren","graticule","X1","X0","Y1","Y0","X","Y","DX","DY","lines","filter","outline","slice","reverse","extent","_","extentMajor","extentMinor","stepMajor","stepMinor","GraticuleSeries","compose","rotationIdentity","round","rotateRadians","deltaLambda","deltaPhi","deltaGamma","rotationLambda","rotationPhiGamma","forwardRotationLambda","rotation","cosDeltaPhi","sinDeltaPhi","cosDeltaGamma","sinDeltaGamma","line","m","rejoin","pop","shift","result","Intersection","points","other","entry","o","e","v","compareIntersection","startInside","subject","clip","forEach","pointEqual","sort","current","isSubject","array","spherical","cartesian","cartesianDot","cartesianCross","cartesianAddInPlace","cartesianScale","vector","cartesianNormalizeInPlace","l","merge","arrays","from","flatten","pointVisible","clipLine","sink","polygon","ring","ringBuffer","ringSink","polygonStarted","pointRing","ringStart","ringEnd","normal","angle","winding","sum","point0","phi0","lambda1","sinPhi1","cosPhi1","point1","phi1","absDelta","antimeridian","arc","intersection","phiArc","polygonContains","pointLine","clean","ringSegments","validSegment","NaN","sign0","sign1","sinLambda0Lambda1","clipAntimeridianIntersect","to","direction","circleStream","radius","t0","t1","cosRadius","sinRadius","circleRadius","acos","cr","smallRadius","notHemisphere","visible","intersect","two","n1","n2","n2n2","n1n2","determinant","c1","c2","n1xn2","u","w","uu","t2","q","polar","q1","code","r","c0","v0","v00","point2","c","clipMax","clipMin","clipRectangle","a1","corner","comparePoint","ca","cb","x__","y__","v__","x_","y_","v_","first","activeStream","bufferStream","clipStream","linePoint","a0","b0","b1","polygonInside","cleanInside","min","ax","ay","transformer","methods","TransformStream","key","prototype","Infinity","boundsStream","bounds","fit","projection","fitBounds","clipExtent","scale","translate","fitExtent","h","fitSize","size","fitWidth","width","fitHeight","height","cosMinDistance","project","delta2","resampleLineTo","depth","d2","phi2","lambda2","x2","y2","dx2","dy2","dz","lambda00","x00","y00","a00","b00","c00","resampleStream","ringPoint","resampleNone","transformRadians","scaleTranslateRotate","sx","sy","alpha","transform","scaleTranslate","cosAlpha","sinAlpha","ai","bi","ci","fi","projectionMutator","projectAt","rotate","projectResample","projectTransform","projectRotateTransform","cache","cacheStream","theta","preclip","postclip","identity","recenter","center","apply","resample","reset","transformRotate","reflectX","reflectY","mercatorRaw","reclip","forward","mercatorProjection","setupDefaultRules","rule","ic","interfaceColors","bind","setAll","panX","panY","pinchZoom","zoomStep","zoomLevel","rotationX","rotationY","rotationZ","maxZoomLevel","minZoomLevel","wheelY","wheelX","animationEasing","wheelEasing","wheelDuration","wheelSensitivity","maxPanOut","centerMapOnZoomOut","role","clipFront","clipBack","autoScale","isMeasured","fillOpacity","strokeWidth","strokeOpacity","draw","moveTo","Theme","areaSum","areaRingSum","areaStream","areaRingStart","areaRingEnd","area","areaPointFirst","areaPoint","Z0","Z1","X2","Y2","Z2","centroidStream","centroidPoint","centroidLineStart","centroidLineEnd","centroidRingStart","centroidRingEnd","centroid","centroidPointFirstLine","centroidPointLine","centroidPointFirstRing","centroidPointRing","PathContext","_context","_radius","pointRadius","_line","_point","closePath","lengthRing","PathString","_string","_circle","join","W0","W1","phi00","z0","centroidPointCartesian","centroidLinePointFirst","centroidLinePoint","centroidRingPointFirst","centroidRingPoint","cx","cy","cz","deltaSum","ranges","areaRing","dLambda","sdLambda","adLambda","boundsLineStart","boundsLineEnd","boundsRingPoint","boundsRingStart","boundsRingEnd","inflection","phii","lambdai","rangeCompare","rangeContains","getGeoCircle","geoPoint","constant","circle","getGeoCentroid","getGeoBounds","merged","deltaMax","left","right","top","bottom","getGeoRectangle","north","east","south","west","multiPolygon","stepLong","stepLat","ln","surface","ll","lt","normalizeGeoPoint","wrapAngleTo180","latitude180","path","projectionStream","contextStream","measure","setPrivateRaw","_geoCentroid","_geoBounds","chartContainer","_wheelDp","event","wheelEvent","originalEvent","preventDefault","toLocal","_handleWheelZoom","deltaY","_handleWheelRotateY","_handleWheelRotateX","deltaX","_disposers","innerWidth","innerHeight","_makeGeoPath","_fitMap","prev","hw","hh","centerLocation","xy","xx","yy","_handleSetWheel","previousGeometries","_geometryColection","_dirtyGeometries","each","_pw","_ph","newScale","_centerX","_centerY","_mapBounds","zoomControl","_disposeProperty","isType","bullets","bullet","sprite","_setUpTouch","prevGeoBounds","_prevGeoBounds","_dispatchBounds","_mapFitted","homeGeoPoint","duration","zoomToGeoPoint","_afterChanged","cancelTouch","_defaultThemes","MapChartDefaultTheme","_settings","themeTags","seriesContainer","Rectangle","fill","Color","_handleChartDown","_handleChartUp","_handleChartMove","license","match","_showBranding","_downZoomLevel","count","_downPoints","_downTranslateX","_downTranslateY","_downRotationX","_downRotationY","_downRotationZ","downId","_getDownPointId","movePoint","_movePoints","bg","enableType","_za","_txa","_tya","_rxa","_rya","downPoint","l0","l1","_pLon","_pLat","_event","downPoints","movePoints","downPoint0","downPoint1","movePoint0","movePoint1","initialDistance","level","moveCenter","downCenter","tx","ty","_getDownPoint","downPointId","pointerId","_handlePinch","local","disableType","ww","downLocation","location","easing","animate","newZoomLevel","zoomToPoint","geoBounds","mapBounds","zl","readerAlert","_t","locale","geoPath","SerialChart","MapChart","_positionBullets","bulletFunction","_makeBullet","lineDataItem","lineDI","polygonDataItem","polygonDI","positionOnLine","visualCentroid","positionToGeoPoint","geoPoint0","geoPoint1","_positionBulletReal","index","_index","di","MapPointSeries","isHover","showTooltip","biggestArea","MapPolygon","mapPolygons","mapPolygon","makeMapPolygon","_addGeometry","_removeGeometry","zoomToGeoBounds","MapPolygonSeries","Button","verticalLayout","plusButton","icon","layout","minusButton","isPrivateDirty","_prevPrivateSettings","_disposer","zoomIn","zoomOut","Container","ZoomControl","orthographicRaw","equirectangularRaw","conicEqualAreaRaw","cylindricalEqualAreaRaw","r0","r0y","parallels","conicProjection","lower48Point","alaskaPoint","hawaiiPoint","lower48","conicEqualArea","alaska","hawaii","pointStream","albersUsa","streams","sc","cc","azimuthalInvert","A1","A2","A3","A4","M","equalEarthRaw","l2","l6","naturalEarth1Raw","phi4","Queue","polylabel","debug","minX","minY","maxX","maxY","cellSize","degeneratePoleOfInaccessibility","cellQueue","compareMax","Cell","bestCell","f","getCentroidCell","bboxCell","numProbes","cell","poleOfInaccessibility","inside","minDistSq","getSegDistSq","pointToPolygonDist","SQRT2","px","py","default","module","exports","TinyQueue","compare","defaultCompare","_down","item","_up","peek","pos","parent","halfLength","best","am5map"],"sourceRoot":""}