forked from MapComplete/MapComplete
Refactoring: move specialVisulations into groups
This commit is contained in:
parent
644445248c
commit
b59524733c
13 changed files with 894 additions and 900 deletions
|
@ -21,6 +21,7 @@ import ShowDataLayer from "./Map/ShowDataLayer"
|
|||
import { CombinedFetcher } from "../Logic/Web/NearbyImagesSearch"
|
||||
import UserRelatedState from "../Logic/State/UserRelatedState"
|
||||
import FeaturePropertiesStore from "../Logic/FeatureSource/Actors/FeaturePropertiesStore"
|
||||
import SvelteUIElement from "./Base/SvelteUIElement"
|
||||
|
||||
/**
|
||||
* The state needed to render a special Visualisation.
|
||||
|
@ -83,6 +84,7 @@ export interface SpecialVisualizationState {
|
|||
export interface SpecialVisualization {
|
||||
readonly funcName: string
|
||||
readonly docs: string | BaseUIElement
|
||||
readonly group?: string
|
||||
readonly example?: string
|
||||
readonly needsUrls?: string[] | ((args: string[]) => string | string[])
|
||||
|
||||
|
@ -109,6 +111,40 @@ export interface SpecialVisualization {
|
|||
): BaseUIElement
|
||||
}
|
||||
|
||||
|
||||
export interface SpecialVisualizationSvelte {
|
||||
readonly funcName: string
|
||||
readonly docs: string
|
||||
/**
|
||||
* The 'group' is merely what association it has in the docs
|
||||
*/
|
||||
readonly group: string
|
||||
readonly example?: string
|
||||
readonly needsUrls?: string[] | ((args: string[]) => string | string[])
|
||||
|
||||
/**
|
||||
* Indicates that this special visualisation will make requests to the 'alLNodesDatabase' and that it thus should be included
|
||||
*/
|
||||
readonly needsNodeDatabase?: boolean
|
||||
readonly args: {
|
||||
name: string
|
||||
defaultValue?: string
|
||||
doc: string
|
||||
required?: false | boolean
|
||||
}[]
|
||||
readonly getLayerDependencies?: (argument: string[]) => string[]
|
||||
|
||||
structuredExamples?(): { feature: Feature<Geometry, Record<string, string>>; args: string[] }[]
|
||||
|
||||
constr(
|
||||
state: SpecialVisualizationState,
|
||||
tagSource: UIEventSource<Record<string, string>>,
|
||||
argument: string[],
|
||||
feature: Feature,
|
||||
layer: LayerConfig
|
||||
): SvelteUIElement
|
||||
}
|
||||
|
||||
export type RenderingSpecification =
|
||||
| string
|
||||
| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue