forked from MapComplete/MapComplete
chore: automated housekeeping...
This commit is contained in:
parent
94c61744c0
commit
04c8ccb0d2
89 changed files with 2353 additions and 1390 deletions
|
|
@ -6,17 +6,24 @@ import SpecialVisualizations from "../../UI/SpecialVisualizations"
|
|||
import { LayerConfigJson } from "./Json/LayerConfigJson"
|
||||
|
||||
export default class DependencyCalculator {
|
||||
|
||||
/**
|
||||
* For every tagRendering in the listed layers, determines in what layers they end up
|
||||
*/
|
||||
public static tagRenderingImportedBy(questionedLayer: LayerConfig, layers: LayerConfig[]): Map<string, {
|
||||
layer: string
|
||||
}[]> {
|
||||
public static tagRenderingImportedBy(
|
||||
questionedLayer: LayerConfig,
|
||||
layers: LayerConfig[]
|
||||
): Map<
|
||||
string,
|
||||
{
|
||||
layer: string
|
||||
}[]
|
||||
> {
|
||||
const result: Map<string, { layer: string }[]> = new Map()
|
||||
|
||||
for (const layer of layers) {
|
||||
const hasRightContext = layer.tagRenderings.filter(tr => tr._definedIn !== undefined && tr?._definedIn?.[0] === questionedLayer.id)
|
||||
const hasRightContext = layer.tagRenderings.filter(
|
||||
(tr) => tr._definedIn !== undefined && tr?._definedIn?.[0] === questionedLayer.id
|
||||
)
|
||||
for (const tr of hasRightContext) {
|
||||
const id = tr._definedIn[1]
|
||||
if (!result.has(id)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue