Module Dot.Ts

val escape_label : string -> string

Full DOT/HTML escape of a label: & < > and double quotes become their entities. Labels may carry user input; unescaped they break the dot parser or the HTML label.

val rank_source : string -> string

rank_source row is the rank=source block seating the given nodes; the TS form keeps the semicolon after the closing brace.

val state_node : int -> label:string -> reward:string -> url:string -> cls:string -> bold:bool -> string

state_node i ~label ~reward ~url ~cls ~bold is the state statement: the HTML label plus the optional reward fragment, the per-state SVG URL, the CSS class, and the bold style marker for the initial state (bold).

val edge : int -> int -> label:string -> id:int -> cls:string -> string

edge src dst ~label ~id ~cls is a transition statement with the vee arrowhead: the DTMC edges of the TS renderers and the action -> state transitions of the MDP renderers.

val action_stub : node:int -> state:int -> label:string -> reward:string -> cls:string -> edge_id:int -> string

MDP action stub: the grey action box (id s<state>_<cls>, class action action-<cls>) plus the state -> node edge (id e<edge_id>, class edge edge-<cls>), emitted as one statement pair.

val diagram : name:string -> rank:string -> states:string -> actions:string -> edges:string -> string

Assemble the full TS digraph from the precomputed statement chunks.