refactoring; more consistent naming for API endpoint and variables.
This commit is contained in:
1 parent
e0c8b3eb1b
commit
e4e05b4788
16 files changed
+325
-238
No files matched your search
@@ -5,7 +5,7 @@
|
||||
<strong>Start</strong>
|
||||
<ul>
|
||||
@foreach($regions as $r)
|
||||
<li><a href="/region/{{ $r['region_id'] }}">{{ $r['region_name'] }}</a></li>
|
||||
<li><a href="/region/{{ $r['id'] }}">{{ $r['name'] }}</a></li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</nav>
|
||||
@@ -82,7 +82,7 @@
|
||||
<script type="module">
|
||||
const sharedOptions = {
|
||||
basic: {
|
||||
color: {!! $chartOptions['colors'] !!},
|
||||
color: {!! $diagramsOptions['shared']['colors'] !!},
|
||||
grid: {
|
||||
top: 30,
|
||||
left: 70,
|
||||
@@ -101,7 +101,7 @@ const sharedOptions = {
|
||||
}
|
||||
}
|
||||
}
|
||||
const extractionDates = {!! json_encode($regionPropertiesCapacities['scrapeDates']) !!};
|
||||
const extractionDates = {!! $diagramsOptions['shared']['extractionDates'] !!};
|
||||
|
||||
const chartHeatmap = document.getElementById('chart-heatmap');
|
||||
const cHeatmap = echarts.init(chartHeatmap);
|
||||
@@ -156,7 +156,7 @@ const cHeatmapOptions = {
|
||||
yAxis: {
|
||||
show: true,
|
||||
type: 'category',
|
||||
data: {!! json_encode($regionPropertiesCapacities['property_ids']) !!},
|
||||
data: {!! $diagramsOptions['heatmap']['yAxis']['data'] !!},
|
||||
splitArea: {
|
||||
show: false
|
||||
},
|
||||
@@ -196,7 +196,7 @@ const cHeatmapOptions = {
|
||||
name: 'Verfügbarkeit',
|
||||
type: 'heatmap',
|
||||
blurSize: 0,
|
||||
data: {!! json_encode($regionPropertiesCapacities['values']) !!},
|
||||
data: {!! $diagramsOptions['heatmap']['series']['data'] !!},
|
||||
label: {
|
||||
show: false
|
||||
},
|
||||
@@ -230,7 +230,7 @@ const cPropsPerRegionOptions = {
|
||||
fontWeight: 'bold',
|
||||
},
|
||||
type: 'category',
|
||||
data: {!! $propsPerRegion[1] !!}
|
||||
data: {!! $diagramsOptions['propertiesPerRegion']['xAxis']['data'] !!}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
@@ -243,7 +243,7 @@ const cPropsPerRegionOptions = {
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: {!! $propsPerRegion[2] !!},
|
||||
data: {!! $diagramsOptions['propertiesPerRegion']['yAxis']['data'] !!},
|
||||
type: 'bar',
|
||||
itemStyle: {
|
||||
color: (e) => {
|
||||
@@ -259,17 +259,13 @@ cPropsPerRegion.setOption(cPropsPerRegionOptions);
|
||||
const chartExtractions = document.getElementById('extractions');
|
||||
const cExtractions = echarts.init(chartExtractions);
|
||||
|
||||
const filters = {
|
||||
regions: ["Alle", "Davos", "Engadin", "Heidiland", "St. Moritz"]
|
||||
}
|
||||
|
||||
const cExtractionsOptions = {
|
||||
color: sharedOptions.basic.color,
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
legend: {
|
||||
data: filters.regions
|
||||
show: true
|
||||
},
|
||||
grid: sharedOptions.basic.grid,
|
||||
xAxis: {
|
||||
@@ -297,31 +293,31 @@ const cExtractionsOptions = {
|
||||
name: 'Alle',
|
||||
type: 'line',
|
||||
stack: 'Total',
|
||||
data: {!! json_encode($growth['total_all']) !!},
|
||||
data: {!! json_encode($diagramsOptions['extractions']['series']['total_all']) !!},
|
||||
},
|
||||
{
|
||||
connectNulls: true,
|
||||
name: 'Davos',
|
||||
type: 'line',
|
||||
data: {!! json_encode($growth['total_davos']) !!}
|
||||
data: {!! json_encode($diagramsOptions['extractions']['series']['total_davos']) !!}
|
||||
},
|
||||
{
|
||||
connectNulls: true,
|
||||
name: 'Engadin',
|
||||
type: 'line',
|
||||
data: {!! json_encode($growth['total_engadin']) !!}
|
||||
data: {!! json_encode($diagramsOptions['extractions']['series']['total_engadin']) !!}
|
||||
},
|
||||
{
|
||||
connectNulls: true,
|
||||
name: 'Heidiland',
|
||||
type: 'line',
|
||||
data: {!! json_encode($growth['total_heidiland']) !!}
|
||||
data: {!! json_encode($diagramsOptions['extractions']['series']['total_heidiland']) !!}
|
||||
},
|
||||
{
|
||||
connectNulls: true,
|
||||
name: 'St. Moritz',
|
||||
type: 'line',
|
||||
data: {!! json_encode($growth['total_stmoritz']) !!}
|
||||
data: {!! json_encode($diagramsOptions['extractions']['series']['total_stmoritz']) !!}
|
||||
},
|
||||
]
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user