import { Stream } from "../data/Stream"; import { ArrayType, BooleanType, DictType, EastFunction, EastType, Expression, FloatType, IntegerType, StringType, StructType, Variable, VariantType } from "../east"; import { ModulePath } from "../template"; /** * Defines a geographic point object type. * * @category Layout * */ export declare const GeoPoint: StructType<{ coordinates: StructType<{ x: FloatType; y: FloatType; }>; }>; /** * Type for a geographic point object type. * * @category Layout * */ export type GeoPointType = typeof GeoPoint; /** * Defines a geographic line-string object type. * * @category Layout * */ export declare const GeoLineString: StructType<{ coordinates: ArrayType>; }>; /** * Type for a geographic line-string object type. * * @category Layout * */ export type GeoLineStringType = typeof GeoLineString; /** * Defines a geographic polygon object type. * * @category Layout * */ export declare const GeoPolygon: StructType<{ coordinates: ArrayType>>; }>; /** * Type for a geographic polygon object type. * * @category Layout * */ export type GeoPolygonType = typeof GeoPolygon; /** * Defines a geographic multi-point object type. * * @category Layout * */ export declare const GeoMultiPoint: StructType<{ coordinates: ArrayType>; }>; /** * Type for a geographic multi-point object type. * * @category Layout * */ export type GeoMultiPointType = typeof GeoMultiPoint; /** * Defines a geographic multi-line-string object type. * * @category Layout * */ export declare const GeoMultiLineString: StructType<{ coordinates: ArrayType>>; }>; /** * Type for a geographic multi-line-string object type. * * @category Layout * */ export type GeoMultiLineStringType = typeof GeoMultiLineString; /** * Defines a geographic multi-polygon object type. * * @category Layout * */ export declare const GeoMultiPolygon: StructType<{ coordinates: ArrayType>>>; }>; /** * Type for a geographic multi-polygon object type. * * @category Layout * */ export type GeoMultiPolygonType = typeof GeoMultiPolygon; /** * Defines a geographic collection object type. * * @category Layout * */ export declare const GeoGeometryCollection: StructType<{ geometries: ArrayType; }>; LineString: StructType<{ coordinates: ArrayType>; }>; Polygon: StructType<{ coordinates: ArrayType>>; }>; MultiPoint: StructType<{ coordinates: ArrayType>; }>; MultiLineString: StructType<{ coordinates: ArrayType>>; }>; MultiPolygon: StructType<{ coordinates: ArrayType>>>; }>; }>>; }>; /** * Type for a geographic collection object type. * * @category Layout * */ export type GeoGeometryCollectionType = typeof GeoGeometryCollection; /** * Defines a geographic feature geometry object type. * * @category Layout * */ export declare const GeoFeatureGeometryType: VariantType<{ Point: StructType<{ coordinates: StructType<{ x: FloatType; y: FloatType; }>; }>; LineString: StructType<{ coordinates: ArrayType>; }>; Polygon: StructType<{ coordinates: ArrayType>>; }>; MultiPoint: StructType<{ coordinates: ArrayType>; }>; MultiLineString: StructType<{ coordinates: ArrayType>>; }>; MultiPolygon: StructType<{ coordinates: ArrayType>>>; }>; GeometryCollection: StructType<{ geometries: ArrayType; }>; LineString: StructType<{ coordinates: ArrayType>; }>; Polygon: StructType<{ coordinates: ArrayType>>; }>; MultiPoint: StructType<{ coordinates: ArrayType>; }>; MultiLineString: StructType<{ coordinates: ArrayType>>; }>; MultiPolygon: StructType<{ coordinates: ArrayType>>>; }>; }>>; }>; }>; /** * Defines a geographic feature object type. * * @category Layout * */ export declare const GeoFeature: StructType<{ geometry: VariantType<{ Point: StructType<{ coordinates: StructType<{ x: FloatType; y: FloatType; }>; }>; LineString: StructType<{ coordinates: ArrayType>; }>; Polygon: StructType<{ coordinates: ArrayType>>; }>; MultiPoint: StructType<{ coordinates: ArrayType>; }>; MultiLineString: StructType<{ coordinates: ArrayType>>; }>; MultiPolygon: StructType<{ coordinates: ArrayType>>>; }>; GeometryCollection: StructType<{ geometries: ArrayType; }>; LineString: StructType<{ coordinates: ArrayType>; }>; Polygon: StructType<{ coordinates: ArrayType>>; }>; MultiPoint: StructType<{ coordinates: ArrayType>; }>; MultiLineString: StructType<{ coordinates: ArrayType>>; }>; MultiPolygon: StructType<{ coordinates: ArrayType>>>; }>; }>>; }>; }>; properties: DictType; }>; /** * Type for a geographic feature object type. * * @category Layout * */ export type GeoFeatureType = typeof GeoFeature; /** * Defines a geographic tooltip object type. * * @category Layout * */ export declare const GeoTooltip: StructType<{ label: StringType; value: StringType; }>; /** * Type for a geographic tooltip object type. * * @category Layout * */ export type GeoTooltipType = typeof GeoTooltip; /** * Type for a styled version of a geographic feature object type. * * @category Layout * */ export type GeoStyledFeatureType = StructType<{ geometry: VariantType<{ Point?: GeoPointType; LineString?: GeoLineStringType; Polygon?: GeoPolygonType; MultiPoint?: GeoMultiPointType; MultiLineString?: GeoMultiLineStringType; MultiPolygon?: GeoMultiPolygonType; GeometryCollection?: GeoGeometryCollectionType; }>; properties: DictType; style?: StructType<{ label?: StringType; stroke_color?: StringType; stroke_weight?: FloatType; stroke_opacity?: FloatType; radius?: FloatType; fill_color?: StringType | FloatType | IntegerType; fill_opacity?: FloatType; }>; tooltips?: ArrayType; }>; /** * Creates a geographic styled feature representing a point on a map. * * @param def - The definition object for the point feature. * @param def.coordinates - The coordinates of the point feature, represented as an {@link Expression} of a {@link StructType} with x and y fields of {@link FloatType}. * @param def.properties - Optional properties associated with the point feature, represented as an {@link Expression} of a {@link DictType} with string keys and values. * @param def.style - Optional style properties for the point feature, represented as an {@link Expression} of a {@link StructType}. * @param def.style.label - The label text for the point feature, of {@link StringType}. * @param def.style.stroke_color - The color of the point feature's stroke, of {@link StringType}. * @param def.style.stroke_weight - The weight (thickness) of the point feature's stroke, of {@link FloatType}. * @param def.style.stroke_opacity - The opacity of the point feature's stroke, of {@link FloatType}. * @param def.style.radius - The radius of the point feature, of {@link FloatType}. * @param def.style.fill_color - The fill color of the point feature, of {@link StringType} describing a hex color, or for a heatmap from {@link FloatType} or {@link IntegerType}. * @param def.style.fill_opacity - The fill opacity of the point feature, of {@link FloatType}. * @param def.tooltips - Optional tooltips associated with the point feature, represented as an {@link Expression} of an {@link ArrayType} containing geographic tooltip objects. * * @returns An {@link EastFunction} that represents the geographic styled feature for the point. * * @category Layout */ export declare function PointFeature(def: { coordinates: Expression>; properties?: Expression>; style?: Expression>; tooltips?: Expression>; }): EastFunction; /** * Creates a geographic styled feature representing a multi-point on a map. * * @param def - The definition object for the multi-point feature. * @param def.coordinates - The coordinates of the multi-point feature, represented as an {@link EastFunction} of an {@link ArrayType} of {@link StructType} with x and y fields of {@link FloatType}. * @param def.properties - Optional properties associated with the multi-point feature, represented as an {@link EastFunction} of a {@link DictType} with string keys and values. * @param def.style - Optional style properties for the multi-point feature, represented as an {@link EastFunction} of a {@link StructType}. * @param def.style.label - The label text for the multi-point feature, of {@link StringType}. * @param def.style.stroke_color - The color of the multi-point feature's stroke, of {@link StringType}. * @param def.style.stroke_weight - The weight (thickness) of the multi-point feature's stroke, of {@link FloatType}. * @param def.style.stroke_opacity - The opacity of the multi-point feature's stroke, of {@link FloatType}. * @param def.style.radius - The radius of the multi-point feature, of {@link FloatType}. * @param def.style.fill_color - The fill color of the multi-point feature, of {@link StringType} describing a hex color, or for a heatmap from {@link FloatType} or {@link IntegerType}. * @param def.style.fill_opacity - The fill opacity of the multi-point feature, of {@link FloatType}. * @param def.tooltips - Optional tooltips associated with the multi-point feature, represented as an {@link EastFunction} of an {@link ArrayType} containing geographic tooltip objects. * * @returns An {@link EastFunction} that represents the geographic styled feature for the multi-point. * * @category Layout */ export declare function MultiPointFeature(def: { coordinates: EastFunction>>; properties?: EastFunction>; style?: EastFunction>; tooltips?: EastFunction>; }): EastFunction; /** * Creates a geographic styled feature representing a line string on a map. * * @param def - The definition object for the line string feature. * @param def.coordinates - The coordinates of the line string feature, represented as an {@link EastFunction} of an {@link ArrayType} of {@link StructType} with x and y fields of {@link FloatType}. * @param def.properties - Optional properties associated with the line string feature, represented as an {@link EastFunction} of a {@link DictType} with string keys and values. * @param def.style - Optional style properties for the line string feature, represented as an {@link EastFunction} of a {@link StructType}. * @param def.style.label - The label text for the line string feature, of {@link StringType}. * @param def.style.stroke_color - The color of the line string feature's stroke, of {@link StringType}. * @param def.style.stroke_weight - The weight (thickness) of the line string feature's stroke, of {@link FloatType}. * @param def.style.stroke_opacity - The opacity of the line string feature's stroke, of {@link FloatType}. * @param def.tooltips - Optional tooltips associated with the line string feature, represented as an {@link EastFunction} of an {@link ArrayType} containing geographic tooltip objects. * * @returns An {@link EastFunction} * * @category Layout */ export declare function LineStringFeature(def: { coordinates: EastFunction>>; properties?: EastFunction>; style?: EastFunction>; tooltips?: EastFunction>; }): EastFunction; /** * Creates a geographic styled feature representing a multi-line string on a map. * * @param def - The definition object for the multi-line string feature. * @param def.coordinates - The coordinates of the multi-line string feature, represented as an {@link EastFunction} of an {@link ArrayType} of {@link ArrayType} of {@link StructType} with x and y fields of {@link FloatType}. * @param def.properties - Optional properties associated with the multi-line string feature, represented as an {@link EastFunction} of a {@link DictType} with string keys and values. * @param def.style - Optional style properties for the multi-line string feature, represented as an {@link EastFunction} of a {@link StructType}. * @param def.style.label - The label text for the multi-line string feature, of {@link StringType}. * @param def.style.stroke_color - The color of the multi-line string feature's stroke, of {@link StringType}. * @param def.style.stroke_weight - The weight (thickness) of the multi-line string feature's stroke, of {@link FloatType}. * @param def.style.stroke_opacity - The opacity of the multi-line string feature's stroke, of {@link FloatType}. * @param def.tooltips - Optional tooltips associated with the multi-line string feature, represented as an {@link EastFunction} of an {@link ArrayType} containing geographic tooltip objects. * * @returns An {@link EastFunction} that represents the geographic styled feature for the multi-line string. * * @category Layout */ export declare function MultiLineStringFeature(def: { coordinates: EastFunction>>>; properties?: EastFunction>; style?: EastFunction>; tooltips?: EastFunction>; }): EastFunction; /** * Creates a geographic styled feature representing a polygon on a map. * * @param def - The definition object for the polygon feature. * @param def.coordinates - The coordinates of the polygon feature, represented as an {@link EastFunction} of an {@link ArrayType} of {@link ArrayType} of {@link StructType} with x and y fields of {@link FloatType}. * @param def.properties - Optional properties associated with the polygon feature, represented as an {@link EastFunction} of a {@link DictType} with string keys and values. * @param def.style - Optional style properties for the polygon feature, represented as an {@link EastFunction} of a {@link StructType}. * @param def.style.label - The label text for the polygon feature, of {@link StringType}. * @param def.style.stroke_color - The color of the polygon feature's stroke, of {@link StringType}. * @param def.style.stroke_weight - The weight (thickness) of the polygon feature's stroke, of {@link FloatType}. * @param def.style.stroke_opacity - The opacity of the polygon feature's stroke, of {@link FloatType}. * @param def.style.fill_color - The fill color of the polygon feature, of {@link StringType} describing a hex color, or for a heatmap from {@link FloatType} or {@link IntegerType}. * @param def.style.fill_opacity - The fill opacity of the polygon feature, of {@link FloatType}. * @param def.tooltips - Optional tooltips associated with the polygon feature, represented as an {@link EastFunction} of an {@link ArrayType} containing geographic tooltip objects. * * @returns An {@link EastFunction} that represents the geographic styled feature for the polygon. * @category Layout */ export declare function PolygonFeature(def: { coordinates: EastFunction>>>; properties?: EastFunction>; style?: EastFunction>; tooltips?: EastFunction>; }): EastFunction; /** * Creates a geographic styled feature representing a multi-polygon on a map. * * @param def - The definition object for the multi-polygon feature. * @param def.coordinates - The coordinates of the multi-polygon feature, represented as an {@link EastFunction} of an {@link ArrayType} of {@link ArrayType} of {@link ArrayType} of {@link StructType} with x and y fields of {@link FloatType}. * @param def.properties - Optional properties associated with the multi-polygon feature, represented as an {@link EastFunction} of a {@link DictType} with string keys and values. * @param def.style - Optional style properties for the multi-polygon feature, represented as an {@link EastFunction} of a {@link StructType}. * @param def.style.label - The label text for the multi-polygon feature, of {@link StringType}. * @param def.style.stroke_color - The color of the multi-polygon feature's stroke, of {@link StringType}. * @param def.style.stroke_weight - The weight (thickness) of the multi-polygon feature's stroke, of {@link FloatType}. * @param def.style.stroke_opacity - The opacity of the multi-polygon feature's stroke, of {@link FloatType}. * @param def.style.fill_color - The fill color of the multi-polygon feature, of {@link StringType} describing a hex color, or for a heatmap from {@link FloatType} or {@link IntegerType}. * @param def.style.fill_opacity - The fill opacity of the multi-polygon feature, of {@link FloatType}. * @param def.tooltips - Optional tooltips associated with the multi-polygon feature, represented as an {@link EastFunction} of an {@link ArrayType} containing geographic tooltip objects. * * @returns An {@link EastFunction} that represents the geographic styled feature for the multi-polygon. * * @category Layout */ export declare function MultiPolygonFeature(def: { coordinates: EastFunction>>>>; properties?: EastFunction>; style?: EastFunction>; tooltips?: EastFunction>; }): EastFunction; /** * Creates a geographic styled feature representing a geometry collection on a map. * * @param def - The definition object for the geometry collection feature. * @param def.geometries - The geometries of the geometry collection feature, represented as an {@link EastFunction} of an {@link ArrayType} of {@link VariantType} representing different geometry types. * @param def.properties - Optional properties associated with the geometry collection feature, represented as an {@link EastFunction} of a {@link DictType} with string keys and values. * @param def.style - Optional style properties for the geometry collection feature, represented as an {@link EastFunction} of a {@link StructType}. * @param def.style.label - The label text for the geometry collection feature, of {@link StringType}. * @param def.style.stroke_color - The color of the geometry collection feature's stroke, of {@link StringType}. * @param def.style.stroke_weight - The weight (thickness) of the geometry collection feature's stroke, of {@link FloatType}. * @param def.style.stroke_opacity - The opacity of the geometry collection feature's stroke, of {@link FloatType}. * @param def.style.fill_color - The fill color of the geometry collection feature, of {@link StringType} describing a hex color, or for a heatmap from {@link FloatType} or {@link IntegerType}. * @param def.style.fill_opacity - The fill opacity of the geometry collection feature, of {@link FloatType}. * @param def.tooltips - Optional tooltips associated with the geometry collection feature, represented as an {@link EastFunction} of an {@link ArrayType} containing geographic tooltip objects. * * @returns An {@link EastFunction} that represents the geographic styled feature for the geometry collection. * * @category Layout */ export declare function GeometryCollectionFeature(def: { geometries: EastFunction>>; properties?: EastFunction>; style?: EastFunction>; tooltips?: EastFunction>; }): EastFunction; /** * Defines a geographic feature collection. * * @category Layout * */ export declare const GeoFeatureCollection: StructType<{ features: ArrayType; }>; LineString: StructType<{ coordinates: ArrayType>; }>; Polygon: StructType<{ coordinates: ArrayType>>; }>; MultiPoint: StructType<{ coordinates: ArrayType>; }>; MultiLineString: StructType<{ coordinates: ArrayType>>; }>; MultiPolygon: StructType<{ coordinates: ArrayType>>>; }>; GeometryCollection: StructType<{ geometries: ArrayType; }>; LineString: StructType<{ coordinates: ArrayType>; }>; Polygon: StructType<{ coordinates: ArrayType>>; }>; MultiPoint: StructType<{ coordinates: ArrayType>; }>; MultiLineString: StructType<{ coordinates: ArrayType>>; }>; MultiPolygon: StructType<{ coordinates: ArrayType>>>; }>; }>>; }>; }>; properties: DictType; }>>; }>; /** * Type for a geographic feature collection object type. * * @category Layout * */ export type GeoFeatureCollectionType = typeof GeoFeatureCollection; /** * Type for a styled version of a geographic feature collection object type. * * @category Layout * */ export type GeoStyledFeatureCollectionType = StructType<{ features: ArrayType; }>; /** * Maps the features in a feature collection to a new feature collection. * * @param collection - The input feature collection represented as an {@link EastFunction}. * @param value - A function that takes a feature from the input collection and returns an {@link Expression} of {@link GeoStyledFeatureType}. * * @remarks The feature is represented as a {@link Variable} of either {@link GeoFeatureType} or {@link GeoStyledFeatureType}, depending on the input collection type. * * @returns An {@link EastFunction} that represents the new feature collection with styled features. * * @category Layout */ export declare function MapFeatureCollection(collection: EastFunction, value: (feature: Variable) => Expression): EastFunction; /** * Filters the features in a {@link GeoFeatureCollectionType} based on a predicate function. * * @param collection - The input feature collection represented as an {@link EastFunction}. * @param value - A predicate function that takes a feature from the input collection and returns an {@link Expression} of {@link BooleanType}. * * @remarks The feature is represented as a {@link Variable} of either {@link GeoFeatureType} or {@link GeoStyledFeatureType}, depending on the input collection type. * * @returns An {@link EastFunction} that represents the new feature collection with filtered features. * * @category Layout */ export declare function FilterFeatureCollection(collection: EastFunction, predicate: (feature: Variable) => Expression): EastFunction; /** * Converts a {@link GeoType} to a {@link GeoFeatureCollectionType}. * * @param value - The input geometry represented as an {@link EastFunction}. * * @returns An {@link EastFunction} that represents the feature collection containing the input geometry. * * @category Layout */ export declare function ToFeatureCollection(value: EastFunction): EastFunction; /** * Defines a geographic object. * * @category Layout * */ export declare const Geo: VariantType<{ Point: StructType<{ coordinates: StructType<{ x: FloatType; y: FloatType; }>; }>; LineString: StructType<{ coordinates: ArrayType>; }>; Polygon: StructType<{ coordinates: ArrayType>>; }>; MultiPoint: StructType<{ coordinates: ArrayType>; }>; MultiLineString: StructType<{ coordinates: ArrayType>>; }>; MultiPolygon: StructType<{ coordinates: ArrayType>>>; }>; GeometryCollection: StructType<{ geometries: ArrayType; }>; LineString: StructType<{ coordinates: ArrayType>; }>; Polygon: StructType<{ coordinates: ArrayType>>; }>; MultiPoint: StructType<{ coordinates: ArrayType>; }>; MultiLineString: StructType<{ coordinates: ArrayType>>; }>; MultiPolygon: StructType<{ coordinates: ArrayType>>>; }>; }>>; }>; Feature: StructType<{ geometry: VariantType<{ Point: StructType<{ coordinates: StructType<{ x: FloatType; y: FloatType; }>; }>; LineString: StructType<{ coordinates: ArrayType>; }>; Polygon: StructType<{ coordinates: ArrayType>>; }>; MultiPoint: StructType<{ coordinates: ArrayType>; }>; MultiLineString: StructType<{ coordinates: ArrayType>>; }>; MultiPolygon: StructType<{ coordinates: ArrayType>>>; }>; GeometryCollection: StructType<{ geometries: ArrayType; }>; LineString: StructType<{ coordinates: ArrayType>; }>; Polygon: StructType<{ coordinates: ArrayType>>; }>; MultiPoint: StructType<{ coordinates: ArrayType>; }>; MultiLineString: StructType<{ coordinates: ArrayType>>; }>; MultiPolygon: StructType<{ coordinates: ArrayType>>>; }>; }>>; }>; }>; properties: DictType; }>; FeatureCollection: StructType<{ features: ArrayType; }>; LineString: StructType<{ coordinates: ArrayType>; }>; Polygon: StructType<{ coordinates: ArrayType>>; }>; MultiPoint: StructType<{ coordinates: ArrayType>; }>; MultiLineString: StructType<{ coordinates: ArrayType>>; }>; MultiPolygon: StructType<{ coordinates: ArrayType>>>; }>; GeometryCollection: StructType<{ geometries: ArrayType; }>; LineString: StructType<{ coordinates: ArrayType>; }>; Polygon: StructType<{ coordinates: ArrayType>>; }>; MultiPoint: StructType<{ coordinates: ArrayType>; }>; MultiLineString: StructType<{ coordinates: ArrayType>>; }>; MultiPolygon: StructType<{ coordinates: ArrayType>>>; }>; }>>; }>; }>; properties: DictType; }>>; }>; }>; /** * Type for a styled version of a geographic object type. * * @category Layout * */ export type GeoStyledType = VariantType<{ Point?: GeoPointType; LineString?: GeoLineStringType; Polygon?: GeoPolygonType; MultiPoint?: GeoMultiPointType; MultiLineString?: GeoMultiLineStringType; MultiPolygon?: GeoMultiPolygonType; GeometryCollection?: GeoGeometryCollectionType; Feature?: GeoStyledFeatureType; FeatureCollection?: GeoStyledFeatureCollectionType; }>; /** * Defines the main geographic type that can hold any geographic structure. * * @category Layout * */ export type GeoType = typeof Geo; /** * Defines a geographic viewport. * * @category Layout * */ export declare const GeoViewport: StructType<{ center: StructType<{ coordinates: StructType<{ x: FloatType; y: FloatType; }>; }>; zoom: FloatType; }>; /** * Type for a geographic viewport type. * * @category Layout * */ export type GeoViewportType = typeof GeoViewport; /** @internal A visual displayed as a geographic map */ export type MapVisual = { type: 'map'; name: string; stream: Stream; layers: MapLayer[]; input_streams: Stream[]; viewport: EastFunction | undefined; }; /** * Define a UI map component from a {@link Stream} within a {@link LayoutBuilder}. * * @category Layout * * @example * ```typescript * const stream = Stream("My Stream", [], GeoType); * * // create a layered vega specification in a layout * const layout = new LayoutBuilder("My Layout") * .map("My Map", builder => builder * .fromStream(stream) * .viewport( * () => Const({ * center: { * coordinates: { x: -25.2744, y: 133.7751 } * }, * zoom: 4 * }) * ) * .layer( * "States", * { * geometry: (value) => MapFeatureCollection( * FilterFeatureCollection( * ToFeatureCollection(value), * (feature) => Equal( * Get(GetField(feature, 'properties'), Const('locality_type')), * Const('State') * ) * ), * feature => Struct({ * ...Spread(feature), * style: Struct({ * label: Get(GetField(feature, 'properties'), Const('locality')), * stroke_color: Const("#000000"), * stroke_weight: Const(0.5), * stroke_opacity: Const(0.7), * fill_color: Const("orange"), * fill_opacity: Const(1), * }), * tooltips: NewArray( * GeoTooltip, * [ * Struct({ label: Const("Locality"), value: Get(GetField(feature, 'properties'), Const('locality')) }), * Struct({ label: Const("Type"), value: Get(GetField(feature, 'properties'), Const('locality_type')) }), * ] * ) * }) * ), * visible: true * } * ) * ) * ``` */ export declare class MapBuilder { private name; private module; /** * Define a UI map component from a {@link Stream} within a {@link LayoutBuilder}. * * @category Layout * */ constructor(name: string, module: ModulePath); /** * Define the {@link Stream} to build a {@link MapBuilder} within a {@link LayoutBuilder}. * * @param stream the {@link DictType} {@link Stream} to build the table from * * @category Layout * */ fromStream(stream: Stream): MapFinalizer<{}, T>; } /** @internal Layout*/ export type MapLayer = { name: string; geometry: EastFunction; visible: EastFunction; }; /** * {@inheritDoc MapBuilder} * * @category Layout */ export declare class MapFinalizer = Record, T extends GeoType = GeoType> { name: string; protected module: ModulePath; protected stream: Stream; protected inputs: Inputs; protected input_streams: Record; private layers; protected viewport_function?: EastFunction; }>; zoom: FloatType; }>> | undefined; /** @internal */ constructor(name: string, module: ModulePath, stream: Stream, inputs: Inputs, input_streams: Record, layers: MapLayer[], viewport_function?: EastFunction; }>; zoom: FloatType; }>> | undefined); /** * Add an additional named input {@link Stream} to the {@link Visual}. * * @param config the input `stream` and the resulting variable `name` * @returns a new {@link LayoutBuilder} * * @category Layout * * @example * ```typescript * const stream = Stream("My Stream", [], GeoType); * * const point = Stream("My Point", [], GeoPointType); * * // create a layered vega specification in a layout * const layout = new LayoutBuilder("My Layout") * .map("My Map", builder => builder * .fromStream(stream) * .input({ name: "point", stream: point }) * .viewport( * (inputs) => Const({ * center: inputs.point, * zoom: 4 * }) * ) * .layer( * "Features", * { * geometry: (value) => ToFeatureCollection(value), * visible: true * } * ) * ) * ``` **/ input(config: { /** The name of the input. **/ name: Name & Name extends "input" | keyof Inputs ? never : Name; /** The {@link Stream} to input. **/ stream: Stream; }): MapFinalizer; }, T>; /** * Create a single point layer in the {@link MapBuilder} within a {@link LayoutBuilder}. * * @param name - The name of the layer. * @param def - The definition of the layer. * @param def.geometry - A function that returns an {@link EastFunction} of type {@link GeoStyledFeatureCollectionType} or {@link GeoStyledFeatureType} representing the values to render. * @param def.visible - An optional function that returns an {@link EastFunction} of type {@link BooleanType} representing if the layer should be initially visible. * * @remarks Often used in conjunction with the geographic feature collection utility methods: * - {@link ToFeatureCollection}: Converts a {@link GeoType} to a {@link GeoFeatureCollectionType} * - {@link FilterFeatureCollection}: Filters the features in a {@link GeoFeatureCollectionType} based on a predicate function. * - {@link MapFeatureCollection}: Maps the features in a {@link GeoFeatureCollectionType} to a new feature collection. * * @category Layout * * @example * ```typescript * const stream = Stream("My Stream", [], GeoType); * * // create a layered vega specification in a layout * const layout = new LayoutBuilder("My Layout") * .map("My Map", builder => builder * .fromStream(stream) * .layer( * "Features", * { * geometry: (value) => ToFeatureCollection(value), * visible: true * } * ) * ) * ``` */ layer(name: string, def: { /** A function that returns an {@link EastFunction} of type {@link GeoStyledFeatureCollectionType} representing the collection of features to render. */ geometry: (value: Variable, inputs: Inputs) => EastFunction; /** An optional function that returns an {@link EastFunction} of type {@link FloatType} representing the initial visibility of the point/s layer */ visible?: boolean | ((inputs: Inputs) => EastFunction); }): MapFinalizer; /** * Initialize the viewport of the map {@link MapBuilder} within a {@link LayoutBuilder}. * * @param value - A function that returns an {@link EastFunction} of type {@link GeoPoint} representing the zoom of the map. * * @category Layout * * @example * ```typescript * const stream = Stream("My Stream", [], GeoType); * * // create a layered vega specification in a layout * const layout = new LayoutBuilder("My Layout") * .map("My Map", builder => builder * .fromStream(stream) * .viewport( * () => Const({ * center: { * coordinates: { x: -25.2744, y: 133.7751 } * }, * zoom: 4 * }) * ) * .layer( * "Features", * { * geometry: (value) => ToFeatureCollection(value), * visible: true * } * ) * ) * ``` */ viewport(value: (inputs: Inputs) => EastFunction): MapFinalizer; /** @internal */ toVisual(): MapVisual; }