// Base class for analytical layer overlays
class BaseLayer {
    constructor(viz) {
        this.viz = viz;
        this.active = false;
        this.edgeClickEnabled = false;
    }

    async activate() { this.active = true; }
    deactivate() { this.active = false; }

    // Return color string or null to fall through to default
    getNodeColor(d) { return null; }
    getEdgeColor(edge) { return null; }

    // Return true to suppress default info panel
    onAirportClick(d) { return false; }
    onEdgeClick(edge) { return false; }
    onEdgeHover(edge) {}

    // Return true to suppress default clear on background click
    onBackgroundClick() { return false; }

    // Filter which edges are hoverable/clickable — return false to skip
    isEdgeInteractive(edge) { return true; }

    // Draw on canvas after normal edges (chain paths, etc)
    renderOverlay(ctx, transform) {}

    getLegendHTML() { return ''; }

    // Called after legend HTML is injected — bind interactive controls
    setupLegendInteraction() {}

    // Called when selection is cleared — override to clean up visual artifacts
    stopAnimation() {}

    destroy() { this.deactivate(); }
}
