diff --git a/app/scripts/components/analysis/define/index.tsx b/app/scripts/components/analysis/define/index.tsx index 789f1615e..503613123 100644 --- a/app/scripts/components/analysis/define/index.tsx +++ b/app/scripts/components/analysis/define/index.tsx @@ -114,7 +114,7 @@ export const allAvailableDatasetsLayers: DatasetLayer[] = Object.values( ) .map((dataset) => (dataset as VedaDatum).data.layers) .flat() - .filter((d) => d.type !== 'vector'); + .filter((d) => d.type !== 'vector' && !d.analysis?.exclude); export default function Analysis() { const { params, setAnalysisParam } = useAnalysisParams(); diff --git a/app/scripts/components/analysis/results/use-analysis-params.ts b/app/scripts/components/analysis/results/use-analysis-params.ts index 95734d4a6..b377be0f8 100644 --- a/app/scripts/components/analysis/results/use-analysis-params.ts +++ b/app/scripts/components/analysis/results/use-analysis-params.ts @@ -89,7 +89,7 @@ export function useAnalysisParams(): { // When accessing the object values with Object.values, they'll always // be defined. (d) => d!.data.layers - ); + ).filter((l) => !l.analysis?.exclude); const layers = datasetsLayers.split('|').map((id) => // Find the one we're looking for. allDatasetLayers.find((l) => l.id === id) diff --git a/docs/content/frontmatter/layer.md b/docs/content/frontmatter/layer.md index 800fb2e74..ca074b182 100644 --- a/docs/content/frontmatter/layer.md +++ b/docs/content/frontmatter/layer.md @@ -213,6 +213,7 @@ Configuration options for the analysis of the dataset layer. ```yaml metrics: string[] +exclude: boolean ``` **analysis.metrics** @@ -224,6 +225,10 @@ Available metrics: - max (Max) - std (Standard Deviation) - median (Median) +- +**analysis.exclude** +`boolean` +Controls whether this layer should be excluded from the analysis page. If set to `true` the layer will not be available for analysis. ### Compare diff --git a/mock/datasets/no2.data.mdx b/mock/datasets/no2.data.mdx index 3359b9642..d9f5160bb 100644 --- a/mock/datasets/no2.data.mdx +++ b/mock/datasets/no2.data.mdx @@ -122,6 +122,8 @@ layers: - "#c13b72" - "#461070" - "#050308" + analysis: + exclude: true - id: no2-monthly-diff stacCol: no2-monthly-diff name: No2 (Diff) - let's make this title reaaaaaaly long diff --git a/parcel-resolver-veda/index.d.ts b/parcel-resolver-veda/index.d.ts index 8c30cd5cb..43ea624f0 100644 --- a/parcel-resolver-veda/index.d.ts +++ b/parcel-resolver-veda/index.d.ts @@ -64,6 +64,7 @@ declare module 'veda' { legend?: LayerLegendCategorical | LayerLegendGradient; analysis?: { metrics: string[]; + exclude: boolean; } }