Files
innovatieplatform/app/Http/Controllers/MapController.php
znetsixe 302c790c13 Recursive zoom dimensions with smooth transitions
MetroCanvas rewrite:
- Dimension stack: every node can contain children forming a sub-metro-map
- Zoom-triggered transitions: scroll-zoom near a node gradually cross-fades
  parent dimension out and child dimension in (threshold 2.5x, range 1.5x)
- Zoom out past 0.5x transitions back to parent dimension
- Right-click context menu: "New node here" on canvas, "Edit/Add child/Delete" on stations
- Depth indicator HUD with back button
- Transition progress bar during cross-fade
- Nodes with children get dashed ring + glow indicator

Backend:
- MapDataService now includes children data inline per project node
- Each project's children contain lifecycle phases, commitments, documents as sub-map
- New API endpoint: GET /api/map/node/{type}/{id}/children for lazy loading
- Consistent data structure: every node has children field (null = leaf)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 16:21:14 +02:00

52 lines
1.5 KiB
PHP

<?php
namespace App\Http\Controllers;
use App\Services\MapDataService;
use Illuminate\Http\Request;
use Inertia\Inertia;
class MapController extends Controller
{
public function __construct(
private MapDataService $mapDataService
) {}
public function index()
{
$mapData = $this->mapDataService->getStrategyMap();
return Inertia::render('Map/MetroMap', [
'mapData' => $mapData,
'users' => \App\Models\User::select('id', 'name')->get(),
'speerpunten' => \App\Models\Speerpunt::select('id', 'naam', 'thema_id')->with('thema:id,naam')->get(),
]);
}
public function project(int $projectId)
{
$mapData = $this->mapDataService->getProjectMap($projectId);
return Inertia::render('Map/MetroMap', [
'mapData' => $mapData,
'users' => \App\Models\User::select('id', 'name')->get(),
'speerpunten' => \App\Models\Speerpunt::select('id', 'naam', 'thema_id')->with('thema:id,naam')->get(),
]);
}
public function apiStrategy(Request $request)
{
return response()->json($this->mapDataService->getStrategyMap());
}
public function apiProject(int $projectId)
{
return response()->json($this->mapDataService->getProjectMap($projectId));
}
public function apiNodeChildren(string $type, int $id)
{
return response()->json($this->mapDataService->getNodeChildren($type, $id));
}
}