-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Introduce multiple and conditional legends (#1491)
* feat: enable multiple and conditional legends * dispatch layerconfig changes in the layercontrol * fix: legends rendering scenarios * fix: adjust layer-legend rendering logic * test: added a multi legends test
- Loading branch information
Showing
10 changed files
with
500 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
135 changes: 135 additions & 0 deletions
135
elements/layercontrol/src/enums/stories/assets/polaris-style.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
{ | ||
"variables": { | ||
"ship_class": "nis", | ||
"type_of_ice": "standard", | ||
"type_of_visualisation": "polaris", | ||
"combined_prop": "polaris_standard_pc_nis_rio" | ||
}, | ||
"fill-color": [ | ||
"case", | ||
["==", ["var", "type_of_visualisation"], "WMO Concentration"], | ||
[ | ||
"match", | ||
["get", "wmo_concentration"], | ||
"Ice Free", | ||
[0, 100, 255, 1], | ||
"Open Water (< 1/10 ice)", | ||
[150, 200, 255, 1], | ||
"Bergy Water", | ||
[150, 200, 255, 1], | ||
"1/10", | ||
[140, 255, 159, 1], | ||
"2/10", | ||
[140, 255, 159, 1], | ||
"3/10", | ||
[140, 255, 159, 1], | ||
"4/10", | ||
[255, 255, 0, 1], | ||
"5/10", | ||
[255, 255, 0, 1], | ||
"6/10", | ||
[255, 255, 0, 1], | ||
"7/10", | ||
[255, 125, 7, 1], | ||
"8/10", | ||
[255, 125, 7, 1], | ||
"9/10", | ||
[255, 0, 0, 1], | ||
"10/10", | ||
[255, 0, 0, 1], | ||
"9/10 to 10/10 ice, 9+/10", | ||
[255, 0, 0, 1], | ||
"Unknown/Undetermined", | ||
[255, 255, 255, 1], | ||
[255, 255, 255, 1] | ||
], | ||
["==", ["var", "type_of_visualisation"], "WMO Stage of Development"], | ||
[ | ||
"match", | ||
["get", "wmo_stage_of_development"], | ||
"Ice Free", | ||
[0, 100, 255, 1], | ||
"Brash Ice", | ||
[0, 0, 0, 0], | ||
"No stage of development", | ||
[0, 0, 0, 0], | ||
"New Ice", | ||
[240, 210, 250, 1], | ||
"Nilas Ice Rind (<10 cm)", | ||
[255, 100, 255, 1], | ||
"Young Ice (10 to 30 cm)", | ||
[0, 0, 0, 0], | ||
"Grey Ice", | ||
[135, 60, 215, 1], | ||
"Grey-White Ice", | ||
[220, 80, 235, 1], | ||
"First Year Ice (>30 cm) or Brash Ice", | ||
[255, 255, 0, 1], | ||
"Thin First Year Ice (30 to 70 cm)", | ||
[155, 210, 0, 1], | ||
"Medium First Year Ice (70 to 120 cm)", | ||
[0, 200, 20, 1], | ||
"Thick First Year Ice (>120 cm)", | ||
[0, 120, 0, 1], | ||
"Old Ice", | ||
[180, 100, 50, 1], | ||
"Second-Year Ice", | ||
[255, 120, 10, 1], | ||
"Multi-Year Ice", | ||
[200, 0, 0, 1], | ||
"Bergy Water", | ||
[255, 255, 255, 1], | ||
"Unknown/Undetermined", | ||
[255, 255, 255, 1], | ||
[0, 0, 0, 0] | ||
], | ||
["==", ["var", "type_of_visualisation"], "polaris"], | ||
[ | ||
"case", | ||
["==", ["get", "polygon_type"], "Ice Free"], | ||
[0, 100, 255], | ||
["==", ["get", ["var", "combined_prop"]], "RIO > 20: Normal Operation"], | ||
[54, 122, 74, 1], | ||
[ | ||
"==", | ||
["get", ["var", "combined_prop"]], | ||
">= 10 RIO < 20: Normal Operation" | ||
], | ||
[62, 150, 85, 1], | ||
[ | ||
"==", | ||
["get", ["var", "combined_prop"]], | ||
">= 0 RIO < 10: Normal Operation" | ||
], | ||
[102, 188, 118, 1], | ||
[ | ||
"==", | ||
["get", ["var", "combined_prop"]], | ||
">= -10 RIO < 0: Operation subject to special consideration" | ||
], | ||
[252, 251, 1, 1], | ||
[ | ||
"==", | ||
["get", ["var", "combined_prop"]], | ||
">= -20 RIO < -10: Operation subject to special consideration" | ||
], | ||
[227, 108, 9, 1], | ||
[ | ||
"==", | ||
["get", ["var", "combined_prop"]], | ||
"RIO < -20: Operation subject to special consideration" | ||
], | ||
[188, 1, 6, 1], | ||
[ | ||
"==", | ||
["get", ["var", "combined_prop"]], | ||
"<= -10 RIO < 0: Elevated operational risk" | ||
], | ||
[252, 251, 1, 1], | ||
[0, 0, 0, 1] | ||
], | ||
[0, 0, 0, 0] | ||
], | ||
"stroke-color": "black", | ||
"stroke-width": 1 | ||
} |
Oops, something went wrong.