@amcharts/amcharts5
Version:
amCharts 5
171 lines • 6.08 kB
TypeScript
import type { IMapPointSeriesDataItem, MapPointSeries } from "./MapPointSeries";
import type { DataItem } from "../../core/render/Component";
import type { IDisposer } from "../../core/util/Disposer";
import { MapSeries, IMapSeriesSettings, IMapSeriesDataItem, IMapSeriesPrivate } from "./MapSeries";
import { MapLine } from "./MapLine";
import { ListTemplate } from "../../core/util/List";
/**
* @ignore
*/
export interface IMapLineSeriesPrivate extends IMapSeriesPrivate {
}
export interface IMapLineSeriesDataItem extends IMapSeriesDataItem {
/**
* Related [[MapLine]] object.
*/
mapLine?: MapLine;
/**
* GeoJSON geometry of the line.
*/
geometry?: GeoJSON.LineString | GeoJSON.MultiLineString;
/**
* An array of data items from [[MapPointSeries]] to use as line end-points. Note, fixed points can not be used here.
*/
pointsToConnect?: Array<DataItem<IMapPointSeriesDataItem>>;
/**
* Ids of the points the line connects, looked up in the series set as
* `pointSeries`. The points themselves stay where they are; the line follows
* them, and a config carries the ids rather than a copy of the coordinates.
*
* The line waits for every id to match a point of its own before it is drawn,
* so it is never drawn short. Fixed points cannot be used, same as with
* `pointsToConnect`.
*
* Ignored if `pointsToConnect` is set on the same data item.
*
* @since 5.20.3
*/
pointIds?: Array<string>;
/**
* A line type.
*
* * `"curved"` (default) - connects points using shortest distance, which will result in curved lines based on map projection.
* * `"straight"` - connects points using visually straight lines, and will not cross the -180/180 longitude.
*
* @default "curved"
* @since 5.2.32
*/
lineType?: "curved" | "straight";
}
export interface IMapLineSeriesSettings extends IMapSeriesSettings {
/**
* If set to `true` will hide line segments that are in the invisible range
* of the map.
*
* For example on the side of the globe facing away from the viewer when
* used with Orthographic projection.
*
* NOTE: not all projections have invisible side.
*/
clipBack?: boolean;
/**
* A line type.
*
* * `"curved"` (default) - connects points using shortest distance, which will result in curved lines based on map projection.
* * `"straight"` - connects points using visually straight lines, and will not cross the -180/180 longitude.
*
* @default "curved"
* @since 5.2.24
*/
lineType?: "curved" | "straight";
/**
* @ignore
*/
lineTypeField?: string;
/**
* A [[MapPointSeries]] the `pointIds` of a data item are looked up in.
*
* @since 5.20.3
*/
pointSeries?: MapPointSeries;
/**
* A field in data that holds ids of the points a line connects.
*
* @default "pointIds"
* @since 5.20.3
*/
pointIdsField?: string;
}
/**
* Creates a map series for displaying lines on the map.
*
* @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-line-series/} for more info
* @important
*/
export declare class MapLineSeries extends MapSeries {
protected _pointSeriesDP?: IDisposer;
/**
* The data items whose `pointsToConnect` this series worked out from
* `pointIds`, so that they can be worked out again - and one set by hand can
* be left alone.
*/
protected _derivedPoints: WeakSet<DataItem<IMapLineSeriesDataItem>>;
protected _afterNew(): void;
protected _dispose(): void;
/**
* (Re)subscribes to the current `pointSeries` so that lines whose points were
* not there yet get connected once they are.
*/
protected _setupPointSeriesListener(): void;
/**
* Retries every line that is still waiting for its points.
*/
protected _resolvePendingPointIds(): void;
/**
* Turns a data item's `pointIds` into the points themselves. Silent when an
* id matches nothing: the line waits rather than being drawn short.
*/
protected _resolvePointIds(dataItem: DataItem<this["_dataItemSettings"]>): boolean;
/**
* @ignore
*/
makeMapLine(dataItem: DataItem<this["_dataItemSettings"]>): MapLine;
/**
* A [[ListTemplate]] of all lines in series.
*
* `mapLines.template` can also be used to configure lines.
*
* @default new ListTemplate<MapLine>
*/
readonly mapLines: ListTemplate<MapLine>;
static className: string;
static classNames: Array<string>;
_settings: IMapLineSeriesSettings;
_privateSettings: IMapLineSeriesPrivate;
_dataItemSettings: IMapLineSeriesDataItem;
protected _types: Array<GeoJSON.GeoJsonGeometryTypes>;
/**
* @ignore
*/
markDirtyProjection(): void;
_prepareChildren(): void;
protected processDataItem(dataItem: DataItem<this["_dataItemSettings"]>): void;
protected _handlePointsToConnect(dataItem: DataItem<this["_dataItemSettings"]>): void;
/**
* Forces a repaint of the element which relies on data.
*
* @since 5.0.21
*/
markDirtyValues(dataItem: DataItem<this["_dataItemSettings"]>): void;
/**
* @ignore
*/
disposeDataItem(dataItem: DataItem<this["_dataItemSettings"]>): void;
/**
* @ignore
*/
protected _excludeDataItem(dataItem: DataItem<this["_dataItemSettings"]>): void;
/**
* @ignore
*/
protected _unexcludeDataItem(dataItem: DataItem<this["_dataItemSettings"]>): void;
/**
* @ignore
*/
protected _notIncludeDataItem(dataItem: DataItem<this["_dataItemSettings"]>): void;
/**
* @ignore
*/
protected _unNotIncludeDataItem(dataItem: DataItem<this["_dataItemSettings"]>): void;
}
//# sourceMappingURL=MapLineSeries.d.ts.map