Skip to content

Commit b0b03e9

Browse files
#724 Legends Max on top (#725)
1 parent 2833269 commit b0b03e9

File tree

2 files changed

+41
-40
lines changed

2 files changed

+41
-40
lines changed

src/essence/Tools/Layers/LayersTool.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@
368368
#layersTool .tileCogColormap #titlerCogColormapCSS {
369369
width: 254px;
370370
height: 28px;
371-
transform: rotateZ(90deg) translateX(125px) translateY(-177px);
371+
transform: rotateZ(-90deg) translateX(-125px) translateY(177px);
372372
border-left: 14px solid #222;
373373
border-right: 14px solid #222;
374374
}

src/essence/Tools/Layers/LayersTool.js

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ var LayersTool = {
259259
units = layer.cogUnits
260260
}
261261

262-
const dynamicLegendConf = []
262+
let dynamicLegendConf = []
263263
const imgElement = document.getElementById(
264264
`titlerCogColormapImage_${L_.asLayerUUID(layerName)}`
265265
)
@@ -349,10 +349,11 @@ var LayersTool = {
349349
value: label,
350350
})
351351
}
352-
document.body.removeChild(canvasElement)
353-
352+
dynamicLegendConf = dynamicLegendConf.reverse()
354353
L_.layers.data[layer.name]._legend = dynamicLegendConf
355354

355+
document.body.removeChild(canvasElement)
356+
356357
$('#tileCogColormapMapLines').empty()
357358
for (let i = 0; i < 9; i++) {
358359
$('#tileCogColormapMapLines').append(
@@ -670,27 +671,27 @@ function interfaceWithMMGIS(fromInit) {
670671
'<i class="mdi mdi-restore mdi-18px"></i>',
671672
'</div>',
672673
'</div>',
673-
`<li class="tileCogMin">`,
674+
`<li class="tileCogMax">`,
674675
'<div>',
675-
'<div>Rescale Min Value</div>',
676+
'<div>Rescale Max Value</div>',
676677
'<div>',
677-
`<input class='tilerescalecogmin' style="width: 120px; border: none; height: 28px; margin: 1px 0px;" layername="${node[i].name}" parameter="min" type="number" value="${node[i].currentCogMin != null ? node[i].currentCogMin : node[i].cogMin}" default="0">`,
678+
`<input class='tilerescalecogmax' style="width: 120px; border: none; height: 28px; margin: 1px 0px;" layername="${node[i].name}" parameter="max" type="number" value="${node[i].currentCogMin != null ? node[i].currentCogMax : node[i].cogMax}" default="255">`,
678679
node[i].cogUnits != null ? `<div class='tileCogUnits'>${node[i].cogUnits}</div>`: '',
679680
'</div>',
680681
'</div>',
681682
'</li>',
682-
'<li id="tileCogLegend_1" class="tileCogLegend">-</li>',
683-
'<li id="tileCogLegend_2" class="tileCogLegend">-</li>',
684-
'<li id="tileCogLegend_3" class="tileCogLegend">-</li>',
685-
'<li id="tileCogLegend_4" class="tileCogLegend">-</li>',
686-
'<li id="tileCogLegend_5" class="tileCogLegend">-</li>',
687-
'<li id="tileCogLegend_6" class="tileCogLegend">-</li>',
688683
'<li id="tileCogLegend_7" class="tileCogLegend">-</li>',
689-
`<li class="tileCogMax">`,
684+
'<li id="tileCogLegend_6" class="tileCogLegend">-</li>',
685+
'<li id="tileCogLegend_5" class="tileCogLegend">-</li>',
686+
'<li id="tileCogLegend_4" class="tileCogLegend">-</li>',
687+
'<li id="tileCogLegend_3" class="tileCogLegend">-</li>',
688+
'<li id="tileCogLegend_2" class="tileCogLegend">-</li>',
689+
'<li id="tileCogLegend_1" class="tileCogLegend">-</li>',
690+
`<li class="tileCogMin">`,
690691
'<div>',
691-
'<div>Rescale Max Value</div>',
692+
'<div>Rescale Min Value</div>',
692693
'<div>',
693-
`<input class='tilerescalecogmax' style="width: 120px; border: none; height: 28px; margin: 1px 0px;" layername="${node[i].name}" parameter="max" type="number" value="${node[i].currentCogMin != null ? node[i].currentCogMax : node[i].cogMax}" default="255">`,
694+
`<input class='tilerescalecogmin' style="width: 120px; border: none; height: 28px; margin: 1px 0px;" layername="${node[i].name}" parameter="min" type="number" value="${node[i].currentCogMin != null ? node[i].currentCogMin : node[i].cogMin}" default="0">`,
694695
node[i].cogUnits != null ? `<div class='tileCogUnits'>${node[i].cogUnits}</div>`: '',
695696
'</div>',
696697
'</div>',
@@ -873,27 +874,27 @@ function interfaceWithMMGIS(fromInit) {
873874
'<i class="mdi mdi-restore mdi-18px"></i>',
874875
'</div>',
875876
'</div>',
876-
`<li class="tileCogMin">`,
877+
`<li class="tileCogMax">`,
877878
'<div>',
878-
'<div>Rescale Min Value</div>',
879+
'<div>Rescale Max Value</div>',
879880
'<div>',
880-
`<input class='tilerescalecogmin' style="width: 120px; border: none; height: 28px; margin: 1px 0px;" layername="${node[i].name}" parameter="min" type="number" value="${node[i].currentCogMin != null ? node[i].currentCogMin : node[i].variables?.streamlines?.minVelocity}" default="0">`,
881+
`<input class='tilerescalecogmax' style="width: 120px; border: none; height: 28px; margin: 1px 0px;" layername="${node[i].name}" parameter="max" type="number" value="${node[i].currentCogMin != null ? node[i].currentCogMax : node[i].variables?.streamlines?.maxVelocity}" default="255">`,
881882
node[i].variables?.streamlines?.units != null ? `<div class='tileCogUnits'>${node[i].variables?.streamlines?.units}</div>`: '',
882883
'</div>',
883884
'</div>',
884885
'</li>',
885-
'<li id="tileCogLegend_1" class="tileCogLegend">-</li>',
886-
'<li id="tileCogLegend_2" class="tileCogLegend">-</li>',
887-
'<li id="tileCogLegend_3" class="tileCogLegend">-</li>',
888-
'<li id="tileCogLegend_4" class="tileCogLegend">-</li>',
889-
'<li id="tileCogLegend_5" class="tileCogLegend">-</li>',
890-
'<li id="tileCogLegend_6" class="tileCogLegend">-</li>',
891886
'<li id="tileCogLegend_7" class="tileCogLegend">-</li>',
892-
`<li class="tileCogMax">`,
887+
'<li id="tileCogLegend_6" class="tileCogLegend">-</li>',
888+
'<li id="tileCogLegend_5" class="tileCogLegend">-</li>',
889+
'<li id="tileCogLegend_4" class="tileCogLegend">-</li>',
890+
'<li id="tileCogLegend_3" class="tileCogLegend">-</li>',
891+
'<li id="tileCogLegend_2" class="tileCogLegend">-</li>',
892+
'<li id="tileCogLegend_1" class="tileCogLegend">-</li>',
893+
`<li class="tileCogMin">`,
893894
'<div>',
894-
'<div>Rescale Max Value</div>',
895+
'<div>Rescale Min Value</div>',
895896
'<div>',
896-
`<input class='tilerescalecogmax' style="width: 120px; border: none; height: 28px; margin: 1px 0px;" layername="${node[i].name}" parameter="max" type="number" value="${node[i].currentCogMin != null ? node[i].currentCogMax : node[i].variables?.streamlines?.maxVelocity}" default="255">`,
897+
`<input class='tilerescalecogmin' style="width: 120px; border: none; height: 28px; margin: 1px 0px;" layername="${node[i].name}" parameter="min" type="number" value="${node[i].currentCogMin != null ? node[i].currentCogMin : node[i].variables?.streamlines?.minVelocity}" default="0">`,
897898
node[i].variables?.streamlines?.units != null ? `<div class='tileCogUnits'>${node[i].variables?.streamlines?.units}</div>`: '',
898899
'</div>',
899900
'</div>',
@@ -978,27 +979,27 @@ function interfaceWithMMGIS(fromInit) {
978979
'<i class="mdi mdi-restore mdi-18px"></i>',
979980
'</div>',
980981
'</div>',
981-
`<li class="tileCogMin">`,
982+
`<li class="tileCogMax">`,
982983
'<div>',
983-
'<div>Rescale Min Value</div>',
984+
'<div>Rescale Max Value</div>',
984985
'<div>',
985-
`<input class='tilerescalecogmin' style="width: 120px; border: none; height: 28px; margin: 1px 0px;" layername="${node[i].name}" parameter="min" type="number" value="${node[i].currentCogMin != null ? node[i].currentCogMin : node[i].cogMin}" default="0">`,
986+
`<input class='tilerescalecogmax' style="width: 120px; border: none; height: 28px; margin: 1px 0px;" layername="${node[i].name}" parameter="max" type="number" value="${node[i].currentCogMin != null ? node[i].currentCogMax : node[i].cogMax}" default="255">`,
986987
node[i].cogUnits != null ? `<div class='tileCogUnits'>${node[i].cogUnits}</div>`: '',
987988
'</div>',
988989
'</div>',
989990
'</li>',
990-
'<li id="tileCogLegend_1" class="tileCogLegend">-</li>',
991-
'<li id="tileCogLegend_2" class="tileCogLegend">-</li>',
992-
'<li id="tileCogLegend_3" class="tileCogLegend">-</li>',
993-
'<li id="tileCogLegend_4" class="tileCogLegend">-</li>',
994-
'<li id="tileCogLegend_5" class="tileCogLegend">-</li>',
995-
'<li id="tileCogLegend_6" class="tileCogLegend">-</li>',
996991
'<li id="tileCogLegend_7" class="tileCogLegend">-</li>',
997-
`<li class="tileCogMax">`,
992+
'<li id="tileCogLegend_6" class="tileCogLegend">-</li>',
993+
'<li id="tileCogLegend_5" class="tileCogLegend">-</li>',
994+
'<li id="tileCogLegend_4" class="tileCogLegend">-</li>',
995+
'<li id="tileCogLegend_3" class="tileCogLegend">-</li>',
996+
'<li id="tileCogLegend_2" class="tileCogLegend">-</li>',
997+
'<li id="tileCogLegend_1" class="tileCogLegend">-</li>',
998+
`<li class="tileCogMin">`,
998999
'<div>',
999-
'<div>Rescale Max Value</div>',
1000+
'<div>Rescale Min Value</div>',
10001001
'<div>',
1001-
`<input class='tilerescalecogmax' style="width: 120px; border: none; height: 28px; margin: 1px 0px;" layername="${node[i].name}" parameter="max" type="number" value="${node[i].currentCogMin != null ? node[i].currentCogMax : node[i].cogMax}" default="255">`,
1002+
`<input class='tilerescalecogmin' style="width: 120px; border: none; height: 28px; margin: 1px 0px;" layername="${node[i].name}" parameter="min" type="number" value="${node[i].currentCogMin != null ? node[i].currentCogMin : node[i].cogMin}" default="0">`,
10021003
node[i].cogUnits != null ? `<div class='tileCogUnits'>${node[i].cogUnits}</div>`: '',
10031004
'</div>',
10041005
'</div>',

0 commit comments

Comments
 (0)