-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Maps] allow for extensible sourceDescriptor typings (#74758)
* [Maps] allow for extensible sourceDescriptor typings * revert changes to blended_vector_layer.test Co-authored-by: Elastic Machine <[email protected]>
- Loading branch information
1 parent
3c5f2e7
commit ea54531
Showing
5 changed files
with
82 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
x-pack/plugins/maps/common/descriptor_types/layer_descriptor_types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
/* eslint-disable @typescript-eslint/consistent-type-definitions */ | ||
|
||
import { Query } from 'src/plugins/data/public'; | ||
import { StyleDescriptor, VectorStyleDescriptor } from './style_property_descriptor_types'; | ||
import { DataRequestDescriptor } from './data_request_descriptor_types'; | ||
import { AbstractSourceDescriptor, ESTermSourceDescriptor } from './source_descriptor_types'; | ||
|
||
export type JoinDescriptor = { | ||
leftField?: string; | ||
right: ESTermSourceDescriptor; | ||
}; | ||
|
||
export type LayerDescriptor = { | ||
__dataRequests?: DataRequestDescriptor[]; | ||
__isInErrorState?: boolean; | ||
__isPreviewLayer?: boolean; | ||
__errorMessage?: string; | ||
__trackedLayerDescriptor?: LayerDescriptor; | ||
alpha?: number; | ||
id: string; | ||
joins?: JoinDescriptor[]; | ||
label?: string | null; | ||
areLabelsOnTop?: boolean; | ||
minZoom?: number; | ||
maxZoom?: number; | ||
sourceDescriptor: AbstractSourceDescriptor | null; | ||
type?: string; | ||
visible?: boolean; | ||
style?: StyleDescriptor | null; | ||
query?: Query; | ||
}; | ||
|
||
export type VectorLayerDescriptor = LayerDescriptor & { | ||
style: VectorStyleDescriptor; | ||
}; | ||
|
||
export type RangeFieldMeta = { | ||
min: number; | ||
max: number; | ||
delta: number; | ||
isMinOutsideStdRange?: boolean; | ||
isMaxOutsideStdRange?: boolean; | ||
}; | ||
|
||
export type Category = { | ||
key: string; | ||
count: number; | ||
}; | ||
|
||
export type CategoryFieldMeta = { | ||
categories: Category[]; | ||
}; | ||
|
||
export type GeometryTypes = { | ||
isPointsOnly: boolean; | ||
isLinesOnly: boolean; | ||
isPolygonsOnly: boolean; | ||
}; | ||
|
||
export type StyleMetaDescriptor = { | ||
geometryTypes?: GeometryTypes; | ||
fieldMeta: { | ||
[key: string]: { | ||
range: RangeFieldMeta; | ||
categories: CategoryFieldMeta; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters