@redus/georedus-ui 0.21.0 → 0.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/Markdown/index.d.ts +4 -1
- package/dist/main.js +3693 -1876
- package/dist/viewSpecs/presets/cem_censo/2010_2022/confSchema.d.ts +1 -0
- package/dist/viewSpecs/presets/cem_censo/2010_2022/index.d.ts +1 -0
- package/dist/viewSpecs/presets/cem_censo/2022/index.d.ts +1 -0
- package/dist/viewSpecs/presets/gtfs_lines/confSchema.d.ts +51 -0
- package/dist/viewSpecs/presets/gtfs_lines/consts.d.ts +3 -0
- package/dist/viewSpecs/presets/gtfs_lines/download.d.ts +9 -0
- package/dist/viewSpecs/presets/gtfs_lines/index.d.ts +100 -0
- package/dist/viewSpecs/presets/gtfs_lines/layers.d.ts +11 -0
- package/dist/viewSpecs/presets/gtfs_lines/metadata/index.d.ts +11 -0
- package/dist/viewSpecs/presets/gtfs_lines/metadata/widthScaleStopsResolvers.d.ts +24 -0
- package/dist/viewSpecs/presets/gtfs_lines/parseStyleSpec.d.ts +26 -0
- package/dist/viewSpecs/presets/gtfs_lines/sources.d.ts +7 -0
- package/dist/viewSpecs/presets/gtfs_stops/confSchema.d.ts +46 -0
- package/dist/viewSpecs/presets/gtfs_stops/download.d.ts +9 -0
- package/dist/viewSpecs/presets/gtfs_stops/index.d.ts +147 -0
- package/dist/viewSpecs/presets/gtfs_stops/layers.d.ts +62 -0
- package/dist/viewSpecs/presets/gtfs_stops/metadata/colorScaleStopResolvers.d.ts +30 -0
- package/dist/viewSpecs/presets/gtfs_stops/metadata/index.d.ts +11 -0
- package/dist/viewSpecs/presets/gtfs_stops/parseStyleSpec.d.ts +33 -0
- package/dist/viewSpecs/presets/gtfs_stops/sources.d.ts +8 -0
- package/dist/viewSpecs/presets/gtfs_travel_time_hex/confSchema.d.ts +21 -0
- package/dist/viewSpecs/presets/gtfs_travel_time_hex/fetchDataForHex.d.ts +7 -0
- package/dist/viewSpecs/presets/gtfs_travel_time_hex/index.d.ts +113 -0
- package/dist/viewSpecs/presets/gtfs_travel_time_hex/layers.d.ts +72 -0
- package/dist/viewSpecs/presets/gtfs_travel_time_hex/sources.d.ts +10 -0
- package/dist/viewSpecs/presets/index.d.ts +10 -7
- package/dist/viewSpecs/presets/tmp_gtfs_travel_time_hex/parseStyleSpec.d.ts +13 -0
- package/dist/viewSpecs/presets/util/components/basicTooltip.d.ts +1 -1
- package/dist/viewSpecs/presets/util/components/confInputs/categoricalColorSchemeSelector.d.ts +8 -4
- package/dist/viewSpecs/presets/util/components/confInputs/colorSelector.d.ts +3 -51
- package/dist/viewSpecs/presets/util/components/confInputs/continuousColorSchemeSelector.d.ts +1 -0
- package/dist/viewSpecs/presets/util/components/confInputs/opacitySlider.d.ts +2 -3
- package/dist/viewSpecs/presets/util/components/rawFileDownload.d.ts +12 -0
- package/dist/viewSpecs/presets/util/hourUtil.d.ts +9 -0
- package/dist/viewSpecs/presets/util/index.d.ts +2 -0
- package/dist/viewSpecs/presets/util/municipioFilter.d.ts +9 -0
- package/dist/viewSpecs/presets/vector_circle/index.d.ts +2 -50
- package/dist/viewSpecs/presets/vector_heatmap/confSchema.d.ts +2 -0
- package/dist/viewSpecs/presets/vector_heatmap/download.d.ts +1 -1
- package/dist/viewSpecs/presets/vector_heatmap/index.d.ts +3 -1
- package/dist/viewSpecs/presets/vector_heatmap/parseStyleSpec.d.ts +3 -0
- package/dist/viewSpecs/presets/vector_line/index.d.ts +2 -50
- package/dist/viewSpecs/presets/vector_line_categorical/confSchema.d.ts +13 -0
- package/dist/viewSpecs/presets/vector_line_categorical/download.d.ts +1 -1
- package/dist/viewSpecs/presets/vector_line_categorical/index.d.ts +14 -1
- package/dist/viewSpecs/presets/vector_line_categorical/parseStyleSpec.d.ts +1 -1
- package/dist/viewSpecs/presets/vector_line_single/confSchema.d.ts +2 -50
- package/dist/viewSpecs/presets/vector_line_single/index.d.ts +2 -50
- package/dist/viewSpecs/presets/vector_point_categorical/confSchema.d.ts +17 -0
- package/dist/viewSpecs/presets/vector_point_categorical/index.d.ts +18 -1
- package/dist/viewSpecs/presets/vector_point_categorical/layers.d.ts +1 -1
- package/dist/viewSpecs/presets/vector_point_categorical/parseStyleSpec.d.ts +2 -1
- package/dist/viewSpecs/presets/vector_point_continuous/parseStyleSpec.d.ts +1 -20
- package/dist/viewSpecs/presets/vector_point_single/confSchema.d.ts +2 -50
- package/dist/viewSpecs/presets/vector_point_single/index.d.ts +2 -50
- package/dist/viewSpecs/presets/vector_point_single/parseStyleSpec.d.ts +1 -1
- package/dist/viewSpecs/presets/vector_polygon/index.d.ts +2 -50
- package/dist/viewSpecs/presets/vector_polygon_categorical/confSchema.d.ts +9 -5
- package/dist/viewSpecs/presets/vector_polygon_categorical/index.d.ts +9 -5
- package/dist/viewSpecs/presets/vector_polygon_categorical/parseStyleSpec.d.ts +2 -1
- package/dist/viewSpecs/presets/vector_polygon_continuous/confSchema.d.ts +2 -0
- package/dist/viewSpecs/presets/vector_polygon_continuous/index.d.ts +3 -1
- package/dist/viewSpecs/presets/vector_polygon_continuous/layers.d.ts +0 -1
- package/dist/viewSpecs/presets/vector_polygon_continuous/parseStyleSpec.d.ts +1 -0
- package/dist/viewSpecs/presets/vector_polygon_single/confSchema.d.ts +3 -50
- package/dist/viewSpecs/presets/vector_polygon_single/index.d.ts +3 -50
- package/dist/viewSpecs/presets/vector_polygon_single/parseStyleSpec.d.ts +1 -0
- package/dist/viewSpecs/resolveView/resolveView.d.ts +2 -2
- package/dist/viewSpecs/types.d.ts +5 -0
- package/dist/viewSpecs/useViews/constants.d.ts +22 -0
- package/dist/viewSpecs/useViews/tmp_useViews.d.ts +42 -0
- package/dist/viewSpecs/useViews/types.d.ts +15 -0
- package/dist/viewSpecs/useViews/useViewStageQueries.d.ts +23 -0
- package/dist/viewSpecs/useViews/useViews.d.ts +39 -10
- package/dist/viewSpecs/useViews/util/index.d.ts +5 -0
- package/dist/viewSpecs/useViews/util/useViewStageQueriesCache.d.ts +2 -0
- package/dist/viewSpecs/useViews/util/viewHasResolvedStages.d.ts +6 -0
- package/dist/viewSpecs/useViews/util/viewStageQueryKey.d.ts +45 -0
- package/dist/viewSpecs/useViews/util/viewsFromStageQueries.d.ts +12 -0
- package/package.json +6 -4
- /package/dist/viewSpecs/useViews/{queryKeyHashFnWithFileSupport.d.ts → util/queryKeyHashFnWithFileSupport.d.ts} +0 -0
|
@@ -10,58 +10,10 @@ export function vector_polygon_single({ style, ...viewSpec }: {
|
|
|
10
10
|
type: string;
|
|
11
11
|
clearable: boolean;
|
|
12
12
|
defaultValue: any;
|
|
13
|
-
options:
|
|
14
|
-
label: import("react").JSX.Element;
|
|
15
|
-
value: string;
|
|
16
|
-
} | {
|
|
17
|
-
label: import("react").JSX.Element;
|
|
18
|
-
value: string;
|
|
19
|
-
} | {
|
|
20
|
-
label: import("react").JSX.Element;
|
|
21
|
-
value: string;
|
|
22
|
-
} | {
|
|
23
|
-
label: import("react").JSX.Element;
|
|
24
|
-
value: string;
|
|
25
|
-
} | {
|
|
26
|
-
label: import("react").JSX.Element;
|
|
27
|
-
value: string;
|
|
28
|
-
} | {
|
|
29
|
-
label: import("react").JSX.Element;
|
|
30
|
-
value: string;
|
|
31
|
-
} | {
|
|
32
|
-
label: import("react").JSX.Element;
|
|
33
|
-
value: string;
|
|
34
|
-
} | {
|
|
35
|
-
label: import("react").JSX.Element;
|
|
36
|
-
value: string;
|
|
37
|
-
} | {
|
|
38
|
-
label: import("react").JSX.Element;
|
|
39
|
-
value: string;
|
|
40
|
-
} | {
|
|
41
|
-
label: import("react").JSX.Element;
|
|
42
|
-
value: string;
|
|
43
|
-
} | {
|
|
44
|
-
label: import("react").JSX.Element;
|
|
45
|
-
value: string;
|
|
46
|
-
} | {
|
|
47
|
-
label: import("react").JSX.Element;
|
|
48
|
-
value: string;
|
|
49
|
-
} | {
|
|
50
|
-
label: import("react").JSX.Element;
|
|
51
|
-
value: string;
|
|
52
|
-
} | {
|
|
53
|
-
label: import("react").JSX.Element;
|
|
54
|
-
value: string;
|
|
55
|
-
} | {
|
|
56
|
-
label: import("react").JSX.Element;
|
|
57
|
-
value: string;
|
|
58
|
-
} | {
|
|
59
|
-
label: import("react").JSX.Element;
|
|
13
|
+
options: {
|
|
60
14
|
value: string;
|
|
61
|
-
} | {
|
|
62
15
|
label: import("react").JSX.Element;
|
|
63
|
-
|
|
64
|
-
})[];
|
|
16
|
+
}[];
|
|
65
17
|
};
|
|
66
18
|
fillPattern: {
|
|
67
19
|
label: string;
|
|
@@ -81,6 +33,7 @@ export function vector_polygon_single({ style, ...viewSpec }: {
|
|
|
81
33
|
max: number;
|
|
82
34
|
step: number;
|
|
83
35
|
defaultValue: number;
|
|
36
|
+
notify: string;
|
|
84
37
|
};
|
|
85
38
|
};
|
|
86
39
|
};
|
|
@@ -2,6 +2,7 @@ export type StyleSpec = {
|
|
|
2
2
|
color?: string;
|
|
3
3
|
fillPattern?: 'circles_1' | 'cross_1' | 'diamonds_1' | 'lines_1' | 'mosaic_1' | 'mosaic_2' | 'squares_1' | 'triangles_1' | 'waves_1' | 'solid';
|
|
4
4
|
borderStyle?: 'solid' | 'dashed' | 'dotted' | 'none';
|
|
5
|
+
opacity?: number;
|
|
5
6
|
};
|
|
6
7
|
export type StyleSpecInput = string | StyleSpec;
|
|
7
8
|
export declare function parseStyleSpec(styleInput?: StyleSpecInput): StyleSpec;
|
|
@@ -5,8 +5,8 @@ export declare function resolveConfSchema(viewSpec: ViewSpec, partialView: Parti
|
|
|
5
5
|
export declare const resolveMetadata: (viewSpec: ViewSpec, partialViewAtStage: Pick<ResolvedView, "conf">, viewResolutionContextBase: ViewResolutionContextBase) => Promise<import("../types").ViewMetadata>;
|
|
6
6
|
export declare const resolveSources: (viewSpec: ViewSpec, partialViewAtStage: Pick<ResolvedView, "metadata" | "conf">, viewResolutionContextBase: ViewResolutionContextBase) => Promise<Record<string, any>>;
|
|
7
7
|
export declare const resolveLayers: (viewSpec: ViewSpec, partialViewAtStage: Pick<ResolvedView, "metadata" | "sources" | "conf">, viewResolutionContextBase: ViewResolutionContextBase) => Promise<Record<string, import("@orioro/react-maplibre-util").MapViewLayer>>;
|
|
8
|
-
export declare const resolveControls: (viewSpec: ViewSpec, partialViewAtStage: Pick<ResolvedView, "
|
|
9
|
-
export declare const resolveDownload: (viewSpec: ViewSpec, partialViewAtStage: Pick<ResolvedView, "
|
|
8
|
+
export declare const resolveControls: (viewSpec: ViewSpec, partialViewAtStage: Pick<ResolvedView, "layers" | "metadata" | "sources" | "conf">, viewResolutionContextBase: ViewResolutionContextBase) => Promise<import("../types").ViewControls>;
|
|
9
|
+
export declare const resolveDownload: (viewSpec: ViewSpec, partialViewAtStage: Pick<ResolvedView, "layers" | "metadata" | "sources" | "conf">, viewResolutionContextBase: ViewResolutionContextBase) => Promise<import("../types").ViewDownload>;
|
|
10
10
|
export declare function resolveView(viewSpec: ViewSpec, viewConf: ResolvedViewConf, viewResolutionContextBase: ViewResolutionContextBase): Promise<{
|
|
11
11
|
id: string;
|
|
12
12
|
keywords: string | string[] | undefined;
|
|
@@ -2,6 +2,8 @@ import { MapView, MapViewLayer, MapViewSource } from '@orioro/react-maplibre-uti
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ViewConf, ViewConfState } from '../GeoReDUS/viewConfReducer';
|
|
4
4
|
import { UseQueryOptions } from '@tanstack/react-query';
|
|
5
|
+
import { InputSchema } from '@orioro/react-ui-core';
|
|
6
|
+
import type { Merge } from 'type-fest';
|
|
5
7
|
export type ExpressionOf<ResultT> = ResultT | [string, ...any[]];
|
|
6
8
|
export type ViewMetadata = {
|
|
7
9
|
[key: string]: any;
|
|
@@ -45,6 +47,9 @@ export type ViewSpec = {
|
|
|
45
47
|
id: string;
|
|
46
48
|
debug?: boolean;
|
|
47
49
|
keywords?: string | string[];
|
|
50
|
+
confSchema?: Record<string, Record<string, Merge<InputSchema, {
|
|
51
|
+
notify: ViewStageKey | ViewStageKey[];
|
|
52
|
+
}>>>;
|
|
48
53
|
metadata: ViewMetadataSpec;
|
|
49
54
|
sources: ViewSourcesSpec;
|
|
50
55
|
layers: ViewLayersSpec;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ResolvedView, ViewResolutionContextBase, ViewSpec, ViewStageKey } from '../types';
|
|
2
|
+
export declare const STAGE_LOADING: unique symbol;
|
|
3
|
+
export declare const STAGE_ERROR: unique symbol;
|
|
4
|
+
/**
|
|
5
|
+
* How a pipeline stage declares its upstream dependencies.
|
|
6
|
+
*
|
|
7
|
+
* - `null` — no dependencies; stage is always enabled
|
|
8
|
+
* - `'all_previous_stages'` — depends on all stages from every group that
|
|
9
|
+
* precedes this stage's group in `PIPELINE_STAGES`.
|
|
10
|
+
* Stages in the same group are parallel and are NOT
|
|
11
|
+
* included. Correct default for most stages, including
|
|
12
|
+
* parallel ones like `controls` and `download`.
|
|
13
|
+
* - `ViewStageKey[]` — explicit list for cases where only a subset of
|
|
14
|
+
* upstream stages should invalidate this one
|
|
15
|
+
*/
|
|
16
|
+
export type StageDependencies = null | 'all_previous_stages' | ViewStageKey[];
|
|
17
|
+
export type PipelineStage = {
|
|
18
|
+
stageKey: ViewStageKey;
|
|
19
|
+
dependsOnStages: StageDependencies;
|
|
20
|
+
resolveFn: (viewSpec: ViewSpec, partialView: Partial<ResolvedView>, ctx: ViewResolutionContextBase) => Promise<unknown>;
|
|
21
|
+
};
|
|
22
|
+
export declare const PIPELINE_STAGES: PipelineStage[][];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ResolvedView, ViewResolutionContextBase, ViewSpec } from '../types';
|
|
2
|
+
export declare const PIPELINE_STAGE_ORDER: any[];
|
|
3
|
+
/**
|
|
4
|
+
* Orchestrates the full view resolution pipeline for all active views.
|
|
5
|
+
*
|
|
6
|
+
* Stages are resolved in sequence: `metadata → sources → layers →
|
|
7
|
+
* (controls, download)`. Each stage receives a snapshot of the preceding
|
|
8
|
+
* resolved queries as `partialViews` so downstream stages can read prior
|
|
9
|
+
* results.
|
|
10
|
+
*
|
|
11
|
+
* Each view × stage pair is an independent React Query query. This means a
|
|
12
|
+
* single view can update without triggering re-resolution of any other view.
|
|
13
|
+
*
|
|
14
|
+
* `resolvedViews` contains only views where `metadata`, `sources`, and
|
|
15
|
+
* `layers` are fully resolved — the minimum required for rendering.
|
|
16
|
+
* `download` is intentionally excluded from this gate.
|
|
17
|
+
*
|
|
18
|
+
* `resolvedViewSpecs` are resolved synchronously because schema changes must
|
|
19
|
+
* reflect immediately as the user edits conf values.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useViews(viewResolutionContextBase: ViewResolutionContextBase): {
|
|
22
|
+
currentLoadingStage: (viewId?: string | null) => any;
|
|
23
|
+
queriesByStage: {
|
|
24
|
+
metadata: import("@tanstack/react-query").UseQueryResult<unknown, Error>[];
|
|
25
|
+
sources: import("@tanstack/react-query").UseQueryResult<unknown, Error>[];
|
|
26
|
+
layers: import("@tanstack/react-query").UseQueryResult<unknown, Error>[];
|
|
27
|
+
controls: import("@tanstack/react-query").UseQueryResult<unknown, Error>[];
|
|
28
|
+
download: import("@tanstack/react-query").UseQueryResult<unknown, Error>[];
|
|
29
|
+
};
|
|
30
|
+
resolvedViews: Partial<ResolvedView>[];
|
|
31
|
+
resolvedViewSpecs: (ViewSpec | {
|
|
32
|
+
confSchema: Partial<ResolvedView>;
|
|
33
|
+
id: string;
|
|
34
|
+
debug?: boolean;
|
|
35
|
+
keywords?: string | string[];
|
|
36
|
+
metadata: import("../types").ViewMetadataSpec;
|
|
37
|
+
sources: import("../types").ViewSourcesSpec;
|
|
38
|
+
layers: import("../types").ViewLayersSpec;
|
|
39
|
+
controls: import("../types").ViewControlsSpec;
|
|
40
|
+
download?: import("../types").ViewDownloadSpec;
|
|
41
|
+
})[];
|
|
42
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import { ViewConf } from '../../GeoReDUS/viewConfReducer';
|
|
3
|
+
import { ViewSpec } from '../types';
|
|
4
|
+
export type ViewToResolve = {
|
|
5
|
+
viewId: string;
|
|
6
|
+
viewConf: ViewConf;
|
|
7
|
+
viewSpec: ViewSpec;
|
|
8
|
+
};
|
|
9
|
+
export type QueriesByStage = {
|
|
10
|
+
metadata: UseQueryResult[];
|
|
11
|
+
sources: UseQueryResult[];
|
|
12
|
+
layers: UseQueryResult[];
|
|
13
|
+
controls: UseQueryResult[];
|
|
14
|
+
download: UseQueryResult[];
|
|
15
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ResolvedView, ViewResolutionContextBase, ViewStageKey } from '../types';
|
|
2
|
+
import type { QueriesByStage, ViewToResolve } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Fans out one React Query query per view for a single pipeline stage via
|
|
5
|
+
* `useQueries`.
|
|
6
|
+
*
|
|
7
|
+
* Each query is enabled only when:
|
|
8
|
+
* 1. The global `enabled` flag is true.
|
|
9
|
+
* 2. All `dependsOnStages` are resolved on that view's partial view.
|
|
10
|
+
*
|
|
11
|
+
* The query key includes the result of `viewSpec[stageKey]._dependencies` (if
|
|
12
|
+
* defined), allowing stages to declare fine-grained cache invalidation based
|
|
13
|
+
* on prior stage data or app context.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useViewStageQueries({ enabled: extEnabled, stageKey, dependsOnStages, viewResolutionContextBase, queriesByStage, viewsToResolve, queryFn, }: {
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
stageKey: ViewStageKey;
|
|
18
|
+
dependsOnStages?: ViewStageKey[] | null;
|
|
19
|
+
viewResolutionContextBase: ViewResolutionContextBase;
|
|
20
|
+
queriesByStage: Partial<QueriesByStage>;
|
|
21
|
+
viewsToResolve: ViewToResolve[];
|
|
22
|
+
queryFn: (viewToResolve: ViewToResolve, partialView: Partial<ResolvedView>) => Promise<Partial<ResolvedView>>;
|
|
23
|
+
}): import("@tanstack/react-query").UseQueryResult<unknown, Error>[];
|
|
@@ -1,12 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ViewResolutionContextBase, ViewSpec, ViewStageKey } from '../types';
|
|
2
|
+
import type { QueriesByStage } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Flat ordered list of all stage keys, derived from `PIPELINE_STAGES`.
|
|
5
|
+
* Parallel stages within the same group appear consecutively.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PIPELINE_STAGE_ORDER: ViewStageKey[];
|
|
8
|
+
/**
|
|
9
|
+
* Orchestrates the full view resolution pipeline for all active views.
|
|
10
|
+
*
|
|
11
|
+
* Stages are resolved in groups: `[metadata] → [sources] → [layers] →
|
|
12
|
+
* [controls, download]`. Stages within a group are parallel — they share the
|
|
13
|
+
* same upstream dependencies. Each stage receives a snapshot of all preceding
|
|
14
|
+
* resolved queries so downstream stages can read prior results.
|
|
15
|
+
*
|
|
16
|
+
* Each view × stage pair is an independent React Query query. A single view
|
|
17
|
+
* can update without triggering re-resolution of any other view.
|
|
18
|
+
*
|
|
19
|
+
* `resolvedViews` carries all active views with raw stage data (sentinels for
|
|
20
|
+
* unresolved stages). Use `viewsReadyAtStage` to obtain a filtered subset.
|
|
21
|
+
*
|
|
22
|
+
* `resolvedViewSpecs` are resolved synchronously because schema changes must
|
|
23
|
+
* reflect immediately as the user edits conf values.
|
|
24
|
+
*/
|
|
3
25
|
export declare function useViews(viewResolutionContextBase: ViewResolutionContextBase): {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
26
|
+
currentLoadingStage: (viewId?: string | null) => ViewStageKey | null;
|
|
27
|
+
queriesByStage: QueriesByStage;
|
|
28
|
+
viewsReadyAtStage: (stageKey: ViewStageKey) => Partial<import("../types").ResolvedView>[];
|
|
29
|
+
resolvedViews: Partial<import("../types").ResolvedView>[];
|
|
30
|
+
resolvedViewSpecs: (ViewSpec | {
|
|
31
|
+
confSchema: Partial<import("../types").ResolvedView>;
|
|
32
|
+
id: string;
|
|
33
|
+
debug?: boolean;
|
|
34
|
+
keywords?: string | string[];
|
|
35
|
+
metadata: import("../types").ViewMetadataSpec;
|
|
36
|
+
sources: import("../types").ViewSourcesSpec;
|
|
37
|
+
layers: import("../types").ViewLayersSpec;
|
|
38
|
+
controls: import("../types").ViewControlsSpec;
|
|
39
|
+
download?: import("../types").ViewDownloadSpec;
|
|
40
|
+
})[];
|
|
12
41
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ResolvedView, ViewStageKey } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Utility that checks whether a partial view
|
|
4
|
+
* has all stages from a list resolved
|
|
5
|
+
*/
|
|
6
|
+
export declare function viewHasResolvedStages(partialView: Partial<ResolvedView>, stages: ViewStageKey[]): boolean;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ViewConf } from '../../../GeoReDUS/viewConfReducer';
|
|
2
|
+
import { ResolvedView, ViewResolutionContextBase, ViewSpec, ViewStageKey } from '../../types';
|
|
3
|
+
import { QueriesByStage } from '../types';
|
|
4
|
+
type ViewStageQueryKeyProps = {
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
stageKey: ViewStageKey;
|
|
7
|
+
dependsOnStages?: ViewStageKey[] | null;
|
|
8
|
+
viewResolutionContextBase: ViewResolutionContextBase;
|
|
9
|
+
queriesByStage: Partial<QueriesByStage>;
|
|
10
|
+
viewId: string;
|
|
11
|
+
viewIndex: number;
|
|
12
|
+
viewSpec: ViewSpec;
|
|
13
|
+
viewConf: ViewConf;
|
|
14
|
+
partialView: Partial<ResolvedView>;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Computes the React Query cache key for a single view × stage combination.
|
|
18
|
+
*
|
|
19
|
+
* The key is a seven-element array. Elements 0–2 are scoping identifiers that
|
|
20
|
+
* isolate each cache entry. Elements 3–6 are invalidation signals — React
|
|
21
|
+
* Query re-fetches the query whenever any of them changes.
|
|
22
|
+
*
|
|
23
|
+
* ```
|
|
24
|
+
* [0] 'GeoReDUS:ViewStage' — namespace; prevents collisions with other query keys
|
|
25
|
+
* [1] viewId — one cache entry per view
|
|
26
|
+
* [2] stageKey — one cache entry per stage within a view
|
|
27
|
+
* [3] app — invalidates all stages for all views on app context change
|
|
28
|
+
* [4] viewConf (filtered) — invalidates stages that declare interest in a conf prop;
|
|
29
|
+
* see _keyViewConf for notify-based filtering
|
|
30
|
+
* [5] upstream stage versions — invalidates this stage when an upstream stage refetches or errors;
|
|
31
|
+
* null when dependsOnStages is absent
|
|
32
|
+
* [6] custom stage dependencies — invalidates this stage based on the upstream data slice it
|
|
33
|
+
* declared via viewSpec[stageKey]._dependencies;
|
|
34
|
+
* 'STABLE_DEPENDENCY' when not defined
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* Invalidation scope summary:
|
|
38
|
+
* - `app` change → all stages, all views
|
|
39
|
+
* - conf prop change → directly invalidates stages whose `notify` matches;
|
|
40
|
+
* downstream stages cascade via element 5 once upstream re-resolves
|
|
41
|
+
* - upstream stage refetch → all stages listing it in `dependsOnStages`
|
|
42
|
+
* - upstream data unchanged (guarded by `_dependencies`) → no re-resolution
|
|
43
|
+
*/
|
|
44
|
+
export declare function viewStageQueryKey(props: ViewStageQueryKeyProps): any[];
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ResolvedView } from '../../types';
|
|
2
|
+
import { QueriesByStage, ViewToResolve } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Merges query results into partial views. For each stage in `queriesByStage`,
|
|
5
|
+
* assigns query data on success or a sentinel symbol (`STAGE_LOADING` /
|
|
6
|
+
* `STAGE_ERROR`) otherwise. When `queriesByStage` is `null`, returns base
|
|
7
|
+
* views with only `id` and `conf`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function viewsFromStageQueries<QueriesByStagePartial extends Partial<QueriesByStage> = QueriesByStage>({ viewsToResolve, queriesByStage, }: {
|
|
10
|
+
viewsToResolve: ViewToResolve[];
|
|
11
|
+
queriesByStage: QueriesByStagePartial | null;
|
|
12
|
+
}): Partial<ResolvedView>[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redus/georedus-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.1",
|
|
4
4
|
"packageManager": "yarn@4.0.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -43,7 +43,8 @@
|
|
|
43
43
|
"react-map-gl": "^8.0.0",
|
|
44
44
|
"react-router-dom": "^7.4.1",
|
|
45
45
|
"rollup": "^4.13.0",
|
|
46
|
-
"storybook": "^8.0.0"
|
|
46
|
+
"storybook": "^8.0.0",
|
|
47
|
+
"type-fest": "^5.8.0"
|
|
47
48
|
},
|
|
48
49
|
"dependencies": {
|
|
49
50
|
"@mapbox/tilebelt": "2.0.0",
|
|
@@ -55,7 +56,7 @@
|
|
|
55
56
|
"@orioro/react-csv": "^0.0.17",
|
|
56
57
|
"@orioro/react-dialogs": "^0.1.5",
|
|
57
58
|
"@orioro/react-dir-nav": "^0.2.2",
|
|
58
|
-
"@orioro/react-maplibre-util": "^0.
|
|
59
|
+
"@orioro/react-maplibre-util": "^0.9.1",
|
|
59
60
|
"@orioro/react-sortable": "^0.0.16",
|
|
60
61
|
"@orioro/react-ui-core": "^0.0.20",
|
|
61
62
|
"@orioro/resolve": "^0.1.12",
|
|
@@ -63,7 +64,7 @@
|
|
|
63
64
|
"@orioro/tree-model": "^0.0.10",
|
|
64
65
|
"@orioro/util": "^0.16.0",
|
|
65
66
|
"@orioro/validate": "^0.0.10",
|
|
66
|
-
"@orioro/vector-tile-util": "^0.
|
|
67
|
+
"@orioro/vector-tile-util": "^0.4.1",
|
|
67
68
|
"@radix-ui/react-collapsible": "^1.1.3",
|
|
68
69
|
"@tanstack/react-query": "^5.18.0",
|
|
69
70
|
"@turf/turf": "^7.1.0",
|
|
@@ -75,6 +76,7 @@
|
|
|
75
76
|
"d3-scale-chromatic": "^3.1.0",
|
|
76
77
|
"file-saver": "^2.0.5",
|
|
77
78
|
"gdal3.js": "^2.8.1",
|
|
79
|
+
"h3-js": "^4.5.0",
|
|
78
80
|
"html-to-image": "^1.11.13",
|
|
79
81
|
"katex": "^0.16.22",
|
|
80
82
|
"lodash": "^4.17.21",
|
|
File without changes
|