Skip to content

Commit

Permalink
Make colormap&&rescale valid sourceparam
Browse files Browse the repository at this point in the history
  • Loading branch information
hanbyul-here committed Feb 12, 2025
1 parent 3ae667f commit a08f4c1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/scripts/components/exploration/data-utils-no-faux-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ import {
DatasetLayerType
} from '$types/veda';

// @NOTE: All fns from './date-utils` should eventually move here to get rid of their faux modules dependencies
// `./date-utils` to be deprecated!!

export const getDatasetLayers = (datasets: VedaData<DatasetData>) =>
Object.values(datasets).flatMap((dataset: VedaDatum<DatasetData>) => {
return dataset.data.layers.map((l) => ({
Expand Down Expand Up @@ -152,8 +149,13 @@ export function resolveLayerTemporalExtent(
}
}

// What is a valid source params to make the dataset render as expected?
const hasValidSourceParams = (params) => {
return params && 'colormap_name' in params && 'rescale' in params;
return (
params &&
('colormap_name' in params || 'colormap' in params) &&
'rescale' in params
);
};

/**
Expand Down

0 comments on commit a08f4c1

Please sign in to comment.