Skip to content

Commit c4a7818

Browse files
committed
Move legend units into a right-aligned chip in the title row so they no longer overlap the layer title, make image legends scale to fit the panel instead of overflowing, clamp the gradient hover-value tooltip within the bar so it isn't cut off at the panel edge, and update the ref blueprint.
1 parent 6d01e1d commit c4a7818

4 files changed

Lines changed: 264 additions & 118 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
value,color,label,shape
2+
150,#d7191c,150,continuous
3+
100,#fdae61,100,continuous
4+
60,#ffffbf,60,continuous
5+
30,#abd9e9,30,continuous
6+
0,#2c7bb6,0,continuous
Lines changed: 19 additions & 0 deletions
Loading

blueprints/Missions/Reference-Mission/config.reference-mission.json

Lines changed: 185 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -3089,49 +3089,49 @@
30893089
"type": "colorize",
30903090
"units": "m",
30913091
"sigfigs": 1,
3092-
"noDataValues": [
3093-
-999999,
3094-
0
3095-
],
3096-
"ramps": [
3097-
[
3098-
"#313695",
3099-
"#4575b4",
3100-
"#74add1",
3101-
"#abd9e9",
3102-
"#e0f3f8",
3103-
"#ffffbf",
3104-
"#fee090",
3105-
"#fdae61",
3106-
"#f46d43",
3107-
"#d73027",
3108-
"#a50026"
3109-
],
3110-
[
3111-
"#440154",
3112-
"#482878",
3113-
"#3e4989",
3114-
"#31688e",
3115-
"#26828e",
3116-
"#1f9e89",
3117-
"#35b779",
3118-
"#6ece58",
3119-
"#b5de2b",
3120-
"#fde725"
3121-
],
3122-
[
3123-
"#000004",
3124-
"#1b0c41",
3125-
"#4a0c6b",
3126-
"#781c6d",
3127-
"#a52c60",
3128-
"#cf4446",
3129-
"#ed6925",
3130-
"#fb9b06",
3131-
"#f7d13d",
3132-
"#fcffa4"
3133-
]
3134-
]
3092+
"noDataValues": [
3093+
-999999,
3094+
0
3095+
],
3096+
"ramps": [
3097+
[
3098+
"#313695",
3099+
"#4575b4",
3100+
"#74add1",
3101+
"#abd9e9",
3102+
"#e0f3f8",
3103+
"#ffffbf",
3104+
"#fee090",
3105+
"#fdae61",
3106+
"#f46d43",
3107+
"#d73027",
3108+
"#a50026"
3109+
],
3110+
[
3111+
"#440154",
3112+
"#482878",
3113+
"#3e4989",
3114+
"#31688e",
3115+
"#26828e",
3116+
"#1f9e89",
3117+
"#35b779",
3118+
"#6ece58",
3119+
"#b5de2b",
3120+
"#fde725"
3121+
],
3122+
[
3123+
"#000004",
3124+
"#1b0c41",
3125+
"#4a0c6b",
3126+
"#781c6d",
3127+
"#a52c60",
3128+
"#cf4446",
3129+
"#ed6925",
3130+
"#fb9b06",
3131+
"#f7d13d",
3132+
"#fcffa4"
3133+
]
3134+
]
31353135
}
31363136
},
31373137
"time": {
@@ -3146,7 +3146,7 @@
31463146
],
31473147
"description": "RGBA-encoded float32 PNG tiles generated by gdal2customtiles.py --dem. Tests the plain URL source type for Data Layers.",
31483148
"style": {
3149-
"className": "elevation-rgba(url)"
3149+
"className": "elevation-rgbatiles(url)"
31503150
}
31513151
}
31523152
],
@@ -3468,6 +3468,140 @@
34683468
"demparser": "",
34693469
"controlled": false,
34703470
"uuid": "3acb87e4-2097-41c9-a186-4d4ca61bb143"
3471+
},
3472+
{
3473+
"name": "Legend Source Types",
3474+
"type": "header",
3475+
"sublayers": [
3476+
{
3477+
"name": "Legend from CSV",
3478+
"type": "vector",
3479+
"url": "Layers/Vectors/points-styled.geojson",
3480+
"initialOpacity": 1,
3481+
"visibility": false,
3482+
"legend": "Layers/Legends/legend-continuous.csv",
3483+
"variables": {
3484+
"legendOrientation": "horizontal"
3485+
},
3486+
"style": {
3487+
"className": "legendfromcsv"
3488+
},
3489+
"description": "Legend test: horizontal continuous gradient legend loaded from a CSV file (value,color,label,shape).",
3490+
"demparser": "",
3491+
"controlled": false,
3492+
"uuid": "0a41cc1b-c5a8-4829-9fa3-3f02b11bef0a"
3493+
},
3494+
{
3495+
"name": "Legend from JSON",
3496+
"type": "vector",
3497+
"url": "Layers/Vectors/polygons-styled.geojson",
3498+
"initialOpacity": 1,
3499+
"visibility": false,
3500+
"variables": {
3501+
"legendOrientation": "horizontal",
3502+
"legend": [
3503+
{
3504+
"value": "0",
3505+
"color": "#0d0887",
3506+
"shape": "continuous"
3507+
},
3508+
{
3509+
"value": "50",
3510+
"color": "#6a00a8",
3511+
"shape": "continuous"
3512+
},
3513+
{
3514+
"value": "100",
3515+
"color": "#b12a90",
3516+
"shape": "continuous"
3517+
},
3518+
{
3519+
"value": "150",
3520+
"color": "#e16462",
3521+
"shape": "continuous"
3522+
},
3523+
{
3524+
"value": "200",
3525+
"color": "#fca636",
3526+
"shape": "continuous"
3527+
},
3528+
{
3529+
"value": "250",
3530+
"color": "#f0f921",
3531+
"shape": "continuous"
3532+
}
3533+
]
3534+
},
3535+
"style": {
3536+
"className": "legendfromjson"
3537+
},
3538+
"description": "Legend test: horizontal continuous legend defined inline as a JSON array in variables.legend (no file).",
3539+
"demparser": "",
3540+
"controlled": false,
3541+
"uuid": "bce84ca8-bf94-4b2a-bfc5-853c719ebe99"
3542+
},
3543+
{
3544+
"name": "Legend from Image",
3545+
"type": "vector",
3546+
"url": "Layers/Vectors/lines-styled.geojson",
3547+
"initialOpacity": 1,
3548+
"visibility": false,
3549+
"legend": "Layers/Legends/legend-image.svg",
3550+
"style": {
3551+
"className": "legendfromimage"
3552+
},
3553+
"description": "Legend test: legend rendered directly from an image file (SVG).",
3554+
"demparser": "",
3555+
"controlled": false,
3556+
"uuid": "6b63f7af-9ed6-4df0-bc05-5e4de22dd25f"
3557+
},
3558+
{
3559+
"name": "Legend from TiTiler Colorramp",
3560+
"type": "tile",
3561+
"visibility": false,
3562+
"sourceType": "stac-collection",
3563+
"url": "reference_mission_EMIT_L2B_Methane_Enhancement_Data_60_m_V002",
3564+
"tileformat": "tms",
3565+
"controlled": false,
3566+
"initialOpacity": 1,
3567+
"minZoom": 0,
3568+
"maxNativeZoom": 30,
3569+
"maxZoom": 30,
3570+
"demparser": "rgba",
3571+
"throughTileServer": true,
3572+
"cogResampling": "nearest",
3573+
"cogBands": [
3574+
1
3575+
],
3576+
"cogExpressionEditable": false,
3577+
"cogTransform": true,
3578+
"cogMin": 0,
3579+
"cogMax": 5000,
3580+
"cogUnits": "ppm",
3581+
"cogColormap": "viridis",
3582+
"style": {
3583+
"brightness": 1,
3584+
"contrast": 1,
3585+
"saturation": 1,
3586+
"blend": "none"
3587+
},
3588+
"time": {
3589+
"enabled": false,
3590+
"type": "requery",
3591+
"compositeTile": false,
3592+
"refreshIntervalEnabled": false
3593+
},
3594+
"variables": {
3595+
"legendOrientation": "horizontal"
3596+
},
3597+
"description": "Legend test: legend auto-generated from a TiTiler color ramp (cogColormap). Requires WITH_STAC=true and WITH_TITILER_PGSTAC=true.",
3598+
"uuid": "fd7d0bec-834a-4acf-9f9d-b919d3dfbbbd"
3599+
}
3600+
],
3601+
"description": "Test layers exercising each legend source type: CSV file, inline JSON array, image file, and TiTiler color ramp.",
3602+
"demparser": "",
3603+
"controlled": false,
3604+
"uuid": "f8023f00-fbe4-4720-a049-88b362bfae3e"
34713605
}
34723606
],
34733607
"tools": [
@@ -3642,7 +3776,12 @@
36423776
"demtileurl": "Data/dem_rgba_tiles/{z}/{x}/{y}.png",
36433777
"minZoom": 10,
36443778
"maxNativeZoom": 14,
3645-
"boundingBox": [-122.50722222192965, 37.70980728349467, -122.41428489305366, 37.78111111121456]
3779+
"boundingBox": [
3780+
-122.50722222192965,
3781+
37.70980728349467,
3782+
-122.41428489305366,
3783+
37.78111111121456
3784+
]
36463785
}
36473786
],
36483787
"cameraPresets": [
@@ -3740,4 +3879,4 @@
37403879
}
37413880
}
37423881
]
3743-
}
3882+
}

0 commit comments

Comments
 (0)