Skip to content

Commit

Permalink
feat: change soil color data format (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
shrouxm authored Mar 13, 2024
1 parent 676f129 commit 19581aa
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 49 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-redux": "^8.1.3",
"terraso-backend": "github:techmatters/terraso-backend#a6eddfc",
"terraso-backend": "github:techmatters/terraso-backend#f19112f",
"uuid": "^9.0.1"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/soilId/soilIdFragments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ export const depthDependentSoilData = /* GraphQL */ `
texture
rockFragmentVolume
clayPercent
colorHueSubstep
colorHue
colorValue
colorChroma
colorPhotoUsed
colorPhotoSoilCondition
colorPhotoLightingCondition
conductivity
Expand Down
58 changes: 13 additions & 45 deletions src/soilId/soilIdTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ import type {
ProjectSoilSettingsNode,
SoilDataDepthIntervalNode,
SoilDataNode,
SoilIdDepthDependentSoilDataColorChromaChoices,
SoilIdDepthDependentSoilDataColorHueChoices,
SoilIdDepthDependentSoilDataColorHueSubstepChoices,
SoilIdDepthDependentSoilDataColorValueChoices,
SoilIdDepthDependentSoilDataRockFragmentVolumeChoices,
SoilIdDepthDependentSoilDataTextureChoices,
SoilIdSoilDataSurfaceCracksSelectChoices,
Expand Down Expand Up @@ -92,51 +88,23 @@ export const textures = [
'SILT_LOAM',
] as const satisfies readonly SoilTexture[];

export type SoilColorValue = SoilIdDepthDependentSoilDataColorValueChoices;
export const colorValues = [
'VALUE_2_5',
'VALUE_3',
'VALUE_4',
'VALUE_5',
'VALUE_6',
'VALUE_7',
'VALUE_8',
'VALUE_8_5',
'VALUE_9',
'VALUE_9_5',
] as const satisfies readonly SoilColorValue[];
export const colorValues = [2.5, 3, 4, 5, 6, 7, 8, 8.5, 9, 9.5] as const;

export type SoilColorChroma = SoilIdDepthDependentSoilDataColorChromaChoices;
export const colorChromas = [
'CHROMA_1',
'CHROMA_2',
'CHROMA_3',
'CHROMA_4',
'CHROMA_5',
'CHROMA_6',
'CHROMA_7',
'CHROMA_8',
] as const satisfies readonly SoilColorChroma[];
export const colorChromas = [1, 2, 3, 4, 5, 6, 7, 8] as const;

export type SoilColorHue = SoilIdDepthDependentSoilDataColorHueChoices;
export const colorHueSubsteps = [2.5, 5, 7.5, 10] as const;
export const colorHues = [
'B',
'BG',
'G',
'GY',
'Y',
'YR',
'R',
] as const satisfies readonly SoilColorHue[];

export type SoilColorHueSubstep =
SoilIdDepthDependentSoilDataColorHueSubstepChoices;
export const colorHueSubsteps = [
'SUBSTEP_2_5',
'SUBSTEP_5',
'SUBSTEP_7_5',
'SUBSTEP_10',
] as const satisfies readonly SoilColorHueSubstep[];
'YR',
'Y',
'GY',
'G',
'BG',
'B',
'PB',
'P',
'RP',
] as const;

export type RockFragmentVolume =
SoilIdDepthDependentSoilDataRockFragmentVolumeChoices;
Expand Down

0 comments on commit 19581aa

Please sign in to comment.