package com.cameleer.server.core.diagram;

import com.cameleer.common.graph.RouteGraph;

/**
 * Renders a route graph as SVG or as a positioned JSON layout.
 * <p>
 * Implementations handle layout computation and visual rendering.
 * Stub interface -- full implementation in a later plan.
 */
public interface DiagramRenderer {

    /**
     * Render the route graph as an SVG document string.
     */
    String renderSvg(RouteGraph graph);

    /**
     * Compute a positioned JSON layout for the route graph.
     */
    DiagramLayout layoutJson(RouteGraph graph);

    /**
     * Compute a positioned JSON layout with a specific flow direction.
     *
     * @param graph     the route graph
     * @param direction "LR" for left-to-right, "TB" for top-to-bottom
     */
    default DiagramLayout layoutJson(RouteGraph graph, String direction) {
        return layoutJson(graph);
    }
}
