Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/v1.0.86'
Browse files Browse the repository at this point in the history
  • Loading branch information
nnkogift committed Jan 23, 2023
2 parents e1cdd2b + a7f5160 commit 41035e8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hisptz/react-ui",
"homepage": "https://hisptz.github.io/react-ui",
"version": "1.0.85",
"version": "1.0.86",
"description": "A collection of reusable complex DHIS2 react ui components.",
"license": "BSD-3-Clause",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,19 @@ export function useThematicLayers(): any {
scale: defaultClasses,
colorClass: defaultColorScaleName,
};
const sortedData = sortBy(layer.data, "data");
const sortedData = sortBy(
layer.data.filter((datum) => !!datum.data),
"data"
);
const autoLegends = generateLegends(last(sortedData)?.data ?? 0, head(sortedData)?.data ?? 0, {
classesCount: scale,
colorClass,
});
console.log({
scale,
colorClass,
sortedData,
});
legends.push(...autoLegends);
}
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ export function MapLayersProvider({ layers, children }: { layers: MapLayerConfig
const sanitizedBoundaryLayers = (boundaryLayers ?? []) as CustomBoundaryLayer[];
const sanitizedPointLayer = head(pointLayers ?? []) ? await sanitizePointLayer(head(pointLayers) as CustomPointLayer) : undefined;
const sanitizedEarthEngineLayers = await sanitizeEarthEngineLayers([...(earthEngineLayers ?? [])] as unknown as CustomGoogleEngineLayer[]);

console.log(sanitizedThematicLayers);

setUpdatedLayers(
compact([...(sanitizedBoundaryLayers ?? []), ...(sanitizedThematicLayers ?? []), sanitizedPointLayer, ...(sanitizedEarthEngineLayers ?? [])])
);
Expand Down

0 comments on commit 41035e8

Please sign in to comment.