From 4bd2d6a9d90e5e476e56b25b188245da3b85165c Mon Sep 17 00:00:00 2001 From: kelsey-taylor Date: Wed, 22 Nov 2023 16:22:07 -0500 Subject: [PATCH] style raster data + add combined sand+soil option --- vacs-map-app/src/MapExplorer.vue | 6 ++ .../components/MapContainerColorSandSoil.vue | 77 +++++++++++++++++++ vacs-map-app/src/components/SandLayer.vue | 6 +- .../src/components/SoilCarbonLayer.vue | 4 +- 4 files changed, 88 insertions(+), 5 deletions(-) create mode 100644 vacs-map-app/src/components/MapContainerColorSandSoil.vue diff --git a/vacs-map-app/src/MapExplorer.vue b/vacs-map-app/src/MapExplorer.vue index 5efb90c..556ae48 100644 --- a/vacs-map-app/src/MapExplorer.vue +++ b/vacs-map-app/src/MapExplorer.vue @@ -23,6 +23,7 @@ import MapContainerColorRadius from '@/components/MapContainerColorRadius.vue'; import MapContainerNotFilled from '@/components/MapContainerNotFilled.vue'; import MapContainerNotFilledTwoLayers from '@/components/MapContainerNotFilledTwoLayers.vue'; import MapContainerColorAfricanUnion from '@/components/MapContainerColorAfricanUnion.vue'; +import MapContainerColorSandSoil from '@/components/MapContainerColorSandSoil.vue'; import MapContainerColorSoil from '@/components/MapContainerColorSoil.vue'; import MapContainerColorSand from '@/components/MapContainerColorSand.vue'; import { useMapExploreStore } from '@/stores/mapExplore'; @@ -60,6 +61,11 @@ const availableMaps = [ name: 'circles + african union regions', component: MapContainerColorAfricanUnion }, + { + id: 'sand-soil', + name: 'circles + sand + soil carbon', + component: MapContainerColorSandSoil + }, { id: 'soil', name: 'circles + soil carbon', diff --git a/vacs-map-app/src/components/MapContainerColorSandSoil.vue b/vacs-map-app/src/components/MapContainerColorSandSoil.vue new file mode 100644 index 0000000..857c529 --- /dev/null +++ b/vacs-map-app/src/components/MapContainerColorSandSoil.vue @@ -0,0 +1,77 @@ + + + + + diff --git a/vacs-map-app/src/components/SandLayer.vue b/vacs-map-app/src/components/SandLayer.vue index 51ba85a..d246c85 100644 --- a/vacs-map-app/src/components/SandLayer.vue +++ b/vacs-map-app/src/components/SandLayer.vue @@ -31,7 +31,7 @@ const props = defineProps({ const { id, map, mapReady, sourceId } = toRefs(props) -const minRasterValue = 0 +const minRasterValue = 50 const maxRasterValue = 100 const getRasterColor = () => { @@ -41,11 +41,11 @@ const getRasterColor = () => { // // Like this: // - // const interpolator = d3.interpolateBrBG; + // const interpolator = d3.interpolateRainbow; // const interpolator = d3.interpolatePiYG; // Or define your own: - const interpolator = d3.interpolateHsl("hsl(60, 2%, 34%)", "red"); + const interpolator = d3.interpolateHsl("transparent", "orange"); // const interpolator = d3.interpolateInferno return interpolator(value) diff --git a/vacs-map-app/src/components/SoilCarbonLayer.vue b/vacs-map-app/src/components/SoilCarbonLayer.vue index 3d30617..681a7ac 100644 --- a/vacs-map-app/src/components/SoilCarbonLayer.vue +++ b/vacs-map-app/src/components/SoilCarbonLayer.vue @@ -37,9 +37,9 @@ const maxRasterValue = 100 const getRasterColor = () => { const getColor = (value) => { // const interpolator = d3.interpolateBrBG; - const interpolator = d3.interpolateHsl("hsl(60, 2%, 34%)", "#DEB887"); + const interpolator = d3.interpolateHsl("hsla(143, 52%, 13%, 0)", "#6DACA4"); // const interpolator = d3.interpolatePiYG; - // const interpolator = d3.interpolateInferno + // const interpolator = d3.interpolateCubehelixDefault return interpolator(value) }