URL for price sources

This commit is contained in:
Gunnar Skjold
2023-12-04 13:18:12 +01:00
parent 0606c47367
commit fd996f44ba
3 changed files with 19 additions and 12 deletions

File diff suppressed because one or more lines are too long

View File

@@ -261,4 +261,11 @@ export function getPriceSourceName(code) {
if(code == "EDS") return "Energy Data Service";
if(code == "MIX") return "Mixed sources";
return "Unknown (" + code + ")";
}
}
export function getPriceSourceUrl(code) {
if(code == "EOE") return "https://transparency.entsoe.eu/-E";
if(code == "HKS") return "https://www.hvakosterstrommen.no/";
if(code == "EDS") return "https://www.energidataservice.dk/";
return "#";
}

View File

@@ -1,5 +1,5 @@
<script>
import { zeropad, addHours, getPriceSourceName } from './Helpers.js';
import { zeropad, addHours, getPriceSourceName, getPriceSourceUrl } from './Helpers.js';
import BarChart from './BarChart.svelte';
export let json;
@@ -127,5 +127,5 @@
</script>
<a href="https://transparency.entsoe.eu/" target="_blank" class="text-xs float-right z-40">Provided by: {getPriceSourceName(json.source)}</a>
<a href="{getPriceSourceUrl(json.source)}" target="_blank" class="text-xs float-right z-40">Provided by: {getPriceSourceName(json.source)}</a>
<BarChart config={config} />