Skip to content
Snippets Groups Projects
Commit ec1bed7d authored by Peter Morstein's avatar Peter Morstein
Browse files

adjust legend with dummy data

parent d2ec864e
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</div> </div>
<div <div
class="gradient mx-1" class="gradient mx-1"
:style="{ backgroundImage: createStationColorramp() }" :style="{ backgroundImage: createStationColorramp(mapProperties.getTemperatureColorMap()) }"
></div> ></div>
<div style="float:left;margin-top:5px;"> <div style="float:left;margin-top:5px;">
{{parseInt(this.mapProperties.getTemperatureBound().max)}} °C {{parseInt(this.mapProperties.getTemperatureBound().max)}} °C
...@@ -66,6 +66,18 @@ ...@@ -66,6 +66,18 @@
</div> </div>
</template> </template>
</v-checkbox> </v-checkbox>
<div style="margin-top:1em;">
<div style="float:left;margin-top:5px;">
{{parseInt(this.mapProperties.getTemperatureBound().min)}} °C
</div>
<div
class="gradient mx-1"
:style="{ backgroundImage: createStationColorramp(mapProperties.getMeanColorMap()) }"
></div>
<div style="float:left;margin-top:5px;">
{{parseInt(this.mapProperties.getTemperatureBound().max)}} °C
</div>
</div>
<div ref="legendTemperature1" id="legendTemperature1"></div> <div ref="legendTemperature1" id="legendTemperature1"></div>
<v-range-slider <v-range-slider
v-model="range1" v-model="range1"
...@@ -99,6 +111,18 @@ ...@@ -99,6 +111,18 @@
</div> </div>
</template> </template>
</v-checkbox> </v-checkbox>
<div style="margin-top:1em;">
<div style="float:left;margin-top:5px;">
{{parseInt(this.mapProperties.getTemperatureBound().min)}} °C
</div>
<div
class="gradient mx-1"
:style="{ backgroundImage: createStationColorramp(mapProperties.getMeanColorMap()) }"
></div>
<div style="float:left;margin-top:5px;">
{{parseInt(this.mapProperties.getTemperatureBound().max)}} °C
</div>
</div>
<div ref="legendTemperature2" id="legendTemperature2"></div> <div ref="legendTemperature2" id="legendTemperature2"></div>
<v-range-slider <v-range-slider
v-model="range2" v-model="range2"
...@@ -130,6 +154,20 @@ ...@@ -130,6 +154,20 @@
</div> </div>
</template> </template>
</v-checkbox> </v-checkbox>
<div style="margin-top:1em;height:30px;">
<div style="float:left;margin-top:5px;">
-1 °C
</div>
<div
class="gradient mx-1"
:style="{ backgroundImage: createStationColorramp(mapProperties.getAnomalieColorMap()) }"
></div>
<div style="float:left;margin-top:5px;">
3 °C
</div>
</div>
</v-card-text> </v-card-text>
</v-card> </v-card>
...@@ -212,9 +250,7 @@ export default class Legend extends Vue{ ...@@ -212,9 +250,7 @@ export default class Legend extends Vue{
} }
private createStationColorramp(){ private createStationColorramp(colormap: string[]){
let colormap: string[] = this.mapProperties.getTemperatureColorMap();
let gradientStyle = 'linear-gradient(to right, '; let gradientStyle = 'linear-gradient(to right, ';
gradientStyle += colormap.join(', '); gradientStyle += colormap.join(', ');
gradientStyle += ')'; gradientStyle += ')';
...@@ -223,10 +259,5 @@ export default class Legend extends Vue{ ...@@ -223,10 +259,5 @@ export default class Legend extends Vue{
} }
private getTemperatureIcon(color:string):string{
return 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="%23000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z" stroke="black"/></svg>';
//return this.mapProperties.getTemperatureIcon(color);
}
} }
</script> </script>
...@@ -12,6 +12,14 @@ export default class MapProperties{ ...@@ -12,6 +12,14 @@ export default class MapProperties{
this.projection = projection; this.projection = projection;
} }
public getMeanColorMap(): string[]{
return colormap({colormap:'temperature', nshades: 20, format: 'hex', alpha: 1});
}
public getAnomalieColorMap(): string[]{
return colormap({colormap:'hot', nshades: 20, format: 'hex', alpha: 1}).reverse();
}
public getTemperatureColorMap(): string[]{ public getTemperatureColorMap(): string[]{
return colormap({colormap:'RdBu', nshades: 20, format: 'hex', alpha: 1}); return colormap({colormap:'RdBu', nshades: 20, format: 'hex', alpha: 1});
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment