Wiederinstandsetzung Heatmap @stoffelmauro musste dazu etwas in der API anpassen.
This commit is contained in:
1 parent
67382003ca
commit
2013d2b440
4 files changed
+28
-28
No files matched your search
@@ -22,7 +22,7 @@ class Api
|
||||
return Cache::get($request);
|
||||
}
|
||||
|
||||
$get = Http::get($request);
|
||||
$get = Http::timeout(600)->get($request);
|
||||
|
||||
if($get->successful()){
|
||||
$result = $get->json();
|
||||
@@ -63,9 +63,9 @@ class Api
|
||||
return self::get("/property/{$id}/base");
|
||||
}
|
||||
|
||||
public static function regionCapacities(int $id): mixed
|
||||
public static function regionPropertyCapacities(int $id): mixed
|
||||
{
|
||||
return self::get("/region/{$id}/capacities");
|
||||
return self::get("/region/{$id}/properties/capacities");
|
||||
}
|
||||
|
||||
public static function propertyCapacitiesMonthly(int $id, string $date): mixed
|
||||
@@ -83,6 +83,10 @@ class Api
|
||||
return self::get("/property/{$id}/neighbours");
|
||||
}
|
||||
|
||||
public static function regionCapacities(int $id): mixed
|
||||
{
|
||||
return self::get("/region/{$id}/capacities");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ const sharedOptions = {
|
||||
}
|
||||
}
|
||||
}
|
||||
const extractionDates = {!! json_encode($growth['dates']) !!};
|
||||
const extractionDates = {!! json_encode($regionPropertiesCapacities['scrapeDates']) !!};
|
||||
|
||||
const chartHeatmap = document.getElementById('chart-heatmap');
|
||||
const cHeatmap = echarts.init(chartHeatmap);
|
||||
@@ -80,7 +80,7 @@ const cHeatmapOptions = {
|
||||
show: false,
|
||||
name: 'Kurzzeitmietobjekt',
|
||||
type: 'category',
|
||||
data: {!! json_encode($heat['property_ids']) !!},
|
||||
data: extractionDates,
|
||||
splitArea: {
|
||||
show: false
|
||||
},
|
||||
@@ -91,7 +91,7 @@ const cHeatmapOptions = {
|
||||
yAxis: {
|
||||
show: false,
|
||||
type: 'category',
|
||||
data: extractionDates,
|
||||
data: {!! json_encode($regionPropertiesCapacities['property_ids']) !!},
|
||||
splitArea: {
|
||||
show: true
|
||||
}
|
||||
@@ -116,7 +116,7 @@ const cHeatmapOptions = {
|
||||
name: 'Auslastung',
|
||||
type: 'heatmap',
|
||||
blurSize: 0,
|
||||
data: {!! json_encode($heat['values']) !!},
|
||||
data: {!! json_encode($regionPropertiesCapacities['values']) !!},
|
||||
label: {
|
||||
show: false
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@ use App\Api;
|
||||
|
||||
Route::get('/', function () {
|
||||
|
||||
$regionHeat = Api::regionCapacities(1);
|
||||
$regionPropertyCapacities = Api::regionPropertyCapacities(-1);
|
||||
$propertiesGrowth = Api::propertiesGrowth();
|
||||
$propsPerRegion = Api::propertiesPerRegion();
|
||||
$propsPerRegionName = [];
|
||||
@@ -18,7 +18,7 @@ Route::get('/', function () {
|
||||
|
||||
$propertiesGeo = Api::propertiesGeo();
|
||||
|
||||
return view('overview', ["heat" => $regionHeat, "geo" => $propertiesGeo, "growth" => $propertiesGrowth, "propsPerRegion" => [json_encode($propsPerRegionName), json_encode($propsPerRegionCounts)]]);
|
||||
return view('overview', ["regionPropertiesCapacities" => $regionPropertyCapacities, "geo" => $propertiesGeo, "growth" => $propertiesGrowth, "propsPerRegion" => [json_encode($propsPerRegionName), json_encode($propsPerRegionCounts)]]);
|
||||
});
|
||||
|
||||
Route::get('/prop/{id}', function (int $id) {
|
||||
|
||||
Reference in new issue
Block a user