2024-12-18 15:14:13 +01:00
|
|
|
|
@extends('base')
|
2025-01-12 20:55:46 +01:00
|
|
|
|
@section('body-class', 'property')
|
2025-01-05 13:26:51 +01:00
|
|
|
|
@section('header')
|
2025-01-15 16:57:18 +01:00
|
|
|
|
<nav>
|
2025-01-18 23:46:07 +01:00
|
|
|
|
<strong>Mietobjekt: {{ $base['latlng'] }} ({{ $base['region_name'] }})</strong>
|
2025-01-15 16:57:18 +01:00
|
|
|
|
<ul>
|
|
|
|
|
<li><a href="/">Start</a></li>
|
|
|
|
|
@foreach($regions as $r)
|
2025-01-17 23:46:22 +01:00
|
|
|
|
<li><a href="/region/{{ $r['id'] }}">{{ $r['name'] }}</a></li>
|
2025-01-15 16:57:18 +01:00
|
|
|
|
@endforeach
|
|
|
|
|
</ul>
|
|
|
|
|
</nav>
|
|
|
|
|
<button popovertarget="prop-details"></button>
|
2025-01-05 13:26:51 +01:00
|
|
|
|
<div popover id="prop-details">
|
|
|
|
|
<dl>
|
|
|
|
|
<dt>Region</dt>
|
|
|
|
|
<dd>{{ $base['region_name'] }}</dd>
|
|
|
|
|
<dt>Zum ersten mal gefunden</dt>
|
|
|
|
|
<dd>{{ $base['first_found'] }}</dd>
|
|
|
|
|
<dt>Zum letzten mal gefunden</dt>
|
|
|
|
|
<dd>{{ $base['last_found'] }}</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
</div>
|
|
|
|
|
@endsection
|
|
|
|
|
|
2024-12-18 15:14:13 +01:00
|
|
|
|
@section('main')
|
2025-01-04 18:16:12 +01:00
|
|
|
|
<article style="grid-area: timeline;">
|
|
|
|
|
<div id="timeline"></div>
|
2024-12-18 15:14:13 +01:00
|
|
|
|
</article>
|
2025-01-19 11:27:21 +01:00
|
|
|
|
<article class="header" style="grid-area: chart2;">
|
2024-12-18 15:14:13 +01:00
|
|
|
|
<header>
|
|
|
|
|
<h2 id="belegung-title">
|
2025-01-17 15:13:41 +01:00
|
|
|
|
Kalenderansicht der Verfügbarkeit am <span class="date">{{ $startDate }}</span>
|
2025-01-14 22:11:31 +01:00
|
|
|
|
</h2><button popovertarget="popup-cal"></button>
|
|
|
|
|
<div popover id="popup-cal">
|
|
|
|
|
<p>
|
|
|
|
|
Das Kalenderdiagram zeigt die drei Verfügbarkeitskategorien des Mietobjekts.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
2024-12-18 15:14:13 +01:00
|
|
|
|
</header>
|
|
|
|
|
<div id="chart-calendar"></div>
|
|
|
|
|
</article>
|
2025-01-13 17:06:54 +01:00
|
|
|
|
<article class="header map" style="grid-area: chart5;">
|
|
|
|
|
<header>
|
|
|
|
|
<h2 id="belegung-title">
|
|
|
|
|
Kurzzeitmietobjekte in der Nähe
|
|
|
|
|
</h2>
|
|
|
|
|
</header>
|
|
|
|
|
<div id="chart-map"></div>
|
|
|
|
|
</article>
|
2025-01-04 18:16:12 +01:00
|
|
|
|
<article class="header" style="grid-area: chart3;">
|
|
|
|
|
<header>
|
|
|
|
|
<h2>
|
2025-01-17 15:13:41 +01:00
|
|
|
|
Verfügbarkeit Mietobjekt Monate am <span class="date">{{ $startDate }}</span>
|
2025-01-04 18:16:12 +01:00
|
|
|
|
</h2>
|
|
|
|
|
</header>
|
|
|
|
|
<div id="chart-capacity-monthly">
|
|
|
|
|
</div>
|
|
|
|
|
</article>
|
2025-01-19 11:27:21 +01:00
|
|
|
|
<article class="header" style="grid-area: chart1;">
|
2024-12-19 19:22:09 +01:00
|
|
|
|
<header>
|
|
|
|
|
<h2>
|
|
|
|
|
Entwicklung der Verfügbarkeit
|
|
|
|
|
</h2>
|
2025-01-05 13:26:51 +01:00
|
|
|
|
<button popovertarget="chart-capacity-popover"></button>
|
|
|
|
|
<div id="chart-capacity-popover" popover>
|
|
|
|
|
<h2>Erkläung zum Diagramm</h2>
|
|
|
|
|
<p>Das Liniendiagramm zeigt, wie sich die insgesamte Verfügbarkeit des Kurzzeitmietobjekts entwickelt hat.</p>
|
|
|
|
|
</div>
|
2024-12-19 19:22:09 +01:00
|
|
|
|
</header>
|
|
|
|
|
<div id="chart-capacity"></div>
|
|
|
|
|
</article>
|
2025-01-04 18:16:12 +01:00
|
|
|
|
<article class="header" style="grid-area: chart4;">
|
|
|
|
|
<header>
|
|
|
|
|
<h2>
|
2025-01-17 15:13:41 +01:00
|
|
|
|
Verfügbarkeit Mietobjekt Tage am <span class="date">{{ $startDate }}</span>
|
2025-01-04 18:16:12 +01:00
|
|
|
|
</h2>
|
|
|
|
|
</header>
|
2025-01-09 18:34:20 +01:00
|
|
|
|
<div id="chart-capacity-daily">
|
2025-01-04 18:16:12 +01:00
|
|
|
|
</article>
|
2024-12-18 15:14:13 +01:00
|
|
|
|
<script type="module">
|
2025-01-14 22:11:31 +01:00
|
|
|
|
|
|
|
|
|
const sharedOptions = {
|
2025-01-17 23:46:22 +01:00
|
|
|
|
extractiondates: {!! $diagramsOptions['shared']['extractiondates']!!},
|
|
|
|
|
basic: {
|
|
|
|
|
color: {!!$diagramsOptions['shared']['colors']!!},
|
|
|
|
|
grid: {
|
|
|
|
|
top: 20,
|
|
|
|
|
left: 60,
|
|
|
|
|
right: 0,
|
|
|
|
|
bottom: 50
|
2025-01-14 22:11:31 +01:00
|
|
|
|
},
|
2025-01-17 23:46:22 +01:00
|
|
|
|
tooltip: {
|
|
|
|
|
show: true,
|
|
|
|
|
trigger: 'axis',
|
|
|
|
|
valueFormatter: (value) => value.toFixed(2) + ' %'
|
|
|
|
|
},
|
|
|
|
|
name: (opt) => {
|
|
|
|
|
return {
|
|
|
|
|
name: opt.name,
|
|
|
|
|
nameLocation: opt.location,
|
|
|
|
|
nameGap: 24,
|
|
|
|
|
nameTextStyle: {
|
|
|
|
|
fontWeight: 'bold',
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-01-14 22:11:31 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-04 18:16:12 +01:00
|
|
|
|
const chartTimeline = document.getElementById('timeline');
|
|
|
|
|
const cTimeline = echarts.init(chartTimeline);
|
|
|
|
|
const cTimelineOptions = {
|
|
|
|
|
grid: {
|
|
|
|
|
show: false,
|
|
|
|
|
},
|
|
|
|
|
timeline: {
|
2025-01-17 23:46:22 +01:00
|
|
|
|
data: sharedOptions.extractiondates,
|
2025-01-15 16:57:18 +01:00
|
|
|
|
playInterval: 1000,
|
2025-01-04 18:16:12 +01:00
|
|
|
|
axisType: 'time',
|
|
|
|
|
left: 8,
|
|
|
|
|
right: 8,
|
|
|
|
|
bottom: 0,
|
|
|
|
|
label: {
|
|
|
|
|
show: false
|
|
|
|
|
}
|
2025-01-13 17:06:54 +01:00
|
|
|
|
},
|
2025-01-04 18:16:12 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
cTimeline.setOption(cTimelineOptions);
|
|
|
|
|
|
|
|
|
|
const chartCapacityMonthly = document.getElementById('chart-capacity-monthly');
|
|
|
|
|
const cCapacityMonthly = echarts.init(chartCapacityMonthly);
|
|
|
|
|
|
|
|
|
|
const cCapacityMonthlyOptions = {
|
2025-01-15 16:57:18 +01:00
|
|
|
|
tooltip: sharedOptions.basic.tooltip,
|
2025-01-04 18:16:12 +01:00
|
|
|
|
timeline: {
|
|
|
|
|
show: false,
|
2025-01-17 23:46:22 +01:00
|
|
|
|
data: sharedOptions.extractiondates,
|
2025-01-04 18:16:12 +01:00
|
|
|
|
axisType: 'time',
|
|
|
|
|
},
|
|
|
|
|
grid: {
|
2025-01-15 16:57:18 +01:00
|
|
|
|
top: 5,
|
|
|
|
|
bottom: 40,
|
2025-01-08 22:02:33 +01:00
|
|
|
|
left: 70,
|
2025-01-04 18:16:12 +01:00
|
|
|
|
right: 10
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
type: 'value',
|
2025-01-15 16:57:18 +01:00
|
|
|
|
max: 100,
|
2025-01-17 13:49:43 +01:00
|
|
|
|
name: 'Verfügbarkeit in %',
|
2025-01-15 16:57:18 +01:00
|
|
|
|
nameLocation: 'center',
|
|
|
|
|
nameGap: 25,
|
|
|
|
|
nameTextStyle: {
|
|
|
|
|
fontWeight: 'bold',
|
|
|
|
|
}
|
2025-01-04 18:16:12 +01:00
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
type: 'category',
|
|
|
|
|
},
|
2025-01-08 22:02:33 +01:00
|
|
|
|
options: [
|
2025-01-17 23:46:22 +01:00
|
|
|
|
@foreach ($diagramsOptions['capacityMonthly']['options'] as $cM)
|
2025-01-08 22:02:33 +01:00
|
|
|
|
{
|
2025-01-04 18:16:12 +01:00
|
|
|
|
yAxis: {
|
2025-01-08 22:02:33 +01:00
|
|
|
|
data: {!! json_encode($cM['months']) !!}
|
2025-01-04 18:16:12 +01:00
|
|
|
|
},
|
|
|
|
|
series: [{
|
|
|
|
|
type: 'bar',
|
2025-01-14 22:11:31 +01:00
|
|
|
|
itemStyle: {
|
|
|
|
|
color: sharedOptions.basic.color[3]
|
|
|
|
|
},
|
2025-01-08 22:02:33 +01:00
|
|
|
|
data: {!! json_encode($cM['capacities']) !!}
|
2025-01-04 18:16:12 +01:00
|
|
|
|
}]
|
2025-01-08 22:02:33 +01:00
|
|
|
|
},
|
|
|
|
|
@endforeach
|
|
|
|
|
]
|
2025-01-04 18:16:12 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
cCapacityMonthly.setOption(cCapacityMonthlyOptions);
|
|
|
|
|
|
2025-01-09 18:34:20 +01:00
|
|
|
|
const chartCapacityDaily = document.getElementById('chart-capacity-daily');
|
|
|
|
|
const cCapacityDaily = echarts.init(chartCapacityDaily);
|
|
|
|
|
|
|
|
|
|
const cCapacityDailyOptions = {
|
2025-01-15 16:57:18 +01:00
|
|
|
|
tooltip: sharedOptions.basic.tooltip,
|
2025-01-09 18:34:20 +01:00
|
|
|
|
timeline: {
|
|
|
|
|
show: false,
|
2025-01-17 23:46:22 +01:00
|
|
|
|
data: sharedOptions.extractiondates,
|
2025-01-09 18:34:20 +01:00
|
|
|
|
axisType: 'time',
|
|
|
|
|
},
|
|
|
|
|
grid: {
|
2025-01-15 16:57:18 +01:00
|
|
|
|
top: 5,
|
|
|
|
|
bottom: 40,
|
2025-01-09 18:34:20 +01:00
|
|
|
|
left: 70,
|
|
|
|
|
right: 10
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
type: 'value',
|
2025-01-15 16:57:18 +01:00
|
|
|
|
max: 100,
|
2025-01-17 13:49:43 +01:00
|
|
|
|
name: 'Verfügbarkeit in %',
|
2025-01-15 16:57:18 +01:00
|
|
|
|
nameLocation: 'center',
|
|
|
|
|
nameGap: 25,
|
|
|
|
|
nameTextStyle: {
|
|
|
|
|
fontWeight: 'bold',
|
|
|
|
|
}
|
2025-01-09 18:34:20 +01:00
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
type: 'category',
|
|
|
|
|
},
|
|
|
|
|
options: [
|
2025-01-17 23:46:22 +01:00
|
|
|
|
@foreach ($diagramsOptions['capacityDaily']['options'] as $cD)
|
2025-01-09 18:34:20 +01:00
|
|
|
|
{
|
|
|
|
|
yAxis: {
|
|
|
|
|
data: {!! json_encode($cD['weekdays']) !!}
|
|
|
|
|
},
|
|
|
|
|
series: [{
|
|
|
|
|
type: 'bar',
|
2025-01-14 22:11:31 +01:00
|
|
|
|
itemStyle: {
|
|
|
|
|
color: sharedOptions.basic.color[3]
|
|
|
|
|
},
|
2025-01-09 18:49:09 +01:00
|
|
|
|
data: {!! json_encode($cD['capacities']) !!}
|
2025-01-09 18:34:20 +01:00
|
|
|
|
}]
|
|
|
|
|
},
|
|
|
|
|
@endforeach
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
cCapacityDaily.setOption(cCapacityDailyOptions);
|
|
|
|
|
|
2024-12-19 19:22:09 +01:00
|
|
|
|
const chartCapacity = document.getElementById('chart-capacity');
|
|
|
|
|
const cCapacity = echarts.init(chartCapacity);
|
|
|
|
|
|
|
|
|
|
const cCapacityOptions = {
|
2025-01-14 22:11:31 +01:00
|
|
|
|
color: sharedOptions.basic.color,
|
2025-01-12 16:49:29 +01:00
|
|
|
|
legend: {
|
2025-01-17 13:49:43 +01:00
|
|
|
|
show: true
|
2025-01-12 16:49:29 +01:00
|
|
|
|
},
|
2024-12-19 19:22:09 +01:00
|
|
|
|
tooltip: {
|
2025-01-05 13:26:51 +01:00
|
|
|
|
trigger: 'axis',
|
2025-01-12 16:49:29 +01:00
|
|
|
|
valueFormatter: (value) => value.toFixed(2)+' %'
|
2024-12-19 19:22:09 +01:00
|
|
|
|
},
|
|
|
|
|
grid: {
|
2025-01-13 17:06:54 +01:00
|
|
|
|
top: 40,
|
2025-01-05 13:26:51 +01:00
|
|
|
|
left: 25,
|
2024-12-19 19:22:09 +01:00
|
|
|
|
right: 10,
|
2025-01-05 13:26:51 +01:00
|
|
|
|
bottom: 20,
|
2024-12-19 19:22:09 +01:00
|
|
|
|
containLabel: true
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
type: 'category',
|
|
|
|
|
boundaryGap: false,
|
2025-01-17 23:46:22 +01:00
|
|
|
|
data: {!! $diagramsOptions['capacities']['xAxis']['data'] !!},
|
2025-01-19 12:44:52 +01:00
|
|
|
|
name: 'Zeitpunkt Beobachtung',
|
2025-01-05 13:26:51 +01:00
|
|
|
|
nameLocation: 'center',
|
|
|
|
|
nameGap: 24,
|
|
|
|
|
nameTextStyle: {
|
|
|
|
|
fontWeight: 'bold',
|
|
|
|
|
}
|
2024-12-19 19:22:09 +01:00
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
type: 'value',
|
|
|
|
|
min: 0,
|
2025-01-05 13:26:51 +01:00
|
|
|
|
max: 100,
|
2025-01-17 13:49:43 +01:00
|
|
|
|
name: 'Verfügbarkeit in %',
|
2025-01-05 13:26:51 +01:00
|
|
|
|
nameLocation: 'center',
|
|
|
|
|
nameGap: 38,
|
|
|
|
|
nameTextStyle: {
|
|
|
|
|
fontWeight: 'bold',
|
|
|
|
|
}
|
2024-12-19 19:22:09 +01:00
|
|
|
|
},
|
2025-01-12 16:49:29 +01:00
|
|
|
|
series: [
|
2025-01-09 18:34:20 +01:00
|
|
|
|
{
|
2025-01-17 13:49:43 +01:00
|
|
|
|
name: 'Verfügbarkeit Mietobjekt',
|
2025-01-12 16:49:29 +01:00
|
|
|
|
type: 'line',
|
|
|
|
|
symbolSize: 7,
|
2025-01-17 23:46:22 +01:00
|
|
|
|
data: {!! $diagramsOptions['capacities']["series"][0]["data"] !!}
|
2025-01-12 16:49:29 +01:00
|
|
|
|
},
|
|
|
|
|
{
|
2025-01-17 13:49:43 +01:00
|
|
|
|
name: 'Verfügbarkeit {{ $base['region_name'] }}',
|
2025-01-12 16:49:29 +01:00
|
|
|
|
type: 'line',
|
|
|
|
|
symbolSize: 7,
|
2025-01-17 23:46:22 +01:00
|
|
|
|
data: {!! $diagramsOptions['capacities']["series"][1]["data"] !!}
|
2025-01-12 16:49:29 +01:00
|
|
|
|
},
|
|
|
|
|
{
|
2025-01-17 13:49:43 +01:00
|
|
|
|
name: 'Verfügbarkeit alle Regionen',
|
2025-01-12 16:49:29 +01:00
|
|
|
|
type: 'line',
|
|
|
|
|
symbolSize: 7,
|
2025-01-17 23:46:22 +01:00
|
|
|
|
data: {!! $diagramsOptions['capacities']["series"][2]["data"] !!}
|
2025-01-12 16:49:29 +01:00
|
|
|
|
}
|
|
|
|
|
]
|
2024-12-19 19:22:09 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
cCapacity.setOption(cCapacityOptions);
|
|
|
|
|
|
2024-12-18 15:14:13 +01:00
|
|
|
|
const chartCalendar = document.getElementById('chart-calendar');
|
|
|
|
|
const cCalendar = echarts.init(chartCalendar);
|
|
|
|
|
const h2Belegung = document.getElementById('belegung-title');
|
|
|
|
|
|
|
|
|
|
const cCalendarOptions = {
|
|
|
|
|
timeline: {
|
2025-01-04 18:16:12 +01:00
|
|
|
|
show: false,
|
2025-01-17 23:46:22 +01:00
|
|
|
|
data: sharedOptions.extractiondates,
|
2024-12-18 19:52:06 +01:00
|
|
|
|
axisType: 'time',
|
2024-12-18 15:14:13 +01:00
|
|
|
|
},
|
|
|
|
|
visualMap: {
|
|
|
|
|
categories: [0,1,2],
|
|
|
|
|
inRange: {
|
2025-01-15 16:57:18 +01:00
|
|
|
|
color: ['#ca0020', '#92c5de', '#0571b0']
|
2024-12-18 15:14:13 +01:00
|
|
|
|
},
|
|
|
|
|
formatter: (cat) => {
|
|
|
|
|
switch (cat) {
|
|
|
|
|
case 0:
|
|
|
|
|
return 'Ausgebucht';
|
|
|
|
|
case 1:
|
|
|
|
|
return 'Verfügbar (kein Anreisetag)';
|
|
|
|
|
case 2:
|
|
|
|
|
return 'Verfügbar';
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
type: 'piecewise',
|
|
|
|
|
orient: 'horizontal',
|
|
|
|
|
left: 'center',
|
|
|
|
|
top: 0
|
|
|
|
|
},
|
|
|
|
|
calendar:[
|
|
|
|
|
{
|
|
|
|
|
orient: 'horizontal',
|
|
|
|
|
range: '2024',
|
2025-01-04 18:16:12 +01:00
|
|
|
|
top: '15%',
|
2024-12-19 19:22:09 +01:00
|
|
|
|
right: 10,
|
2025-01-04 18:16:12 +01:00
|
|
|
|
bottom: '65%',
|
2024-12-18 15:14:13 +01:00
|
|
|
|
left: 50,
|
2025-01-17 13:49:43 +01:00
|
|
|
|
dayLabel: {
|
|
|
|
|
fontSize: 10
|
|
|
|
|
}
|
2024-12-18 15:14:13 +01:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
orient: 'horizontal',
|
|
|
|
|
range: '2025',
|
2025-01-04 18:16:12 +01:00
|
|
|
|
top: '47%',
|
2024-12-19 19:22:09 +01:00
|
|
|
|
right: 10,
|
2025-01-04 18:16:12 +01:00
|
|
|
|
bottom: '33%',
|
2024-12-18 15:14:13 +01:00
|
|
|
|
left: 50,
|
2025-01-17 13:49:43 +01:00
|
|
|
|
dayLabel: {
|
|
|
|
|
fontSize: 10
|
|
|
|
|
}
|
2024-12-18 15:14:13 +01:00
|
|
|
|
},
|
2024-12-19 19:22:09 +01:00
|
|
|
|
{
|
|
|
|
|
orient: 'horizontal',
|
|
|
|
|
range: '2026',
|
2025-01-04 18:16:12 +01:00
|
|
|
|
top: '79%',
|
2024-12-19 19:22:09 +01:00
|
|
|
|
right: 10,
|
2025-01-04 18:16:12 +01:00
|
|
|
|
bottom: '1%',
|
2024-12-19 19:22:09 +01:00
|
|
|
|
left: 50,
|
2025-01-17 13:49:43 +01:00
|
|
|
|
dayLabel: {
|
|
|
|
|
fontSize: 10
|
|
|
|
|
}
|
2024-12-19 19:22:09 +01:00
|
|
|
|
}
|
2024-12-18 15:14:13 +01:00
|
|
|
|
],
|
|
|
|
|
options: [
|
2025-01-17 23:46:22 +01:00
|
|
|
|
@foreach ($diagramsOptions['calendar']['series'] as $c)
|
2024-12-18 15:14:13 +01:00
|
|
|
|
{
|
|
|
|
|
series: [{
|
|
|
|
|
type: 'heatmap',
|
|
|
|
|
coordinateSystem: 'calendar',
|
|
|
|
|
calendarIndex: 0,
|
|
|
|
|
data: {!! json_encode($c) !!}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'heatmap',
|
|
|
|
|
coordinateSystem: 'calendar',
|
|
|
|
|
calendarIndex: 1,
|
|
|
|
|
data: {!! json_encode($c) !!}
|
2024-12-19 19:22:09 +01:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'heatmap',
|
|
|
|
|
coordinateSystem: 'calendar',
|
|
|
|
|
calendarIndex: 2,
|
|
|
|
|
data: {!! json_encode($c) !!}
|
2024-12-18 15:14:13 +01:00
|
|
|
|
}]
|
|
|
|
|
},
|
|
|
|
|
@endforeach
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
cCalendar.setOption(cCalendarOptions);
|
2025-01-04 18:16:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cTimeline.on('timelinechanged', (e) => {
|
|
|
|
|
|
2025-01-14 22:11:31 +01:00
|
|
|
|
let dateTitles = document.querySelectorAll('span.date');
|
|
|
|
|
dateTitles.forEach(el => {
|
|
|
|
|
el.innerText = cTimelineOptions.timeline.data[e.currentIndex];
|
|
|
|
|
});
|
2024-12-19 19:22:09 +01:00
|
|
|
|
|
2024-12-20 12:20:49 +01:00
|
|
|
|
// Set markpoint on linechart
|
|
|
|
|
let x = cCapacityOptions.xAxis.data[e.currentIndex];
|
2025-01-09 18:49:09 +01:00
|
|
|
|
let y = cCapacityOptions.series[0].data[e.currentIndex];
|
2025-01-04 18:16:12 +01:00
|
|
|
|
|
|
|
|
|
cCapacityMonthly.dispatchAction({
|
|
|
|
|
type: 'timelineChange',
|
|
|
|
|
currentIndex: e.currentIndex
|
|
|
|
|
});
|
|
|
|
|
|
2025-01-09 18:49:09 +01:00
|
|
|
|
cCapacityDaily.dispatchAction({
|
|
|
|
|
type: 'timelineChange',
|
|
|
|
|
currentIndex: e.currentIndex
|
|
|
|
|
});
|
|
|
|
|
|
2025-01-04 18:16:12 +01:00
|
|
|
|
cCalendar.dispatchAction({
|
|
|
|
|
type: 'timelineChange',
|
|
|
|
|
currentIndex: e.currentIndex
|
|
|
|
|
});
|
|
|
|
|
|
2024-12-20 12:20:49 +01:00
|
|
|
|
cCapacity.setOption({
|
|
|
|
|
series: {
|
|
|
|
|
markPoint: {
|
|
|
|
|
data: [{
|
|
|
|
|
coord: [x, y]
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
2025-01-04 18:16:12 +01:00
|
|
|
|
|
2024-12-18 15:14:13 +01:00
|
|
|
|
})
|
|
|
|
|
|
2025-01-13 17:06:54 +01:00
|
|
|
|
/* Map w/ neighbours*/
|
|
|
|
|
const map = L.map('chart-map');
|
|
|
|
|
|
|
|
|
|
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
|
|
|
|
maxZoom: 19,
|
|
|
|
|
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
|
|
|
|
|
}).addTo(map);
|
|
|
|
|
|
|
|
|
|
function icon(id = 0){
|
|
|
|
|
return L.divIcon({
|
|
|
|
|
className: "region"+id,
|
|
|
|
|
html: '<span></span>'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const markers = L.featureGroup([
|
2025-01-17 23:46:22 +01:00
|
|
|
|
L.marker([{{ $base['latlng'] }}], {icon: icon(1)}),
|
2025-01-13 17:06:54 +01:00
|
|
|
|
@foreach($neighbours as $n)
|
|
|
|
|
L.marker([{{ $n['lat'] }}, {{ $n['lon'] }}], {icon: icon()}).bindPopup('<a href="/property/{{ $n['id'] }}">{{ $n['lat'] }}, {{ $n['lon'] }}</a>'),
|
|
|
|
|
@endforeach
|
|
|
|
|
]).addTo(map);
|
|
|
|
|
|
|
|
|
|
map.fitBounds(markers.getBounds(), {padding: [20,20]})
|
|
|
|
|
|
2024-12-19 19:22:09 +01:00
|
|
|
|
cCapacity.on('click', 'series', (e) => {
|
|
|
|
|
|
2024-12-20 12:20:49 +01:00
|
|
|
|
// Switch to correct calendar in the timeline
|
2025-01-04 18:16:12 +01:00
|
|
|
|
cTimeline.dispatchAction({
|
2024-12-19 19:22:09 +01:00
|
|
|
|
type: 'timelineChange',
|
|
|
|
|
currentIndex: e.dataIndex
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
2024-12-18 15:14:13 +01:00
|
|
|
|
</script>
|
|
|
|
|
@endsection
|