import type { Root } from "../../core/Root"; import type { Bullet } from "../../core/render/Bullet"; import type { IDisposer } from "../../core/util/Disposer"; import { MapPointSeries, IMapPointSeriesSettings, IMapPointSeriesPrivate, IMapPointSeriesDataItem } from "./MapPointSeries"; import { DataItem, IComponentDataItem } from "../../core/render/Component"; import * as d3hierarchy from "d3-hierarchy"; export interface IClusteredDataItem extends IComponentDataItem { /** * Data items of the points in the cluster. */ children?: Array>; /** * The bullet that shows the cluster. */ bullet?: Bullet; /** * Group id of the cluster's points. */ groupId?: string; /** * Longitude of the cluster, in degrees. */ longitude?: number; /** * Latitude of the cluster, in degrees. */ latitude?: number; /** * Average altitude of the cluster's data items, in metres. * * @since 5.21.0 */ altitude?: number; } export interface IClusteredPointSeriesDataItem extends IMapPointSeriesDataItem { /** * Id of the point's group: it clusters only with points of the same group. */ groupId?: string; /** * The cluster the point is in, if any. * @readonly */ cluster?: DataItem; /** * How far, in pixels, scattering moved the bullet horizontally. */ dx?: number; /** * How far, in pixels, scattering moved the bullet vertically. */ dy?: number; } export interface IClusteredPointSeriesPrivate extends IMapPointSeriesPrivate { } export interface IClusteredPointSeriesSettings extends IMapPointSeriesSettings { /** * Field in `data` that holds the id of the point's group. Points cluster * only with points of the same group, such as the same continent. * * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/clustered-point-series/#Group_segregation} for more info * @default "groupId" */ groupIdField?: string; /** * Points closer than this many pixels to each other are clustered. * * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/clustered-point-series/#Minimal_distance} for more info * @default 20 */ minDistance?: number; /** * A function that returns the [[Bullet]] to show a cluster with. Without * it, points aren't clustered. * * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/clustered-point-series/#Group_bullet} for more info */ clusteredBullet?: (root: Root, series: ClusteredPointSeries, dataItem: DataItem) => Bullet | undefined; /** * Once clustering stops (see `stopClusterZoom`), points closer than this * many pixels to each other are scattered so that all of them show. * * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/clustered-point-series/#Scatter_settings} for more info * @default 3 * @since 5.5.7 */ scatterDistance?: number; /** * Radius in pixels each bullet is taken to have when scattering them. * * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/clustered-point-series/#Scatter_settings} for more info * @default 8 * @since 5.5.7 */ scatterRadius?: number; /** * Clustering stops, and scattering starts, once the map is zoomed to * `maxZoomLevel` times this. * * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/clustered-point-series/#Scatter_settings} for more info * @default 0.95 * @since 5.5.7 */ stopClusterZoom?: number; /** * Waits this many milliseconds after the zoom level changes before * clustering again. Helps with many data items. * * @default 0 * @since 5.9.11 */ clusterDelay?: number; } /** * A [[MapPointSeries]] that groups points close together on screen into * clusters. Clusters are worked out again whenever the zoom level changes. * * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/clustered-point-series/} for more info * @since 5.5.6 * @important */ export declare class ClusteredPointSeries extends MapPointSeries { static className: string; static classNames: Array; _settings: IClusteredPointSeriesSettings; _privateSettings: IClusteredPointSeriesPrivate; _dataItemSettings: IClusteredPointSeriesDataItem; protected _dataItem: DataItem; protected _clusterIndex: number; protected _clusters: Array>>; clusteredDataItems: Array>; protected _scatterIndex: number; protected _scatters: Array>>; _packLayout: d3hierarchy.PackLayout; protected _spiral: Array<{ x: number; y: number; }>; protected _clusterDP?: IDisposer; protected _previousZL: number; protected _afterNew(): void; protected _afterDataChange(): void; _updateChildren(): void; protected _doTheCluster(): void; /** * Zooms the map to fit the points of a cluster. * * @param dataItem Data item of the cluster * @param rotate Also rotate the map to bring the cluster to the middle, as on a globe * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/clustered-point-series/#Drill_down} for more info */ zoomToCluster(dataItem: DataItem, rotate?: boolean): void; protected _clusterGroup(dataItems: Array>): void; protected _onDataClear(): void; protected _scatterGroup(dataItems: Array>): void; } //# sourceMappingURL=ClusteredPointSeries.d.ts.map