Skip to content

Commit

Permalink
[Release] v5.9.0 (#1224)
Browse files Browse the repository at this point in the history
You can find VEDA Dashboard preview link to test these changes:
NASA-IMPACT/veda-config#470

## 🎉 Features
- Cookie consent component:
#1163,
#1165,
#1127,
#1177
- Stories Hub export in #1162
- Expose As Is - PageHeader, LinkElement Prop & Logo in
#1184
## 🚀 Improvements

- Add docs for registry dev in
#1169
- Timeline date selection centering functionality in
#1181
- Deprecate old explore page, Mapbox component
#1176
- Update doc with new diagrams about general architecture in
#1195
-  Add playwright in #1139
- Pre-select AOIs that have the "selected" prop set to true in
#1215
- 
## 🐛 Fixes
- Check dastaset analysis exclude attribute before running analysis in
#1175
- Restrict dynamic colormaps to applicable layer types in
#1183
- Fix external link badge display for tools hosted under the same domain
in #1192
- Escape special characters in regex expression when searching datasets
in #1204


### New Contributors
* @snmln made their first contribution in
#1127
* @AliceR made their first contribution in
#1204
  • Loading branch information
snmln authored Oct 30, 2024
2 parents 1046666 + ebcaff6 commit 179976e
Show file tree
Hide file tree
Showing 14 changed files with 86 additions and 576 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ interface RasterPaintLayerProps extends BaseGeneratorParams {
colorMap?: string | undefined;
tileParams: Record<string, any>;
generatorPrefix?: string;
reScale?: { min: number; max: number };
}

export function RasterPaintLayer(props: RasterPaintLayerProps) {
Expand All @@ -25,23 +24,16 @@ export function RasterPaintLayer(props: RasterPaintLayerProps) {
hidden,
opacity,
colorMap,
reScale,
generatorPrefix = 'raster'
generatorPrefix = 'raster',
} = props;

const { updateStyle } = useMapStyle();
const [minZoom] = zoomExtent ?? [0, 20];
const generatorId = `${generatorPrefix}-${id}`;

const updatedTileParams = useMemo(() => {
return {
...tileParams,
...(colorMap && {
colormap_name: colorMap
}),
...(reScale && { rescale: Object.values(reScale) })
};
}, [tileParams, colorMap, reScale]);
return { ...tileParams, ...colorMap && {colormap_name: colorMap}};
}, [tileParams, colorMap]);

//
// Generate Mapbox GL layers and sources for raster timeseries
Expand All @@ -55,9 +47,7 @@ export function RasterPaintLayer(props: RasterPaintLayerProps) {

useEffect(
() => {
const tileParamsAsString = qs.stringify(updatedTileParams, {
arrayFormat: 'comma'
});
const tileParamsAsString = qs.stringify(updatedTileParams, { arrayFormat: 'comma' });

const zarrSource: RasterSource = {
type: 'raster',
Expand All @@ -73,8 +63,8 @@ export function RasterPaintLayer(props: RasterPaintLayerProps) {
paint: {
'raster-opacity': hidden ? 0 : rasterOpacity,
'raster-opacity-transition': {
duration: 320
}
duration: 320,
},
},
minzoom: minZoom,
metadata: {
Expand Down Expand Up @@ -103,8 +93,7 @@ export function RasterPaintLayer(props: RasterPaintLayerProps) {
tileApiEndpoint,
haveTileParamsChanged,
generatorParams,
colorMap,
reScale
colorMap
// generatorParams includes hidden and opacity
// hidden,
// opacity,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ export function RasterTimeseries(props: RasterTimeseriesProps) {
stacApiEndpoint,
tileApiEndpoint,
colorMap,
reScale
} = props;

const { current: mapInstance } = useMaps();

const theme = useTheme();
const { updateStyle } = useMapStyle();

Expand Down Expand Up @@ -270,9 +270,7 @@ export function RasterTimeseries(props: RasterTimeseriesProps) {
controller
});
const mosaicUrl = responseData.links[1].href;
setMosaicUrl(
mosaicUrl.replace('/{tileMatrixSetId}', '/WebMercatorQuad')
);
setMosaicUrl(mosaicUrl.replace('/{tileMatrixSetId}', '/WebMercatorQuad'));
} catch (error) {
// @NOTE: conditional logic TO BE REMOVED once new BE endpoints have moved to prod... Fallback on old request url if new endpoints error with nonexistance...
if (error.request) {
Expand All @@ -286,14 +284,10 @@ export function RasterTimeseries(props: RasterTimeseriesProps) {
const mosaicUrl = responseData.links[1].href;
setMosaicUrl(mosaicUrl);
} else {
LOG &&
LOG &&
/* eslint-disable-next-line no-console */
console.log(
'Titiler /register %cEndpoint error',
'color: red;',
error
);
throw error;
console.log('Titiler /register %cEndpoint error', 'color: red;', error);
throw error;
}
}

Expand Down Expand Up @@ -367,8 +361,7 @@ export function RasterTimeseries(props: RasterTimeseriesProps) {
{
assets: 'cog_default',
...(sourceParams ?? {}),
...(colorMap && { colormap_name: colorMap }),
...(reScale && {rescale: Object.values(reScale)})
...colorMap && {colormap_name: colorMap}
},
// Temporary solution to pass different tile parameters for hls data
{
Expand Down Expand Up @@ -496,7 +489,6 @@ export function RasterTimeseries(props: RasterTimeseriesProps) {
}, [
mosaicUrl,
colorMap,
reScale,
points,
minZoom,
haveSourceParamsChanged,
Expand Down
1 change: 0 additions & 1 deletion app/scripts/components/common/map/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export interface BaseTimeseriesProps extends BaseGeneratorParams {
zoomExtent?: number[];
onStatusChange?: (result: { status: ActionStatus; id: string }) => void;
colorMap?: string;
reScale?: { min: number; max: number };
}

// export interface ZarrTimeseriesProps extends BaseTimeseriesProps {
Expand Down
2 changes: 0 additions & 2 deletions app/scripts/components/common/uswds/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ export { USWDSAlert } from './alert';
export { USWDSButtonGroup, USWDSButton } from './button';
export { USWDSLink } from './link';
export { USWDSBanner, USWDSBannerContent } from './banner';

export { USWDSTextInput, USWDSTextInputMask } from './input';
10 changes: 0 additions & 10 deletions app/scripts/components/common/uswds/input.tsx

This file was deleted.

11 changes: 0 additions & 11 deletions app/scripts/components/exploration/atoms/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,6 @@ export function useTimelineDatasetColormap(
return useAtom(colorMapAtom);
}

export function useTimelineDatasetColormapScale(
datasetAtom: PrimitiveAtom<TimelineDataset>
) {
const colorMapScaleAtom = useMemo(() => {
return focusAtom(datasetAtom, (optic) =>
optic.prop('settings').prop('scale')
);
}, [datasetAtom]);

return useAtom(colorMapScaleAtom);
}
export const useTimelineDatasetAnalysis = (
datasetAtom: PrimitiveAtom<TimelineDataset>
) => {
Expand Down

This file was deleted.

Loading

0 comments on commit 179976e

Please sign in to comment.