@redus/georedus-ui 0.20.3 → 0.22.0

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.
Files changed (109) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/Markdown/index.d.ts +4 -1
  3. package/dist/main.js +3896 -1033
  4. package/dist/viewSpecs/presets/cem_censo/2010_2022/confSchema.d.ts +1 -0
  5. package/dist/viewSpecs/presets/cem_censo/2010_2022/index.d.ts +1 -0
  6. package/dist/viewSpecs/presets/cem_censo/2022/index.d.ts +1 -0
  7. package/dist/viewSpecs/presets/gtfs_lines/confSchema.d.ts +51 -0
  8. package/dist/viewSpecs/presets/gtfs_lines/consts.d.ts +3 -0
  9. package/dist/viewSpecs/presets/gtfs_lines/download.d.ts +9 -0
  10. package/dist/viewSpecs/presets/gtfs_lines/index.d.ts +100 -0
  11. package/dist/viewSpecs/presets/gtfs_lines/layers.d.ts +11 -0
  12. package/dist/viewSpecs/presets/gtfs_lines/metadata/index.d.ts +11 -0
  13. package/dist/viewSpecs/presets/gtfs_lines/metadata/widthScaleStopsResolvers.d.ts +24 -0
  14. package/dist/viewSpecs/presets/gtfs_lines/parseStyleSpec.d.ts +26 -0
  15. package/dist/viewSpecs/presets/gtfs_lines/sources.d.ts +7 -0
  16. package/dist/viewSpecs/presets/gtfs_stops/confSchema.d.ts +46 -0
  17. package/dist/viewSpecs/presets/gtfs_stops/download.d.ts +9 -0
  18. package/dist/viewSpecs/presets/gtfs_stops/index.d.ts +147 -0
  19. package/dist/viewSpecs/presets/gtfs_stops/layers.d.ts +62 -0
  20. package/dist/viewSpecs/presets/gtfs_stops/metadata/colorScaleStopResolvers.d.ts +30 -0
  21. package/dist/viewSpecs/presets/gtfs_stops/metadata/index.d.ts +11 -0
  22. package/dist/viewSpecs/presets/gtfs_stops/parseStyleSpec.d.ts +33 -0
  23. package/dist/viewSpecs/presets/gtfs_stops/sources.d.ts +8 -0
  24. package/dist/viewSpecs/presets/gtfs_travel_time_hex/confSchema.d.ts +21 -0
  25. package/dist/viewSpecs/presets/gtfs_travel_time_hex/fetchDataForHex.d.ts +7 -0
  26. package/dist/viewSpecs/presets/gtfs_travel_time_hex/index.d.ts +113 -0
  27. package/dist/viewSpecs/presets/gtfs_travel_time_hex/layers.d.ts +72 -0
  28. package/dist/viewSpecs/presets/gtfs_travel_time_hex/sources.d.ts +10 -0
  29. package/dist/viewSpecs/presets/index.d.ts +13 -5
  30. package/dist/viewSpecs/presets/raster_categorical/index.d.ts +34 -0
  31. package/dist/viewSpecs/presets/raster_categorical/layers.d.ts +15 -0
  32. package/dist/viewSpecs/presets/raster_categorical/parseStyleSpec.d.ts +12 -0
  33. package/dist/viewSpecs/presets/raster_categorical/sources.d.ts +9 -0
  34. package/dist/viewSpecs/presets/tmp_gtfs_travel_time_hex/parseStyleSpec.d.ts +13 -0
  35. package/dist/viewSpecs/presets/util/components/basicTooltip.d.ts +1 -1
  36. package/dist/viewSpecs/presets/util/components/confInputs/categoricalColorSchemeSelector.d.ts +17 -0
  37. package/dist/viewSpecs/presets/util/components/confInputs/colorSelector.d.ts +63 -0
  38. package/dist/viewSpecs/presets/util/components/confInputs/continuousColorSchemeSelector.d.ts +12 -0
  39. package/dist/viewSpecs/presets/util/components/confInputs/fillPatternSelector.d.ts +16 -0
  40. package/dist/viewSpecs/presets/util/components/confInputs/index.d.ts +7 -0
  41. package/dist/viewSpecs/presets/util/components/confInputs/linePatternSelector.d.ts +18 -0
  42. package/dist/viewSpecs/presets/util/components/confInputs/lineWidthSelector.d.ts +18 -0
  43. package/dist/viewSpecs/presets/util/components/confInputs/opacitySlider.d.ts +10 -0
  44. package/dist/viewSpecs/presets/util/components/rawFileDownload.d.ts +12 -0
  45. package/dist/viewSpecs/presets/util/hourUtil.d.ts +9 -0
  46. package/dist/viewSpecs/presets/util/index.d.ts +2 -0
  47. package/dist/viewSpecs/presets/util/municipioFilter.d.ts +9 -0
  48. package/dist/viewSpecs/presets/vector_circle/index.d.ts +2 -50
  49. package/dist/viewSpecs/presets/vector_heatmap/confSchema.d.ts +24 -0
  50. package/dist/viewSpecs/presets/vector_heatmap/download.d.ts +9 -0
  51. package/dist/viewSpecs/presets/vector_heatmap/index.d.ts +72 -0
  52. package/dist/viewSpecs/presets/vector_heatmap/layers.d.ts +12 -0
  53. package/dist/viewSpecs/presets/vector_heatmap/metadata/index.d.ts +9 -0
  54. package/dist/viewSpecs/presets/vector_heatmap/parseStyleSpec.d.ts +20 -0
  55. package/dist/viewSpecs/presets/vector_heatmap/sources.d.ts +8 -0
  56. package/dist/viewSpecs/presets/vector_line/index.d.ts +2 -50
  57. package/dist/viewSpecs/presets/vector_line_categorical/confSchema.d.ts +39 -0
  58. package/dist/viewSpecs/presets/vector_line_categorical/download.d.ts +9 -0
  59. package/dist/viewSpecs/presets/vector_line_categorical/index.d.ts +88 -0
  60. package/dist/viewSpecs/presets/vector_line_categorical/layers.d.ts +11 -0
  61. package/dist/viewSpecs/presets/vector_line_categorical/metadata.d.ts +11 -0
  62. package/dist/viewSpecs/presets/vector_line_categorical/parseStyleSpec.d.ts +15 -0
  63. package/dist/viewSpecs/presets/vector_line_categorical/sources.d.ts +7 -0
  64. package/dist/viewSpecs/presets/vector_line_single/confSchema.d.ts +37 -0
  65. package/dist/viewSpecs/presets/vector_line_single/download.d.ts +9 -0
  66. package/dist/viewSpecs/presets/vector_line_single/index.d.ts +76 -0
  67. package/dist/viewSpecs/presets/vector_line_single/layers.d.ts +11 -0
  68. package/dist/viewSpecs/presets/vector_line_single/metadata.d.ts +1 -0
  69. package/dist/viewSpecs/presets/vector_line_single/parseStyleSpec.d.ts +7 -0
  70. package/dist/viewSpecs/presets/vector_line_single/sources.d.ts +7 -0
  71. package/dist/viewSpecs/presets/vector_point_categorical/confSchema.d.ts +17 -0
  72. package/dist/viewSpecs/presets/vector_point_categorical/download.d.ts +9 -0
  73. package/dist/viewSpecs/presets/vector_point_categorical/index.d.ts +100 -0
  74. package/dist/viewSpecs/presets/vector_point_categorical/layers.d.ts +45 -0
  75. package/dist/viewSpecs/presets/vector_point_categorical/metadata/index.d.ts +11 -0
  76. package/dist/viewSpecs/presets/vector_point_categorical/parseStyleSpec.d.ts +15 -0
  77. package/dist/viewSpecs/presets/vector_point_categorical/sources.d.ts +8 -0
  78. package/dist/viewSpecs/presets/vector_point_continuous/parseStyleSpec.d.ts +1 -20
  79. package/dist/viewSpecs/presets/vector_point_single/confSchema.d.ts +2 -50
  80. package/dist/viewSpecs/presets/vector_point_single/index.d.ts +2 -50
  81. package/dist/viewSpecs/presets/vector_point_single/parseStyleSpec.d.ts +1 -4
  82. package/dist/viewSpecs/presets/vector_polygon/index.d.ts +2 -50
  83. package/dist/viewSpecs/presets/vector_polygon_categorical/confSchema.d.ts +23 -0
  84. package/dist/viewSpecs/presets/vector_polygon_categorical/index.d.ts +23 -0
  85. package/dist/viewSpecs/presets/vector_polygon_categorical/parseStyleSpec.d.ts +2 -1
  86. package/dist/viewSpecs/presets/vector_polygon_continuous/confSchema.d.ts +11 -1
  87. package/dist/viewSpecs/presets/vector_polygon_continuous/index.d.ts +21 -3
  88. package/dist/viewSpecs/presets/vector_polygon_continuous/layers.d.ts +9 -2
  89. package/dist/viewSpecs/presets/vector_polygon_continuous/parseStyleSpec.d.ts +1 -3
  90. package/dist/viewSpecs/presets/vector_polygon_single/confSchema.d.ts +12 -50
  91. package/dist/viewSpecs/presets/vector_polygon_single/index.d.ts +12 -50
  92. package/dist/viewSpecs/presets/vector_polygon_single/parseStyleSpec.d.ts +1 -0
  93. package/dist/viewSpecs/resolveView/resolveView.d.ts +2 -2
  94. package/dist/viewSpecs/types.d.ts +5 -0
  95. package/dist/viewSpecs/useViews/constants.d.ts +22 -0
  96. package/dist/viewSpecs/useViews/tmp_useViews.d.ts +42 -0
  97. package/dist/viewSpecs/useViews/types.d.ts +15 -0
  98. package/dist/viewSpecs/useViews/useViewStageQueries.d.ts +23 -0
  99. package/dist/viewSpecs/useViews/useViews.d.ts +39 -10
  100. package/dist/viewSpecs/useViews/util/index.d.ts +5 -0
  101. package/dist/viewSpecs/useViews/util/useViewStageQueriesCache.d.ts +2 -0
  102. package/dist/viewSpecs/useViews/util/viewHasResolvedStages.d.ts +6 -0
  103. package/dist/viewSpecs/useViews/util/viewStageQueryKey.d.ts +45 -0
  104. package/dist/viewSpecs/useViews/util/viewsFromStageQueries.d.ts +12 -0
  105. package/dist/viewSpecs/util/colorSchemes/d3.d.ts +1 -1
  106. package/dist/viewSpecs/util/colorSchemes/index.d.ts +1 -1
  107. package/package.json +6 -4
  108. package/dist/viewSpecs/presets/util/components/confInputs.d.ts +0 -127
  109. /package/dist/viewSpecs/useViews/{queryKeyHashFnWithFileSupport.d.ts → util/queryKeyHashFnWithFileSupport.d.ts} +0 -0
@@ -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, "metadata" | "sources" | "layers" | "conf">, viewResolutionContextBase: ViewResolutionContextBase) => Promise<import("../types").ViewControls>;
9
- export declare const resolveDownload: (viewSpec: ViewSpec, partialViewAtStage: Pick<ResolvedView, "metadata" | "sources" | "layers" | "conf">, viewResolutionContextBase: ViewResolutionContextBase) => Promise<import("../types").ViewDownload>;
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 { UseQueryResult } from '@tanstack/react-query';
2
- import { ResolvedView, ViewResolutionContextBase, ViewSpec } from '../types';
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
- isLoading: boolean;
5
- metadataQueries: UseQueryResult<unknown, Error>[];
6
- sourcesQueries: UseQueryResult<unknown, Error>[];
7
- layersQueries: UseQueryResult<unknown, Error>[];
8
- controlsQueries: UseQueryResult<unknown, Error>[];
9
- downloadQueries: UseQueryResult<unknown, Error>[];
10
- resolvedViews: Partial<ResolvedView>[];
11
- resolvedViewSpecs: ViewSpec[];
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,5 @@
1
+ export * from './queryKeyHashFnWithFileSupport';
2
+ export * from './useViewStageQueriesCache';
3
+ export * from './viewsFromStageQueries';
4
+ export * from './viewHasResolvedStages';
5
+ export * from './viewStageQueryKey';
@@ -0,0 +1,2 @@
1
+ import { ViewToResolve } from '../types';
2
+ export declare function useViewStageQueriesCache(viewsToResolve: ViewToResolve[]): import("react").RefObject<Record<string, unknown>>;
@@ -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>[];
@@ -54,5 +54,5 @@ export declare const D3_SEQUENTIAL: {
54
54
  schemeYlOrRd: any;
55
55
  };
56
56
  export declare const D3_COLOR_SCHEMES: {
57
- schemeGeoReDUS: string[];
57
+ [x: string]: any;
58
58
  };
@@ -8,6 +8,6 @@ export declare const COLOR_SCHEMES: {
8
8
  };
9
9
  export declare function colorScheme(path: string): any;
10
10
  export declare function resolveColor(colorInput: string): string;
11
- export declare function resolveSchemeColor(colorSchemeId: string, indexOrId: string | number): string;
11
+ export declare function resolveCategoricalSchemeColor(colorSchemeId: string, indexOrId: string | number): string;
12
12
  export * from './d3';
13
13
  export * from './georedus';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redus/georedus-ui",
3
- "version": "0.20.3",
3
+ "version": "0.22.0",
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.8.1",
59
+ "@orioro/react-maplibre-util": "^0.9.0",
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.3.2",
67
+ "@orioro/vector-tile-util": "^0.4.0",
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",
@@ -1,127 +0,0 @@
1
- export function colorSelector(_initialColor: any): {
2
- label: string;
3
- helperText: string;
4
- type: string;
5
- clearable: boolean;
6
- defaultValue: any;
7
- options: ({
8
- label: import("react").JSX.Element;
9
- value: string;
10
- } | {
11
- label: import("react").JSX.Element;
12
- value: string;
13
- } | {
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
- };
60
- export function svgBgImage(svg: any): string;
61
- export function fillPatternSelector(props?: {}): {
62
- label: string;
63
- type: string;
64
- clearable: boolean;
65
- defaultValue: string;
66
- options: {
67
- label: import("react").JSX.Element;
68
- value: string;
69
- }[];
70
- };
71
- export const COLOR_OPTIONS: ({
72
- label: string;
73
- value: string;
74
- } | {
75
- label: string;
76
- value: string;
77
- } | {
78
- label: string;
79
- value: string;
80
- } | {
81
- label: string;
82
- value: string;
83
- } | {
84
- label: string;
85
- value: string;
86
- } | {
87
- label: string;
88
- value: string;
89
- } | {
90
- label: string;
91
- value: string;
92
- } | {
93
- label: string;
94
- value: string;
95
- } | {
96
- label: string;
97
- value: string;
98
- } | {
99
- label: string;
100
- value: string;
101
- } | {
102
- label: string;
103
- value: string;
104
- } | {
105
- label: string;
106
- value: string;
107
- } | {
108
- label: string;
109
- value: string;
110
- } | {
111
- label: string;
112
- value: string;
113
- } | {
114
- label: string;
115
- value: string;
116
- } | {
117
- label: string;
118
- value: string;
119
- } | {
120
- label: string;
121
- value: string;
122
- })[];
123
- export const FILL_PATTERN_SOLID: "solid";
124
- export const FILL_PATTERN_OPTIONS: {
125
- label: string;
126
- value: string;
127
- }[];