forked from MapComplete/MapComplete
chore: automated housekeeping...
This commit is contained in:
parent
9cd7ad597d
commit
69ab755f29
520 changed files with 16616 additions and 13483 deletions
|
|
@ -1,4 +1,8 @@
|
|||
import { SpecialVisualization, SpecialVisualizationState, SpecialVisualizationSvelte } from "../SpecialVisualization"
|
||||
import {
|
||||
SpecialVisualization,
|
||||
SpecialVisualizationState,
|
||||
SpecialVisualizationSvelte,
|
||||
} from "../SpecialVisualization"
|
||||
import { HistogramViz } from "./HistogramViz"
|
||||
import { Store, UIEventSource } from "../../Logic/UIEventSource"
|
||||
import { Feature } from "geojson"
|
||||
|
|
@ -36,7 +40,7 @@ class DirectionIndicatorVis extends SpecialVisualization {
|
|||
state: SpecialVisualizationState,
|
||||
tagSource: UIEventSource<Record<string, string>>,
|
||||
argument: string[],
|
||||
feature: Feature,
|
||||
feature: Feature
|
||||
): BaseUIElement {
|
||||
return new SvelteUIElement(DirectionIndicator, { state, feature })
|
||||
}
|
||||
|
|
@ -64,7 +68,7 @@ class DirectionAbsolute extends SpecialVisualization {
|
|||
constr(
|
||||
state: SpecialVisualizationState,
|
||||
tagSource: UIEventSource<Record<string, string>>,
|
||||
args: string[],
|
||||
args: string[]
|
||||
): BaseUIElement {
|
||||
const key = args[0] === "" ? "_direction:centerpoint" : args[0]
|
||||
const offset = args[1] === "" ? 0 : Number(args[1])
|
||||
|
|
@ -77,11 +81,11 @@ class DirectionAbsolute extends SpecialVisualization {
|
|||
})
|
||||
.mapD((value) => {
|
||||
const dir = GeoOperations.bearingToHuman(
|
||||
GeoOperations.parseBearing(value) + offset,
|
||||
GeoOperations.parseBearing(value) + offset
|
||||
)
|
||||
console.log("Human dir", dir)
|
||||
return Translations.t.general.visualFeedback.directionsAbsolute[dir]
|
||||
}),
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -151,7 +155,7 @@ class OpeningHoursState extends SpecialVisualizationSvelte {
|
|||
constr(
|
||||
state: SpecialVisualizationState,
|
||||
tags: UIEventSource<Record<string, string>>,
|
||||
args: string[],
|
||||
args: string[]
|
||||
): SvelteUIElement {
|
||||
const keyToUse = args[0]
|
||||
const prefix = args[1]
|
||||
|
|
@ -193,7 +197,7 @@ class Canonical extends SpecialVisualization {
|
|||
return undefined
|
||||
}
|
||||
const allUnits: Unit[] = [].concat(
|
||||
...(state?.theme?.layers?.map((lyr) => lyr.units) ?? []),
|
||||
...(state?.theme?.layers?.map((lyr) => lyr.units) ?? [])
|
||||
)
|
||||
const unit = allUnits.filter((unit) => unit.isApplicableToKey(key))[0]
|
||||
if (unit === undefined) {
|
||||
|
|
@ -201,7 +205,7 @@ class Canonical extends SpecialVisualization {
|
|||
}
|
||||
const getCountry = () => tagSource.data._country
|
||||
return unit.asHumanLongValue(value, getCountry)
|
||||
}),
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -226,7 +230,7 @@ class PresetDescription extends SpecialVisualization {
|
|||
|
||||
constr(
|
||||
state: SpecialVisualizationState,
|
||||
tagSource: UIEventSource<Record<string, string>>,
|
||||
tagSource: UIEventSource<Record<string, string>>
|
||||
): BaseUIElement {
|
||||
const translation = tagSource.map((tags) => {
|
||||
const layer = state.theme.getMatchingLayer(tags)
|
||||
|
|
@ -246,7 +250,7 @@ class PresetTypeSelect extends SpecialVisualizationSvelte {
|
|||
tags: UIEventSource<Record<string, string>>,
|
||||
argument: string[],
|
||||
selectedElement: Feature,
|
||||
layer: LayerConfig,
|
||||
layer: LayerConfig
|
||||
): SvelteUIElement {
|
||||
const t = Translations.t.preset_type
|
||||
if (layer._basedOn !== layer.id) {
|
||||
|
|
@ -303,14 +307,22 @@ class PointsInTimeVis extends SpecialVisualization {
|
|||
},
|
||||
]
|
||||
|
||||
constr(state: SpecialVisualizationState, tagSource: UIEventSource<Record<string, string>>, args: string[], feature: Feature, layer: LayerConfig): BaseUIElement {
|
||||
constr(
|
||||
state: SpecialVisualizationState,
|
||||
tagSource: UIEventSource<Record<string, string>>,
|
||||
args: string[],
|
||||
feature: Feature,
|
||||
layer: LayerConfig
|
||||
): BaseUIElement {
|
||||
const key = args[0]
|
||||
const points_in_time = tagSource.map(tags => tags[key])
|
||||
const times = points_in_time.map(times =>
|
||||
OH.createOhObject(<any>tagSource.data, times, tagSource.data["_country"], 1), [tagSource])
|
||||
return new VariableUiElement(times.map(times =>
|
||||
new SvelteUIElement(CollectionTimes, { times }),
|
||||
))
|
||||
const points_in_time = tagSource.map((tags) => tags[key])
|
||||
const times = points_in_time.map(
|
||||
(times) => OH.createOhObject(<any>tagSource.data, times, tagSource.data["_country"], 1),
|
||||
[tagSource]
|
||||
)
|
||||
return new VariableUiElement(
|
||||
times.map((times) => new SvelteUIElement(CollectionTimes, { times }))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue